Merge branch 'master' of git.alfresco.com:records-management/records-management into RM-4431_CompleteRecordActionRestAPI

This commit is contained in:
Sara Aspery
2017-06-14 13:05:53 +01:00
9 changed files with 731 additions and 266 deletions

3
.gitignore vendored
View File

@@ -39,3 +39,6 @@ test-output
/rm-enterprise/rm-automation-enterprise/root /rm-enterprise/rm-automation-enterprise/root
rm-automation/src/test/resources/webdriver.properties rm-automation/src/test/resources/webdriver.properties
/rm-community/rm-community-rest-api-explorer/overlays
/rm-enterprise/rm-enterprise-rest-api-explorer/overlays

View File

@@ -76,7 +76,7 @@
<property name="filePlanService" ref="FilePlanService" /> <property name="filePlanService" ref="FilePlanService" />
<property name="recordFolderService" ref="RecordFolderService" /> <property name="recordFolderService" ref="RecordFolderService" />
<property name="filePlanRoleService" ref="FilePlanRoleService" /> <property name="filePlanRoleService" ref="FilePlanRoleService" />
<property name="unfilerRecordContainerType" ref="rma.unfiledRecordsContainer" /> <property name="unfiledRecordContainerType" ref="rma.unfiledRecordsContainer" />
<property name="transferContainerType" ref="rma.transferContainer" /> <property name="transferContainerType" ref="rma.transferContainer" />
<property name="holdContainerType" ref="rma.holdContainer" /> <property name="holdContainerType" ref="rma.holdContainer" />
</bean> </bean>

View File

@@ -1075,6 +1075,7 @@
<property name="dispositionService" ref="DispositionService"/> <property name="dispositionService" ref="DispositionService"/>
<property name="recordableVersionService" ref="RecordableVersionService"/> <property name="recordableVersionService" ref="RecordableVersionService"/>
<property name="alwaysEditURIs" ref="recordService_alwaysEditURIs" /> <property name="alwaysEditURIs" ref="recordService_alwaysEditURIs" />
<property name="incompleteNodeTagger" ref="incompleteNodeTagger" />
</bean> </bean>
<!-- Defines a list of namespace URIs for properties, which should be always editable --> <!-- Defines a list of namespace URIs for properties, which should be always editable -->

View File

@@ -27,7 +27,10 @@
package org.alfresco.module.org_alfresco_module_rm.action.impl; package org.alfresco.module.org_alfresco_module_rm.action.impl;
import static org.alfresco.module.org_alfresco_module_rm.record.RecordUtils.generateRecordIdentifier;
import java.io.Serializable; import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
@@ -35,8 +38,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import static org.alfresco.module.org_alfresco_module_rm.record.RecordUtils.generateRecordIdentifier;
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase; import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
import org.alfresco.module.org_alfresco_module_rm.record.RecordServiceImpl; import org.alfresco.module.org_alfresco_module_rm.record.RecordServiceImpl;
import org.alfresco.module.org_alfresco_module_rm.util.TransactionalResourceHelper; import org.alfresco.module.org_alfresco_module_rm.util.TransactionalResourceHelper;
@@ -63,24 +64,24 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
{ {
/** action name */ /** action name */
public static final String NAME = "declareRecord"; public static final String NAME = "declareRecord";
/** I18N */ /** I18N */
private static final String MSG_UNDECLARED_ONLY_RECORDS = "rm.action.undeclared-only-records"; private static final String MSG_UNDECLARED_ONLY_RECORDS = "rm.action.undeclared-only-records";
private static final String MSG_NO_DECLARE_MAND_PROP = "rm.action.no-declare-mand-prop"; private static final String MSG_NO_DECLARE_MAND_PROP = "rm.action.no-declare-mand-prop";
/** Logger */ /** Logger */
private static Log logger = LogFactory.getLog(DeclareRecordAction.class); private static Log logger = LogFactory.getLog(DeclareRecordAction.class);
/** check mandatory properties */ /** check mandatory properties */
private boolean checkMandatoryPropertiesEnabled = true; private boolean checkMandatoryPropertiesEnabled = true;
/** transactional resource helper */ /** transactional resource helper */
private TransactionalResourceHelper transactionalResourceHelper; private TransactionalResourceHelper transactionalResourceHelper;
/** /**
* @param checkMandatoryPropertiesEnabled true if check mandatory properties is enabled, false otherwise * @param checkMandatoryPropertiesEnabled true if check mandatory properties is enabled, false otherwise
*/ */
public void setCheckMandatoryPropertiesEnabled(boolean checkMandatoryPropertiesEnabled) public void setCheckMandatoryPropertiesEnabled(boolean checkMandatoryPropertiesEnabled)
{ {
this.checkMandatoryPropertiesEnabled = checkMandatoryPropertiesEnabled; this.checkMandatoryPropertiesEnabled = checkMandatoryPropertiesEnabled;
} }
@@ -112,16 +113,16 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
generateRecordIdentifier(getNodeService(), getIdentifierService(), actionedUponNodeRef); generateRecordIdentifier(getNodeService(), getIdentifierService(), actionedUponNodeRef);
} }
List<String> missingProperties = new ArrayList<String>(5); List<String> missingProperties = new ArrayList<>(5);
// Aspect not already defined - check mandatory properties then add // Aspect not already defined - check mandatory properties then add
if (!checkMandatoryPropertiesEnabled || if (!checkMandatoryPropertiesEnabled ||
mandatoryPropertiesSet(actionedUponNodeRef, missingProperties)) mandatoryPropertiesSet(actionedUponNodeRef, missingProperties))
{ {
getRecordService().disablePropertyEditableCheck(); getRecordService().disablePropertyEditableCheck();
try try
{ {
// Add the declared aspect // Add the declared aspect
Map<QName, Serializable> declaredProps = new HashMap<QName, Serializable>(2); Map<QName, Serializable> declaredProps = new HashMap<>(2);
declaredProps.put(PROP_DECLARED_AT, new Date()); declaredProps.put(PROP_DECLARED_AT, new Date());
declaredProps.put(PROP_DECLARED_BY, AuthenticationUtil.getRunAsUser()); declaredProps.put(PROP_DECLARED_BY, AuthenticationUtil.getRunAsUser());
this.getNodeService().addAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD, declaredProps); this.getNodeService().addAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD, declaredProps);
@@ -215,6 +216,34 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
} }
} }
// check for missing mandatory metadata from custom aspect definitions
if (result)
{
QName aspect = ASPECT_RECORD;
if (nodeRefType.equals(TYPE_NON_ELECTRONIC_DOCUMENT))
{
aspect = TYPE_NON_ELECTRONIC_DOCUMENT;
}
// get customAspectImpl
String localName = aspect.toPrefixString(getNamespaceService()).replace(":", "");
localName = MessageFormat.format("{0}CustomProperties", localName);
QName customAspect = QName.createQName(RM_CUSTOM_URI, localName);
AspectDefinition aspectDef = this.getDictionaryService().getAspect(customAspect);
for (PropertyDefinition propDef : aspectDef.getProperties().values())
{
if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null)
{
logMissingProperty(propDef, missingProperties);
result = false;
break;
}
}
}
return result; return result;
} }

