private static Element getEditSet ( Element node , Document plf , IPerson person , boolean create ) throws PortalException { Node child = node . getFirstChild ( ) ; while ( child != null ) { if ( child . getNodeName ( ) . equals ( Constants . ELM_EDIT_SET ) ) return ( Element ) child ; child = child . getNextSibling ( ) ; } if ( create == false ) return null ; String ID = null ; try { ID = getDLS ( ) . getNextStructDirectiveId ( person ) ; } catch ( Exception e ) { throw new PortalException ( "Exception encountered while " + "generating new edit set node " + "Id for userId=" + person . getID ( ) , e ) ; } Element editSet = plf . createElement ( Constants . ELM_EDIT_SET ) ; editSet . setAttribute ( Constants . ATT_TYPE , Constants . ELM_EDIT_SET ) ; editSet . setAttribute ( Constants . ATT_ID , ID ) ; node . appendChild ( editSet ) ; return editSet ; }
Get the edit set if any stored in the passed in node . If not found and if the create flag is true then create a new edit set and add it as a child to the passed in node . Then return it .