signature:
public class ModalWindowContainer { /** * Method creates a JavaScript to reload the parent page .
 * @ param _ uiObject uiObject of the page that was opened in the current modal
 * @ return JavaScript
 * @ throws EFapsException */
public CharSequence getReloadJavaScript ( final ICmdUIObject _uiObject ) { } }

implementation:
final StringBuilder javascript = new StringBuilder ( ) ; if ( _uiObject instanceof IPageObject ) { try { final Page page ; final Object modelObject = getPage ( ) . getDefaultModelObject ( ) ; if ( modelObject instanceof UIGrid ) { final UIGrid uiGrid = ( UIGrid ) modelObject ; page = new GridPage ( Model . of ( UIGrid . get ( uiGrid . getCmdUUID ( ) , uiGrid . getPagePosition ( ) ) . setCallInstance ( uiGrid . getCallInstance ( ) ) ) ) ; } else if ( modelObject instanceof UIForm ) { final UIForm uiForm = ( UIForm ) modelObject ; uiForm . resetModel ( ) ; page = new FormPage ( Model . of ( uiForm ) ) ; } else if ( modelObject instanceof UITable ) { final UITable uiTable = ( UITable ) modelObject ; uiTable . resetModel ( ) ; page = new TablePage ( Model . of ( uiTable ) ) ; } else if ( modelObject instanceof UIStructurBrowser ) { final UIStructurBrowser uiStrBrws = ( UIStructurBrowser ) modelObject ; uiStrBrws . resetModel ( ) ; page = new StructurBrowserPage ( Model . of ( uiStrBrws ) ) ; } else { ModalWindowContainer . LOG . error ( "NO PAGE" ) ; page = new UnexpectedErrorPage ( ) ; } final IRequestHandler handler = new RenderPageRequestHandler ( new PageProvider ( page ) ) ; final String url = getRequestCycle ( ) . urlFor ( handler ) . toString ( ) ; switch ( ( ( IPageObject ) _uiObject ) . getPagePosition ( ) ) { case TREE : case TREEMODAL : javascript . append ( "var mF = top.dojo.doc.getElementById(\"" ) . append ( MainPage . IFRAME_ID ) . append ( "\");\n" ) . append ( "if (mF != null) {\n" ) . append ( "mF.contentWindow.dojo.query('.dijitContentPane.eFapsCenterPanel')" ) . append ( ".forEach(function(_p){\n" ) . append ( "var d = mF.contentWindow.dijit.registry.byNode(_p);\n" ) . append ( "d.set('content', domConstruct.create('iframe', {\n" ) . append ( "\"src\": \"" ) . append ( url ) . append ( "\",\"style\": \"border: 0; width: 100%; height: 99%\"}" ) . append ( "));\n" ) . append ( "});\n" ) . append ( "mF.contentWindow." ) . append ( MenuUpdateBehavior . FUNCTION_NAME ) . append ( "(\"" ) . append ( MenuUpdateBehavior . PARAMETERKEY4UPDATE ) . append ( "\");\n" ) . append ( "}" ) ; break ; case CONTENT : case CONTENTMODAL : default : javascript . append ( " top.dijit.registry.byId(\"mainPanel\").set(\"content\"," ) . append ( " domConstruct.create(\"iframe\",{" ) . append ( "\"id\": \"" ) . append ( MainPage . IFRAME_ID ) . append ( "\",\"src\": \"./wicket/" ) . append ( url ) . append ( "\",\"style\": \"border: 0; width: 100%; height: 99%\" }" ) . append ( "))" ) ; } } catch ( final EFapsException e ) { throw new RestartResponseException ( new ErrorPage ( e ) ) ; } } else { final AbstractUIPageObject uiObject = ( AbstractUIPageObject ) getPage ( ) . getDefaultModelObject ( ) ; if ( uiObject != null ) { try { PageReference calledByPageRef = ( ( AbstractContentPage ) getPage ( ) ) . getCalledByPageReference ( ) ; if ( calledByPageRef != null && calledByPageRef . getPage ( ) instanceof AbstractContentPage ) { calledByPageRef = ( ( AbstractContentPage ) calledByPageRef . getPage ( ) ) . getCalledByPageReference ( ) ; } final String href = _uiObject . getCommand ( ) == null ? null : _uiObject . getCommand ( ) . getReference ( ) ; final Page page ; boolean tree = false ; if ( "TREE?" . equalsIgnoreCase ( href ) && _uiObject . getInstance ( ) != null && _uiObject . getInstance ( ) . isValid ( ) ) { final Menu menu = Menu . getTypeTreeMenu ( _uiObject . getInstance ( ) . getType ( ) ) ; if ( menu == null ) { final Exception ex = new Exception ( "no tree menu defined for type " + _uiObject . getInstance ( ) . getType ( ) . getName ( ) ) ; throw new RestartResponseException ( new ErrorPage ( ex ) ) ; } page = new ContentContainerPage ( menu . getUUID ( ) , _uiObject . getInstance ( ) . getKey ( ) ) ; tree = true ; } else { uiObject . resetModel ( ) ; if ( uiObject instanceof UITable ) { page = new TablePage ( Model . of ( ( UITable ) uiObject ) , calledByPageRef ) ; } else if ( uiObject instanceof UIForm ) { page = new FormPage ( Model . of ( ( UIForm ) uiObject ) , calledByPageRef ) ; } else if ( uiObject instanceof UIStructurBrowser ) { page = new StructurBrowserPage ( Model . of ( ( UIStructurBrowser ) uiObject ) , calledByPageRef ) ; } else { page = new MockHomePage ( ) ; } } final IRequestHandler handler = new RenderPageRequestHandler ( new PageProvider ( page ) ) ; // touch the page to ensure that the pagemanager stores it to be accessible
getSession ( ) . getPageManager ( ) . touchPage ( page ) ; final String url = getRequestCycle ( ) . urlFor ( handler ) . toString ( ) ; if ( calledByPageRef != null && calledByPageRef . getPage ( ) instanceof ContentContainerPage && ! tree ) { final String panelId = ( ( ContentContainerPage ) calledByPageRef . getPage ( ) ) . getCenterPanelId ( ) ; javascript . append ( "var mF = top.dojo.doc.getElementById(\"" ) . append ( MainPage . IFRAME_ID ) . append ( "\");" ) . append ( "if (mF != null) {" ) . append ( "mF.contentWindow.dijit.registry.byId(\"" ) . append ( panelId ) . append ( "\").set(\"content\"," ) . append ( " domConstruct.create(\"iframe\", {" ) . append ( "\"src\": \"" ) . append ( url ) . append ( "\",\"style\": \"border: 0; width: 100%; height: 99%\"}" ) . append ( ")); " ) . append ( "mF.contentWindow." ) . append ( MenuUpdateBehavior . FUNCTION_NAME ) . append ( "(\"" ) . append ( MenuUpdateBehavior . PARAMETERKEY4UPDATE ) . append ( "\");" ) . append ( "}" ) ; } else { javascript . append ( " top.dijit.registry.byId(\"mainPanel\").set(\"content\"," ) . append ( " domConstruct.create(\"iframe\",{" ) . append ( "\"id\": \"" ) . append ( MainPage . IFRAME_ID ) . append ( "\",\"src\": \"./wicket/" ) . append ( url ) . append ( "\",\"style\": \"border: 0; width: 100%; height: 99%\" }" ) . append ( "))" ) ; } } catch ( final EFapsException e ) { throw new RestartResponseException ( new ErrorPage ( e ) ) ; } } else if ( getPage ( ) instanceof MainPage ) { try { // this was called by the DashBoard
final DashboardPage page = new DashboardPage ( getPage ( ) . getPageReference ( ) ) ; final IRequestHandler handler = new RenderPageRequestHandler ( new PageProvider ( page ) ) ; // touch the page to ensure that the pagemanager stores it to be accessible
getSession ( ) . getPageManager ( ) . touchPage ( page ) ; final String url = getRequestCycle ( ) . urlFor ( handler ) . toString ( ) ; javascript . append ( " top.dijit.registry.byId(\"mainPanel\").set(\"content\"," ) . append ( " domConstruct.create(\"iframe\",{" ) . append ( "\"id\": \"" ) . append ( MainPage . IFRAME_ID ) . append ( "\",\"src\": \"./wicket/" ) . append ( url ) . append ( "\",\"style\": \"border: 0; width: 100%; height: 99%\" }" ) . append ( "))" ) ; } catch ( final EFapsException e ) { throw new RestartResponseException ( new ErrorPage ( e ) ) ; } } } return DojoWrapper . require ( javascript , DojoClasses . domConstruct ) ;


signature:
public class ModalWindowContainer { /** * This method sets this ModalWindowContainer into the state like it was
 * just created . It uses the default values as they are defined in
 * < code > org . apache . wicket . extensions . ajax . markup . html . modal . ModalWindow
 * < / code > */
public void reset ( ) { } }

implementation: super . setMinimalWidth ( 200 ) ; super . setMinimalHeight ( 200 ) ; super . setInitialHeight ( 400 ) ; super . setInitialWidth ( 600 ) ; super . setUseInitialHeight ( true ) ; super . setResizable ( true ) ; super . setHeightUnit ( "px" ) ; super . setWidthUnit ( "px" ) ; super . setPageCreator ( null ) ; super . setCloseButtonCallback ( null ) ; super . setWindowClosedCallback ( null ) ;


signature:
public class ModalWindowContainer { /** * Check it the size of the modal window is not to big and reduces it if
 * necessary .
 * @ see org . apache . wicket . extensions . ajax . markup . html . modal . ModalWindow # setInitialHeight ( int )
 * @ param _ initialHeight height
 * @ return this Modalwindow */
@ Override public ModalWindow setInitialHeight ( final int _initialHeight ) { } }

implementation: int height = _initialHeight ; final WebClientInfo wcInfo = ( WebClientInfo ) getSession ( ) . getClientInfo ( ) ; if ( wcInfo . getProperties ( ) . getBrowserHeight ( ) > 0 && wcInfo . getProperties ( ) . getBrowserHeight ( ) < height ) { height = wcInfo . getProperties ( ) . getBrowserHeight ( ) - 33 ; } return super . setInitialHeight ( height ) ;


signature:
public class ModalWindowContainer { /** * Check it the size of the modal window is not to big and reduces it if
 * necessary .
 * @ see org . apache . wicket . extensions . ajax . markup . html . modal . ModalWindow # setInitialWidth ( int )
 * @ param _ initialWidth width
 * @ return this Modalwindow */
@ Override public ModalWindow setInitialWidth ( final int _initialWidth ) { } }

implementation: int width = _initialWidth ; final WebClientInfo wcInfo = ( WebClientInfo ) getSession ( ) . getClientInfo ( ) ; if ( wcInfo . getProperties ( ) . getBrowserWidth ( ) > 0 && wcInfo . getProperties ( ) . getBrowserWidth ( ) < _initialWidth ) { width = wcInfo . getProperties ( ) . getBrowserWidth ( ) ; } return super . setInitialWidth ( width ) ;


signature:
public class DojoWrapper { /** * Require .
 * @ param _ script the script
 * @ param _ classes the classes
 * @ return the char sequence */
public static CharSequence require ( final CharSequence _script , final DojoClass ... _classes ) { } }

implementation: final TreeMap < Double , DojoLayer > layers = new TreeMap < > ( ) ; for ( final DojoLayer layer : DojoLayer . values ( ) ) { long count = 0 ; for ( final DojoClass dojoClass : _classes ) { if ( layer . getDojoClasses ( ) . contains ( dojoClass ) ) { count ++ ; } } if ( count > 0 ) { final double weight = ( double ) count / ( double ) layer . getDojoClasses ( ) . size ( ) ; layers . put ( weight , layer ) ; } } return DojoWrapper . require ( _script , layers . isEmpty ( ) ? null : layers . descendingMap ( ) . values ( ) . iterator ( ) . next ( ) . getName ( ) , _classes ) ;


signature:
public class DojoWrapper { /** * Require .
 * @ param _ script the script
 * @ param _ layer the layer
 * @ param _ classes the classes
 * @ return the char sequence */
public static CharSequence require ( final CharSequence _script , final String _layer , final DojoClass ... _classes ) { } }

implementation: final StringBuilder ret = new StringBuilder ( ) ; if ( _layer != null ) { ret . append ( "require(['" ) . append ( _layer ) . append ( "'],function() {\n" ) ; } ret . append ( "require([" ) ; final StringBuilder paras = new StringBuilder ( ) ; boolean first = true ; final List < DojoClass > libs = Arrays . asList ( _classes ) ; final ComparatorChain < DojoClass > comparator = new ComparatorChain < > ( ) ; comparator . addComparator ( new Comparator < DojoClass > ( ) { @ Override public int compare ( final DojoClass _arg0 , final DojoClass _arg1 ) { return _arg0 . getParameterName ( ) == null && _arg1 . getParameterName ( ) == null || _arg0 . getParameterName ( ) != null && _arg1 . getParameterName ( ) != null ? 0 : _arg0 . getParameterName ( ) == null ? 1 : - 1 ; } } ) ; comparator . addComparator ( new Comparator < DojoClass > ( ) { @ Override public int compare ( final DojoClass _arg0 , final DojoClass _arg1 ) { return _arg0 . getClassName ( ) . compareTo ( _arg1 . getClassName ( ) ) ; } } ) ; Collections . sort ( libs , comparator ) ; for ( final DojoClass dojoLibs : libs ) { if ( first ) { first = false ; } else { ret . append ( "," ) ; if ( dojoLibs . getParameterName ( ) != null ) { paras . append ( "," ) ; } } ret . append ( "\"" ) . append ( dojoLibs . getClassName ( ) ) . append ( "\"" ) ; if ( dojoLibs . getParameterName ( ) != null ) { paras . append ( dojoLibs . getParameterName ( ) ) ; } } if ( _script == null ) { ret . append ( "]);" ) ; } else { ret . append ( "]," ) . append ( " function(" ) . append ( paras ) . append ( ") {\n" ) . append ( _script ) . append ( "});" ) ; } if ( _layer != null ) { ret . append ( "});" ) ; } return ret ;


