mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-1124 (RM user can create a folder within the unfiled records area)
RM-1125 (RM user can delete a folder within the unfiled records area) RM-1126 (RM user can edit the meta-data of a folder within the unfiled records area) RM-1127 (RM user can view the details of a folder in the unfiled records area) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@59986 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
<list>
|
||||
<value>RECORD_CATEGORY</value>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>UNFILED_RECORD_CONTAINER</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
|
@@ -59,6 +59,7 @@
|
||||
|
||||
<bean id="rma.recordsManagementContainer" class="org.alfresco.module.org_alfresco_module_rm.model.rma.type.RecordsManagementContainerType" parent="rm.baseBehaviour">
|
||||
<property name="identifierService" ref="recordsManagementIdentifierService"/>
|
||||
<property name="recordService" ref="RecordService" />
|
||||
</bean>
|
||||
|
||||
<bean id="rma.filePlan" class="org.alfresco.module.org_alfresco_module_rm.model.rma.type.FilePlanType" parent="rm.baseBehaviour">
|
||||
|
@@ -1240,6 +1240,7 @@
|
||||
org.alfresco.module.org_alfresco_module_rm.record.RecordService.isPropertyEditable=RM.Read.0
|
||||
org.alfresco.module.org_alfresco_module_rm.record.RecordService.isMetadataStub=RM.Read.0
|
||||
org.alfresco.module.org_alfresco_module_rm.record.RecordService.getRecords=RM.Read.0,AFTER_RM.FilterNode
|
||||
org.alfresco.module.org_alfresco_module_rm.record.RecordService.makeRecord=RM_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.record.RecordService.*=RM_DENY
|
||||
]]>
|
||||
</value>
|
||||
|
@@ -317,6 +317,7 @@
|
||||
<property name="kinds">
|
||||
<set>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>UNFILED_RECORD_CONTAINER</value>
|
||||
</set>
|
||||
</property>
|
||||
<property name="capability" value ="FileRecords"/>
|
||||
@@ -573,6 +574,7 @@
|
||||
<property name="kinds">
|
||||
<set>
|
||||
<value>RECORD_CATEGORY</value>
|
||||
<value>UNFILED_RECORD_CONTAINER</value>
|
||||
</set>
|
||||
</property>
|
||||
<property name="capability" value ="CreateModifyDestroyFolders"/>
|
||||
|
@@ -165,7 +165,14 @@ Filters.getFilterParams = function RecordsManagementFilter_getFilterParams(filte
|
||||
|
||||
case "unfiledRecords":
|
||||
filterParams.variablePath = false;
|
||||
if (filterData == null)
|
||||
{
|
||||
filterParams.query = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
filterParams.query = "+PARENT:\"" + filterData + "\"";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@@ -27,6 +27,7 @@ import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -155,6 +156,9 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC
|
||||
rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString());
|
||||
}
|
||||
|
||||
// Find out if it is an unfiled record container child
|
||||
rmNodeValues.put("isUnfileRecordContainerChild", isUnfileRecordContainerChild(nodeRef));
|
||||
|
||||
// Set the indicators array
|
||||
setIndicators(rmNodeValues, nodeRef);
|
||||
|
||||
@@ -164,6 +168,25 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC
|
||||
return rmNodeValues;
|
||||
}
|
||||
|
||||
private boolean isUnfileRecordContainerChild(NodeRef nodeRef)
|
||||
{
|
||||
boolean isUnfileRecordContainerChild = false;
|
||||
|
||||
List<ChildAssociationRef> parentAssocs = nodeService.getParentAssocs(nodeRef);
|
||||
if (parentAssocs.size() == 1)
|
||||
{
|
||||
NodeRef parentNodeRef = parentAssocs.iterator().next().getParentRef();
|
||||
FilePlanComponentKind filePlanComponentKind = filePlanService.getFilePlanComponentKind(parentNodeRef);
|
||||
|
||||
if (filePlanComponentKind != null && filePlanComponentKind.equals(FilePlanComponentKind.RECORD_CATEGORY) == false)
|
||||
{
|
||||
isUnfileRecordContainerChild = true;
|
||||
}
|
||||
}
|
||||
|
||||
return isUnfileRecordContainerChild;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void setIndicators(JSONObject rmNodeValues, NodeRef nodeRef)
|
||||
{
|
||||
|
@@ -22,7 +22,6 @@ import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.RecordsManagementSearchBehaviour;
|
||||
@@ -239,12 +238,6 @@ public class RecordFolderType extends BaseBehaviourBean
|
||||
NodeRef nodeRef = childAssocRef.getChildRef();
|
||||
if (nodeService.exists(nodeRef) == true)
|
||||
{
|
||||
// ensure folders are never added to a record folder
|
||||
if (instanceOf(nodeRef, ContentModel.TYPE_FOLDER) == true)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("You can't create a folder within an exisiting record folder.");
|
||||
}
|
||||
|
||||
// ensure nothing is being added to a closed record folder
|
||||
NodeRef recordFolder = childAssocRef.getParentRef();
|
||||
Boolean isClosed = (Boolean) nodeService.getProperty(recordFolder, PROP_IS_CLOSED);
|
||||
|
@@ -22,6 +22,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||
import org.alfresco.repo.policy.annotation.Behaviour;
|
||||
@@ -49,6 +50,9 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
|
||||
/** identifier service */
|
||||
protected IdentifierService identifierService;
|
||||
|
||||
/** record service */
|
||||
protected RecordService recordService;
|
||||
|
||||
/**
|
||||
* @param identifierService identifier service
|
||||
*/
|
||||
@@ -57,6 +61,14 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
|
||||
this.identifierService = identifierService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordService record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
this.recordService = recordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.model.BaseTypeBehaviour#onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef, boolean)
|
||||
*/
|
||||
@@ -102,6 +114,24 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
|
||||
setIdenifierProperty(child);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NodeRef parentRef = childAssocRef.getParentRef();
|
||||
QName parentType = nodeService.getType(parentRef);
|
||||
boolean isContentSubType = dictionaryService.isSubClass(childType, ContentModel.TYPE_CONTENT);
|
||||
boolean isUnfiledRecordContainerSubType = dictionaryService.isSubClass(parentType, RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER);
|
||||
if (isContentSubType == true && isUnfiledRecordContainerSubType == true)
|
||||
{
|
||||
if (nodeService.hasAspect(child, ASPECT_FILE_PLAN_COMPONENT) == false)
|
||||
{
|
||||
nodeService.addAspect(child, ASPECT_FILE_PLAN_COMPONENT, null);
|
||||
}
|
||||
if (nodeService.hasAspect(child, ASPECT_RECORD) == false)
|
||||
{
|
||||
recordService.makeRecord(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@@ -161,4 +161,11 @@ public interface RecordService
|
||||
* @param typeQName Type to add
|
||||
*/
|
||||
void addRecordType(NodeRef nodeRef, QName typeQName);
|
||||
|
||||
/**
|
||||
* Creates a record from the given document
|
||||
*
|
||||
* @param nodeRef The document node reference from which a record will be created
|
||||
*/
|
||||
void makeRecord(NodeRef nodeRef);
|
||||
}
|
||||
|
@@ -774,8 +774,11 @@ public class RecordServiceImpl implements RecordService,
|
||||
*
|
||||
* @param document the document from which a record will be created
|
||||
*/
|
||||
private void makeRecord(NodeRef document)
|
||||
@Override
|
||||
public void makeRecord(NodeRef document)
|
||||
{
|
||||
ParameterCheck.mandatory("document", document);
|
||||
|
||||
ruleService.disableRules();
|
||||
try
|
||||
{
|
||||
|
Reference in New Issue
Block a user