public static void deleteNode ( Element compViewNode , IPerson person ) throws PortalException { String ID = compViewNode . getAttribute ( Constants . ATT_ID ) ; if ( ID . startsWith ( Constants . FRAGMENT_ID_USER_PREFIX ) ) // ilf node DeleteManager . addDeleteDirective ( compViewNode , ID , person ) ; else { // plf node Document plf = ( Document ) person . getAttribute ( Constants . PLF ) ; Element node = plf . getElementById ( ID ) ; if ( node == null ) return ; Element parent = ( Element ) node . getParentNode ( ) ; if ( parent == null ) return ; parent . removeChild ( node ) ; } }
Handles user requests to delete UI elements . For ILF owned nodes it delegates to the DeleteManager to add a delete directive . For PLF owned nodes it deletes the node outright .