private static Element createAndAppendPosition ( String elementID , Element positions , IPerson person ) throws PortalException { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Adding Position Set entry " + elementID + "." ) ; String ID = null ; try { ID = getDLS ( ) . getNextStructDirectiveId ( person ) ; } catch ( Exception e ) { throw new PortalException ( "Exception encountered while " + "generating new position node " + "Id for userId=" + person . getID ( ) , e ) ; } Document plf = positions . getOwnerDocument ( ) ; Element position = plf . createElement ( Constants . ELM_POSITION ) ; position . setAttribute ( Constants . ATT_TYPE , Constants . ELM_POSITION ) ; position . setAttribute ( Constants . ATT_ID , ID ) ; position . setAttributeNS ( Constants . NS_URI , Constants . ATT_NAME , elementID ) ; positions . appendChild ( position ) ; return position ; }
Create append to the passed in position set and return a position element that references the passed in elementID .