public String getSubMenuXML ( ) { StringBuffer sbMenuArea = new StringBuffer ( ) ; if ( this . getEditMode ( ) == Constants . EDIT_CURRENT ) { if ( this . getField ( Menus . ICON_RESOURCE ) . isNull ( ) ) { String strIcon = this . getField ( Menus . TYPE ) . toString ( ) ; if ( strIcon . length ( ) > 0 ) strIcon = strIcon . substring ( 0 , 1 ) . toUpperCase ( ) + strIcon . substring ( 1 ) ; this . getField ( Menus . ICON_RESOURCE ) . setString ( strIcon ) ; } sbMenuArea . append ( XmlUtilities . createXMLStringRecord ( this ) ) ; sbMenuArea = this . addLinkTag ( sbMenuArea ) ; } if ( sbMenuArea . length ( ) == 0 ) sbMenuArea . append ( Utility . startTag ( this . getTableNames ( false ) ) + " <Name>Name</Name>" + " <Description>Description</Description>" + " <Program>Program</Program>" + " <Params>Params</Params>" + " <IconResource>IconResource</IconResource>" + " <Keywords>Keywords</Keywords>" + " <Html>Html</Html>" + Utility . endTag ( this . getTableNames ( false ) ) ) ; StringBuffer sbContentArea = new StringBuffer ( ) ; sbContentArea . append ( Utility . startTag ( XMLTags . MENU_LIST ) ) ; try { String strMenu = this . getField ( Menus . ID ) . toString ( ) ; this . setKeyArea ( Menus . PARENT_FOLDER_ID_KEY ) ; FileListener behavior = new StringSubFileFilter ( strMenu , this . getField ( Menus . PARENT_FOLDER_ID ) , null , null , null , null ) ; this . addListener ( behavior ) ; this . close ( ) ; while ( this . hasNext ( ) ) { this . next ( ) ; if ( this . getField ( Menus . ICON_RESOURCE ) . isNull ( ) ) { String strIcon = this . getField ( Menus . TYPE ) . toString ( ) ; if ( strIcon . length ( ) > 0 ) strIcon = strIcon . substring ( 0 , 1 ) . toUpperCase ( ) + strIcon . substring ( 1 ) ; this . getField ( Menus . ICON_RESOURCE ) . setString ( strIcon ) ; } StringBuffer sbMenuItem = new StringBuffer ( ) ; sbMenuItem . append ( XmlUtilities . createXMLStringRecord ( this ) ) ; sbMenuItem = this . addLinkTag ( sbMenuItem ) ; sbContentArea . append ( sbMenuItem ) ; } this . removeListener ( behavior , true ) ; } catch ( DBException ex ) { ex . printStackTrace ( ) ; } sbContentArea . append ( Utility . endTag ( XMLTags . MENU_LIST ) ) ; sbMenuArea . insert ( sbMenuArea . lastIndexOf ( Utility . endTag ( this . getTableNames ( false ) ) ) , sbContentArea ) ; return sbMenuArea . toString ( ) ; }
Get the XML for this menu item and it s sub - menus .