signature:
public class HeadingPanel { /** * Method to add the Component to this Panel .
 * @ param _ headingmodel model of the heading . */
public void addComponents ( final Model < UIHeading > _headingmodel ) { } }

implementation: final WebMarkupContainer container = new WebMarkupContainer ( "container" ) ; this . add ( container ) ; if ( _headingmodel . getObject ( ) . getLevel ( ) == 0 ) { container . add ( AttributeModifier . replace ( "class" , "eFapsFrameTitle" ) ) ; } else { container . add ( AttributeModifier . replace ( "class" , "eFapsHeading" + _headingmodel . getObject ( ) . getLevel ( ) ) ) ; } container . add ( new Label ( "heading" , _headingmodel . getObject ( ) . getLabel ( ) ) ) ; final String toggleId = this . getMarkupId ( true ) ; final Component span = new WebComponent ( "toggle" ) { private static final long serialVersionUID = 1L ; @ Override protected void onComponentTag ( final ComponentTag _tag ) { super . onComponentTag ( _tag ) ; _tag . put ( "onclick" , "toggleSection('" + toggleId + "');" ) ; } @ Override public boolean isVisible ( ) { return _headingmodel . getObject ( ) . getLevel ( ) > 0 && _headingmodel . getObject ( ) . isCollapsible ( ) ; } } ; container . add ( span ) ; final Component status = new WebComponent ( "status" ) { private static final long serialVersionUID = 1L ; @ Override protected void onComponentTag ( final ComponentTag _tag ) { super . onComponentTag ( _tag ) ; _tag . put ( "name" , _headingmodel . getObject ( ) . getName ( ) ) ; _tag . put ( "value" , false ) ; } @ Override public boolean isVisible ( ) { return _headingmodel . getObject ( ) . getLevel ( ) > 0 && _headingmodel . getObject ( ) . isCollapsible ( ) ; } } ; status . setMarkupId ( "status_" + toggleId ) ; container . add ( status ) ;


signature:
public class StructurBrowserProvider { /** * Get the children of the given node .
 * @ param _ node node to get children for
 * @ return children of node */
@ Override public Iterator < ? extends UIStructurBrowser > getChildren ( final UIStructurBrowser _node ) { } }

implementation: if ( _node . isParent ( ) && ! _node . hasChildren ( ) ) { _node . addChildren ( ) ; } return _node . getChildren ( ) . iterator ( ) ;


signature:
public class AbstractUIField { /** * Getter method for the instance variable { @ link # autoCompleteSetting } .
 * @ return value of instance variable { @ link # autoCompleteSetting } */
@ Override public AutoCompleteSettings getAutoCompleteSetting ( ) { } }

implementation:
if ( this . autoCompleteSetting == null && isAutoComplete ( ) ) { this . autoCompleteSetting = new AutoCompleteSettings ( getFieldConfiguration ( ) ) ; final List < EventDefinition > events = getFieldConfiguration ( ) . getField ( ) . getEvents ( EventType . UI_FIELD_AUTOCOMPLETE ) ; for ( final EventDefinition event : events ) { this . autoCompleteSetting . setMinInputLength ( event . getProperty ( "MinInputLength" ) == null ? 1 : Integer . valueOf ( event . getProperty ( "MinInputLength" ) ) ) ; this . autoCompleteSetting . setMaxChoiceLength ( event . getProperty ( "MaxChoiceLength" ) == null ? - 1 : Integer . valueOf ( event . getProperty ( "MaxChoiceLength" ) ) ) ; this . autoCompleteSetting . setMaxValueLength ( event . getProperty ( "MaxValueLength" ) == null ? - 1 : Integer . valueOf ( event . getProperty ( "MaxValueLength" ) ) ) ; if ( event . getProperty ( "MaxResult" ) != null ) { this . autoCompleteSetting . setMaxResult ( Integer . valueOf ( event . getProperty ( "MaxResult" ) ) ) ; } if ( event . getProperty ( "HasDownArrow" ) != null ) { this . autoCompleteSetting . setHasDownArrow ( "true" . equalsIgnoreCase ( event . getProperty ( "HasDownArrow" ) ) ) ; } if ( event . getProperty ( "Required" ) != null ) { this . autoCompleteSetting . setRequired ( ! "false" . equalsIgnoreCase ( event . getProperty ( "Required" ) ) ) ; } if ( event . getProperty ( "AutoType" ) != null ) { this . autoCompleteSetting . setAutoType ( EnumUtils . getEnum ( AutoCompleteBehavior . Type . class , event . getProperty ( "AutoType" ) ) ) ; } // add the ExtraParameter definitions
final String ep = event . getProperty ( "ExtraParameter" ) ; if ( ep != null ) { this . autoCompleteSetting . getExtraParameters ( ) . add ( ep ) ; } int i = 1 ; String keyTmp = "ExtraParameter" + String . format ( "%02d" , i ) ; while ( event . getProperty ( keyTmp ) != null ) { this . autoCompleteSetting . getExtraParameters ( ) . add ( event . getProperty ( keyTmp ) ) ; i ++ ; keyTmp = "ExtraParameter" + String . format ( "%02d" , i ) ; } final String value4EditStr = event . getProperty ( "Value4Edit" ) ; if ( value4EditStr != null ) { this . autoCompleteSetting . setValue4Edit ( EditValue . valueOf ( value4EditStr ) ) ; } } } return this . autoCompleteSetting ;


signature:
public class AbstractUIField { /** * Execute events .
 * @ param _ eventType the event type
 * @ param _ others the others
 * @ param _ uiID2Oid the ui i d2 oid
 * @ return the list < return >
 * @ throws EFapsException on error */
public List < Return > executeEvents ( final EventType _eventType , final Object _others , final Map < String , String > _uiID2Oid ) throws EFapsException { } }

implementation: List < Return > ret = new ArrayList < > ( ) ; final Field field = getFieldConfiguration ( ) . getField ( ) ; if ( field . hasEvents ( _eventType ) ) { final Context context = Context . getThreadContext ( ) ; final String [ ] contextoid = { getInstanceKey ( ) } ; context . getParameters ( ) . put ( "oid" , contextoid ) ; ret = field . executeEvents ( _eventType , ParameterValues . INSTANCE , getInstance ( ) , ParameterValues . OTHERS , _others , ParameterValues . PARAMETERS , context . getParameters ( ) , ParameterValues . CLASS , this , ParameterValues . OIDMAP4UI , _uiID2Oid , ParameterValues . CALL_INSTANCE , getParent ( ) . getInstance ( ) , ParameterValues . CALL_CMD , ( ( AbstractUIObject ) getParent ( ) ) . getCommand ( ) ) ; } return ret ;


signature:
public class AbstractUIField { /** * { @ inheritDoc } */
@ Override public Comparable < ? > getCompareValue ( ) { } }

implementation: Comparable < ? > ret = null ; try { if ( this . sortValue == null ) { ret = getFactory ( ) . getCompareValue ( this ) ; } else { ret = this . sortValue ; } } catch ( final EFapsException e ) { LOG . error ( "Catched error" , e ) ; } return ret ;


signature:
public class AbstractUIField { /** * Getter method for the instance variable { @ link # factory } .
 * @ return value of instance variable { @ link # factory }
 * @ throws EFapsException on error */
public IComponentFactory getFactory ( ) throws EFapsException { } }

implementation: if ( getFactoryKey ( ) == null ) { for ( final IComponentFactory factory : getFactories ( ) . values ( ) ) { if ( factory . applies ( this ) ) { setFactory ( factory ) ; break ; } } if ( getFactoryKey ( ) == null ) { LOG . error ( "Could not find factory for field '{}' in '{}'" , getFieldConfiguration ( ) . getName ( ) , getFieldConfiguration ( ) . getField ( ) . getCollection ( ) . getName ( ) ) ; } } return getFactories ( ) . get ( getFactoryKey ( ) ) ;


signature:
public class PopupMenuItemBehavior { /** * Render the links for the head .
 * @ param _ component component the header will be rendered for
 * @ param _ response resonse to add */
@ Override public void renderHead ( final Component _component , final IHeaderResponse _response ) { } }

implementation: super . renderHead ( _component , _response ) ; _response . render ( RequireHeaderItem . forClasses ( DojoClasses . PopupMenuItem , DojoClasses . parser ) ) ;


signature:
public class Requester { /** * Makes a request to HP Haven OnDemand using a TokenProxy provided by a { @ link TokenProxyService } , converting the
 * response body to the type specified by the Class object .
 * @ param returnType The desired type of the value returned by HP Haven OnDemand
 * @ param backendCaller Makes the request to HP Haven OnDemand
 * @ param < U > The desired type of the value returned by HP Haven OnDemand
 * @ return An object representing the output from HP Haven OnDemand
 * @ throws HodErrorException
 * @ throws NullPointerException If a TokenProxyService has not been configured */
public < U > U makeRequest ( final Class < U > returnType , final BackendCaller < ? super E , ? super T > backendCaller ) throws HodErrorException { } }

implementation: checkTokenProxyService ( ) ; return makeRequest ( tokenProxyService . getTokenProxy ( ) , returnType , backendCaller ) ;


signature:
public class Requester { /** * Makes a request to HP Haven OnDemand using a TokenProxy provided by a { @ link TokenProxyService } , converting the
 * response body to the type specified by the type reference .
 * @ param typeReference The desired type of the value returned by HP Haven OnDemand
 * @ param backendCaller Makes the request to HP Haven OnDemand
 * @ param < U > The desired type of the value returned by HP Haven OnDemand
 * @ return An object representing the output from HP Haven OnDemand
 * @ throws HodErrorException
 * @ throws NullPointerException If a TokenProxyService has not been configured */
public < U > U makeRequest ( final TypeReference < U > typeReference , final BackendCaller < ? super E , ? super T > backendCaller ) throws HodErrorException { } }

implementation: checkTokenProxyService ( ) ; return makeRequest ( tokenProxyService . getTokenProxy ( ) , typeReference , backendCaller ) ;


signature:
public class Requester { /** * Makes a request to HP Haven OnDemand using a TokenProxy provided by a { @ link TokenProxyService } , returning the
 * response body as an input stream .
 * @ param backendCaller Makes the request to HP Haven OnDemand
 * @ return The response body
 * @ throws HodErrorException
 * @ throws NullPointerException If a TokenProxyService has not been configured */
public InputStream makeRequest ( final BackendCaller < ? super E , ? super T > backendCaller ) throws HodErrorException { } }

implementation: checkTokenProxyService ( ) ; return makeRequest ( tokenProxyService . getTokenProxy ( ) , backendCaller ) ;


signature:
public class Requester { /** * Makes a request to HP Haven OnDemand using a TokenProxy provided by a { @ link TokenProxyService } , converting the
 * response body to the type specified by the JavaType . This method does not guarantee that the type parameter U
 * represents the given JavaType . If possible , use one of the safe makeRequest methods instead .
 * @ param type The desired type of the value returned by HP Haven OnDemand
 * @ param backendCaller Makes the request to HP Haven OnDemand
 * @ param < U > The desired type of the value returned by HP Haven OnDemand
 * @ return An object representing the output from HP Haven OnDemand
 * @ throws HodErrorException */
public < U > U unsafeMakeRequest ( final JavaType type , final BackendCaller < ? super E , ? super T > backendCaller ) throws HodErrorException { } }

implementation: checkTokenProxyService ( ) ; return unsafeMakeRequest ( tokenProxyService . getTokenProxy ( ) , type , backendCaller ) ;


signature:
public class Requester { /** * Makes a request to HP Haven OnDemand , converting the response body to the type specified by the Class object .
 * @ param tokenProxy The token proxy to use to make the request
 * @ param returnType The desired type of the value returned by HP Haven OnDemand
 * @ param backendCaller Makes the request to HP Haven OnDemand
 * @ param < U > The desired type of the value returned by HP Haven OnDemand
 * @ param < BE > The entity type of the token proxy
 * @ param < BT > The token type of the token proxy
 * @ return An object representing the output from HP Haven OnDemand
 * @ throws HodErrorException */
public < U , BE extends EntityType , BT extends TokenType > U makeRequest ( final TokenProxy < BE , BT > tokenProxy , final Class < U > returnType , final BackendCaller < ? super BE , ? super BT > backendCaller ) throws HodErrorException { } }

implementation: return responseParser . parseResponse ( tokenProxy , returnType , backendCaller . makeRequest ( getAuthenticationToken ( tokenProxy ) ) ) ;


