NodeChange implements

        BeforeDeleteNodePolicy, OnAddAspectPolicy, OnCreateNodePolicy, OnMoveNodePolicy,
        OnRemoveAspectPolicy, OnUpdatePropertiesPolicy,

        OnContentReadPolicy, OnContentUpdatePolicy,

        OnCreateVersionPolicy,

        OnCopyCompletePolicy,
        
        OnCheckOut, OnCheckIn, OnCancelCheckOut { @Override public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> fromProperties, Map<QName, Serializable> toProperties) { if (fromProperties.isEmpty() && this.toProperties != null) { fromProperties = this.toProperties; } setFromProperties(fromProperties); setToProperties(toProperties); appendSubAction(new NodeChange(nodeInfoFactory, namespaceService, nodeRef). setAction(UPDATE_NODE_PROPERTIES). setFromProperties(fromProperties). setToProperties(toProperties)); } NodeChange(NodeInfoFactory nodeInfoFactory, NamespaceService namespaceService, NodeRef nodeRef); String getDerivedAction(); boolean isTemporaryNode(); NodeChange setAuditSubActions(boolean auditSubActions); @Override void beforeDeleteNode(NodeRef nodeRef); @Override void onCreateNode(ChildAssociationRef childAssocRef); @Override void onMoveNode(ChildAssociationRef fromChildAssocRef, ChildAssociationRef toChildAssocRef); @Override void onUpdateProperties(NodeRef nodeRef,
            Map<QName, Serializable> fromProperties, Map<QName, Serializable> toProperties); @Override void onRemoveAspect(NodeRef nodeRef, QName aspect); @Override void onAddAspect(NodeRef nodeRef, QName aspect); @Override void onContentUpdate(NodeRef nodeRef, boolean newContent); @Override void onContentRead(NodeRef nodeRef); @Override void onCreateVersion(QName classRef, NodeRef nodeRef,
            Map<String, Serializable> versionProperties, PolicyScope nodeDetails); void onCopyComplete(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef,
            boolean copyToNewNode, Map<NodeRef, NodeRef> copyMap); void onCheckOut(NodeRef workingCopy); void onCheckIn(NodeRef nodeRef); void onCancelCheckOut(NodeRef nodeRef); Map<String, Serializable> getAuditData(boolean subAction); static final String SUB_ACTION; static Collection<String> SUMMARY_KEYS; static final String SUB_ACTION_PREFIX; }
@Test public final void testOnUpdateProperties() { Map<QName, Serializable> fromProperties = new HashMap<QName, Serializable>(); fromProperties.put(ContentModel.PROP_CREATED, "created"); fromProperties.put(ContentModel.PROP_CREATOR, "creator"); fromProperties.put(ContentModel.PROP_CONTENT, "content"); fromProperties.put(ContentModel.PROP_LOCATION, "location"); fromProperties.put(ContentModel.PROP_MOBILE, "mobile"); fromProperties.put(ContentModel.PROP_HITS, "hits"); fromProperties.put(ContentModel.PROP_TITLE, "title"); Map<QName, Serializable> toProperties = new HashMap<QName, Serializable>(fromProperties); toProperties.put(ContentModel.PROP_AUTHOR, "AUTHOR"); toProperties.put(ContentModel.PROP_ADDRESSEE, "ADDRESSEE"); toProperties.remove(ContentModel.PROP_CREATED); toProperties.remove(ContentModel.PROP_CREATOR); toProperties.remove(ContentModel.PROP_CONTENT); toProperties.put(ContentModel.PROP_LOCATION, "LOCATION"); nodeChange.onUpdateProperties(content1, fromProperties, toProperties); Map<String, Serializable> auditMap = nodeChange.getAuditData(false); assertStandardData(auditMap, "updateNodeProperties", "updateNodeProperties"); assertEquals(1, ((Map<?,?>)auditMap.get("properties/from")).size()); assertEquals("location", ((Map<?,?>)auditMap.get("properties/from")).get(ContentModel.PROP_LOCATION)); assertEquals("location", auditMap.get("properties/from/cm:location")); assertEquals(1, ((Map<?,?>)auditMap.get("properties/to")).size()); assertEquals("LOCATION", ((Map<?,?>)auditMap.get("properties/to")).get(ContentModel.PROP_LOCATION)); assertEquals("LOCATION", auditMap.get("properties/to/cm:location")); assertEquals(2, ((Map<?,?>)auditMap.get("properties/add")).size()); assertEquals("AUTHOR", ((Map<?,?>)auditMap.get("properties/add")).get(ContentModel.PROP_AUTHOR)); assertEquals("ADDRESSEE", ((Map<?,?>)auditMap.get("properties/add")).get(ContentModel.PROP_ADDRESSEE)); assertEquals("AUTHOR", auditMap.get("properties/add/cm:author")); assertEquals("ADDRESSEE", auditMap.get("properties/add/cm:addressee")); assertEquals(3, ((Map<?,?>)auditMap.get("properties/delete")).size()); assertEquals("created", ((Map<?,?>)auditMap.get("properties/delete")).get(ContentModel.PROP_CREATED)); assertEquals("creator", ((Map<?,?>)auditMap.get("properties/delete")).get(ContentModel.PROP_CREATOR)); assertEquals("content", ((Map<?,?>)auditMap.get("properties/delete")).get(ContentModel.PROP_CONTENT)); assertEquals("created", auditMap.get("properties/delete/cm:created")); assertEquals("creator", auditMap.get("properties/delete/cm:creator")); assertEquals("content", auditMap.get("properties/delete/cm:content")); }