View File

@@ -85,7 +85,7 @@ public class FilePlanType extends BaseBehaviourBean
/** /**
* Unfiled Record Container Type behaviour bean * Unfiled Record Container Type behaviour bean
*/ */
private UnfiledRecordContainerType unfilerRecordContainerType; private UnfiledRecordContainerType unfiledRecordContainerType;
/** /**
* Transfer Container Type behaviour bean * Transfer Container Type behaviour bean
@@ -162,11 +162,11 @@ public class FilePlanType extends BaseBehaviourBean
} }
/** /**
* @param unfilerRecordContainerType - unfiled record container type behaviour bean * @param unfiledRecordContainerType - unfiled record container type behaviour bean
*/ */
public void setUnfilerRecordContainerType(UnfiledRecordContainerType unfilerRecordContainerType) public void setUnfiledRecordContainerType(UnfiledRecordContainerType unfiledRecordContainerType)
{ {
this.unfilerRecordContainerType = unfilerRecordContainerType; this.unfiledRecordContainerType = unfiledRecordContainerType;
} }
/** /**
@@ -273,7 +273,7 @@ public class FilePlanType extends BaseBehaviourBean
) )
public void onDeleteNode(ChildAssociationRef childAssocRef, boolean archived) public void onDeleteNode(ChildAssociationRef childAssocRef, boolean archived)
{ {
unfilerRecordContainerType.enable(); unfiledRecordContainerType.enable();
transferContainerType.enable(); transferContainerType.enable();
holdContainerType.enable(); holdContainerType.enable();
throw new IntegrityException("Operation failed. Deletion of File Plan is not allowed.", null); throw new IntegrityException("Operation failed. Deletion of File Plan is not allowed.", null);
@@ -290,7 +290,7 @@ public class FilePlanType extends BaseBehaviourBean
) )
public void beforeDeleteNode(NodeRef nodeRef) public void beforeDeleteNode(NodeRef nodeRef)
{ {
unfilerRecordContainerType.disable(); unfiledRecordContainerType.disable();
transferContainerType.disable(); transferContainerType.disable();
holdContainerType.disable(); holdContainerType.disable();
} }
@@ -305,7 +305,7 @@ public class FilePlanType extends BaseBehaviourBean
{ {
// tear down the file plan roles // tear down the file plan roles
getFilePlanRoleService().tearDownFilePlanRoles(childAssocRef.getChildRef()); getFilePlanRoleService().tearDownFilePlanRoles(childAssocRef.getChildRef());
unfilerRecordContainerType.enable(); unfiledRecordContainerType.enable();
transferContainerType.enable(); transferContainerType.enable();
holdContainerType.enable(); holdContainerType.enable();
} }

View File

@@ -80,6 +80,7 @@ import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionModel
import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionService; import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionService;
import org.alfresco.repo.content.ContentServicePolicies; import org.alfresco.repo.content.ContentServicePolicies;
import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.node.integrity.IncompleteNodeTagger;
import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.repo.node.integrity.IntegrityException;
import org.alfresco.repo.policy.ClassPolicyDelegate; import org.alfresco.repo.policy.ClassPolicyDelegate;
import org.alfresco.repo.policy.PolicyComponent; import org.alfresco.repo.policy.PolicyComponent;
@@ -272,6 +273,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
private ClassPolicyDelegate<BeforeRecordRejection> beforeRecordRejectionDelegate; private ClassPolicyDelegate<BeforeRecordRejection> beforeRecordRejectionDelegate;
private ClassPolicyDelegate<OnRecordRejection> onRecordRejectionDelegate; private ClassPolicyDelegate<OnRecordRejection> onRecordRejectionDelegate;
private IncompleteNodeTagger incompleteNodeTagger;
/** /**
* @param identifierService identifier service * @param identifierService identifier service
*/ */
@@ -416,6 +419,11 @@ public class RecordServiceImpl extends BaseBehaviourBean
this.recordableVersionService = recordableVersionService; this.recordableVersionService = recordableVersionService;
} }
public void setIncompleteNodeTagger(IncompleteNodeTagger incompleteNodeTagger)
{
this.incompleteNodeTagger = incompleteNodeTagger;
}
/** /**
* Init method * Init method
*/ */
@@ -450,6 +458,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
if (nodeService.exists(nodeRef) && nodeService.hasAspect(nodeRef, ASPECT_RECORD)) if (nodeService.exists(nodeRef) && nodeService.hasAspect(nodeRef, ASPECT_RECORD))
{ {
generateRecordIdentifier(nodeService, identifierService, nodeRef); generateRecordIdentifier(nodeService, identifierService, nodeRef);
reevaluateIncompleteTag(nodeRef);
} }
return null; return null;
} }
@@ -473,6 +482,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
if (ContentData.hasContent(contentData) && contentData.getSize() > 0) if (ContentData.hasContent(contentData) && contentData.getSize() > 0)
{ {
appendIdentifierToName(nodeService, nodeRef); appendIdentifierToName(nodeService, nodeRef);
reevaluateIncompleteTag(nodeRef);
} }
} }
} }
@@ -1925,6 +1935,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
if (nodeService.exists(nodeRef) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE)) if (nodeService.exists(nodeRef) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE))
{ {
generateRecordIdentifier(nodeService, identifierService, nodeRef); generateRecordIdentifier(nodeService, identifierService, nodeRef);
reevaluateIncompleteTag(nodeRef);
} }
} }
@@ -1983,4 +1994,22 @@ public class RecordServiceImpl extends BaseBehaviourBean
OnRecordRejection policy = onRecordRejectionDelegate.get(qnames); OnRecordRejection policy = onRecordRejectionDelegate.get(qnames);
policy.onRecordRejection(nodeRef); policy.onRecordRejection(nodeRef);
} }
/**
* RM-5244 - workaround to make sure the incomplete aspect is removed
*
* @param nodeRef the node to reevaluate for
*/
private void reevaluateIncompleteTag(NodeRef nodeRef)
{
/*
* Check if the node has the aspect because the reevaluation is expensive.
* If the node doesn't have the aspect it means IncompleteNodeTagger didn't load before TransactionBehaviourQueue
* and we don't need to reevaluate.
*/
if(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_INCOMPLETE))
{
incompleteNodeTagger.beforeCommit(false);
}
}
} }

View File