signature:
public class Requester { /** * Makes a request to HP Haven OnDemand , converting the response body to the type specified by the type reference .
 * @ param tokenProxy The token proxy to use to make the request
 * @ param typeReference The desired type of the value returned by HP Haven OnDemand
 * @ param backendCaller Makes the request to HP Haven OnDemand
 * @ param < U > The desired type of the value returned by HP Haven OnDemand
 * @ param < BE > The entity type of the token proxy
 * @ param < BT > The token type of the token proxy
 * @ return An object representing the output from HP Haven OnDemand
 * @ throws HodErrorException */
public < U , BE extends EntityType , BT extends TokenType > U makeRequest ( final TokenProxy < BE , BT > tokenProxy , final TypeReference < U > typeReference , final BackendCaller < ? super BE , ? super BT > backendCaller ) throws HodErrorException { } }

implementation: return responseParser . parseResponse ( tokenProxy , typeReference , backendCaller . makeRequest ( getAuthenticationToken ( tokenProxy ) ) ) ;


signature:
public class Requester { /** * Makes a request to HP Haven OnDemand , returning the response body as an input stream .
 * @ param tokenProxy The token proxy to use to make the request
 * @ param backendCaller Makes the request to HP Haven OnDemand
 * @ param < BE > The entity type of the token proxy
 * @ param < BT > The token type of the token proxy
 * @ return The response body
 * @ throws HodErrorException */
public < BE extends EntityType , BT extends TokenType > InputStream makeRequest ( final TokenProxy < BE , BT > tokenProxy , final BackendCaller < ? super BE , ? super BT > backendCaller ) throws HodErrorException { } }

implementation: return responseParser . parseResponse ( tokenProxy , backendCaller . makeRequest ( getAuthenticationToken ( tokenProxy ) ) ) ;


signature:
public class Requester { /** * Makes a request to HP Haven OnDemand , converting the response body to the type specified by the JavaType . This
 * method does not guarantee that the type parameter U represents the given JavaType . If possible , use one of the
 * safe makeRequest methods instead .
 * @ param tokenProxy The token proxy to use to make the request
 * @ param type The desired type of the value returned by HP Haven OnDemand
 * @ param backendCaller Makes the request to HP Haven OnDemand
 * @ param < U > The desired type of the value returned by HP Haven OnDemand
 * @ param < BE > The entity type of the token proxy
 * @ param < BT > The token type of the token proxy
 * @ return An object representing the output from HP Haven OnDemand
 * @ throws HodErrorException */
public < U , BE extends EntityType , BT extends TokenType > U unsafeMakeRequest ( final TokenProxy < BE , BT > tokenProxy , final JavaType type , final BackendCaller < ? super BE , ? super BT > backendCaller ) throws HodErrorException { } }

implementation: return responseParser . unsafeParseResponse ( tokenProxy , type , backendCaller . makeRequest ( getAuthenticationToken ( tokenProxy ) ) ) ;


signature:
public class HodConverter { /** * Returns the object returned by calling fromBody on the underlying converter */
@ Override public Object fromBody ( final TypedInput body , final Type type ) throws ConversionException { } }

implementation: try { return converter . fromBody ( body , type ) ; } catch ( final ConversionException e ) { if ( e . getCause ( ) instanceof JsonParseException ) { throw new HodUnavailableException ( e . getCause ( ) ) ; } else { throw e ; } }


signature:
public class HodConverter { /** * If object is annotated with { @ link DoNotConvert } , returns a String
 * representation of the object . Otherwise returns the object returned by calling toBody on the underlying converter */
@ Override public TypedOutput toBody ( final Object object ) { } }

implementation: if ( object . getClass ( ) . isAnnotationPresent ( DoNotConvert . class ) ) { return new TypedString ( object . toString ( ) ) ; } else { return converter . toBody ( object ) ; }


signature:
public class AjaxFieldUpdateBehavior { /** * Render to the web response the eFapsContentReference .
 * @ param _ response Response object */
@ Override public void renderHead ( final Component _component , final IHeaderResponse _response ) { } }

implementation: super . renderHead ( _component , _response ) ; _response . render ( AbstractEFapsHeaderItem . forJavaScript ( AjaxFieldUpdateBehavior . JS ) ) ;


signature:
public class AjaxFieldUpdateBehavior { /** * Default means nothing is done on error .
 * @ see org . apache . wicket . ajax . form . AjaxFormSubmitBehavior # onError ( org . apache . wicket . ajax . AjaxRequestTarget )
 * @ param _ target AjaxRequestTarget */
@ Override protected void onError ( final AjaxRequestTarget _target ) { } }

