*/
public PageSecurity copyPageSecurity(PageSecurity source)
throws NodeException
{
// create the new page security document and copy attributes
PageSecurity copy = this.newPageSecurity();
copy.setPath(source.getPath());
copy.setVersion(source.getVersion());
// copy security constraint defintions
copy.setSecurityConstraintsDefs(DatabasePageManagerUtils.createList());
Iterator defs = source.getSecurityConstraintsDefs().iterator();
while (defs.hasNext())
{
SecurityConstraintsDef def = (SecurityConstraintsDef)defs.next();
SecurityConstraintsDef defCopy = this.newSecurityConstraintsDef();
defCopy.setName(def.getName());
List copiedConstraints = DatabasePageManagerUtils.createList();
Iterator constraints = def.getSecurityConstraints().iterator();
while (constraints.hasNext())
{
SecurityConstraint srcConstraint = (SecurityConstraint)constraints.next();
SecurityConstraint dstConstraint = newPageSecuritySecurityConstraint();
copyConstraint(srcConstraint, dstConstraint);
copiedConstraints.add(dstConstraint);
}
defCopy.setSecurityConstraints(copiedConstraints);
copy.getSecurityConstraintsDefs().add(defCopy);
}
// copy global security constraint references
copy.setGlobalSecurityConstraintsRefs(DatabasePageManagerUtils.createList());
Iterator globals = source.getGlobalSecurityConstraintsRefs().iterator();
while (globals.hasNext())
{
String global = (String)globals.next();
copy.getGlobalSecurityConstraintsRefs().add(global);
}
return copy;
}