public boolean checkUpdateRestrictions(IUserLayoutNodeDescription nodeDescription) throws PortalException {
IALNodeDescription nodeDesc=(IALNodeDescription)nodeDescription;
String nodeId = nodeDesc.getId();
if ( nodeId == null ) return false;
ALNode node = layout.getLayoutNode(nodeId);
IALNodeDescription currentNodeDesc = (IALNodeDescription) node.getNodeDescription();
// If the node Ids do no match to each other then return false
if ( !nodeId.equals(currentNodeDesc.getId()) ) return false;
// Checking the immutable node restriction
//if ( checkRestriction(node,RestrictionTypes.IMMUTABLE_RESTRICTION,"true") )
if ( currentNodeDesc.isImmutable() )
return false;
// Checking the immutable parent node related restriction
if ( getRestriction(layout.getLayoutNode(node.getParentNodeId()),RestrictionTypes.IMMUTABLE_RESTRICTION,IUserLayoutRestriction.CHILDREN_RESTRICTION_PATH) != null &&
checkRestriction(node.getParentNodeId(),RestrictionTypes.IMMUTABLE_RESTRICTION,IUserLayoutRestriction.CHILDREN_RESTRICTION_PATH,"true") )
return false;
// Checking the immutable children node related restrictions
if ( node.getNodeType() == IUserLayoutNodeDescription.FOLDER ) {
ALFolder folder = (ALFolder) node;
//Loop for all children
for ( String nextId = folder.getFirstChildNodeId(); nextId != null; nextId = layout.getLayoutNode(nextId).getNextNodeId() )
if ( getRestriction(layout.getLayoutNode(nextId),RestrictionTypes.IMMUTABLE_RESTRICTION,IUserLayoutRestriction.PARENT_RESTRICTION_PATH) != null &&
checkRestriction(nextId,RestrictionTypes.IMMUTABLE_RESTRICTION,IUserLayoutRestriction.PARENT_RESTRICTION_PATH,"true") )
return false;
}
// if a new node description doesn't contain any restrictions the old restrictions will be used
if ( nodeDesc.getRestrictions() == null )
nodeDesc.setRestrictions(currentNodeDesc.getRestrictions());
Hashtable rhash = nodeDesc.getRestrictions();
// Setting the new node description to the node
node.setNodeDescription(nodeDesc);
// Checking restrictions for the node