private void updateFolderNode ( String nodeId , IUserLayoutFolderDescription newFolderDesc , IUserLayoutFolderDescription oldFolderDesc ) throws PortalException { Element ilfNode = ( Element ) getUserLayoutDOM ( ) . getElementById ( nodeId ) ; List < ILayoutProcessingAction > pendingActions = new ArrayList < ILayoutProcessingAction > ( ) ; /* * see what structure attributes changed if any and see if allowed. * * CHANNEL ATTRIBUTES that currently can be EDITED in DLM are: * name - in both fragments and regular layouts * dlm:moveAllowed - only on fragments * dlm:editAllowed - only on fragments * dlm:deleteAllowed - only on fragments * dlm:addChildAllowed - only on fragments */ // ATT: DLM Restrictions if ( isFragmentOwner && ( newFolderDesc . isDeleteAllowed ( ) != oldFolderDesc . isDeleteAllowed ( ) || newFolderDesc . isEditAllowed ( ) != oldFolderDesc . isEditAllowed ( ) || newFolderDesc . isAddChildAllowed ( ) != oldFolderDesc . isAddChildAllowed ( ) || newFolderDesc . isMoveAllowed ( ) != oldFolderDesc . isMoveAllowed ( ) ) ) { pendingActions . add ( new LPAEditRestriction ( owner , ilfNode , newFolderDesc . isMoveAllowed ( ) , newFolderDesc . isDeleteAllowed ( ) , newFolderDesc . isEditAllowed ( ) , newFolderDesc . isAddChildAllowed ( ) ) ) ; } // ATT: Name updateNodeAttribute ( ilfNode , nodeId , Constants . ATT_NAME , newFolderDesc . getName ( ) , oldFolderDesc . getName ( ) , pendingActions ) ; /* * if we make it to this point then all edits made are allowed so * process the actions to push the edits into the layout */ for ( Iterator itr = pendingActions . iterator ( ) ; itr . hasNext ( ) ; ) { ILayoutProcessingAction action = ( ILayoutProcessingAction ) itr . next ( ) ; action . perform ( ) ; } }
Compares the new folder description object with the old folder description object to determine what items were changed and if those changes are allowed . Once all changes are verified as being allowed changes then they are pushed into both the ILF and the PLF as appropriate . No changes are made until we determine that all changes are allowed .