implementation:
if ( this . errorHandling ) { final FeedbackCollector collector = new FeedbackCollector ( getForm ( ) . getPage ( ) ) ; final List < FeedbackMessage > msgs = collector . collect ( ) ; final StringBuilder html = new StringBuilder ( ) . append ( "
" ) ; for ( final FeedbackMessage msg : msgs ) { msg . getReporter ( ) . add ( AttributeModifier . append ( "class" , "invalid" ) ) ; _target . add ( msg . getReporter ( ) ) ; Serializable warn = null ; if ( msg . getMessage ( ) instanceof ValidationErrorFeedback ) { // look if a message was set
warn = ( ( ValidationErrorFeedback ) msg . getMessage ( ) ) . getMessage ( ) ; // still no message , create one
if ( warn == null ) { warn = ( ( ValidationErrorFeedback ) msg . getMessage ( ) ) . getError ( ) . getErrorMessage ( new ErrorMessageResource ( ) ) ; } } String label = "" ; if ( msg . getReporter ( ) instanceof IFieldConfig ) { label = ( ( IFieldConfig ) msg . getReporter ( ) ) . getFieldConfig ( ) . getLabel ( ) ; } html . append ( "
" ) . append ( label ) . append ( ":	" ) . append ( warn ) . append ( "
" ) ; } html . append ( "
" ) ; final ModalWindowContainer modal = ( ( AbstractContentPage ) getComponent ( ) . getPage ( ) ) . getModal ( ) ; modal . setInitialWidth ( 350 ) ; modal . setInitialHeight ( 200 ) ; modal . setPageCreator ( new ModalWindow . PageCreator ( ) { private static final long serialVersionUID = 1L ; @ Override public Page createPage ( ) { return new DialogPage ( ( ( AbstractContentPage ) getComponent ( ) . getPage ( ) ) . getPageReference ( ) , html . toString ( ) , true , false ) ; } } ) ; modal . show ( _target ) ; }


signature:
public class DecimalUIFactory { /** * { @ inheritDoc } */
@ Override protected String getReadOnlyValue ( final AbstractUIField _abstractUIField ) throws EFapsException { } }

implementation: String strValue = "" ; final Object valueTmp = _abstractUIField . getValue ( ) . getReadOnlyValue ( _abstractUIField . getParent ( ) . getMode ( ) ) ; if ( valueTmp instanceof Number ) { final DecimalFormat formatter = ( DecimalFormat ) NumberFormat . getInstance ( Context . getThreadContext ( ) . getLocale ( ) ) ; if ( _abstractUIField . getValue ( ) . getAttribute ( ) != null ) { formatter . setMaximumFractionDigits ( _abstractUIField . getValue ( ) . getAttribute ( ) . getScale ( ) ) ; } if ( valueTmp instanceof BigDecimal ) { final int scale = ( ( BigDecimal ) valueTmp ) . scale ( ) ; if ( formatter . getMinimumFractionDigits ( ) < scale ) { formatter . setMinimumFractionDigits ( scale ) ; } } strValue = formatter . format ( valueTmp ) ; } return strValue ;


signature:
public class DecimalUIFactory { /** * { @ inheritDoc } */
@ Override public Comparable < ? > getCompareValue ( final AbstractUIField _uiField ) throws EFapsException { } }

implementation: return ( Comparable < ? > ) _uiField . getValue ( ) . getReadOnlyValue ( _uiField . getParent ( ) . getMode ( ) ) ;


signature:
public class EFapsApplication { /** * @ param _ servletRequest request
 * @ param _ filterPath path
 * @ return a new WebRequest */
@ Override public WebRequest newWebRequest ( final HttpServletRequest _servletRequest , final String _filterPath ) { } }

implementation: if ( EFapsApplication . MAXINACTIVEINTERVAL == 0 ) { final int interval = _servletRequest . getSession ( ) . getMaxInactiveInterval ( ) ; if ( interval == 0 ) { EFapsApplication . MAXINACTIVEINTERVAL = - 1 ; } else { EFapsApplication . MAXINACTIVEINTERVAL = interval ; } } return new EFapsRequest ( _servletRequest , _filterPath ) ;


signature:
public class EFapsApplication { /** * Launch a job .
 * @ param _ job the _ job
 * @ param _ jobName the _ job name
 * @ return the execution bridge
 * @ throws EFapsException on error */
public ExecutionBridge launch ( final IJob _job , final String _jobName ) throws EFapsException { } }

implementation:
// we are on WEB thread so services should be normally injected .
final ExecutionBridge bridge = new ExecutionBridge ( ) ; // register bridge on session
if ( _jobName == null ) { bridge . setJobName ( "EFapsJob-" + EFapsSession . get ( ) . countJobs ( ) + 1 + "-" + RandomUtil . randomAlphanumeric ( 4 ) ) ; } else { bridge . setJobName ( _jobName ) ; } bridge . setJobContext ( new JobContext ( ) . setUserName ( Context . getThreadContext ( ) . getPerson ( ) . getName ( ) ) . setLocale ( Context . getThreadContext ( ) . getLocale ( ) ) . setCompanyUUID ( Context . getThreadContext ( ) . getCompany ( ) . getUUID ( ) ) ) ; EFapsSession . get ( ) . addExecutionBridge ( bridge ) ; // run the task
this . executorService . execute ( new JobRunnable ( _job , bridge ) ) ; return bridge ;


signature:
public class LinkWithRangesUIFactory { /** * { @ inheritDoc } */
@ Override public Component getEditable ( final String _wicketId , final AbstractUIField _abstractUIField ) throws EFapsException { } }

implementation: Component ret = null ; if ( applies ( _abstractUIField ) ) { ret = new DropDownField ( _wicketId , Model . of ( _abstractUIField ) , DropDownOption . getChoices ( _abstractUIField . getValue ( ) . getEditValue ( _abstractUIField . getParent ( ) . getMode ( ) ) ) ) ; } return ret ;


signature:
public class LinkWithRangesUIFactory { /** * { @ inheritDoc } */
@ Override public boolean applies ( final AbstractUIField _uiField ) throws EFapsException { } }

implementation: return _uiField . getValue ( ) . getUIProvider ( ) instanceof LinkWithRangesUI && UIType . DEFAULT . equals ( _uiField . getFieldConfiguration ( ) . getUIType ( ) ) ;


signature:
public class LinkWithRangesUIFactory { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override protected String getReadOnlyValue ( final AbstractUIField _abstractUIField ) throws EFapsException { } }

implementation: String strValue = "" ; if ( _abstractUIField . getValue ( ) . getDbValue ( ) != null ) { final Object valueObj = _abstractUIField . getValue ( ) . getReadOnlyValue ( _abstractUIField . getParent ( ) . getMode ( ) ) ; if ( valueObj instanceof List ) { final List < IOption > values = ( List < IOption > ) valueObj ; if ( values != null && ! values . isEmpty ( ) ) { if ( values . size ( ) == 1 ) { strValue = values . get ( 0 ) . getLabel ( ) ; } else { for ( final IOption option : values ) { if ( option . isSelected ( ) ) { strValue = option . getLabel ( ) ; break ; } } } } } else if ( valueObj != null ) { strValue = valueObj . toString ( ) ; } } return strValue ;


signature:
public class AddToTextIndexRequestBuilder { /** * Adds values to the referencePrefixes parameter
 * @ param referencePrefix The first index
 * @ param referencePrefixes The remaining referencePrefixes
 * @ return this */
public AddToTextIndexRequestBuilder addReferencePrefixes ( final String referencePrefix , final String ... referencePrefixes ) { } }

implementation: this . referencePrefixes . add ( referencePrefix ) ; this . referencePrefixes . addAll ( Arrays . asList ( referencePrefixes ) ) ; return this ;


signature:
public class AddToTextIndexRequestBuilder { /** * Sets the value of the metadata parameter
 * @ param metadatum The first index
 * @ param metadata The remaining metadata
 * @ return this */
public AddToTextIndexRequestBuilder addAdditionalMetadata ( final Object metadatum , final Object ... metadata ) { } }

implementation: this . additionalMetadata . add ( metadatum ) ; this . additionalMetadata . addAll ( Arrays . asList ( metadata ) ) ; return this ;


signature:
public class QueryProfileRequestBuilder { /** * Adds categories to the promotion _ categories parameter
 * @ param category0 The first category to add
 * @ param categories Additional categories to add
 * @ return this */
public QueryProfileRequestBuilder addPromotionCategories ( final String category0 , final String ... categories ) { } }

implementation: promotionCategories . add ( category0 ) ; promotionCategories . addAll ( Arrays . asList ( categories ) ) ; return this ;


signature:
public class QueryProfileRequestBuilder { /** * Adds categories to the synonym _ categories parameter
 * @ param category0 The first category to add
 * @ param categories Additional categories to add
 * @ return this */
public QueryProfileRequestBuilder addSynonymCategories ( final String category0 , final String ... categories ) { } }

implementation: synonymCategories . add ( category0 ) ; synonymCategories . addAll ( Arrays . asList ( categories ) ) ; return this ;


signature:
public class QueryProfileRequestBuilder { /** * Adds categories to the blacklist _ categories parameter
 * @ param category0 The first category to add
 * @ param categories Additional categories to add
 * @ return this */
public QueryProfileRequestBuilder addBlacklistCategories ( final String category0 , final String ... categories ) { } }

implementation: blacklistCategories . add ( category0 ) ; blacklistCategories . addAll ( Arrays . asList ( categories ) ) ; return this ;


signature:
public class AjaxDownloadBehavior { /** * Call this method to initiate the download .
 * @ param _ target Ajaxtarget */
public void initiate ( final IPartialPageRequestHandler _target ) { } }

implementation: final String url = getCallBackURL ( ) ; if ( url != null ) { _target . prependJavaScript ( getCallBackScript ( url ) ) ; }


signature:
public class AjaxDownloadBehavior { /** * On request , respond with a ResourcStream . */
@ Override public void onRequest ( ) { } }

implementation: final String fileName = getFileName ( ) ; final IResourceStream stream = getResourceStream ( ) ; final ResourceStreamRequestHandler handler = new ResourceStreamRequestHandler ( stream , fileName ) ; handler . setContentDisposition ( ContentDisposition . ATTACHMENT ) ; getComponent ( ) . getRequestCycle ( ) . scheduleRequestHandlerAfterCurrent ( handler ) ;


signature:
public class AjaxDownloadBehavior { /** * Hook method providing the actual resource stream .
 * @ return stream */
protected IResourceStream getResourceStream ( ) { } }

implementation: final File file = EFapsSession . get ( ) . getFile ( ) ; final FileResourceStream ret = new FileResourceStream ( file ) ; EFapsSession . get ( ) . setFile ( null ) ; return ret ;


signature:
public class AjaxDownloadBehavior { /** * Script that searches for an existing iframe to use it for the download of the frame .
 * If it does not exist it will be created .
 * @ param _ url the url
 * @ return the callback script */
protected CharSequence getCallBackScript ( final String _url ) { } }

implementation: final StringBuilder js = new StringBuilder ( ) . append ( "baseWindow.withDoc(top.dojo.doc, function () {\n" ) . append ( "var node = dom.byId('downloadFrame');\n" ) . append ( "if (node == null) {\n" ) . append ( "node = domConstruct.place('<iframe id=\"downloadFrame\" src=\"about:blank\" " ) . append ( "style=\"position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; " ) . append ( "visibility: hidden\">', win.body());\n" ) . append ( "}\n" ) . append ( "node.src='" ) . append ( _url ) . append ( "';" ) . append ( "});\n" ) ; return DojoWrapper . require ( js , DojoClasses . baseWindow , DojoClasses . dom , DojoClasses . domConstruct ) ;


signature:
public class RateUIFactory { /** * { @ inheritDoc } */
@ Override protected String getReadOnlyValue ( final AbstractUIField _abstractUIField ) throws EFapsException { } }

implementation: String strValue = "" ; final Object valueTmp = _abstractUIField . getValue ( ) . getReadOnlyValue ( _abstractUIField . getParent ( ) . getMode ( ) ) ; if ( valueTmp instanceof Number ) { final DecimalFormat formatter = ( DecimalFormat ) NumberFormat . getInstance ( Context . getThreadContext ( ) . getLocale ( ) ) ; strValue = formatter . format ( valueTmp ) ; } else if ( valueTmp instanceof RateUI . Value ) { final DecimalFormat formatter = ( DecimalFormat ) NumberFormat . getInstance ( Context . getThreadContext ( ) . getLocale ( ) ) ; if ( _abstractUIField . getValue ( ) . getAttribute ( ) != null ) { formatter . setMaximumFractionDigits ( _abstractUIField . getValue ( ) . getAttribute ( ) . getScale ( ) ) ; } strValue = formatter . format ( ( ( RateUI . Value ) valueTmp ) . getRate ( ) ) ; } return strValue ;


signature:
public class GetParametricValuesServiceImpl { /** * HOD has a bug ( HOD - 5731 ) where , if a query profile is provided , GetParametricValues returns an object with number
 * keys rather than an array . This parses a JSON node of either type . */
private List < FieldValues > parseResponse ( final JsonNode response ) { } }

implementation: if ( response == null || response . get ( "fields" ) == null ) { throw new RuntimeException ( "Failed to parse JSON" ) ; } final JsonNode fieldsNode = response . get ( "fields" ) ; if ( fieldsNode . getNodeType ( ) == JsonNodeType . OBJECT || fieldsNode . getNodeType ( ) == JsonNodeType . ARRAY ) { final List < FieldValues > output = new ArrayList < > ( ) ; for ( final JsonNode node : fieldsNode ) { try { final FieldValues fieldValues = objectMapper . treeToValue ( node , FieldValues . class ) ; output . add ( fieldValues ) ; } catch ( final JsonProcessingException e ) { throw new RuntimeException ( "Failed to parse JSON" , e ) ; } } return output ; } else { throw new RuntimeException ( "Failed to parse JSON" ) ; }


signature:
public class DimValuePanel { /** * Gets the java script .
 * @ return the java script */
private CharSequence getJavaScript ( ) { } }

implementation: final String divId = get ( "triStateDiv" ) . getMarkupId ( true ) ; get ( "triStateDiv:triStateBtn" ) . getMarkupId ( true ) ; final String valId = get ( "triStateDiv:triStateValue" ) . getMarkupId ( true ) ; final StringBuilder ret = new StringBuilder ( ) . append ( "switch (dom.byId('" ) . append ( valId ) . append ( "').value)" ) . append ( "{" ) . append ( "case 'on':" ) . append ( "dom.byId('" ) . append ( valId ) . append ( "').value = 'off';" ) . append ( "domClass.replace('" ) . append ( divId ) . append ( "', 'off', 'on');" ) . append ( "break;" ) . append ( "case 'off':" ) . append ( "dom.byId('" ) . append ( valId ) . append ( "').value = '';" ) . append ( "domClass.remove('" ) . append ( divId ) . append ( "', 'off');" ) . append ( "break;" ) . append ( "default:" ) . append ( "dom.byId('" ) . append ( valId ) . append ( "').value = 'on';" ) . append ( "domClass.add('" ) . append ( divId ) . append ( "', 'on');" ) . append ( "}" ) ; return DojoWrapper . require ( ret , DojoClasses . domClass , DojoClasses . dom , DojoClasses . on , DojoClasses . query , DojoClasses . NodeListTraverse , DojoClasses . domReady ) ;


signature:
public class ConnectionRegistry { /** * Send the KeepAlive .
 * @ param _ application Application the KeepAlive will be send for */
public void sendKeepAlive ( final Application _application ) { } }

implementation: final long reference = new Date ( ) . getTime ( ) ; final ConcurrentMap < String , IKey > sessionId2key = _application . getMetaData ( ConnectionRegistry . SESSION2KEY ) ; final ConcurrentMap < String , Long > keepalive = _application . getMetaData ( ConnectionRegistry . KEEPALIVE ) ; if ( keepalive != null ) { for ( final Entry < String , Long > entry : keepalive . entrySet ( ) ) { if ( reference - entry . getValue ( ) > Configuration . getAttributeAsInteger ( ConfigAttribute . WEBSOCKET_KATH ) * 1000 ) { final IKey key = sessionId2key . get ( entry . getKey ( ) ) ; if ( key != null ) { final IWebSocketConnectionRegistry registry = WebSocketSettings . Holder . get ( _application ) . getConnectionRegistry ( ) ; final IWebSocketConnection conn = registry . getConnection ( _application , entry . getKey ( ) , key ) ; if ( conn != null ) { try { conn . sendMessage ( KeepAliveBehavior . MSG ) ; ConnectionRegistry . LOG . debug ( "Send KeepAlive for Session: {}" , entry . getKey ( ) ) ; } catch ( final IOException e ) { ConnectionRegistry . LOG . error ( "Catched error" , e ) ; } } } } } }


signature:
public class ConnectionRegistry { /** * Init the KeepAlive mechanism . */
private void initKeepAlive ( ) { } }

implementation:
if ( ! this . keepAlive ) { this . keepAlive = true ; final KeepAliveTask keepAliveTask = new KeepAliveTask ( EFapsApplication . get ( ) . getApplicationKey ( ) ) ; final Timer timer = new Timer ( true ) ; // every two minutes
timer . scheduleAtFixedRate ( keepAliveTask , 0 * 1000 , Configuration . getAttributeAsInteger ( ConfigAttribute . WEBSOCKET_KASP ) * 1000 ) ; }


signature:
public class UIUserSession { /** * Gets the UI user sessions .
 * @ return list of currently registered Users */
public static List < UIUserSession > getUIUserSessions ( ) { } }

implementation: final List < UIUserSession > ret = new ArrayList < > ( ) ; final Collection < UserSession > userSessions = RegistryManager . getUserSessions ( ) ; for ( final UserSession userSession : userSessions ) { ret . add ( new UIUserSession ( userSession . getUserName ( ) , userSession . getSessionId ( ) , userSession . getLastActivity ( ) ) ) ; } return ret ;


signature:
public class LabelComponent { /** * Must be overwritten so that no replacing of html tags is done .
 * @ see org . apache . wicket . Component # onComponentTagBody ( org . apache . wicket . markup . MarkupStream ,
 * org . apache . wicket . markup . ComponentTag )
 * @ param _ markupStream MarkupStream
 * @ param _ openTag Tag */
@ Override public void onComponentTagBody ( final MarkupStream _markupStream , final ComponentTag _openTag ) { } }

implementation:
setEscapeModelStrings ( false ) ; String value = getDefaultModelObjectAsString ( getDefaultModelObject ( ) ) ; // if the value contains the EFAPSTMPTAG all tags from this component
// will be moved to the subcomponent
if ( value != null && value . contains ( IUserInterface . EFAPSTMPTAG ) ) { final StringBuilder tagBldr = new StringBuilder ( ) ; final List < ? extends Behavior > behaviors = getBehaviors ( ) ; final ComponentTag tmpTag = new ComponentTag ( _openTag ) ; for ( final Behavior behavior : behaviors ) { behavior . onComponentTag ( this , tmpTag ) ; } final IValueMap map = tmpTag . getAttributes ( ) ; for ( final Entry < String , Object > entry : map . entrySet ( ) ) { final String key = entry . getKey ( ) ; if ( ! "wicket:id" . equals ( key ) ) { tagBldr . append ( " " ) . append ( key ) . append ( "=\"" ) . append ( entry . getValue ( ) ) . append ( "\" " ) ; } } // if no id is given add the id here
if ( ! map . containsKey ( "id" ) ) { tagBldr . append ( " id=\"" ) . append ( getMarkupId ( ) ) . append ( "\" " ) ; } value = value . replace ( IUserInterface . EFAPSTMPTAG , tagBldr ) ; } super . replaceComponentTagBody ( _markupStream , _openTag , value ) ;


signature:
public class LabelComponent { /** * Method is overwritten to prevent the annoing warnings from Component to come up .
 * The warning come up due to the reason that this component moves the tags from parent
 * element to its child . */
@ Override protected void onRender ( ) { } }

implementation:
final IMarkupFragment markup = getMarkup ( ) ; if ( markup == null ) { throw new MarkupException ( "Markup not found. Component: " + toString ( ) ) ; } final MarkupStream markupStream = new MarkupStream ( markup ) ; // Get mutable copy of next tag
final ComponentTag openTag = markupStream . getTag ( ) ; final ComponentTag tag = openTag . mutable ( ) ; // Call any tag handler
onComponentTag ( tag ) ; // If we ' re an openclose tag
if ( ! tag . isOpenClose ( ) && ! tag . isOpen ( ) ) { // We were something other than < tag > or < tag / >
markupStream . throwMarkupException ( "Method renderComponent called on bad markup element: " + tag ) ; } if ( tag . isOpenClose ( ) && openTag . isOpen ( ) ) { markupStream . throwMarkupException ( "You can not modify a open tag to open-close: " + tag ) ; } markupStream . next ( ) ; getMarkupSourcingStrategy ( ) . onComponentTagBody ( this , markupStream , tag ) ;


signature:
public class EmbeddedLink { /** * Getter method for the instance variable { @ link # tag } .
 * @ return value of instance variable { @ link # tag } */
public String getTag ( ) { } }

implementation: String ret = this . tag ; final Formatter formatter = new Formatter ( ) ; formatter . format ( ret , getId ( ) ) ; ret = formatter . toString ( ) ; formatter . close ( ) ; return ret ;


signature:
public class EmbeddedLink { /** * Gets the dashboard link .
 * @ param _ instanceKey instance key the link is wanted for
 * @ param _ identifier the identifier
 * @ return new Embeded Link */
public static EmbeddedLink getDashboardLink ( final String _instanceKey , final String _identifier ) { } }

implementation: final EmbeddedLink ret = new EmbeddedLink ( _instanceKey ) ; ret . setTagHtml ( TAG . DASHBOARD . getHtml ( ) ) ; ret . setIdentifier ( _identifier ) ; return ret ;


signature:
public class ResponseParser { /** * Parse the response into a type represented by the Class object . Checks for a refreshed token and updates the token
 * repository accordingly .
 * @ param < T > The desired type of the response body
 * @ param tokenProxy The token proxy to update in the token repository if required
 * @ param clazz A class object representing the desired type of the response body
 * @ param response The response to parse
 * @ return An object representing the result from HP Haven OnDemand */
< T > T parseResponse ( final TokenProxy < ? , ? > tokenProxy , final Class < T > clazz , final Response response ) { } }

implementation: return unsafeParseResponse ( tokenProxy , objectMapper . constructType ( clazz ) , response ) ;


signature:
public class ResponseParser { /** * Parse the response into a type represented by the TypeReference object . Checks for a refreshed token and updates
 * the token repository accordingly .
 * @ param < T > The desired type of the response body
 * @ param tokenProxy The token proxy to update in the token repository if required
 * @ param typeReference A type reference object representing the desired type of the response body
 * @ param response The response to parse
 * @ return An object representing the result from HP Haven OnDemand */
< T > T parseResponse ( final TokenProxy < ? , ? > tokenProxy , final TypeReference < T > typeReference , final Response response ) { } }

implementation: return unsafeParseResponse ( tokenProxy , objectMapper . getTypeFactory ( ) . constructType ( typeReference ) , response ) ;


signature:
public class ResponseParser { /** * Parse the response into a type represented by the JavaType object . Checks for a refreshed token and updates
 * the token repository accordingly . This method does not guarantee that the type parameter T represents the given
 * JavaType . If possible , use one of the safe parseResponse methods instead .
 * @ param < T > The desired type of the response body
 * @ param tokenProxy The token proxy to update in the token repository if required
 * @ param type A JavaType representing the desired type of the response body
 * @ param response The response to parse
 * @ return An object representing the result from HP Haven OnDemand */
< T > T unsafeParseResponse ( final TokenProxy < ? , ? > tokenProxy , final JavaType type , final Response response ) { } }

implementation: checkRefresh ( tokenProxy , response ) ; try { return objectMapper . readValue ( response . getBody ( ) . in ( ) , type ) ; } catch ( final IOException e ) { throw new RuntimeException ( e ) ; }


signature:
public class ResponseParser { /** * Checks the response headers for a refreshed authentication token then returns the response body as an input stream .
 * @ param tokenProxy The token proxy to update in the token repository if required
 * @ param response The response to read
 * @ return The response body as an input stream */
InputStream parseResponse ( final TokenProxy < ? , ? > tokenProxy , final Response response ) { } }

implementation: checkRefresh ( tokenProxy , response ) ; try { return response . getBody ( ) . in ( ) ; } catch ( final IOException e ) { throw new RuntimeException ( e ) ; }


signature:
public class UIFieldTable { /** * { @ inheritDoc } */
@ Override @ SuppressWarnings ( "unchecked" ) protected List < Instance > getInstanceList ( ) throws EFapsException { } }

implementation: final List < Return > ret = FieldTable . get ( this . fieldId ) . executeEvents ( EventType . UI_TABLE_EVALUATE , ParameterValues . INSTANCE , getInstance ( ) ) ; final List < Instance > lists = ( List < Instance > ) ret . get ( 0 ) . get ( ReturnValues . VALUES ) ; return lists ;


signature:
public class UIFieldTable { /** * Method to get the events that are related to this UITable .
 * @ param _ eventType eventype to get
 * @ return List of events */
@ Override protected List < EventDefinition > getEvents ( final EventType _eventType ) { } }

implementation: return Field . get ( this . fieldId ) . getEvents ( _eventType ) ;


signature:
public class StaticContentServlet { /** * The method checks the image from the user interface image object out and
 * returns them in a output stream to the web client . The name of the user
 * interface image object must given as name at the end of the path .
 * @ param _ req request variable
 * @ param _ res response variable
 * @ throws ServletException on error */
@ Override protected void doGet ( final HttpServletRequest _req , final HttpServletResponse _res ) throws ServletException { } }

implementation: String contentName = _req . getRequestURI ( ) ; contentName = contentName . substring ( contentName . lastIndexOf ( '/' ) + 1 ) ; try { final Cache < String , ContentMapper > cache = InfinispanCache . get ( ) . < String , ContentMapper > getCache ( StaticContentServlet . CACHENAME ) ; final int cacheDuration = Configuration . getAttributeAsInteger ( Configuration . ConfigAttribute . CACHE_DURATION ) ; if ( ! cache . containsKey ( contentName ) ) { final QueryBuilder queryBldr = new QueryBuilder ( CIAdminProgram . StaticCompiled ) ; queryBldr . addWhereAttrEqValue ( CIAdminProgram . StaticCompiled . Name , contentName ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; final SelectBuilder selLabel = new SelectBuilder ( ) . file ( ) . label ( ) ; final SelectBuilder selLength = new SelectBuilder ( ) . file ( ) . length ( ) ; multi . addSelect ( selLabel , selLength ) ; multi . addAttribute ( CIAdminProgram . StaticCompiled . Name , CIAdminProgram . StaticCompiled . OID , CIAdminProgram . StaticCompiled . Modified ) ; multi . executeWithoutAccessCheck ( ) ; if ( multi . next ( ) ) { final String name = multi . < String > getAttribute ( CIAdminProgram . StaticCompiled . Name ) ; final String file = multi . < String > getSelect ( selLabel ) ; final Long filelength = multi . < Long > getSelect ( selLength ) ; final DateTime datetime = multi . < DateTime > getAttribute ( CIAdminProgram . StaticCompiled . Modified ) ; final ContentMapper mapper = new ContentMapper ( name , file , multi . getCurrentInstance ( ) . getOid ( ) , filelength , datetime . getMillis ( ) ) ; cache . put ( contentName , mapper ) ; } else { cache . put ( contentName , StaticContentServlet . NULL ) ; } } final ContentMapper contentMapper = cache . get ( contentName ) ; if ( contentMapper != null && ! contentMapper . equals ( StaticContentServlet . NULL ) ) { final Checkout checkout = new Checkout ( contentMapper . oid ) ; _res . setContentType ( getServletContext ( ) . getMimeType ( contentMapper . file ) ) ; _res . setDateHeader ( "Last-Modified" , contentMapper . time ) ; _res . setDateHeader ( "Expires" , System . currentTimeMillis ( ) + ( cacheDuration * 1000 ) ) ; _res . setHeader ( "Cache-Control" , "max-age=" + cacheDuration ) ; if ( supportsCompression ( _req ) ) { _res . setHeader ( "Content-Encoding" , "gzip" ) ; final ByteArrayOutputStream bytearray = new ByteArrayOutputStream ( ) ; final GZIPOutputStream zout = new GZIPOutputStream ( bytearray ) ; checkout . execute ( zout ) ; zout . close ( ) ; final byte [ ] b = bytearray . toByteArray ( ) ; bytearray . close ( ) ; _res . getOutputStream ( ) . write ( b ) ; checkout . close ( ) ; } else { _res . setContentLength ( ( int ) contentMapper . filelength ) ; checkout . execute ( _res . getOutputStream ( ) ) ; } } else if ( BundleMaker . containsKey ( contentName ) ) { final BundleInterface bundle = BundleMaker . getBundle ( contentName ) ; _res . setContentType ( bundle . getContentType ( ) ) ; _res . setDateHeader ( "Last-Modified" , bundle . getCreationTime ( ) ) ; _res . setDateHeader ( "Expires" , System . currentTimeMillis ( ) + ( cacheDuration * 1000 ) ) ; _res . setHeader ( "Cache-Control" , "max-age=" + cacheDuration ) ; _res . setHeader ( "Content-Encoding" , "gzip" ) ; int bytesRead ; final byte [ ] buffer = new byte [ 2048 ] ; final InputStream in = bundle . getInputStream ( supportsCompression ( _req ) ) ; while ( ( bytesRead = in . read ( buffer ) ) != - 1 ) { _res . getOutputStream ( ) . write ( buffer , 0 , bytesRead ) ; } } } catch ( final IOException e ) { StaticContentServlet . LOG . error ( "while reading Static Content" , e ) ; throw new ServletException ( e ) ; } catch ( final CacheReloadException e ) { StaticContentServlet . LOG . error ( "while reading Static Content" , e ) ; throw new ServletException ( e ) ; } catch ( final EFapsException e ) { StaticContentServlet . LOG . error ( "while reading Static Content" , e ) ; throw new ServletException ( e ) ; }


signature:
public class MenuContentLink { /** * Add to the tag .
 * @ param _ tag tag to write */
protected void onComponentTagInternal ( final ComponentTag _tag ) { } }

implementation: _tag . put ( "name" , getConfig ( ) . getName ( ) ) ; _tag . append ( "style" , "text-align:" + getConfig ( ) . getAlign ( ) , ";" ) ;


signature:
public class UIFieldSetValue { /** * { @ inheritDoc } */
@ Override protected FieldConfiguration getNewFieldConfiguration ( ) throws EFapsException { } }

implementation: final FieldConfiguration ret ; if ( getValue ( ) . getAttribute ( ) == null ) { ret = super . getNewFieldConfiguration ( ) ; } else { ret = new FieldSetConfiguration ( getValue ( ) . getField ( ) . getId ( ) , getValue ( ) . getAttribute ( ) . getId ( ) ) ; } return ret ;


signature:
public class PollingJobStatusRunnable { /** * Checks the status of the job . If the job has not finished , the runnable will schedule itself to run again after a
 * short wait */
@ Override public void run ( ) { } }

implementation:
try { log . debug ( "About to check status for jobId {}" , jobId ) ; final JobStatus < T > jobStatus ; if ( tokenProxy != null ) { jobStatus = jobService . getJobStatus ( tokenProxy , jobId ) ; } else { jobStatus = jobService . getJobStatus ( jobId ) ; } final Status jobStatusStatus = jobStatus . getStatus ( ) ; if ( jobStatusStatus == Status . FINISHED || jobStatusStatus == Status . FAILED ) { for ( final Action < T > action : jobStatus . getActions ( ) ) { final Status status = action . getStatus ( ) ; if ( status == Status . FINISHED ) { log . debug ( "Found a finished action, calling callback" ) ; callback . success ( action . getResult ( ) ) ; } else if ( status == Status . FAILED ) { log . debug ( "Found a failed action, calling callback" ) ; for ( final HodError error : action . getErrors ( ) ) { log . debug ( "Error callback called with: {}" , error ) ; callback . error ( error . getErrorCode ( ) ) ; } } } } else if ( timeout != null && timeout . isBefore ( LocalDateTime . now ( ) ) ) { callback . timeout ( ) ; log . debug ( "Timeout callback called" ) ; } else { log . debug ( "Not finished or failed, retrying" ) ; // we got a status successfully , so reset the counter
tries . set ( 0 ) ; executorService . schedule ( this , WAIT_SECONDS , TimeUnit . SECONDS ) ; } } catch ( final HodErrorException e ) { log . error ( "Error retrieving job status for jobId: {}" , jobId ) ; log . error ( "Cause:" , e ) ; if ( DO_NOT_RETRY_CODES . contains ( e . getErrorCode ( ) ) ) { log . error ( "Unrecoverable error, will not retry" ) ; callback . error ( e . getErrorCode ( ) ) ; } else if ( tries . get ( ) >= MAX_TRIES ) { log . error ( "Max retries reached, will not retry" ) ; callback . error ( e . getErrorCode ( ) ) ; } else { log . error ( "Retrying" ) ; tries . incrementAndGet ( ) ; executorService . schedule ( this , WAIT_SECONDS , TimeUnit . SECONDS ) ; } } catch ( final RuntimeException e ) { log . error ( "Error retrieving job status for jobId: {}" , jobId ) ; log . error ( "Cause:" , e ) ; callback . handleException ( e ) ; }


signature:
public class ParameterUtil { /** * Get an array for the StringValues .
 * @ param _ parameters IRequestParameters
 * @ return always StringArray , if parameter does not exist an empty
 * StringArray */
public static Map < String , String [ ] > parameter2Map ( final IRequestParameters _parameters ) { } }

implementation: final Map < String , String [ ] > ret = new HashMap < > ( ) ; for ( final String name : _parameters . getParameterNames ( ) ) { ret . put ( name , ParameterUtil . parameter2Array ( _parameters , name ) ) ; } return ret ;


signature:
public class ParameterUtil { /** * Get an array for the StringValues .
 * @ param _ parameters IRequestParameters
 * @ param _ parameterName name of the Paramaters
 * @ return always StringArray , if parameter does not exist an empty
 * StringArray */
public static String [ ] parameter2Array ( final IRequestParameters _parameters , final String _parameterName ) { } }

implementation: final List < StringValue > values = _parameters . getParameterValues ( _parameterName ) ; return ParameterUtil . stringValues2Array ( values ) ;


signature:
public class ParameterUtil { /** * Get an array for the StringValues .
 * @ param _ values the values
 * @ return always StringArray , if parameter does not exist an empty
 * StringArray */
public static String [ ] stringValues2Array ( final List < StringValue > _values ) { } }

implementation: final String [ ] ret ; if ( _values != null ) { ret = new String [ _values . size ( ) ] ; int i = 0 ; for ( final StringValue value : _values ) { ret [ i ] = value . toString ( ) ; i ++ ; } } else { ret = new String [ 0 ] ; } return ret ;


signature:
public class DnDBehavior { /** * The tag of the component must be altered , so that the dojo dnd will be rendered .
 * @ see org . apache . wicket . behavior . AbstractBehavior # onComponentTag ( org . apache . wicket . Component ,
 * org . apache . wicket . markup . ComponentTag )
 * @ param _ component Component
 * @ param _ tag tag to edit */
@ Override public void onComponentTag ( final Component _component , final ComponentTag _tag ) { } }

implementation: super . onComponentTag ( _component , _tag ) ; if ( this . type == DnDBehavior . BehaviorType . ITEM ) { String value = "dojoDndItem " ; if ( _tag . getAttribute ( "class" ) != null ) { value += _tag . getAttribute ( "class" ) ; } _tag . put ( "dndType" , this . dndType ) ; _tag . put ( "class" , value ) ; }


signature:
public class DnDBehavior { /** * Add the javascriupt to the head of the webpage .
 * @ see org . efaps . ui . wicket . behaviors . dojo . AbstractDojoBehavior # renderHead (
 * org . apache . wicket . markup . html . IHeaderResponse )
 * @ param _ component component the header will be rendered for
 * @ param _ response rseponse */
@ Override public void renderHead ( final Component _component , final IHeaderResponse _response ) { } }

implementation: super . renderHead ( _component , _response ) ; _response . render ( RequireHeaderItem . forClasses ( DojoClasses . DnDSource , DojoClasses . parser ) ) ; if ( this . type == DnDBehavior . BehaviorType . SOURCE ) { final StringBuilder js = new StringBuilder ( ) . append ( "var nSrc = new dojo.dnd.Source(dom.byId('" ) . append ( _component . getMarkupId ( true ) ) . append ( "')," ) . append ( "{ accept: ['" + this . dndType + "']});" ) . append ( " aspect.after(nSrc,\"onDrop\", function(){\n" ) . append ( this . appendJavaScript ) . append ( "\n});" ) ; _response . render ( OnDojoReadyHeaderItem . forScript ( DojoWrapper . require ( js , DojoClasses . aspect , DojoClasses . dom , DojoClasses . DnDSource ) ) ) ; }


signature:
public class MenuTree { /** * Set the default selected item .
 * @ param _ selectCmdUUID UUID of the selected Command */
public void setDefault ( final UUID _selectCmdUUID ) { } }

implementation: final UIMenuItem menuItem = getProvider ( ) . getRoots ( ) . next ( ) ; menuItem . setHeader ( true ) ; boolean hasDefault = false ; for ( final UIMenuItem childItem : menuItem . getChildren ( ) ) { if ( _selectCmdUUID == null && childItem . isDefaultSelected ( ) || _selectCmdUUID != null && _selectCmdUUID . equals ( childItem . getCommandUUID ( ) ) ) { hasDefault = true ; childItem . setSelected ( true ) ; } } if ( ! hasDefault ) { menuItem . setSelected ( true ) ; } expand ( menuItem ) ; expandChildren ( menuItem ) ;


signature:
public class MenuTree { /** * { @ inheritDoc } */
@ Override public void registerListener ( final IRemoteUpdateListener _listener ) { } }

implementation: final MenuUpdateBehavior behavior = getBehaviors ( MenuUpdateBehavior . class ) . get ( 0 ) ; behavior . register ( _listener ) ;


signature:
public class DialogPage { /** * Method that gets the Value for the Buttons from the DBProperties .
 * @ param _ cmdName Name of the Command , that Label for the Button should be
 * retrieved
 * @ param _ keytype type of the key e . g . " Cancel " , " Submit " , " Close "
 * @ return Label */
public static String getLabel ( final String _cmdName , final String _keytype ) { } }

implementation: final String ret ; if ( DBProperties . hasProperty ( _cmdName + ".Button." + _keytype ) ) { ret = DBProperties . getProperty ( _cmdName + ".Button." + _keytype ) ; } else { ret = DBProperties . getProperty ( "default.Button." + _keytype ) ; } return ret ;


signature:
public class PickerCallBack { /** * The actual Javascript that will be executed on close of the modal window .
 * @ param _ target Target */
@ Override public void onClose ( final AjaxRequestTarget _target ) { } }

implementation:
final AbstractUIPageObject pageObject = ( AbstractUIPageObject ) this . pageReference . getPage ( ) . getDefaultModelObject ( ) ; if ( pageObject . isOpenedByPicker ( ) ) { final UIPicker picker = pageObject . getPicker ( ) ; pageObject . setPicker ( null ) ; if ( picker . isExecuted ( ) ) { final Map < String , Object > map = picker . getReturnMap ( ) ; final boolean escape = escape ( map ) ; final StringBuilder js = new StringBuilder ( ) ; final String value = ( String ) map . get ( EFapsKey . PICKER_VALUE . getKey ( ) ) ; if ( value != null ) { js . append ( "require(['dojo/dom'], function(dom){\n" ) . append ( "dom.byId('" ) . append ( this . targetMarkupId ) . append ( "').value ='" ) . append ( escape ? StringEscapeUtils . escapeEcmaScript ( StringEscapeUtils . escapeHtml4 ( value ) ) : value ) . append ( "';" ) . append ( "});" ) ; } for ( final String keyString : map . keySet ( ) ) { // if the map contains a key that is not defined in this
// class it is assumed to be the name of a field
if ( ! ( EFapsKey . PICKER_JAVASCRIPT . getKey ( ) . equals ( keyString ) || EFapsKey . PICKER_DEACTIVATEESCAPE . getKey ( ) . equals ( keyString ) || EFapsKey . PICKER_VALUE . getKey ( ) . equals ( keyString ) ) ) { final Object valueObj = map . get ( keyString ) ; final String strValue ; final String strLabel ; if ( valueObj instanceof String [ ] && ( ( String [ ] ) valueObj ) . length == 2 ) { strValue = escape && ! ( ( String [ ] ) valueObj ) [ 0 ] . contains ( "Array(" ) ? StringEscapeUtils . escapeEcmaScript ( ( ( String [ ] ) valueObj ) [ 0 ] ) : ( ( String [ ] ) valueObj ) [ 0 ] ; strLabel = escape && ! ( ( String [ ] ) valueObj ) [ 0 ] . contains ( "Array(" ) ? StringEscapeUtils . escapeEcmaScript ( ( ( String [ ] ) valueObj ) [ 1 ] ) : ( ( String [ ] ) valueObj ) [ 1 ] ; } else { strValue = escape && ! String . valueOf ( valueObj ) . contains ( "Array(" ) ? StringEscapeUtils . escapeEcmaScript ( String . valueOf ( valueObj ) ) : String . valueOf ( valueObj ) ; strLabel = null ; } js . append ( "eFapsSetFieldValue(" ) . append ( this . targetMarkupId == null ? 0 : "'" + this . targetMarkupId + "'" ) . append ( ",'" ) . append ( keyString ) . append ( "'," ) . append ( strValue . contains ( "Array(" ) ? "" : "'" ) . append ( strValue ) . append ( strValue . contains ( "Array(" ) ? "" : "'" ) ; if ( strLabel != null ) { js . append ( ",'" ) . append ( strLabel ) . append ( "'" ) ; } js . append ( ");" ) ; } } if ( map . containsKey ( EFapsKey . PICKER_JAVASCRIPT . getKey ( ) ) ) { js . append ( map . get ( EFapsKey . PICKER_JAVASCRIPT . getKey ( ) ) ) ; } _target . prependJavaScript ( js . toString ( ) ) ; picker . setExecuted ( false ) ; } }


signature:
public class PickerCallBack { /** * Check if for the current values the escape is activated . < br >
 * Default : true , < br >
 * key exits : null = false else evaluation of given String
 * @ param _ map map to be checked
 * @ return boolean */
private boolean escape ( final Map < String , Object > _map ) { } }

implementation: boolean ret = true ; if ( _map . containsKey ( EFapsKey . PICKER_DEACTIVATEESCAPE . getKey ( ) ) ) { final Object value = _map . get ( EFapsKey . PICKER_DEACTIVATEESCAPE . getKey ( ) ) ; if ( value == null ) { ret = false ; } else { ret = BooleanUtils . toBoolean ( EFapsKey . PICKER_DEACTIVATEESCAPE . getKey ( ) ) ; } } return ret ;


signature:
public class UITypeFactory { /** * Gets the editable comp .
 * @ param _ wicketId the wicket id
 * @ param _ uiField the ui field
 * @ return the editable comp
 * @ throws EFapsException on error */
protected Component getEditableComp ( final String _wicketId , final AbstractUIField _uiField ) throws EFapsException { } }

implementation: Component ret = null ; switch ( _uiField . getFieldConfiguration ( ) . getUIType ( ) ) { case SNIPPLET : if ( ! _uiField . getFieldConfiguration ( ) . isHideLabel ( ) ) { _uiField . getFieldConfiguration ( ) . evalLabel ( _uiField . getValue ( ) , _uiField . getInstance ( ) ) ; } final String html = String . valueOf ( _uiField . getValue ( ) . getEditValue ( _uiField . getParent ( ) . getMode ( ) ) ) ; ret = new SnippletField ( _wicketId , Model . of ( html ) , _uiField ) ; break ; case DROPDOWN : final List < DropDownOption > choices = DropDownOption . getChoices ( _uiField . getValue ( ) . getEditValue ( _uiField . getParent ( ) . getMode ( ) ) ) ; ret = new DropDownField ( _wicketId , Model . of ( _uiField ) , choices ) ; break ; case RADIO : final List < RadioOption > radios = RadioOption . getChoices ( _uiField . getValue ( ) . getEditValue ( _uiField . getParent ( ) . getMode ( ) ) ) ; ret = new RadioField ( _wicketId , Model . of ( _uiField ) , radios ) ; break ; case CHECKBOX : final List < CheckBoxOption > checkBoxes = CheckBoxOption . getChoices ( _uiField , _uiField . getValue ( ) . getEditValue ( _uiField . getParent ( ) . getMode ( ) ) ) ; ret = new CheckBoxField ( _wicketId , Model . of ( _uiField ) , checkBoxes ) ; break ; case BUTTON : ret = new AjaxPickerButton ( _wicketId , Model . < IPickable > of ( _uiField ) ) ; break ; case NUMBER : ret = new NumberField ( _wicketId , Model . of ( _uiField ) , _uiField . getFieldConfiguration ( ) ) ; break ; case UPLOAD : ret = new UploadField ( _wicketId , Model . of ( _uiField ) , false ) ; break ; case UPLOADMULTIPLE : ret = new UploadField ( _wicketId , Model . of ( _uiField ) , true ) ; break ; default : break ; } return ret ;


signature:
public class UITypeFactory { /** * { @ inheritDoc } */
@ Override public Component getHidden ( final String _wicketId , final AbstractUIField _uiField ) throws EFapsException { } }

implementation: Component ret = null ; if ( applies ( _uiField ) ) { switch ( _uiField . getFieldConfiguration ( ) . getUIType ( ) ) { case SNIPPLET : final Object value = _uiField . getValue ( ) . getHiddenValue ( _uiField . getParent ( ) . getMode ( ) ) ; final String html = value == null ? null : String . valueOf ( value ) ; ret = new SnippletField ( _wicketId , Model . of ( html ) , _uiField ) ; break ; default : break ; } } return ret ;


signature:
public class HeaderCellPanel { /** * Set the markupid into the model .
 * @ see org . apache . wicket . Component # onAfterRender ( ) */
@ Override protected void onAfterRender ( ) { } }

implementation: super . onAfterRender ( ) ; if ( getDefaultModel ( ) != null ) { final UITableHeader headermodel = ( UITableHeader ) getDefaultModelObject ( ) ; headermodel . setMarkupId ( this . getMarkupId ( ) ) ; }


signature:
public class DateTimePanel { /** * Depending on the locale am / pm is used or not .
 * @ return true if 12 hour format else false */
protected boolean use12HourFormat ( ) { } }

implementation: final String pattern = DateTimeFormat . patternForStyle ( "-S" , getLocale ( ) ) ; return pattern . indexOf ( 'a' ) != - 1 || pattern . indexOf ( 'h' ) != - 1 || pattern . indexOf ( 'K' ) != - 1 ;


signature:
public class DateTimePanel { /** * Method to get for the parameters returned from the form as a valid string . for a datetime
 * @ param _ date date
 * @ param _ hour hour
 * @ param _ minute minutes
 * @ param _ ampm am / pm
 * @ return valid string
 * @ throws EFapsException on error */
public List < StringValue > getDateAsString ( final List < StringValue > _date , final List < StringValue > _hour , final List < StringValue > _minute , final List < StringValue > _ampm ) throws EFapsException { } }

implementation: final List < StringValue > ret = new ArrayList < > ( ) ; final List < DateTime > dates = getDateList ( _date , _hour , _minute , _ampm ) ; for ( final DateTime date : dates ) { final DateTimeFormatter isofmt = ISODateTimeFormat . dateTime ( ) ; ret . add ( StringValue . valueOf ( date . toString ( isofmt ) ) ) ; } return ret ;


signature:
public class DateTimePanel { /** * Method to get for the parameters returned from the form as a datetimes .
 * @ param _ date date
 * @ param _ hour hour
 * @ param _ minute minutes
 * @ param _ ampm am / pm
 * @ return valid string
 * @ throws EFapsException on error */
public List < DateTime > getDateList ( final List < StringValue > _date , final List < StringValue > _hour , final List < StringValue > _minute , final List < StringValue > _ampm ) throws EFapsException { } }

implementation: final List < DateTime > ret = new ArrayList < > ( ) ; if ( _date != null ) { Iterator < StringValue > hourIter = null ; Iterator < StringValue > minuteIter = null ; Iterator < StringValue > ampmIter = null ; if ( _hour != null ) { hourIter = _hour . iterator ( ) ; } if ( _minute != null ) { minuteIter = _minute . iterator ( ) ; } if ( _ampm != null ) { ampmIter = _ampm . iterator ( ) ; } for ( final StringValue date : _date ) { if ( ! date . isNull ( ) && ! date . isEmpty ( ) ) { final DateTimeFormatter fmt = DateTimeFormat . forPattern ( this . converter . getDatePattern ( Context . getThreadContext ( ) . getLocale ( ) ) ) . withChronology ( Context . getThreadContext ( ) . getChronology ( ) ) ; fmt . withLocale ( getLocale ( ) ) ; final MutableDateTime mdt = fmt . parseMutableDateTime ( date . toString ( ) ) ; if ( hourIter != null ) { final StringValue hourStr = hourIter . next ( ) ; final int hour = Integer . parseInt ( hourStr . toString ( "0" ) ) ; mdt . setHourOfDay ( hour ) ; if ( ampmIter != null ) { final StringValue ampmStr = ampmIter . next ( ) ; if ( "am" . equals ( ampmStr . toString ( "am" ) ) ) { if ( hour == 12 ) { mdt . setHourOfDay ( 0 ) ; } } else { if ( hour != 12 ) { mdt . setHourOfDay ( hour + 12 ) ; } } } if ( minuteIter != null ) { final StringValue minuteStr = minuteIter . next ( ) ; final int minute = Integer . parseInt ( minuteStr . toString ( "0" ) ) ; mdt . setMinuteOfHour ( minute ) ; } } ret . add ( mdt . toDateTime ( ) ) ; } } } return ret ;


signature:
public class DateTimePanel { /** * After rendering the datefields are added to the parent . */
@ Override protected void onAfterRender ( ) { } }

implementation: super . onAfterRender ( ) ; final IDateListener container = this . findParent ( IDateListener . class ) ; if ( container != null ) { container . addDateComponent ( this ) ; }


signature:
public class AbstractPollingService { /** * Shuts down the executor service . This method should be called when the job service is no longer needed , if the
 * default executor service was used */
public void destroy ( ) { } }

implementation: log . debug ( "Shutting down executor service" ) ; executorService . shutdown ( ) ; try { if ( ! executorService . awaitTermination ( 10 , TimeUnit . SECONDS ) ) { log . debug ( "Timed out waiting for executor service to die, calling shutdownNow" ) ; executorService . shutdownNow ( ) ; } } catch ( final InterruptedException e ) { log . debug ( "Interrupted waiting for executor service to die, calling shutdownNow" ) ; executorService . shutdownNow ( ) ; }


signature:
public class LoadInTargetAjaxLink { /** * Method to load something inside the opener window .
 * @ param _ target AjaxRequestTarget */
@ Override @ SuppressWarnings ( "checkstyle:illegalcatch" ) public void onClick ( final AjaxRequestTarget _target ) { } }

implementation:
Instance instance = null ; try { if ( this . target . equals ( ScriptTarget . TOP ) ) { final PageReference reference = ( ( AbstractContentPage ) getPage ( ) ) . getCalledByPageReference ( ) ; if ( reference != null ) { final UIMenuItem menuItem = ( UIMenuItem ) ( ( ContentContainerPage ) reference . getPage ( ) ) . getMenuTree ( ) . getSelected ( ) . getDefaultModelObject ( ) ; final RecentObjectLink link = new RecentObjectLink ( menuItem ) ; if ( link != null ) { ( ( EFapsSession ) getSession ( ) ) . addRecent ( link ) ; } } } final AbstractUIField uiField = super . getModelObject ( ) ; if ( uiField . getInstanceKey ( ) != null ) { Menu menu = null ; try { instance = uiField . getInstance ( ) ; menu = Menu . getTypeTreeMenu ( instance . getType ( ) ) ; } catch ( final Exception e ) { if ( menu == null ) { throw new EFapsException ( LoadInTargetAjaxLink . class , "NoTreeMenu" , instance ) ; } } final ContentContainerPage page = new ContentContainerPage ( menu . getUUID ( ) , uiField . getInstanceKey ( ) , uiField . getParent ( ) instanceof UIStructurBrowser ) ; final CharSequence url = urlFor ( new RenderPageRequestHandler ( new PageProvider ( page ) ) ) ; // touch the page to ensure that the pagemanager stores it to be accessible
getSession ( ) . getPageManager ( ) . touchPage ( page ) ; final StringBuilder js = new StringBuilder ( ) . append ( this . target . key ) . append ( ".dijit.registry.byId(\"" ) . append ( "mainPanel" ) . append ( "\").set(\"content\", dojo.create(\"iframe\",{" ) . append ( "\"id\": \"" ) . append ( MainPage . IFRAME_ID ) . append ( "\",\"src\": \"./wicket/" ) . append ( url ) . append ( "\",\"style\": \"border: 0; width: 100%; height: 99%\"" ) . append ( "}));" ) ; _target . appendJavaScript ( js ) ; } } catch ( final EFapsException e ) { throw new RestartResponseException ( new ErrorPage ( e ) ) ; }


signature:
public class PasswordUIFactory { /** * { @ inheritDoc } */
@ Override public boolean applies ( final AbstractUIField _uiField ) throws EFapsException { } }

implementation: return _uiField . getValue ( ) . getUIProvider ( ) instanceof PasswordUI && _uiField . editable ( ) ;


signature:
public class TypeUIFactory { /** * { @ inheritDoc } */
@ Override public Component getEditable ( final String _wicketId , final AbstractUIField _uiField ) throws EFapsException { } }

implementation:
Component ret = null ; if ( applies ( _uiField ) ) { // there is no default editable field for TypeUI , teherfor give the chance to UIType
ret = UITypeFactory . get ( ) . getEditable ( _wicketId , _uiField ) ; } return ret ;


signature:
public class TypeUIFactory { /** * { @ inheritDoc } */
@ Override protected String getReadOnlyValue ( final AbstractUIField _uiField ) throws EFapsException { } }

implementation: Object ret = _uiField . getValue ( ) . getReadOnlyValue ( _uiField . getParent ( ) . getMode ( ) ) ; if ( ret instanceof Type ) { ret = ( ( Type ) ret ) . getLabel ( ) ; } return ret == null ? "" : String . valueOf ( ret ) ;


signature:
public class FormContainer { /** * On component tag .
 * @ param _ tag the tag
 * @ see org . apache . wicket . markup . html . form . Form
 * # onComponentTag ( org . apache . wicket . markup . ComponentTag ) */
@ Override protected void onComponentTag ( final ComponentTag _tag ) { } }

implementation:
if ( this . actionUrl == null ) { this . actionUrl = urlFor ( getRequestCycle ( ) . getActiveRequestHandler ( ) ) . toString ( ) ; } super . onComponentTag ( _tag ) ; if ( getPage ( ) . getDefaultModelObject ( ) != null ) { // only on SearchMode we want normal submit , in any other case we
// use AjaxSubmit
if ( getPage ( ) . getDefaultModelObject ( ) instanceof AbstractUIObject && ! ( ( AbstractUIObject ) getPage ( ) . getDefaultModelObject ( ) ) . isSearchMode ( ) ) { // _ tag . put ( " onSubmit " , " return false ; " ) ;
_tag . put ( "action" , "" ) ; } }


signature:
public class FormContainer { /** * Handle the multipart to store the files and parameters in the context also .
 * @ return true if multipart */
@ Override protected boolean handleMultiPart ( ) { } }

implementation: final boolean ret = super . handleMultiPart ( ) ; try { if ( isMultiPart ( ) && getRequest ( ) instanceof MultipartServletWebRequest ) { for ( final Entry < String , List < FileItem > > entry : ( ( MultipartServletWebRequest ) getRequest ( ) ) . getFiles ( ) . entrySet ( ) ) { int i = - 1 ; if ( entry . getValue ( ) . size ( ) > 1 ) { i = 0 ; } for ( final FileItem fileItem : entry . getValue ( ) ) { final String key = i > - 1 ? entry . getKey ( ) + "_" + i : entry . getKey ( ) ; final FileParameter parameter = new FileParameter ( key , fileItem ) ; Context . getThreadContext ( ) . getFileParameters ( ) . put ( key , parameter ) ; if ( i > - 1 ) { i ++ ; } } } final Map < String , String [ ] > parameters = new HashMap < > ( ) ; final IRequestParameters reqPara = getRequest ( ) . getRequestParameters ( ) ; for ( final String name : reqPara . getParameterNames ( ) ) { final List < StringValue > values = reqPara . getParameterValues ( name ) ; final String [ ] valArray = new String [ values . size ( ) ] ; int i = 0 ; for ( final StringValue value : values ) { valArray [ i ] = value . toString ( ) ; i ++ ; } parameters . put ( name , valArray ) ; } Context . getThreadContext ( ) . getParameters ( ) . putAll ( parameters ) ; } } catch ( final EFapsException e ) { throw new RestartResponseAtInterceptPageException ( new ErrorPage ( e ) ) ; } return ret ;


signature:
public class FormContainer { /** * Reset the counters for sets . */
private void resetSetCounter ( ) { } }

implementation: if ( getPage ( ) . getDefaultModelObject ( ) instanceof UIForm ) { for ( final Element element : ( ( UIForm ) getPage ( ) . getDefaultModelObject ( ) ) . getElements ( ) ) { if ( element . getType ( ) . equals ( ElementType . FORM ) ) { final Iterator < FormRow > iter = ( ( UIForm . FormElement ) element . getElement ( ) ) . getRowModels ( ) ; while ( iter . hasNext ( ) ) { final FormRow row = iter . next ( ) ; for ( final IUIElement uiElement : row . getValues ( ) ) { if ( uiElement instanceof UIFieldSet ) { ( ( UIFieldSet ) uiElement ) . resetIndex ( ) ; } } } } else if ( element . getType ( ) . equals ( ElementType . SUBFORM ) ) { for ( final Element nElement : ( ( UIFieldForm ) element . getElement ( ) ) . getElements ( ) ) { if ( nElement . getType ( ) . equals ( ElementType . FORM ) ) { final Iterator < FormRow > iter = ( ( UIForm . FormElement ) nElement . getElement ( ) ) . getRowModels ( ) ; while ( iter . hasNext ( ) ) { final FormRow row = iter . next ( ) ; for ( final IUIElement uiElement : row . getValues ( ) ) { if ( uiElement instanceof UIFieldSet ) { ( ( UIFieldSet ) uiElement ) . resetIndex ( ) ; } } } } } } } }


signature:
public class AbstractAuthenticationFilter { /** * Called by the web container to indicate to a filter that it is being
 * placed into service . The servlet container calls the init method exactly
 * once after instantiating the filter . The init method must complete
 * successfully before the filter is asked to do any filtering work .
 * The web container cannot place the filter into service if the init method
 * either 1 . Throws a ServletException 2 . Does not return within a time period
 * defined by the web container / / sets the login handler
 * @ param _ filterConfig filter configuration instance
 * @ see # INIT _ PARAM _ TITLE
 * @ see # title
 * @ see # INIT _ PARAM _ APPLICATION
 * @ see # loginhandler
 * @ throws ServletException on error */
@ Override public void init ( final FilterConfig _filterConfig ) throws ServletException { } }

implementation: super . init ( _filterConfig ) ; try { this . loginHandler = new LoginHandler ( AppAccessHandler . getApplicationKey ( ) ) ; } catch ( final EFapsException e ) { AbstractAuthenticationFilter . LOG . error ( "AppAccessHandler" , e ) ; }


signature:
public class AbstractAuthenticationFilter { /** * If the current user is already logged in , nothing is filtered .
 * @ param _ request HttpServletRequest
 * @ param _ response HttpServletResponse
 * @ param _ chain FilterChain
 * @ see # doAuthenticate
 * @ throws IOException on error
 * @ throws ServletException on error */
@ Override protected void doFilter ( final HttpServletRequest _request , final HttpServletResponse _response , final FilterChain _chain ) throws IOException , ServletException { } }

implementation: if ( isLoggedIn ( _request ) ) { _chain . doFilter ( _request , _response ) ; } else { doAuthenticate ( _request , _response , _chain ) ; }


signature:
public class AbstractAuthenticationFilter { /** * Checks if the user with given name and password is allowed to login .
 * @ param _ name user name to check
 * @ param _ passwd password to check
 * @ return < i > true < / i > if the user is allowed to login ( name and password is
 * correct ) , otherweise < i > false < / i >
 * @ see # loginhandler
 * @ see # doFilter */
protected boolean checkLogin ( final String _name , final String _passwd ) { } }

implementation: boolean loginOk = false ; Context context = null ; try { context = Context . begin ( ) ; boolean ok = false ; try { if ( this . loginHandler . checkLogin ( _name , _passwd ) != null ) { loginOk = true ; } ok = true ; } finally { if ( ok && Context . isTMActive ( ) ) { Context . commit ( ) ; } else { if ( Context . isTMMarkedRollback ( ) ) { AbstractAuthenticationFilter . LOG . error ( "transaction is marked to roll back" ) ; } else { AbstractAuthenticationFilter . LOG . error ( "transaction manager in undefined status" ) ; } Context . rollback ( ) ; } } } catch ( final EFapsException e ) { AbstractAuthenticationFilter . LOG . error ( "could not check name and password" , e ) ; } finally { context . close ( ) ; } return loginOk ;


signature:
public class AjaxExecuteLink { /** * On submit .
 * @ param _ target AjaxRequestTarget */
@ Override public void onRequest ( final AjaxRequestTarget _target ) { } }

implementation: final UICmdField uiObject = ( UICmdField ) getDefaultModelObject ( ) ; final StringBuilder snip = new StringBuilder ( ) ; try { final AbstractUIPageObject pageObject = ( AbstractUIPageObject ) getPage ( ) . getDefaultModelObject ( ) ; final Map < String , String > uiID2Oid = pageObject == null ? null : pageObject . getUiID2Oid ( ) ; final List < Return > returns = uiObject . executeEvents ( null , uiID2Oid ) ; for ( final Return oneReturn : returns ) { if ( oneReturn . contains ( ReturnValues . SNIPLETT ) ) { snip . append ( oneReturn . get ( ReturnValues . SNIPLETT ) ) ; } } } catch ( final EFapsException e ) { throw new RestartResponseException ( new ErrorPage ( e ) ) ; } _target . appendJavaScript ( snip . toString ( ) ) ;


signature:
public class GridXComponent { /** * Gets the persistence script .
 * @ param _ uiGrid the ui grid
 * @ return the persistence script
 * @ throws EFapsException the e faps exception */
protected CharSequence getPersistenceScript ( final UIGrid _uiGrid ) throws EFapsException { } }

implementation: final StringBuilder ret = new StringBuilder ( ) ; ret . append ( "persistGet: function(_key) {" ) ; if ( Context . getThreadContext ( ) . containsUserAttribute ( _uiGrid . getCacheKey ( CacheKey . GRIDX ) ) ) { final Set < Long > colIds = _uiGrid . getColumns ( ) . stream ( ) . map ( col -> col . getField ( ) . getId ( ) ) . collect ( Collectors . toSet ( ) ) ; boolean add = true ; final JSONObject json = new JSONObject ( new JSONTokener ( Context . getThreadContext ( ) . getUserAttribute ( _uiGrid . getCacheKey ( CacheKey . GRIDX ) ) ) ) ; final JSONArray columnsArray = json . getJSONArray ( "column" ) ; for ( int i = 0 ; i < columnsArray . length ( ) ; i ++ ) { final JSONObject colObj = ( JSONObject ) columnsArray . get ( i ) ; final Long colid = colObj . getLong ( "id" ) ; if ( ! colIds . contains ( colid ) ) { add = false ; break ; } } if ( add && ! json . isNull ( "filterBar" ) ) { final JSONObject filterBar = json . getJSONObject ( "filterBar" ) ; if ( ! filterBar . isNull ( "conditions" ) ) { final JSONArray conditionsArray = filterBar . getJSONArray ( "conditions" ) ; for ( int i = 0 ; i < conditionsArray . length ( ) ; i ++ ) { final JSONObject colObj = ( JSONObject ) conditionsArray . get ( i ) ; if ( colObj . has ( "colId" ) ) { final Long colid = colObj . optLong ( "colId" ) ; if ( colid > 0 && ! colIds . contains ( colid ) ) { add = false ; break ; } } } } } if ( add ) { ret . append ( "return " ) . append ( json . toString ( ) ) ; } } ret . append ( "},\n" ) . append ( "persistPut: function(_key, _value, _options) {\n" ) . append ( "  var value;" ) . append ( "  if(_value && lang.isObject(_value)){\n" ) . append ( "    value = json.toJson(_value);\n" ) . append ( "  }else{\n" ) . append ( "    value = {expires: -1};\n" ) . append ( "  }\n" ) . append ( "top.eFaps.persistUserAttr('" ) . append ( _uiGrid . getCacheKey ( CacheKey . GRIDX ) ) . append ( "', value);" ) . append ( "},\n" ) ; return ret ;


signature:
public class GridXComponent { /** * Gets the prints the menu items .
 * @ param _ dojoClasses the dojo classes
 * @ return the prints the menu items */
protected CharSequence getPrintMenuItems ( final Set < DojoClass > _dojoClasses ) { } }

implementation: final StringBuilder ret = new StringBuilder ( ) ; Collections . addAll ( _dojoClasses , DojoClasses . MenuItem ) ; final PrintBehavior printBehavior = ( PrintBehavior ) getBehavior ( PrintBehavior . class ) ; final String [ ] mimes = new String [ ] { "PDF" , "XLS" } ; for ( final String mime : mimes ) { if ( ret . length ( ) > 0 ) { ret . append ( "," ) ; } ret . append ( "new MenuItem({\n" ) . append ( "label: \"" ) . append ( mime ) . append ( "\",\n" ) . append ( "iconClass:\"eFapsMenuIcon eFapsMenuIcon" ) . append ( mime . toUpperCase ( ) ) . append ( "\",\n" ) . append ( "onClick: function(event) {\n" ) . append ( "var g = registry.byId('grid');\n" ) . append ( "var sr = g.select.row.getSelected();\n" ) . append ( "if (sr.length == 0) {\n" ) . append ( "array.forEach(g.rows(), function (_item, _id) {\n" ) . append ( "sr[_id] = _item.id;\n" ) . append ( "});\n" ) . append ( "}\n" ) . append ( "var cm = [];\n" ) . append ( "array.forEach(g.columns(), function (_item, _id) {\n" ) . append ( "cm[_id] = _item.id;\n" ) . append ( "});\n" ) . append ( printBehavior . getCallbackFunctionBody ( CallbackParameter . resolved ( "MIME" , "\"" + mime + "\"" ) , CallbackParameter . explicit ( "sr" ) , CallbackParameter . explicit ( "cm" ) ) ) . append ( "}\n" ) . append ( "})\n" ) ; } return ret ;


signature:
public class GridXComponent { /** * Gets the menu .
 * @ param _ dojoClasses the dojo classes
 * @ return the menu
 * @ throws EFapsException on error */
protected CharSequence getMenu ( final Set < DojoClass > _dojoClasses ) throws EFapsException { } }

implementation: final StringBuilder ret = new StringBuilder ( ) ; final UIGrid uiGrid = ( UIGrid ) getDefaultModelObject ( ) ; if ( ! ( uiGrid instanceof UIFieldGrid ) && uiGrid . getCommand ( ) . getTargetMenu ( ) != null ) { Collections . addAll ( _dojoClasses , DojoClasses . MenuBar , DojoClasses . DropDownMenu , DojoClasses . MenuItem , DojoClasses . PopupMenuBarItem , DojoClasses . MenuBarItem ) ; ret . append ( "var pMenuBar = new MenuBar({});\n" ) ; for ( final AbstractCommand child : uiGrid . getCommand ( ) . getTargetMenu ( ) . getCommands ( ) ) { if ( child . hasAccess ( uiGrid . getCommand ( ) . getTargetMode ( ) , uiGrid . getInstance ( ) ) ) { if ( child instanceof AbstractMenu ) { ret . append ( getSubMenu ( ( AbstractMenu ) child , "pMenuBar" ) ) ; } else { ret . append ( "pMenuBar.addChild(" ) . append ( getMenuItem ( child , true ) ) . append ( ");\n" ) ; } } } } return ret ;


signature:
public class GridXComponent { /** * Gets the sub menu .
 * @ param _ menu the menu
 * @ param _ parent the parent
 * @ return the sub menu
 * @ throws EFapsException on error */
protected CharSequence getSubMenu ( final AbstractMenu _menu , final String _parent ) throws EFapsException { } }

implementation: final String var = RandomUtil . randomAlphabetic ( 4 ) ; final StringBuilder js = new StringBuilder ( ) ; js . append ( "var " ) . append ( var ) . append ( " = new DropDownMenu({});\n" ) ; final UIGrid uiGrid = ( UIGrid ) getDefaultModelObject ( ) ; for ( final AbstractCommand child : _menu . getCommands ( ) ) { if ( child . hasAccess ( uiGrid . getCommand ( ) . getTargetMode ( ) , uiGrid . getInstance ( ) ) ) { if ( child instanceof AbstractMenu ) { js . append ( getSubMenu ( ( AbstractMenu ) child , var ) ) ; } else { js . append ( var ) . append ( ".addChild(" ) . append ( getMenuItem ( child , false ) ) . append ( ");\n" ) ; } } } js . append ( _parent ) . append ( ".addChild(new PopupMenuBarItem({\n" ) . append ( "label: \"" ) . append ( StringEscapeUtils . escapeEcmaScript ( _menu . getLabelProperty ( ) ) ) . append ( "\",\n" ) . append ( " popup: " ) . append ( var ) . append ( "\n" ) . append ( " }));\n" ) ; return js ;


signature:
public class GridXComponent { /** * Gets the menu item .
 * @ param _ cmd the cmd
 * @ param _ menuBar the menu bar
 * @ return the menu item */
protected CharSequence getMenuItem ( final AbstractCommand _cmd , final boolean _menuBar ) { } }

implementation: final UIGrid uiGrid = ( UIGrid ) getDefaultModelObject ( ) ; final String rid = uiGrid . getRandom4ID ( _cmd . getId ( ) ) ; final StringBuilder js = new StringBuilder ( ) ; if ( _menuBar ) { js . append ( "new MenuBarItem({\n" ) ; } else { js . append ( "new MenuItem({\n" ) ; } js . append ( " label: \"" ) . append ( StringEscapeUtils . escapeEcmaScript ( _cmd . getLabelProperty ( ) ) ) . append ( "\",\n" ) . append ( "onClick: function(event) {\n" ) . append ( "var rid = \"" ) . append ( rid ) . append ( "\";\n" ) ; if ( Target . MODAL . equals ( _cmd . getTarget ( ) ) ) { if ( _cmd . isSubmit ( ) ) { js . append ( getBehavior ( SubmitModalBehavior . class ) . getCallbackFunctionBody ( CallbackParameter . explicit ( "rid" ) ) ) ; } else { js . append ( getBehavior ( OpenModalBehavior . class ) . getCallbackFunctionBody ( CallbackParameter . explicit ( "rid" ) ) ) ; } } else if ( _cmd . isSubmit ( ) ) { js . append ( getBehavior ( SubmitBehavior . class ) . getCallbackFunctionBody ( CallbackParameter . explicit ( "rid" ) ) ) ; } js . append ( "}\n" ) . append ( "})\n" ) ; return js ;


signature:
public class GridXComponent { /** * Gets the data JS .
 * @ param _ uiGrid the ui grid
 * @ return the data JS
 * @ throws EFapsException on error */
public static CharSequence getDataJS ( final UIGrid _uiGrid ) throws EFapsException { } }

implementation: final StringBuilder ret = new StringBuilder ( ) . append ( " [\n" ) ; int i = 0 ; for ( final GridRow row : _uiGrid . getValues ( ) ) { if ( i > 0 ) { ret . append ( ",\n" ) ; } ret . append ( getRowJS ( row , String . valueOf ( i ) ) ) ; i ++ ; } ret . append ( "]\n" ) ; return ret ;


signature:
public class GridXComponent { /** * Gets the javascript .
 * @ param _ uiGrid the ui grid
 * @ return the javascript
 * @ throws EFapsException on error */
public static CharSequence getDataReloadJS ( final UIGrid _uiGrid ) throws EFapsException { } }

implementation:
final StringBuilder js = new StringBuilder ( ) . append ( "var grid = registry.byId('grid');\n" ) . append ( "var items = " ) . append ( GridXComponent . getDataJS ( _uiGrid ) ) ; final StringBuilder dialogJs = new StringBuilder ( ) ; if ( ! _uiGrid . isColumnsUpToDate ( ) ) { // lazy setting of data type when first time data
_uiGrid . setColumnsUpToDate ( true ) ; js . append ( "array.forEach(grid.structure, function(entry){\n" ) ; for ( final GridColumn column : _uiGrid . getColumns ( ) ) { if ( column . getDataType ( ) != null ) { js . append ( "if ('" ) . append ( column . getField ( ) . getId ( ) ) . append ( "'== entry.id) {\n" ) . append ( "entry.dataType='" ) . append ( column . getDataType ( ) ) . append ( "';\n" ) . append ( "entry.comparator = grid.comparators." ) . append ( column . getDataType ( ) ) . append ( ";\n" ) . append ( "}\n" ) ; } if ( _uiGrid . getFilterList ( ) . stream ( ) . filter ( filter -> filter . getFieldId ( ) == column . getField ( ) . getId ( ) ) . findFirst ( ) . isPresent ( ) ) { // to prevent jumping of the modal filter dialog , close and open it
final String varName = RandomUtil . randomAlphabetic ( 4 ) ; dialogJs . append ( "var " ) . append ( varName ) . append ( " = registry.byId('" ) . append ( "fttd_" + column . getField ( ) . getId ( ) ) . append ( "');\n" ) . append ( "if (" ) . append ( varName ) . append ( " && !(" ) . append ( varName ) . append ( ".domNode.offsetHeight == 0 && " ) . append ( varName ) . append ( ".domNode.offsetWidth == 0)) {\n" ) . append ( varName ) . append ( ".onBlur();\n" ) . append ( "var nl = query(\".gridxHeaderMenuBtn\", dom.byId('grid-" ) . append ( column . getField ( ) . getId ( ) ) . append ( "'));\n" ) . append ( "nl[0].click();\n" ) . append ( "}\n" ) ; } } js . append ( "});\n" ) . append ( "grid.setColumns(grid.structure);\n" ) . append ( dialogJs ) ; } js . append ( "grid.model.clearCache();\n" ) . append ( "grid.model.store.setData(items);\n" ) . append ( "grid.body.refresh();\n" ) ; return DojoWrapper . require ( js , DojoClasses . registry , DojoClasses . array , DojoClasses . dom , DojoClasses . query ) ;