@@ -33,210 +33,591 @@ import java.util.Map;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionResult; import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionResult;
import org.alfresco.module.org_alfresco_module_rm.action.impl.DeclareRecordAction; import org.alfresco.module.org_alfresco_module_rm.action.impl.DeclareRecordAction;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementCustomModel;
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
/** /**
* Complete record tests. * Complete record tests.
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.2.1 * @since 2.2.1
*/ */
public class CompleteRecordTest extends BaseRMTestCase public class CompleteRecordTest extends BaseRMTestCase
{ {
private static final QName ASPECT_TEST = QName.createQName("http://www.alfresco.org/model/rmtest/1.0", "recordMetaDataWithProperty"); private static final QName ASPECT_TEST = QName.createQName("http://www.alfresco.org/model/rmtest/1.0", "recordMetaDataWithProperty");
private static final QName PROP_TEST = QName.createQName("http://www.alfresco.org/model/rmtest/1.0", "customMandatoryProperty"); private static final QName PROP_TEST = QName.createQName("http://www.alfresco.org/model/rmtest/1.0", "customMandatoryProperty");
private static final QName CUSTOM_ELECTRONIC_TEST = QName.createQName(RecordsManagementCustomModel.RM_CUSTOM_URI, "rmarecordCustomProperties");
/** complete record action */ private static final QName CUSTOM_NON_ELECTRONIC_TEST = QName.createQName(RecordsManagementCustomModel.RM_CUSTOM_URI, "rmanonElectronicDocumentCustomProperties");
private DeclareRecordAction action; private static final boolean MANDATORY_METADATA = true;
private static final boolean OPTIONAL_METADATA = false;
/**
* @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#initServices() /**
*/ * complete record action
@Override */
protected void initServices() private DeclareRecordAction action;
{
super.initServices(); /**
* @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#initServices()
// get the action */
action = (DeclareRecordAction)applicationContext.getBean("declareRecord"); @Override
} protected void initServices()
{
/** super.initServices();
* @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#tearDownImpl()
*/ // get the action
@Override action = (DeclareRecordAction) applicationContext.getBean("declareRecord");
protected void tearDownImpl() }
{
super.tearDownImpl(); /**
* @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#tearDownImpl()
// ensure action is returned to original state */
action.setCheckMandatoryPropertiesEnabled(true); @Override
} protected void tearDownImpl()
{
/** super.tearDownImpl();
* Given the the application is configured to check for mandatory values before complete
* And a filed record is missing mandatory values // ensure action is returned to original state
* When I try to complete the record action.setCheckMandatoryPropertiesEnabled(true);
* Then the missing properties parameter of the action will be populated }
* And the record will not be complete
*/ /**
* Given the the application is configured to check for mandatory values before complete
* And a filed record is missing mandatory values
* When I try to complete the record
* Then the missing properties parameter of the action will be populated
* And the record will not be complete
*/
public void testCheckForMandatoryValuesMissing() throws Exception public void testCheckForMandatoryValuesMissing() throws Exception
{ {
doBehaviourDrivenTest(new BehaviourDrivenTest() doBehaviourDrivenTest(new BehaviourDrivenTest()
{ {
private NodeRef record; private NodeRef record;
private RecordsManagementActionResult result; private RecordsManagementActionResult result;
public void given() public void given()
{ {
// enable mandatory parameter check // enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true); action.setCheckMandatoryPropertiesEnabled(true);
// create a record // create a record
record = utils.createRecord(rmFolder, "record.txt", "title"); record = utils.createRecord(rmFolder, "record.txt", "title");
// add the record aspect (that has a mandatory property) // add the record aspect (that has a mandatory property)
nodeService.addAspect(record, ASPECT_TEST, null); nodeService.addAspect(record, ASPECT_TEST, null);
} }
public void when() public void when()
{ {
// complete record // complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord"); result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
} }
public void then() public void then()
{ {
assertNotNull(result); assertNotNull(result);
assertNotNull(result.getValue()); assertNotNull(result.getValue());
assertFalse(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD)); assertFalse(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
} }
}); });
} }
/** /**
* Given the the application is configured to check for mandatory values before complete * Given the the application is configured to check for mandatory values before complete
* And a filed record has all mandatory values * And a filed record has all mandatory values
* When I try to complete the record * When I try to complete the record
* Then the record is completed * Then the record is completed
*/ */
public void testCheckForMandatoryValuePresent() throws Exception public void testCheckForMandatoryValuePresent() throws Exception
{ {
doBehaviourDrivenTest(new BehaviourDrivenTest() doBehaviourDrivenTest(new BehaviourDrivenTest()
{ {
private NodeRef record; private NodeRef record;
private RecordsManagementActionResult result; private RecordsManagementActionResult result;
public void given() public void given()
{ {
// enable mandatory parameter check // enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true); action.setCheckMandatoryPropertiesEnabled(true);
// create a record // create a record
record = utils.createRecord(rmFolder, "record.txt", "title"); record = utils.createRecord(rmFolder, "record.txt", "title");
// add the record aspect (that has a mandatory property) // add the record aspect (that has a mandatory property)
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1); Map<QName, Serializable> properties = new HashMap<>(1);
properties.put(PROP_TEST, "something"); properties.put(PROP_TEST, "something");
nodeService.addAspect(record, ASPECT_TEST, properties); nodeService.addAspect(record, ASPECT_TEST, properties);
} }
public void when() public void when()
{ {
// complete record // complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord"); result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
} }
public void then() public void then()
{ {
assertNotNull(result); assertNotNull(result);
assertNull(result.getValue()); assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD)); assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
} }
}); });
} }
/** /**
* Given the the application is configured not to check for mandatory values before complete * Given the the application is configured to check for mandatory values before complete
* And a filed record is missing mandatory values * And a filed record is missing custom mandatory values
* When I try to complete the record * When I try to complete the record
* Then the record is completed * Then the missing properties parameter of the action will be populated
*/ * And the record will not be complete
*/
public void testCheckForCustomMandatoryValuesMissing() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef record;
private RecordsManagementActionResult result;
public void given() throws Exception
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// create the custom metadata definition (that has a mandatory property) for electronic records
defineCustomMetadata(CUSTOM_ELECTRONIC_TEST, ASPECT_RECORD, MANDATORY_METADATA);
// create an electronic record
record = utils.createRecord(rmFolder, "electronicRecord.txt", "title");
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNotNull(result.getValue());
assertFalse(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
}
public void after()
{
// remove the custom metadata definition
removeCustomMetadata(CUSTOM_ELECTRONIC_TEST);
}
});
}
/**
* Given the the application is configured to check for mandatory values before complete
* And a filed record has all custom mandatory values
* When I try to complete the record
* Then the record is completed
*/
public void testCheckForCustomMandatoryValuePresent() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef record;
private RecordsManagementActionResult result;
public void given() throws Exception
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// define the custom metadata definition (that has a mandatory property)
defineCustomMetadata(CUSTOM_ELECTRONIC_TEST, ASPECT_RECORD, MANDATORY_METADATA);
// create a record
record = utils.createRecord(rmFolder, "customrecord.txt", "title");
// populate the custom metadata mandatory property for the record
populateCustomMetadata(record, CUSTOM_ELECTRONIC_TEST);
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
}
public void after()
{
// remove the custom metadata definition
removeCustomMetadata(CUSTOM_ELECTRONIC_TEST);
}
});
}
/**
* Given the the application is configured to check for mandatory values before complete
* And a non-electronic record is missing custom mandatory values
* When I try to complete the record
* Then the missing properties parameter of the action will be populated
* And the record will not be complete
*/
public void testCheckForCustomMandatoryValuesMissingInNonElectronicRecord() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef nonElectronicRecord;
private RecordsManagementActionResult result;
public void given() throws Exception
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// create the custom metadata definition (that has a mandatory property) for non-electronic records
defineCustomMetadata(CUSTOM_NON_ELECTRONIC_TEST, TYPE_NON_ELECTRONIC_DOCUMENT, MANDATORY_METADATA);
// create a non-electronic record
nonElectronicRecord = utils.createNonElectronicRecord(rmFolder, "non-electronicRecord.txt", "title");
}
public void when()
{
// complete non-electronic record
result = rmActionService.executeRecordsManagementAction(nonElectronicRecord,
"declareRecord");
}
public void then()
{
assertNotNull(result);
assertNotNull(result.getValue());
assertFalse(nodeService.hasAspect(nonElectronicRecord, ASPECT_DECLARED_RECORD));
}
public void after()
{
// remove the custom metadata definition
removeCustomMetadata(CUSTOM_NON_ELECTRONIC_TEST);
}
});
}
/**
* Given the the application is configured to check for mandatory values before complete
* And a non-electronic record has all custom mandatory values
* When I try to complete the record
* Then the record is completed
*/
public void testCheckForCustomMandatoryValuePresentInNonElectronicRecord() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef nonElectronicRecord;
private RecordsManagementActionResult result;
public void given() throws Exception
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// create the custom metadata definition (that has a mandatory property)
defineCustomMetadata(CUSTOM_NON_ELECTRONIC_TEST, TYPE_NON_ELECTRONIC_DOCUMENT, MANDATORY_METADATA);
// create a non-electronic record
nonElectronicRecord = utils.createNonElectronicRecord(rmFolder, "non-electronicRecord.txt", "title");
// populate the custom metadata mandatory property for the record
populateCustomMetadata(nonElectronicRecord, CUSTOM_NON_ELECTRONIC_TEST);
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(nonElectronicRecord, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNull(result.getValue());
assertTrue(nodeService.hasAspect(nonElectronicRecord, ASPECT_DECLARED_RECORD));
}
public void after()
{
// remove the custom metadata definition
removeCustomMetadata(CUSTOM_NON_ELECTRONIC_TEST);
}
});
}
/**
* Given the the application is configured to check for mandatory values before complete
* And a filed record is missing custom non-mandatory values
* When I try to complete the record
* Then the record is completed
*/
public void testCheckForCustomOptionalValuesMissing() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef record;
private RecordsManagementActionResult result;
public void given() throws Exception
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// create the custom metadata definition (that does not have a mandatory property)
defineCustomMetadata(CUSTOM_ELECTRONIC_TEST, ASPECT_RECORD, OPTIONAL_METADATA);
// create a record
record = utils.createRecord(rmFolder, "customrecord.txt", "title");
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
}
public void after()
{
// remove the custom metadata definition
removeCustomMetadata(CUSTOM_ELECTRONIC_TEST);
}
});
}
/**
* Given the the application is configured to check for mandatory values before complete
* And custom mandatory metadata is required for electronic records
* And a non-electronic record has no custom mandatory values
* When I try to complete the non-electronic record
* Then the record is completed
*/
public void testElectronicRecordCustomMandatoryNotAppliedToNonElectronicRecord() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef nonElectronicRecord;
private RecordsManagementActionResult result;
public void given() throws Exception
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// create the record custom metadata definition (that has a mandatory property)
defineCustomMetadata(CUSTOM_ELECTRONIC_TEST, ASPECT_RECORD, MANDATORY_METADATA);
// create a non-electronic record
nonElectronicRecord = utils.createNonElectronicRecord(rmFolder, "non-electronicRecord.txt", "title");
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(nonElectronicRecord, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNull(result.getValue());
assertTrue(nodeService.hasAspect(nonElectronicRecord, ASPECT_DECLARED_RECORD));
}
public void after()
{
// remove the custom metadata definition
removeCustomMetadata(CUSTOM_ELECTRONIC_TEST);
}
});
}
/**
* Given the the application is configured to check for mandatory values before complete
* And custom mandatory metadata is required for non-electronic records
* And an electronic record has no custom mandatory values
* When I try to complete the electronic record
* Then the record is completed
*/
public void testNonElectronicRecordCustomMandatoryNotAppliedToElectronicRecord() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef record;
private RecordsManagementActionResult result;
public void given() throws Exception
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// create the non-electronic record custom metadata definition (that has a mandatory property)
defineCustomMetadata(CUSTOM_NON_ELECTRONIC_TEST, TYPE_NON_ELECTRONIC_DOCUMENT, MANDATORY_METADATA);
// create a electronic record
record = utils.createRecord(rmFolder, "electronicRecord.txt", "title");
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
}
public void after()
{
// remove the custom metadata definition
removeCustomMetadata(CUSTOM_NON_ELECTRONIC_TEST);
}
});
}
/**
* Given the the application is configured not to check for mandatory values before complete
* And a filed record is missing mandatory values
* When I try to complete the record
* Then the record is completed
*/
public void testDontCheckForMandatoryValuesMissing() throws Exception public void testDontCheckForMandatoryValuesMissing() throws Exception
{ {
doBehaviourDrivenTest(new BehaviourDrivenTest() doBehaviourDrivenTest(new BehaviourDrivenTest()
{ {
private NodeRef record; private NodeRef record;
private RecordsManagementActionResult result; private RecordsManagementActionResult result;
public void given() public void given()
{ {
// disable mandatory parameter check // disable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(false); action.setCheckMandatoryPropertiesEnabled(false);
// create a record // create a record
record = utils.createRecord(rmFolder, "record.txt", "title"); record = utils.createRecord(rmFolder, "record.txt", "title");
// add the record aspect (that has a mandatory property) // add the record aspect (that has a mandatory property)
nodeService.addAspect(record, ASPECT_TEST, null); nodeService.addAspect(record, ASPECT_TEST, null);
} }
public void when() public void when()
{ {
// complete record // complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord"); result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
} }
public void then() public void then()
{ {
assertNotNull(result); assertNotNull(result);
assertNull(result.getValue()); assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD)); assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
} }
}); });
} }
/** /**
* Given the the application is configured to not to check for mandatory values before complete * Given the the application is configured to not to check for mandatory values before complete
* And a filed record has all mandatory values * And a filed record has all mandatory values
* When I try to complete the record * When I try to complete the record
* Then the record is completed * Then the record is completed
*/ */
public void testDontCheckForMandatoryValuePresent() throws Exception public void testDontCheckForMandatoryValuePresent() throws Exception
{ {
doBehaviourDrivenTest(new BehaviourDrivenTest() doBehaviourDrivenTest(new BehaviourDrivenTest()
{ {
private NodeRef record; private NodeRef record;
private RecordsManagementActionResult result; private RecordsManagementActionResult result;
public void given() public void given()
{ {
// enable mandatory parameter check // enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(false); action.setCheckMandatoryPropertiesEnabled(false);
// create a record // create a record
record = utils.createRecord(rmFolder, "record.txt", "title"); record = utils.createRecord(rmFolder, "record.txt", "title");
// add the record aspect (that has a mandatory property) // add the record aspect (that has a mandatory property)
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1); Map<QName, Serializable> properties = new HashMap<>(1);
properties.put(PROP_TEST, "something"); properties.put(PROP_TEST, "something");
nodeService.addAspect(record, ASPECT_TEST, properties); nodeService.addAspect(record, ASPECT_TEST, properties);
} }
public void when() public void when()
{ {
// complete record // complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord"); result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
} }
public void then() public void then()
{ {
assertNotNull(result); assertNotNull(result);
assertNull(result.getValue()); assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD)); assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
} }
}); });
}
/**
* Helper method to create a Custom Metadata definition in the RM custom model
*
* @param mandatory specifies if metadata is mandatory
*/
private void defineCustomMetadata(QName propId, QName typeName, boolean mandatory) throws Exception
{
rmAdminService.addCustomPropertyDefinition(
propId,
typeName,
"SomeCustomDefLabel",
DataTypeDefinition.TEXT,
null,
null,
null,
false,
mandatory,
false,
null
);
}
/**
* Helper method to populate the Custom Metadata for the record
*/
private void populateCustomMetadata(NodeRef record, QName propId)
{
Map<QName, Serializable> properties = new HashMap<>(1);
properties.put(propId, "SomeCustomValue");
nodeService.addAspect(record, propId, properties);
}
/**
* Helper method to remove the Custom Metadata definition in the RM custom model
*/
private void removeCustomMetadata(QName propId)
{
rmAdminService.removeCustomPropertyDefinition(propId);
} }
} }

