if (!childAssocDef.getPropagateTimestamps()) logger.debug("Not propagating cm:auditable for association type " + childAssocDef.getName());
if (childAssocDef.getDuplicateChildNamesAllowed())
for (ChildAssociationDefinition childAssocDef : childAssocDefs.values()) targetTypes.put(childAssocDef.getTargetClass().getName(), childAssocDef.getName()); for (ChildAssociationDefinition childAssocDef : childAssocDefs.values()) targetTypes.put(childAssocDef.getTargetClass().getName(), childAssocDef.getName());
public void testChildAssocPropagate() { // Check the default value AssociationDefinition assocDef = service.getAssociation(QName.createQName(TEST_URL, "childassoc1")); assertNotNull("No such child association found", assocDef); assertTrue("Expected a child association", assocDef instanceof ChildAssociationDefinition); ChildAssociationDefinition childAssocDef = (ChildAssociationDefinition) assocDef; assertFalse("Expected 'false' for default timestamp propagation", childAssocDef.getPropagateTimestamps()); // Check the explicit value assocDef = service.getAssociation(QName.createQName(TEST_URL, "childassocPropagate")); assertNotNull("No such child association found", assocDef); assertTrue("Expected a child association", assocDef instanceof ChildAssociationDefinition); childAssocDef = (ChildAssociationDefinition) assocDef; assertTrue("Expected 'true' for timestamp propagation", childAssocDef.getPropagateTimestamps()); }
@Override public Serializable getValueInternal(CMISNodeInfo nodeInfo) { if(nodeInfo.getType() == null) { //If the type is null, we can't handle it so return an empty list return (Serializable) Collections.emptyList(); } TypeDefinition type = getServiceRegistry().getDictionaryService() .getType(nodeInfo.getType().getAlfrescoClass()); if ((type != null) && (type.getChildAssociations() != null) && (!type.getChildAssociations().isEmpty())) { ArrayList<String> result = new ArrayList<String>(); for (ChildAssociationDefinition cad : type.getChildAssociations().values()) { String typeId = cmisMapping.getCmisTypeId(cad.getTargetClass().getName()); if (typeId != null) { result.add(typeId); } } return result; } return (Serializable) Collections.emptyList(); } }
/** * Checks that the association name matches the constraints imposed by the model. */ protected void checkAssocQNameRegex( List<IntegrityRecord> eventResults, ChildAssociationDefinition assocDef, QName assocQName, NodeRef sourceNodeRef) { // check the association name QName assocRoleQName = assocDef.getTargetRoleName(); if (assocRoleQName != null) { // the assoc defines a role name - check it RegexQNamePattern rolePattern = new RegexQNamePattern(assocRoleQName.getNamespaceURI(), assocRoleQName.getLocalName()); if (!rolePattern.isMatch(assocQName)) { IntegrityRecord result = new IntegrityRecord( "The association name does not match the allowed role names: \n" + " Source Node: " + sourceNodeRef + "\n" + " Association: " + assocDef + "\n" + " Allowed roles: " + rolePattern + "\n" + " Name assigned: " + assocRoleQName); eventResults.add(result); } } } }
if (!childAssocDef.isChild())
@Override public Serializable getValueInternal(CMISNodeInfo nodeInfo) { if(nodeInfo.getType() == null) { //If the type is null, we can't handle it so return an empty list return (Serializable) Collections.emptyList(); } TypeDefinition type = getServiceRegistry().getDictionaryService() .getType(nodeInfo.getType().getAlfrescoClass()); if ((type != null) && (type.getChildAssociations() != null) && (!type.getChildAssociations().isEmpty())) { ArrayList<String> result = new ArrayList<String>(); for (ChildAssociationDefinition cad : type.getChildAssociations().values()) { String typeId = cmisMapping.getCmisTypeId(cad.getTargetClass().getName()); if (typeId != null) { result.add(typeId); } } return result; } return (Serializable) Collections.emptyList(); } }
/** * Checks that the association name matches the constraints imposed by the model. */ protected void checkAssocQNameRegex( List<IntegrityRecord> eventResults, ChildAssociationDefinition assocDef, QName assocQName, NodeRef sourceNodeRef) { // check the association name QName assocRoleQName = assocDef.getTargetRoleName(); if (assocRoleQName != null) { // the assoc defines a role name - check it RegexQNamePattern rolePattern = new RegexQNamePattern(assocRoleQName.getNamespaceURI(), assocRoleQName.getLocalName()); if (!rolePattern.isMatch(assocQName)) { IntegrityRecord result = new IntegrityRecord( "The association name does not match the allowed role names: \n" + " Source Node: " + sourceNodeRef + "\n" + " Association: " + assocDef + "\n" + " Allowed roles: " + rolePattern + "\n" + " Name assigned: " + assocRoleQName); eventResults.add(result); } } } }
if (!childAssocDef.isChild())
if (!childAssocDef.getPropagateTimestamps()) logger.debug("Not propagating cm:auditable for association type " + childAssocDef.getName());
for (ChildAssociationDefinition childAssocDef : childAssocDefs.values()) targetTypes.put(childAssocDef.getTargetClass().getName(), childAssocDef.getName()); for (ChildAssociationDefinition childAssocDef : childAssocDefs.values()) targetTypes.put(childAssocDef.getTargetClass().getName(), childAssocDef.getName());
if (childAssocDef.getDuplicateChildNamesAllowed())
if (dropName && !childAssocDef.getDuplicateChildNamesAllowed())
if (dropName && !childAssocDef.getDuplicateChildNamesAllowed())