View File

@@ -301,6 +301,29 @@ public class CommonRMTestUtils implements RecordsManagementModel
return record; return record;
} }
/**
* Helper method to create a non-electronic record in a record folder.
*
* @param recordFolder record folder
* @param name name of the non-electronic record
* @param title title of the non-electronic record
* @return {@link NodeRef} non-electronic record node reference
*/
public NodeRef createNonElectronicRecord(NodeRef recordFolder, String name, String title)
{
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
props.put(ContentModel.PROP_TITLE, title);
props.put(ContentModel.PROP_NAME, name);
// Create the document
NodeRef record = nodeService.createNode(recordFolder,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name),
RecordsManagementModel.TYPE_NON_ELECTRONIC_DOCUMENT,
props).getChildRef();
return record;
}
/** /**
* Helper method to complete record. * Helper method to complete record.
*/ */

View File

@@ -25,7 +25,7 @@ tags:
- name: record-folders - name: record-folders
description: Retrieve and manage record folders description: Retrieve and manage record folders
- name: gs-sites - name: gs-sites
description: Retrieve and manage the RM site description: Retrieve and manage the Records Management site
- name: records - name: records
description: Perform record specific operations description: Perform record specific operations
- name: files - name: files
@@ -44,18 +44,18 @@ paths:
post: post:
tags: tags:
- gs-sites - gs-sites
summary: Create the RM site summary: Create the Records Management (RM) site
description: | description: |
**Note:** this endpoint is available in RM 2.6 and newer versions. **Note:** this endpoint is available in Records Management 2.6 and newer versions.
Creates the RM site with the given details. Creates the RM site with the given details.
**Note:** the id of a site cannot be updated once the site has been created. **Note:** the id of a site cannot be updated once the site has been created.
For example, to create the RM site named "Records Management Title" with "Records Management Description" as description, the following body could be used: For example, to create an RM site named "Records Management" with "Records Management Description" as description, the following body could be used:
```JSON ```JSON
{ {
"title": "Records Management Title", "title": "Records Management",
"description": "Records Management Description" "description": "Records Management Description"
} }
``` ```
@@ -100,9 +100,9 @@ paths:
get: get:
tags: tags:
- gs-sites - gs-sites
summary: Get the RM site summary: Get the Records Management (RM) site
description: | description: |
**Note:** this endpoint is available in RM 2.6 and newer versions. **Note:** this endpoint is available in Records Management 2.6 and newer versions.
Gets information for RM site. Gets information for RM site.
@@ -118,7 +118,7 @@ paths:
$ref: '#/definitions/RMSiteEntry' $ref: '#/definitions/RMSiteEntry'
'400': '400':
description: | description: |
Invalid parameter: GET request is suported only for the RM site Invalid parameter: GET request is only supported for the RM site
'401': '401':
description: Authentication failed description: Authentication failed
'404': '404':
@@ -131,9 +131,9 @@ paths:
delete: delete:
tags: tags:
- gs-sites - gs-sites
summary: Delete the RM site summary: Delete the Records Management (RM) site
description: | description: |
**Note:** this endpoint is available in RM 2.6 and newer versions. **Note:** this endpoint is available in Records Management 2.6 and newer versions.
Deletes the RM site. Deletes the RM site.
operationId: deleteRMSite operationId: deleteRMSite
@@ -144,7 +144,7 @@ paths:
description: Successful response description: Successful response
'400': '400':
description: | description: |
Invalid parameter: DELETE request is suported only for the RM site Invalid parameter: DELETE request is only supported for the RM site
'401': '401':
description: Authentication failed description: Authentication failed
'403': '403':
@@ -159,14 +159,13 @@ paths:
put: put:
tags: tags:
- gs-sites - gs-sites
summary: Update the RM site summary: Update the Records Management (RM) site
description: | description: |
**Note:** this endpoint is available in RM 2.6 and newer versions. **Note:** this endpoint is available in Records Management 2.6 and newer versions.
Update the details for the RM site. Site Manager or otherwise a Update the details for the RM site. Site Manager or other (site) admin can update title or description.
(site) admin can update title or description.
**Note**: the id, site visibility or compliance of the RM site cannot be updated once the RM site has been created. **Note**: the id, site visibility, or compliance of the RM site cannot be updated once the site has been created.
operationId: updateRMSite operationId: updateRMSite
produces: produces:
@@ -205,9 +204,9 @@ paths:
- file-plans - file-plans
summary: Get a file plan summary: Get a file plan
description: | description: |
Get information for file plan **filePlanId** Gets information for file plan **filePlanId**
Besides mandatory fields the file plan's aspects and properties are returned by default. Mandatory fields and the file plan's aspects and properties are returned by default.
You can use the **include** parameter (include=allowableOperations) to return additional information. You can use the **include** parameter (include=allowableOperations) to return additional information.
operationId: getFilePlan operationId: getFilePlan
@@ -226,11 +225,11 @@ paths:
description: | description: |
Invalid parameter: **filePlanId** is not a valid format Invalid parameter: **filePlanId** is not a valid format
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **filePlanId** description: Current user does not have permission to read **filePlanId**
'404': '404':
description: If **filePlanId** does not exist description: "**filePlanId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -275,13 +274,13 @@ paths:
description: | description: |
Invalid parameter: The update request is invalid or **filePlanId** is not a valid format or **filePlanBodyUpdate** is invalid Invalid parameter: The update request is invalid or **filePlanId** is not a valid format or **filePlanBodyUpdate** is invalid
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to update **filePlanId** description: If current user does not have permission to update **filePlanId**
'404': '404':
description: If **filePlanId** does not exist description: "**filePlanId** does not exist"
'409': '409':
description: If the updated name clashes with an existing fileplan description: Updated name clashes with an existing fileplan
'422': '422':
description: Model integrity exception, including file name with invalid characters description: Model integrity exception, including file name with invalid characters
default: default:
@@ -316,11 +315,11 @@ paths:
schema: schema:
$ref: '#/definitions/RecordCategoryPaging' $ref: '#/definitions/RecordCategoryPaging'
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **filePlanId** description: Current user does not have permission to read **filePlanId**
'404': '404':
description: If **filePlanId** does not exist description: "**filePlanId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -328,9 +327,9 @@ paths:
post: post:
tags: tags:
- file-plans - file-plans
summary: Create record categories for given file plan summary: Create record categories for a file plan
description: | description: |
Create a record category as a primary child of **filePlanId**. Creates a record category as a primary child of **filePlanId**.
You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then
the API method tries to create the API method tries to create
@@ -413,13 +412,13 @@ paths:
description: | description: |
Invalid parameter: **filePlanId** is not a valid format or **filePlanId** is invalid Invalid parameter: **filePlanId** is not a valid format or **filePlanId** is invalid
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to add children to **filePlanId** description: Current user does not have permission to add children to **filePlanId**
'404': '404':
description: If **filePlanId** does not exist description: "**filePlanId** does not exist"
'409': '409':
description: If new name clashes with an existing node in the current parent container description: New name clashes with an existing node in the current parent container
'422': '422':
description: Model integrity exception, including node name with invalid characters description: Model integrity exception, including node name with invalid characters
## Unfiled records containers ## Unfiled records containers
@@ -429,9 +428,9 @@ paths:
- unfiled-containers - unfiled-containers
summary: Get the unfiled records container summary: Get the unfiled records container
description: | description: |
Get information for unfiled records contianer **unfiledContainerId** Gets information for unfiled records container **unfiledContainerId**
Besides mandatory fields the unfiled records container's aspects and properties are returned by default. Mandatory fields and the unfiled records container's aspects and properties are returned by default.
You can use the **include** parameter (include=allowableOperations) to return additional information. You can use the **include** parameter (include=allowableOperations) to return additional information.
operationId: getUnfiledContainer operationId: getUnfiledContainer
@@ -450,11 +449,11 @@ paths:
description: | description: |
Invalid parameter: **unfiledContainerId** is not a valid format Invalid parameter: **unfiledContainerId** is not a valid format
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **unfiledContainerId** description: Current user does not have permission to read **unfiledContainerId**
'404': '404':
description: If **unfiledContainerId** does not exist description: "**unfiledContainerId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -504,13 +503,13 @@ paths:
description: | description: |
Invalid parameter: The update request is invalid or **unfiledContainerId** is not a valid format or **unfiledContainerBodyUpdate** is invalid Invalid parameter: The update request is invalid or **unfiledContainerId** is not a valid format or **unfiledContainerBodyUpdate** is invalid
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to update **unfiledContainerId** description: Current user does not have permission to update **unfiledContainerId**
'404': '404':
description: If **unfiledContainerId** does not exist description: "**unfiledContainerId** does not exist"
'409': '409':
description: If the updated name clashes with an existing root category of special container in the current fileplan description: Updated name clashes with an existing root category of special container in the current fileplan
'422': '422':
description: Model integrity exception, including file name with invalid characters description: Model integrity exception, including file name with invalid characters
default: default:
@@ -545,11 +544,11 @@ paths:
schema: schema:
$ref: '#/definitions/UnfiledContainerAssociationPaging' $ref: '#/definitions/UnfiledContainerAssociationPaging'
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **unfiledContainerId** description: Current user does not have permission to read **unfiledContainerId**
'404': '404':
description: If **unfiledContainerId** does not exist description: "**unfiledContainerId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -559,7 +558,7 @@ paths:
- unfiled-containers - unfiled-containers
summary: Create a record or an unfiled record folder summary: Create a record or an unfiled record folder
description: | description: |
Create a record or an unfiled record folder as a primary child of **unfiledContainerId**. Creates a record or an unfiled record folder as a primary child of **unfiledContainerId**.
You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then
the API method tries to create a unique name using an integer suffix. the API method tries to create a unique name using an integer suffix.
@@ -702,7 +701,7 @@ paths:
- unfiled-record-folders - unfiled-record-folders
summary: Get the unfiled record folder summary: Get the unfiled record folder
description: | description: |
Get information for unfiled record folder id **unfiledRecordFolderId** Gets information for unfiled record folder id **unfiledRecordFolderId**
Mandatory fields and the unfiled record folder's aspects and properties are returned by default. Mandatory fields and the unfiled record folder's aspects and properties are returned by default.
@@ -798,7 +797,7 @@ paths:
- unfiled-record-folders - unfiled-record-folders
summary : Delete an unfiled record folder summary : Delete an unfiled record folder
description: | description: |
Deletes unfiled record folder **unfiledRecordFolderId**. Deletes the unfiled record folder **unfiledRecordFolderId**.
operationId: deleteUnfiledRecordFolder operationId: deleteUnfiledRecordFolder
parameters: parameters:
- $ref: '#/parameters/unfiledRecordFolderIdParam' - $ref: '#/parameters/unfiledRecordFolderIdParam'
@@ -851,11 +850,11 @@ paths:
schema: schema:
$ref: '#/definitions/UnfiledRecordFolderAssociationPaging' $ref: '#/definitions/UnfiledRecordFolderAssociationPaging'
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **unfiledRecordFolderId** description: Current user does not have permission to read **unfiledRecordFolderId**
'404': '404':
description: If **unfiledRecordFolderId** does not exist description: "**unfiledRecordFolderId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -902,7 +901,7 @@ paths:
} }
``` ```
You can create an empty electronic record: You can create an empty electronic record like this:
```JSON ```JSON
{ {
"name":"My Electronic Record", "name":"My Electronic Record",
@@ -992,13 +991,13 @@ paths:
description: | description: |
Invalid parameter: **unfiledRecordFolderId** is not a valid format or **unfiledRecordFolderId** is invalid Invalid parameter: **unfiledRecordFolderId** is not a valid format or **unfiledRecordFolderId** is invalid
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to add children to **unfiledRecordFolderId** description: Current user does not have permission to add children to **unfiledRecordFolderId**
'404': '404':
description: If **unfiledRecordFolderId** does not exist description: "**unfiledRecordFolderId** does not exist"
'409': '409':
description: If new name clashes with an existing node in the current parent container description: New name clashes with an existing node in the current parent container
'422': '422':
description: Model integrity exception, including node name with invalid characters description: Model integrity exception, including node name with invalid characters
## Record categories ## Record categories
@@ -1008,9 +1007,9 @@ paths:
- record-categories - record-categories
summary: Get a record category summary: Get a record category
description: | description: |
Get information for record category **recordCategoryId** Gets information for record category **recordCategoryId**
Besides mandatory fields the record category's aspects and properties are returned by default. Mandatory fields and the record category's aspects and properties are returned by default.
You can use the **include** parameter (include=allowableOperations) to return additional information. You can use the **include** parameter (include=allowableOperations) to return additional information.
operationId: getRecordCategory operationId: getRecordCategory
@@ -1030,11 +1029,11 @@ paths:
description: | description: |
Invalid parameter: **recordCategoryId** is not a valid format Invalid parameter: **recordCategoryId** is not a valid format
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **recordCategoryId** description: Current user does not have permission to read **recordCategoryId**
'404': '404':
description: If **recordCategoryId** does not exist description: "**recordCategoryId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -1158,7 +1157,7 @@ paths:
schema: schema:
$ref: '#/definitions/RecordCategoryChildPaging' $ref: '#/definitions/RecordCategoryChildPaging'
'401': '401':
description: Authentication fails description: Authentication failed
'403': '403':
description: Current user does not have permission to read **recordCategoryId** description: Current user does not have permission to read **recordCategoryId**
'404': '404':
@@ -1294,7 +1293,7 @@ paths:
description: | description: |
Invalid parameter: **recordCategoryId** is not a valid format or **nodeBodyCreate** is invalid Invalid parameter: **recordCategoryId** is not a valid format or **nodeBodyCreate** is invalid
'401': '401':
description: Authentication fails description: Authentication failed
'403': '403':
description: Current user does not have permission to add children to **recordCategoryId** description: Current user does not have permission to add children to **recordCategoryId**
'404': '404':
@@ -1310,9 +1309,9 @@ paths:
- record-folders - record-folders
summary: Get a record folder summary: Get a record folder
description: | description: |
Get information for record folder **recordFolderId** Gets information for record folder **recordFolderId**
Besides mandatory fields the record folder's aspects and properties are returned by default. Mandatory fields and the record folder's aspects and properties are returned by default.
You can use the **include** parameter (include=allowableOperations) to return additional information. You can use the **include** parameter (include=allowableOperations) to return additional information.
operationId: getRecordFolder operationId: getRecordFolder
@@ -1434,7 +1433,7 @@ paths:
- record-folders - record-folders
summary: List records summary: List records
description: | description: |
Returns a list of records. Gets a list of records.
Minimal information for each record is returned by default. Minimal information for each record is returned by default.
@@ -1601,7 +1600,7 @@ paths:
- records - records
summary: Get a record summary: Get a record
description: | description: |
Get information for record **recordId** Gets information for record **recordId**
Mandatory fields and the record's aspects and properties are returned by default. Mandatory fields and the record's aspects and properties are returned by default.
@@ -1622,7 +1621,7 @@ paths:
description: | description: |
Invalid parameter: **recordId** is not a valid format Invalid parameter: **recordId** is not a valid format
'401': '401':
description: Authentication fails description: Authentication failed
'403': '403':
description: Current user does not have permission to read **recordId** description: Current user does not have permission to read **recordId**
'404': '404':
@@ -1708,7 +1707,7 @@ paths:
description: | description: |
Invalid parameter: **recordId** is not a valid format Invalid parameter: **recordId** is not a valid format
'401': '401':
description: Authentication fails description: Authentication failed
'403': '403':
description: Current user does not have permission to delete **recordId** description: Current user does not have permission to delete **recordId**
'404': '404':
@@ -1806,7 +1805,7 @@ paths:
tags: tags:
- files - files
summary: Declare as record summary: Declare as record
description: Declares the file **fileId** in the unfiled record container. description: Declares the file **fileId** in the unfiled records container.
operationId: declareRecord operationId: declareRecord
parameters: parameters:
- name: fileId - name: fileId
@@ -1854,7 +1853,7 @@ paths:
- transfer-containers - transfer-containers
summary: Get a transfer container summary: Get a transfer container
description: | description: |
Get information for transfer container **transferContainerId** Gets information for transfer container **transferContainerId**
Mandatory fields and the transfer container's aspects and properties are returned by default. Mandatory fields and the transfer container's aspects and properties are returned by default.
@@ -1875,11 +1874,11 @@ paths:
description: | description: |
Invalid parameter: **transferContainerId** is not a valid format Invalid parameter: **transferContainerId** is not a valid format
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **transferContainerId** description: Current user does not have permission to read **transferContainerId**
'404': '404':
description: If **transferContainerId** does not exist description: "**transferContainerId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -1928,13 +1927,13 @@ paths:
description: | description: |
Invalid parameter: the update request is invalid or **transferContainerId** is not a valid format or **nodeBody** is invalid Invalid parameter: the update request is invalid or **transferContainerId** is not a valid format or **nodeBody** is invalid
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to update **transferContainerId** description: Current user does not have permission to update **transferContainerId**
'404': '404':
description: If **transferContainerId** does not exist description: "**transferContainerId** does not exist"
'409': '409':
description: If the updated name clashes with an existing node in the current parent folder description: Updated name clashes with an existing node in the current parent folder
'422': '422':
description: Model integrity exception, including transfer container name with invalid characters description: Model integrity exception, including transfer container name with invalid characters
default: default:
@@ -1968,11 +1967,11 @@ paths:
schema: schema:
$ref: '#/definitions/TransferContainerAssociationPaging' $ref: '#/definitions/TransferContainerAssociationPaging'
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **transferContainerId** description: Current user does not have permission to read **transferContainerId**
'404': '404':
description: If **transferContainerId** does not exist description: "**transferContainerId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -1984,9 +1983,9 @@ paths:
- transfers - transfers
summary: Get a transfer summary: Get a transfer
description: | description: |
Get information for transfer **transferId** Gets information for transfer **transferId**
Besides mandatory fields the transfer's aspects and properties are returned by default. Mandatory fields and the transfer's aspects and properties are returned by default.
You can use the **include** parameter (include=allowableOperations) to return additional information. You can use the **include** parameter (include=allowableOperations) to return additional information.
operationId: getTransfer operationId: getTransfer
@@ -2005,11 +2004,11 @@ paths:
description: | description: |
Invalid parameter: **transferId** is not a valid format Invalid parameter: **transferId** is not a valid format
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **transferId** description: Current user does not have permission to read **transferId**
'404': '404':
description: If **transferId** does not exist description: "**transferId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -2020,7 +2019,7 @@ paths:
- transfers - transfers
summary: List transfer's children summary: List transfer's children
description: | description: |
Returns a list of transfer's children. Gets a list of transfer's children.
Minimal information for each child is returned by default. Minimal information for each child is returned by default.
@@ -2041,11 +2040,11 @@ paths:
schema: schema:
$ref: '#/definitions/TransferAssociationPaging' $ref: '#/definitions/TransferAssociationPaging'
'401': '401':
description: If authentication fails description: Authentication failed
'403': '403':
description: If current user does not have permission to read **transferId** description: Current user does not have permission to read **transferId**
'404': '404':
description: If **transferId** does not exist description: "**transferId** does not exist"
default: default:
description: Unexpected error description: Unexpected error
schema: schema:
@@ -2088,7 +2087,7 @@ parameters:
filePlanIncludeSourceParam: filePlanIncludeSourceParam:
name: includeSource name: includeSource
in: query in: query
description: Also include **source** in addition to **entries** with folder information on the parent node the specified parent **filePlanId** description: Also include **source** (in addition to **entries**) with folder information on the parent node the specified parent **filePlanId**
required: false required: false
type: boolean type: boolean
## Unfiled records containers ## Unfiled records containers
@@ -2096,14 +2095,14 @@ parameters:
name: unfiledContainerId name: unfiledContainerId
in: path in: path
description: description:
The identifier of a unfiled records container. You can use the **-unfiled-** alias. The identifier of an unfiled records container. You can use the **-unfiled-** alias.
required: true required: true
type: string type: string
unfiledContainerEntryIncludeParam: unfiledContainerEntryIncludeParam:
name: include name: include
in: query in: query
description: | description: |
Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example:
* allowableOperations * allowableOperations
* path * path
required: false required: false
@@ -2115,7 +2114,7 @@ parameters:
name: include name: include
in: query in: query
description: | description: |
Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example:
* allowableOperations * allowableOperations
* aspectNames * aspectNames
* association * association
@@ -2129,7 +2128,7 @@ parameters:
unfiledContainerIncludeSourceParam: unfiledContainerIncludeSourceParam:
name: includeSource name: includeSource
in: query in: query
description: Also include **source** in addition to **entries** with folder information on the parent node the specified parent **unfiledContainerId** description: Also include **source** (in addition to **entries**) with folder information on the parent node the specified parent **unfiledContainerId**
required: false required: false
type: boolean type: boolean
## Unfiled record folders ## Unfiled record folders
@@ -2137,14 +2136,14 @@ parameters:
name: unfiledRecordFolderId name: unfiledRecordFolderId
in: path in: path
description: description:
The identifier of a unfiled record folder. The identifier of an unfiled record folder.
required: true required: true
type: string type: string
unfiledRecordFolderEntryIncludeParam: unfiledRecordFolderEntryIncludeParam:
name: include name: include
in: query in: query
description: | description: |
Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example:
* allowableOperations * allowableOperations
* path * path
required: false required: false
@@ -2156,7 +2155,7 @@ parameters:
name: include name: include
in: query in: query
description: | description: |
Returns additional information about the unfiled records container children. Any optional field from the response model can be requested. For example: Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example:
* allowableOperations * allowableOperations
* aspectNames * aspectNames
* association * association
@@ -2177,7 +2176,7 @@ parameters:
unfiledRecordFolderIncludeSourceParam: unfiledRecordFolderIncludeSourceParam:
name: includeSource name: includeSource
in: query in: query
description: Also include **source** in addition to **entries** with folder information on the parent node either the specified parent **unfiledRecordFolderId**, or as resolved by **relativePath**. description: Also include **source** (in addition to **entries**) with folder information on the parent node either the specified parent **unfiledRecordFolderId**, or as resolved by **relativePath**.
required: false required: false
type: boolean type: boolean
unfiledRecordFolderAndContainerWhereParam: unfiledRecordFolderAndContainerWhereParam:
@@ -2225,7 +2224,7 @@ parameters:
recordCategoryIncludeSourceParam: recordCategoryIncludeSourceParam:
name: includeSource name: includeSource
in: query in: query
description: Also include **source** in addition to **entries** with folder information on the parent node either the specified parent **recordCategoryId**, or as resolved by **relativePath**. description: Also include **source** (in addition to **entries**) with folder information on the parent node either the specified parent **recordCategoryId**, or as resolved by **relativePath**.
required: false required: false
type: boolean type: boolean
recordCategoryChildEntryIncludeParam: recordCategoryChildEntryIncludeParam:
@@ -2284,7 +2283,7 @@ parameters:
recordFolderIncludeSourceParam: recordFolderIncludeSourceParam:
name: includeSource name: includeSource
in: query in: query
description: Also include **source** in addition to **entries** with record information on the parent folder the specified parent **recordFolderId** description: Also include **source** (in addition to **entries**) with record information on the parent folder the specified parent **recordFolderId**
required: false required: false
type: boolean type: boolean
recordFolderChildEntryIncludeParam: recordFolderChildEntryIncludeParam:
@@ -2356,7 +2355,7 @@ parameters:
transferContainerIncludeSourceParam: transferContainerIncludeSourceParam:
name: includeSource name: includeSource
in: query in: query
description: Also include **source** in addition to **entries** with folder information on the specified parent **transferContainerId**. description: Also include **source** (in addition to **entries**) with folder information on the specified parent **transferContainerId**.
required: false required: false
type: boolean type: boolean
## Transfers ## Transfers
@@ -2383,7 +2382,7 @@ parameters:
transferIncludeSourceParam: transferIncludeSourceParam:
name: includeSource name: includeSource
in: query in: query
description: Also include **source** in addition to **entries** with folder information on the specified parent **transferId**. description: Also include **source** (in addition to **entries**) with folder information on the specified parent **transferId**.
required: false required: false
type: boolean type: boolean
transferChildEntryIncludeParam: transferChildEntryIncludeParam:
@@ -3718,4 +3717,4 @@ definitions:
- SiteConsumer - SiteConsumer
- SiteCollaborator - SiteCollaborator
- SiteContributor - SiteContributor
- SiteManager - SiteManager