signature:
public class ImageServlet { /** * 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 imgName = _req . getRequestURI ( ) ; imgName = imgName . substring ( imgName . lastIndexOf ( '/' ) + 1 ) ; try { final Cache < String , ImageMapper > cache = InfinispanCache . get ( ) . < String , ImageMapper > getCache ( ImageServlet . CACHENAME ) ; if ( ! cache . containsKey ( imgName ) ) { final QueryBuilder queryBldr = new QueryBuilder ( CIAdminUserInterface . Image ) ; queryBldr . addWhereAttrEqValue ( CIAdminUserInterface . Image . Name , imgName ) ; 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 ( CIAdminUserInterface . Image . Name , CIAdminUserInterface . Image . Modified ) ; multi . executeWithoutAccessCheck ( ) ; if ( multi . next ( ) ) { final String name = multi . < String > getAttribute ( CIAdminUserInterface . Image . Name ) ; final String file = multi . < String > getSelect ( selLabel ) ; final Long filelength = multi . < Long > getSelect ( selLength ) ; final DateTime time = multi . < DateTime > getAttribute ( CIAdminUserInterface . Image . Modified ) ; final ImageMapper imageMapper = new ImageMapper ( multi . getCurrentInstance ( ) , name , file , filelength , time . getMillis ( ) ) ; cache . put ( imgName , imageMapper ) ; } else { cache . put ( imgName , ImageServlet . NULL ) ; } } final ImageMapper imageMapper = cache . get ( imgName ) ; if ( imageMapper != null && ! imageMapper . equals ( ImageServlet . NULL ) ) { final Checkout checkout = new Checkout ( imageMapper . instance ) ; _res . setContentType ( getServletContext ( ) . getMimeType ( imageMapper . file ) ) ; _res . setContentLength ( ( int ) imageMapper . filelength ) ; _res . setDateHeader ( "Last-Modified" , imageMapper . time ) ; _res . setDateHeader ( "Expires" , System . currentTimeMillis ( ) + ( 3600 * 1000 ) ) ; _res . setHeader ( "Cache-Control" , "max-age=3600" ) ; checkout . execute ( _res . getOutputStream ( ) ) ; checkout . close ( ) ; } } catch ( final IOException e ) { ImageServlet . LOG . error ( "while reading history data" , e ) ; throw new ServletException ( e ) ; } catch ( final CacheReloadException e ) { ImageServlet . LOG . error ( "while reading history data" , e ) ; throw new ServletException ( e ) ; } catch ( final EFapsException e ) { ImageServlet . LOG . error ( "while reading history data" , e ) ; throw new ServletException ( e ) ; }


signature:
public class InfinispanPageStore { /** * Removes the session .
 * @ param _ sessionId the session id */
public static void removePages4Session ( final String _sessionId ) { } }

implementation: final AdvancedCache < String , StoredPage > cache = InfinispanCache . get ( ) . < String , StoredPage > getIgnReCache ( InfinispanPageStore . PAGECACHE ) ; final QueryFactory queryFactory = Search . getQueryFactory ( cache ) ; final Query query = queryFactory . from ( StoredPage . class ) . having ( "sessionId" ) . eq ( _sessionId ) . build ( ) ; query . < StoredPage > list ( ) . forEach ( storedPage -> cache . remove ( storedPage . getSessionId ( ) + "::" + storedPage . getPage ( ) . getPageId ( ) ) ) ;


signature:
public class ContentContainerLink { /** * The tag must be overwritten .
 * @ param _ tag tag to write . */
@ Override protected void onComponentTag ( final ComponentTag _tag ) { } }

implementation: _tag . setName ( "a" ) ; super . onComponentTag ( _tag ) ; onComponentTagInternal ( _tag ) ;


signature:
public class ContentContainerLink { /** * Method is executed on click . */
@ Override public void onClick ( ) { } }

implementation: Instance instance = null ; final AbstractUIField uiField = super . getModelObject ( ) ; if ( uiField . getInstanceKey ( ) != null ) { Menu menu = null ; try { instance = uiField . getInstance ( ) ; menu = Menu . getTypeTreeMenu ( instance . getType ( ) ) ; } catch ( final EFapsException e ) { throw new RestartResponseException ( new ErrorPage ( e ) ) ; } if ( menu == null ) { final Exception ex = new Exception ( "no tree menu defined for type " + instance . getType ( ) . getName ( ) ) ; throw new RestartResponseException ( new ErrorPage ( ex ) ) ; } Page page ; try { page = new ContentContainerPage ( menu . getUUID ( ) , uiField . getInstanceKey ( ) , getPage ( ) instanceof StructurBrowserPage ) ; } catch ( final EFapsException e ) { page = new ErrorPage ( e ) ; } this . setResponsePage ( page ) ; }


signature:
public class EFapsRequestCycleListener { /** * Method to get the EFapsSession .
 * @ param _ request Request the Session is wanted for
 * @ return EFapsSession */
private EFapsSession getEFapsSession ( final Request _request ) { } }

implementation: final ISessionStore sessionStore = WebApplication . get ( ) . getSessionStore ( ) ; final EFapsSession session = ( EFapsSession ) sessionStore . lookup ( _request ) ; return session ;


signature:
public class EFapsRequestCycleListener { /** * Called when the request cycle object is beginning its response .
 * @ param _ cycle RequestCycle this Listener belongs to */
@ Override public void onBeginRequest ( final RequestCycle _cycle ) { } }

implementation: final EFapsSession session = getEFapsSession ( _cycle . getRequest ( ) ) ; if ( session != null ) { session . openContext ( ) ; RegistryManager . registerActivity ( session ) ; } EFapsRequestCycleListener . LOG . debug ( "Begin of Request." ) ;


signature:
public class EFapsRequestCycleListener { /** * Called when the request cycle object has finished its response .
 * @ param _ cycle RequestCycle this Listener belongs to */
@ Override public void onEndRequest ( final RequestCycle _cycle ) { } }

implementation: final EFapsSession session = getEFapsSession ( _cycle . getRequest ( ) ) ; if ( session != null ) { session . closeContext ( ) ; } EFapsRequestCycleListener . LOG . debug ( "End of Request." ) ;


signature:
public class RegistryManager { /** * Register user session .
 * @ param _ userName the user name
 * @ param _ sessionId the session ID */
public static void registerUserSession ( final String _userName , final String _sessionId ) { } }

implementation: if ( EFapsApplication . getMaxInactiveInterval ( ) > 0 ) { RegistryManager . getCache ( ) . put ( _sessionId , new UserSession ( ) . setUserName ( _userName ) . setSessionId ( _sessionId ) , - 1 , TimeUnit . MINUTES , EFapsApplication . getMaxInactiveInterval ( ) + 600 , TimeUnit . SECONDS ) ; } else { RegistryManager . getCache ( ) . put ( _sessionId , new UserSession ( ) . setUserName ( _userName ) . setSessionId ( _sessionId ) ) ; } RegistryManager . registerLogin4History ( _userName , _sessionId ) ;


signature:
public class RegistryManager { /** * Register activity .
 * @ param _ session the session */
public static void registerActivity ( final EFapsSession _session ) { } }

implementation: if ( _session . isLogedIn ( ) && RegistryManager . getCache ( ) . containsKey ( _session . getId ( ) ) ) { final UserSession userSession = RegistryManager . getCache ( ) . get ( _session . getId ( ) ) ; if ( userSession . isInvalidated ( ) ) { _session . invalidate ( ) ; } else { userSession . registerActivity ( ) ; } }


signature:
public class RegistryManager { /** * Adds the msg connection .
 * @ param _ sessionId the session ID
 * @ param _ key the key */
public static void addMsgConnection ( final String _sessionId , final IKey _key ) { } }

implementation: if ( RegistryManager . getCache ( ) . containsKey ( _sessionId ) ) { RegistryManager . getCache ( ) . get ( _sessionId ) . setConnectionKey ( _key ) ; } RegistryManager . LOG . debug ( "Added Message Connection for Session: {}" , _sessionId ) ;


signature:
public class RegistryManager { /** * Invalidate session .
 * @ param _ sessionId the session id */
public static void invalidateSession ( final String _sessionId ) { } }

implementation: if ( RegistryManager . getCache ( ) . containsKey ( _sessionId ) ) { RegistryManager . getCache ( ) . get ( _sessionId ) . markInvalid ( ) ; }


signature:
public class RegistryManager { /** * Removes the user session .
 * @ param _ sessionId the session id */
public static void removeUserSession ( final String _sessionId ) { } }

implementation: if ( RegistryManager . getCache ( ) . containsKey ( _sessionId ) ) { RegistryManager . registerLogout4History ( RegistryManager . getCache ( ) . get ( _sessionId ) . getUserName ( ) , _sessionId ) ; RegistryManager . getCache ( ) . remove ( _sessionId ) ; }


signature:
public class RegistryManager { /** * Gets the users .
 * @ return the users */
public static Set < String > getUsers ( ) { } }

implementation: final Set < String > ret = new HashSet < > ( ) ; for ( final UserSession userSession : RegistryManager . getCache ( ) . values ( ) ) { ret . add ( userSession . getUserName ( ) ) ; } return ret ;


signature:
public class RegistryManager { /** * Gets the connections 4 user .
 * @ param _ login the login
 * @ return the connections 4 user */
public static List < IWebSocketConnection > getConnections4User ( final String _login ) { } }

implementation: final List < IWebSocketConnection > ret = new ArrayList < > ( ) ; final SearchManager searchManager = Search . getSearchManager ( RegistryManager . getCache ( ) ) ; final QueryBuilder qbldr = searchManager . buildQueryBuilderForClass ( UserSession . class ) . get ( ) ; final CacheQuery < ? > query = searchManager . getQuery ( qbldr . keyword ( ) . onField ( "userName" ) . matching ( _login ) . createQuery ( ) ) ; try ( ResultIterator < ? > iter = query . iterator ( ) ) { while ( iter . hasNext ( ) ) { final UserSession userSession = ( UserSession ) iter . next ( ) ; if ( userSession . getConnectionKey ( ) != null ) { final IWebSocketConnectionRegistry registry = WebSocketSettings . Holder . get ( EFapsApplication . get ( ) ) . getConnectionRegistry ( ) ; final IWebSocketConnection conn = registry . getConnection ( EFapsApplication . get ( ) , userSession . getSessionId ( ) , userSession . getConnectionKey ( ) ) ; if ( conn != null ) { ret . add ( conn ) ; } } } } return ret ;


signature:
public class RegistryManager { /** * Gets the connection 4 session .
 * @ param _ sessionId the session id
 * @ return the connection 4 session */
public static IWebSocketConnection getConnection4Session ( final String _sessionId ) { } }

implementation: IWebSocketConnection ret = null ; if ( RegistryManager . getCache ( ) . containsKey ( _sessionId ) ) { final UserSession userSession = RegistryManager . getCache ( ) . get ( _sessionId ) ; if ( userSession . getConnectionKey ( ) != null ) { final IWebSocketConnectionRegistry registry = WebSocketSettings . Holder . get ( EFapsApplication . get ( ) ) . getConnectionRegistry ( ) ; ret = registry . getConnection ( EFapsApplication . get ( ) , userSession . getSessionId ( ) , userSession . getConnectionKey ( ) ) ; } } return ret ;


signature:
public class RegistryManager { /** * Gets the cache .
 * @ return the cache */
private static Cache < String , UserSession > getCache ( ) { } }

implementation:
// before the first use the Entity used for indexing must be added
if ( ! ( ( EmbeddedCacheManager ) InfinispanCache . get ( ) . getContainer ( ) ) . cacheExists ( RegistryManager . SESSIONCACHE ) ) { final Configuration config = ( ( EmbeddedCacheManager ) InfinispanCache . get ( ) . getContainer ( ) ) . getCacheConfiguration ( RegistryManager . SESSIONCACHE ) ; final ConfigurationBuilder bldr = new ConfigurationBuilder ( ) . read ( config ) ; bldr . indexing ( ) . addIndexedEntity ( UserSession . class ) ; ( ( EmbeddedCacheManager ) InfinispanCache . get ( ) . getContainer ( ) ) . undefineConfiguration ( RegistryManager . SESSIONCACHE ) ; ( ( EmbeddedCacheManager ) InfinispanCache . get ( ) . getContainer ( ) ) . defineConfiguration ( RegistryManager . SESSIONCACHE , bldr . build ( ) ) ; } return InfinispanCache . get ( ) . getIgnReCache ( RegistryManager . SESSIONCACHE ) ;


signature:
public class AbstractUIObject { /** * Method initializes the model .
 * @ param _ commandUUID UUID for this Model
 * @ param _ openerId id of the opener
 * @ throws CacheReloadException on error */
protected void initialize ( final UUID _commandUUID , final String _openerId ) throws CacheReloadException { } }

implementation: this . openerId = _openerId ; if ( _commandUUID != null ) { final AbstractCommand command = getCommand ( _commandUUID ) ; this . cmdUUID = command . getUUID ( ) ; setMode ( command . getTargetMode ( ) ) ; this . target = command . getTarget ( ) ; this . submit = command . isSubmit ( ) ; if ( command . getTargetSearch ( ) != null && ! ( this instanceof UIMenuItem ) ) { this . callingCmdUUID = this . cmdUUID ; this . cmdUUID = command . getTargetSearch ( ) . getDefaultCommand ( ) . getUUID ( ) ; setMode ( TargetMode . SEARCH ) ; if ( command . hasEvents ( EventType . UI_COMMAND_EXECUTE ) ) { this . submit = true ; } } }


signature:
public class AbstractUIObject { /** * Get the CommandAbstract which was originally called from the Frontend and
 * let to the construction of this model .
 * @ see # callingCmdUUID
 * @ return the calling CommandAbstract UIClassification
 * @ throws CacheReloadException on error */
public AbstractCommand getCallingCommand ( ) throws CacheReloadException { } }

implementation: AbstractCommand cmd = null ; if ( getCallingCommandUUID ( ) != null ) { cmd = Command . get ( getCallingCommandUUID ( ) ) ; if ( cmd == null ) { cmd = Menu . get ( getCallingCommandUUID ( ) ) ; } } return cmd ;


signature:
public class AbstractUIObject { /** * get the CommandAbstract for the instance variable { @ link # cmdUUID } .
 * @ return CommandAbstract for the instance variable { @ link # cmdUUID }
 * @ throws CacheReloadException on error */
public AbstractCommand getCommand ( ) throws CacheReloadException { } }

implementation: AbstractCommand cmd = Command . get ( this . cmdUUID ) ; if ( cmd == null ) { cmd = Menu . get ( this . cmdUUID ) ; } if ( cmd == null ) { cmd = Search . get ( this . cmdUUID ) ; } return cmd ;


signature:
public class AbstractUIObject { /** * This method executes the Events which are related to this Model . It will
 * take the Events of the CallingCommand { @ link # callingCmdUUID } , if it is
 * declared , otherwise it will take the Events of the Command
 * { @ link # cmdUUID } . The Method also adds the oid { @ link # instanceKey } to
 * the Context , so that it is accessible for the esjp . < br >
 * This method throws an eFpasError to provide the possibility for different
 * responses in the components .
 * @ param _ objectTuples n tuples of ParamterValue and Object
 * @ throws EFapsException on error
 * @ return List of Returns */
public List < Return > executeEvents ( final Object ... _objectTuples ) throws EFapsException { } }

implementation: return executeEvents ( EventType . UI_COMMAND_EXECUTE , _objectTuples ) ;


signature:
public class AbstractUIObject { /** * Execute the events .
 * @ param _ eventType type of events to be executed
 * @ param _ objectTuples tuples of objects passed to the event
 * @ return Lsit of returns from the events
 * @ throws EFapsException on error */
public List < Return > executeEvents ( final EventType _eventType , final Object ... _objectTuples ) throws EFapsException { } }

implementation:
List < Return > ret = new ArrayList < > ( ) ; final AbstractCommand command ; if ( this . callingCmdUUID == null ) { command = this . getCommand ( ) ; } else { command = getCallingCommand ( ) ; } if ( command . hasEvents ( _eventType ) ) { final Parameter param = new Parameter ( ) ; if ( _objectTuples != null ) { // add all parameters
for ( int i = 0 ; i < _objectTuples . length ; i += 2 ) { if ( i + 1 < _objectTuples . length && _objectTuples [ i ] instanceof ParameterValues ) { param . put ( ( ParameterValues ) _objectTuples [ i ] , _objectTuples [ i + 1 ] ) ; } } } param . put ( ParameterValues . PARAMETERS , Context . getThreadContext ( ) . getParameters ( ) ) ; if ( getInstance ( ) != null ) { final String [ ] contextoid = { getInstanceKey ( ) } ; Context . getThreadContext ( ) . getParameters ( ) . put ( "oid" , contextoid ) ; param . put ( ParameterValues . CALL_INSTANCE , getInstance ( ) ) ; param . put ( ParameterValues . INSTANCE , getInstance ( ) ) ; } ret = command . executeEvents ( _eventType , param ) ; } return ret ;


signature:
public class AbstractUIObject { /** * This method executes the Validate - Events which are related to this Model .
 * It will take the Events of the Command { @ link # cmdUUID } .
 * @ param _ objectTuples tuples of Objects to be added to the event
 * @ return List with Return from the esjp
 * @ throws EFapsException on error */
public List < Return > validate ( final Object ... _objectTuples ) throws EFapsException { } }

implementation: return executeEvents ( EventType . UI_VALIDATE , _objectTuples ) ;


signature:
public class AbstractUIObject { /** * Setter method for instance variable { @ link # picker } .
 * @ param _ uiObject value for instance variable { @ link # picker } */
public void setPicker ( final ICmdUIObject _uiObject ) { } }

implementation: if ( _uiObject instanceof UIPicker ) { this . picker = ( UIPicker ) _uiObject ; } else if ( _uiObject == null ) { this . picker = null ; }


signature:
public class FieldConfiguration { /** * Gets the width weight .
 * @ return the width weight */
public int getWidthWeight ( ) { } }

implementation: int ret = 1 ; if ( ! isFixedWidth ( ) && hasProperty ( UIFormFieldProperty . WIDTH ) ) { ret = Integer . valueOf ( getProperty ( UIFormFieldProperty . WIDTH ) ) ; } return ret ;


signature:
public class FieldConfiguration { /** * Evaluate the label .
 * @ param _ uiValue the _ ui value
 * @ param _ fieldInst the _ field inst
 * @ return the label
 * @ throws CacheReloadException the cache reload exception */
public String evalLabel ( final UIValue _uiValue , final Instance _fieldInst ) throws CacheReloadException { } }

implementation: final String key ; if ( getField ( ) . getLabel ( ) == null ) { if ( _uiValue != null && _uiValue . getAttribute ( ) != null ) { if ( _fieldInst != null && _fieldInst . isValid ( ) && _fieldInst . getType ( ) . getAttribute ( _uiValue . getAttribute ( ) . getName ( ) ) != null ) { key = _fieldInst . getType ( ) . getAttribute ( _uiValue . getAttribute ( ) . getName ( ) ) . getLabelKey ( ) ; } else if ( _uiValue . getInstance ( ) != null && _uiValue . getInstance ( ) . getType ( ) . getAttribute ( _uiValue . getAttribute ( ) . getName ( ) ) != null ) { key = _uiValue . getInstance ( ) . getType ( ) . getAttribute ( _uiValue . getAttribute ( ) . getName ( ) ) . getLabelKey ( ) ; } else { key = _uiValue . getAttribute ( ) . getLabelKey ( ) ; } } else { key = FieldConfiguration . class . getName ( ) + ".NoLabel" ; } } else { key = getField ( ) . getLabel ( ) ; } this . label = DBProperties . getProperty ( key ) ; return this . label ;


signature:
public class FieldConfiguration { /** * Checks if is table .
 * @ return true , if is table */
public boolean isTableField ( ) { } }

implementation: boolean ret = false ; try { ret = getField ( ) . getCollection ( ) instanceof Table ; } catch ( final CacheReloadException e ) { LOG . error ( "CacheReloadException" , e ) ; } return ret ;


signature:
public class EsjpInvoker { /** * Checks if is visible .
 * @ return true , if is visible */
public boolean isVisible ( ) { } }

implementation: initialize ( ) ; boolean ret = false ; try { ret = this . snipplet . isVisible ( ) ; } catch ( final EFapsBaseException e ) { EsjpInvoker . LOG . error ( "EFapsException" , e ) ; } return ret ;


signature:
public class AbstractFilter { /** * 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: final String appkey = _filterConfig . getInitParameter ( AbstractFilter . INITPARAM_APP_KEY ) ; final String loginName = _filterConfig . getInitParameter ( AbstractFilter . SESSIONPARAM_LOGIN_NAME ) ; final String loginRolesTmp = _filterConfig . getInitParameter ( AbstractFilter . INITPARAM_LOGIN_ROLES ) ; if ( loginName != null ) { this . sessionParameterLoginName = loginName ; } final Set < UUID > temp = new HashSet < > ( ) ; if ( loginRolesTmp != null ) { final String [ ] loginRolesAr = loginRolesTmp . split ( "," ) ; for ( final String loginRole : loginRolesAr ) { temp . add ( UUID . fromString ( loginRole ) ) ; } } AppAccessHandler . init ( appkey , temp ) ;


signature:
public class AbstractFilter { /** * First the filtes tests , if the http ( s ) protokoll is used . If the request
 * is not implementing the { @ link HttpServletRequest } and the response is
 * not implementing the { @ link HttpServletResponse } interface , a
 * { @ link ServletException } is thrown . < br / >
 * @ param _ request ServletRequest
 * @ param _ response ServletResponse
 * @ param _ chain FilterChain
 * @ throws ServletException if the request and response does not use the
 * http ( s ) protokoll
 * @ see HttpServletRequest
 * @ see HttpServletResponse
 * @ see # checkLogin
 * @ throws IOException on error */
@ Override public void doFilter ( final ServletRequest _request , final ServletResponse _response , final FilterChain _chain ) throws IOException , ServletException { } }

implementation: if ( _request instanceof HttpServletRequest && _response instanceof HttpServletResponse ) { doFilter ( ( HttpServletRequest ) _request , ( HttpServletResponse ) _response , _chain ) ; } else { throw new ServletException ( "request not allowed" ) ; }


signature:
public class AbstractFilter { /** * Stores the logged in user name in a session attribute of the http servlet
 * request . If the new user name is < code > null < / code > , the session attribute
 * is removed .
 * @ param _ request http servlet request
 * @ param _ userName name of logged in user to set ( or null if not defined ) */
protected void setLoggedInUser ( final HttpServletRequest _request , final String _userName ) { } }

implementation: if ( _userName == null ) { _request . getSession ( true ) . removeAttribute ( this . sessionParameterLoginName ) ; } else { _request . getSession ( true ) . setAttribute ( this . sessionParameterLoginName , _userName ) ; }


signature:
public class AjaxStorePositionBehavior { /** * On request the values are stored .
 * @ param _ target AjaxRequestTarget */
@ Override protected void respond ( final AjaxRequestTarget _target ) { } }

implementation: final StringValue horizontal = getComponent ( ) . getRequest ( ) . getRequestParameters ( ) . getParameterValue ( AjaxStorePositionBehavior . PARAMETER_HORIZONTALPOSITION ) ; final StringValue verticalTmp = getComponent ( ) . getRequest ( ) . getRequestParameters ( ) . getParameterValue ( AjaxStorePositionBehavior . PARAMETER_VERTICALPOSITION ) ; if ( ! horizontal . isNull ( ) ) { Configuration . setAttribute ( ConfigAttribute . SPLITTERPOSHORIZONTAL , horizontal . toString ( ) ) ; } if ( ! verticalTmp . isNull ( ) ) { Configuration . setAttribute ( ConfigAttribute . SPLITTERPOSVERTICAL , verticalTmp . toString ( ) ) ; }


signature:
public class UIPicker { /** * Execute events .
 * @ param _ eventType the event type
 * @ param _ objectTuples the object tuples
 * @ return the list < return >
 * @ throws EFapsException on error */
@ Override @ SuppressWarnings ( "unchecked" ) public List < Return > executeEvents ( final EventType _eventType , final Object ... _objectTuples ) throws EFapsException { } }

implementation:
List < Return > ret = new ArrayList < > ( ) ; if ( _eventType . equals ( EventType . UI_COMMAND_EXECUTE ) && getCommand ( ) . hasEvents ( EventType . UI_PICKER ) ) { this . executed = true ; final Parameter param = new Parameter ( ) ; if ( _objectTuples != null ) { // add all parameters
for ( int i = 0 ; i < _objectTuples . length ; i += 2 ) { if ( i + 1 < _objectTuples . length && _objectTuples [ i ] instanceof ParameterValues ) { param . put ( ( ParameterValues ) _objectTuples [ i ] , _objectTuples [ i + 1 ] ) ; } } } param . put ( ParameterValues . PARAMETERS , Context . getThreadContext ( ) . getParameters ( ) ) ; param . put ( ParameterValues . PARENTPARAMETERS , this . parentParameters ) ; if ( getInstance ( ) != null ) { final String [ ] contextoid = { getInstanceKey ( ) } ; Context . getThreadContext ( ) . getParameters ( ) . put ( "oid" , contextoid ) ; param . put ( ParameterValues . CALL_INSTANCE , getInstance ( ) ) ; param . put ( ParameterValues . INSTANCE , getInstance ( ) ) ; } ret = getCommand ( ) . executeEvents ( EventType . UI_PICKER , param ) ; this . returnMap = ( Map < String , Object > ) ret . get ( 0 ) . get ( ReturnValues . VALUES ) ; } return ret ;


signature:
public class FindSimilarServiceImpl { /** * Creates a new FindSimilarServiceImpl of type { @ link QueryResults }
 * @ param hodServiceConfig The configuration to use
 * @ return The new service */
public static FindSimilarServiceImpl < Document > documentsService ( final HodServiceConfig < ? , TokenType . Simple > hodServiceConfig ) { } }

implementation: return new FindSimilarServiceImpl < > ( hodServiceConfig , Document . class ) ;


signature:
public class LinkItem { /** * On click it is evaluated what must be responded . */
@ Override public void onClick ( ) { } }

implementation: ( ( EFapsSession ) getSession ( ) ) . addRecent ( this ) ; final UIMenuItem model = super . getModelObject ( ) ; try { final AbstractCommand command = model . getCommand ( ) ; final PagePosition pagePosition = isPopup ( ) ? PagePosition . POPUP : PagePosition . CONTENT ; if ( command . getTargetTable ( ) != null ) { final WebPage page ; if ( command . getTargetStructurBrowserField ( ) != null ) { if ( "GridX" . equals ( Configuration . getAttribute ( ConfigAttribute . STRUCBRWSR_DEFAULTTYPECONTENT ) ) ) { page = new GridPage ( Model . of ( UIGrid . get ( command . getUUID ( ) , pagePosition ) ) ) ; } else { final UIStructurBrowser uiStrBrws = new UIStructurBrowser ( model . getCommandUUID ( ) , model . getInstanceKey ( ) ) . setPagePosition ( pagePosition ) ; page = new StructurBrowserPage ( Model . of ( uiStrBrws ) , getPage ( ) . getPageReference ( ) ) ; } } else { if ( "GridX" . equals ( Configuration . getAttribute ( ConfigAttribute . TABLE_DEFAULTTYPECONTENT ) ) ) { page = new GridPage ( Model . of ( UIGrid . get ( command . getUUID ( ) , pagePosition ) ) ) ; } else { final UITable uiTable = new UITable ( model . getCommandUUID ( ) , model . getInstanceKey ( ) ) . setPagePosition ( pagePosition ) ; page = new TablePage ( Model . of ( uiTable ) , null , getPage ( ) . getPageReference ( ) ) ; } } setResponsePage ( page ) ; } else if ( command . getTargetForm ( ) != null || command . getTargetSearch ( ) != null ) { final UIForm uiForm = new UIForm ( model . getCommandUUID ( ) , model . getInstanceKey ( ) ) . setPagePosition ( pagePosition ) ; final FormPage page = new FormPage ( Model . of ( uiForm ) , getPage ( ) . getPageReference ( ) ) ; setResponsePage ( page ) ; } else { try { final List < Return > rets = model . executeEvents ( ParameterValues . OTHERS , this ) ; if ( command . isTargetShowFile ( ) ) { final Object object = rets . get ( 0 ) . get ( ReturnValues . VALUES ) ; if ( object instanceof File ) { getRequestCycle ( ) . scheduleRequestHandlerAfterCurrent ( new RedirectRequestHandler ( "/usage.html" ) ) ; } } } catch ( final EFapsException e ) { throw new RestartResponseException ( new ErrorPage ( e ) ) ; } } } catch ( final EFapsException e ) { setResponsePage ( new ErrorPage ( e ) ) ; }


signature:
public class LinkItem { /** * { @ inheritDoc } */
@ Override public void open ( final Component _openComponent ) throws EFapsException { } }

implementation: final UIMenuItem model = super . getModelObject ( ) ; final AbstractCommand command = model . getCommand ( ) ; _openComponent . getPage ( ) ; if ( command . getTargetTable ( ) != null ) { if ( command . getTargetStructurBrowserField ( ) != null ) { final StructurBrowserPage page = new StructurBrowserPage ( model . getCommandUUID ( ) , model . getInstanceKey ( ) ) ; setResponsePage ( page ) ; } else { if ( "GridX" . equals ( Configuration . getAttribute ( ConfigAttribute . TABLE_DEFAULTTYPECONTENT ) ) ) { final GridPage page = new GridPage ( Model . of ( UIGrid . get ( command . getUUID ( ) , PagePosition . CONTENT ) ) ) ; setResponsePage ( page ) ; } else { final UITable uiTable = new UITable ( model . getCommandUUID ( ) , model . getInstanceKey ( ) ) . setPagePosition ( PagePosition . CONTENT ) ; final TablePage page = new TablePage ( Model . of ( uiTable ) ) ; setResponsePage ( page ) ; } } } else if ( command . getTargetForm ( ) != null ) { final UIForm uiForm = new UIForm ( model . getCommandUUID ( ) , model . getInstanceKey ( ) ) . setPagePosition ( PagePosition . CONTENT ) ; final FormPage page = new FormPage ( Model . of ( uiForm ) ) ; setResponsePage ( page ) ; }


signature:
public class LinkItem { /** * { @ inheritDoc } */
@ Override public String getLabel ( final int _maxLength ) throws EFapsException { } }

implementation: final UIMenuItem model = super . getModelObject ( ) ; String label = model . getLabel ( ) ; if ( label . length ( ) > _maxLength ) { label = label . substring ( 0 , _maxLength - 3 ) + "..." ; } return label ;


signature:
public class AjaxButton { /** * Init the component .
 * @ param _ model Model for this component
 * @ param _ reference refernce to an icon
 * @ param _ label label of the button */
protected void initialize ( final IModel < T > _model , final EFapsContentReference _reference , final String _label ) { } }

implementation: final ButtonLink < T > link ; if ( _model == null ) { link = new ButtonLink < > ( "button" ) ; } else { link = new ButtonLink < > ( "button" , _model ) ; } add ( link ) ; link . add ( new ButtonImage ( "icon" , _reference ) ) ; link . add ( new Label ( "label" , _label == null ? "" : _label ) ) ;


signature:
public class AutoCompleteComboBox { /** * Method to get the values from the esjp .
 * @ see org . apache . wicket . extensions . ajax . markup . html . autocomplete
 * . AutoCompleteTextField # getChoices ( java . lang . String )
 * @ param _ input input from the webform
 * @ return iterator */
@ SuppressWarnings ( "unchecked" ) @ Override public Iterator < Map < String , String > > getChoices ( final String _input ) { } }

implementation: final List < Map < String , String > > retList = new ArrayList < Map < String , String > > ( ) ; try { final AbstractUIPageObject pageObject = ( AbstractUIPageObject ) getPage ( ) . getDefaultModelObject ( ) ; final Map < String , String > uiID2Oid = pageObject == null ? null : pageObject . getUiID2Oid ( ) ; final List < Return > returns = this . autoComplete . getAutoCompletion ( _input , uiID2Oid ) ; for ( final Return aReturn : returns ) { final Object ob = aReturn . get ( ReturnValues . VALUES ) ; if ( ob instanceof List ) { retList . addAll ( ( Collection < ? extends Map < String , String > > ) ob ) ; } } } catch ( final EFapsException e ) { AutoCompleteComboBox . LOG . error ( "Error in getChoice()" , e ) ; } return retList . iterator ( ) ;


signature:
public class AutoCompleteComboBox { /** * { @ inheritDoc } */
@ Override public String getItemValue ( ) { } }

implementation: String ret = null ; try { if ( this . autoComplete != null && this . autoComplete . getParent ( ) . isEditMode ( ) && ! EditValue . NONE . equals ( this . autoComplete . getAutoCompleteSetting ( ) . getValue4Edit ( ) ) ) { final Instance instance = this . autoComplete . getInstance ( ) ; if ( instance != null && instance . isValid ( ) ) { switch ( this . autoComplete . getAutoCompleteSetting ( ) . getValue4Edit ( ) ) { case OID : ret = instance . getOid ( ) ; break ; case ID : ret = String . valueOf ( instance . getId ( ) ) ; break ; default : break ; } } } else if ( this . autoComplete != null && ( this . autoComplete . getParent ( ) . isEditMode ( ) || this . autoComplete . getParent ( ) . isCreateMode ( ) ) && ! this . autoComplete . getAutoCompleteSetting ( ) . isRequired ( ) ) { ret = this . autoComplete . getAutoCompleteValue ( ) ; } } catch ( final EFapsException e ) { AutoCompleteComboBox . LOG . error ( "Error in getItemValue()" , e ) ; } return ret ;


signature:
public class AutoCompleteComboBox { /** * { @ inheritDoc } */
@ Override public String getItemLabel ( ) { } }

implementation: String ret = null ; if ( ( this . autoComplete . getParent ( ) . isEditMode ( ) || this . autoComplete . getParent ( ) . isCreateMode ( ) ) && ! EditValue . NONE . equals ( this . autoComplete . getAutoCompleteSetting ( ) . getValue4Edit ( ) ) ) { try { ret = this . autoComplete . getAutoCompleteValue ( ) ; } catch ( final EFapsException e ) { AutoCompleteComboBox . LOG . error ( "Error in getItemValue()" , e ) ; } } return ret ;


signature:
public class DateUtil { /** * Convert a date from a parameter into a < code > DateTime < / code > .
 * @ param _ value value to be converted
 * @ return DateTime
 * @ throws EFapsException on error */
public static DateTime getDateFromParameter ( final String _value ) throws EFapsException { } }

implementation: final StyleDateConverter styledate = new StyleDateConverter ( false ) ; final DateTimeFormatter fmt = DateTimeFormat . forPattern ( styledate . getDatePattern ( Context . getThreadContext ( ) . getLocale ( ) ) ) ; fmt . withLocale ( Context . getThreadContext ( ) . getLocale ( ) ) ; final DateTime dt = fmt . parseDateTime ( _value ) ; return dt ;


signature:
public class DateUtil { /** * Convert a < code > DateTime < / code > to a String for parameter .
 * @ param _ value value to be converted
 * @ return DateTime
 * @ throws EFapsException on error */
public static String getDate4Parameter ( final DateTime _value ) throws EFapsException { } }

implementation: final StyleDateConverter styledate = new StyleDateConverter ( false ) ; final DateTimeFormatter fmt = DateTimeFormat . forPattern ( styledate . getDatePattern ( Context . getThreadContext ( ) . getLocale ( ) ) ) ; fmt . withLocale ( Context . getThreadContext ( ) . getLocale ( ) ) ; return _value . toString ( fmt ) ;


signature:
public class DateUtil { /** * Gets the date pattern .
 * @ return the date pattern
 * @ throws EFapsException the e faps exception */
public static String getDatePattern ( ) throws EFapsException { } }

implementation: final String formatStr = Configuration . getAttribute ( Configuration . ConfigAttribute . FORMAT_DATE ) ; return formatStr . matches ( "^[S,M,L,F,-]{2}$" ) ? DateTimeFormat . patternForStyle ( formatStr , Context . getThreadContext ( ) . getLocale ( ) ) : formatStr ;


signature:
public class DateUtil { /** * Gets the date time formatter .
 * @ return the date time formatter
 * @ throws EFapsException the e faps exception */
public static DateTimeFormatter getDateTimeFormatter ( ) throws EFapsException { } }

implementation: final String formatStr = Configuration . getAttribute ( Configuration . ConfigAttribute . FORMAT_DATETIME ) ; final DateTimeFormatter ret ; if ( formatStr . matches ( "^[S,M,L,F,-]{2}$" ) ) { ret = DateTimeFormat . forStyle ( formatStr ) ; } else { ret = DateTimeFormat . forPattern ( formatStr ) ; } return ret . withLocale ( Context . getThreadContext ( ) . getLocale ( ) ) ;


signature:
public class DateUtil { /** * Gets the date pattern .
 * @ return the date pattern
 * @ throws EFapsException the e faps exception */
public static String getDateTimePattern ( ) throws EFapsException { } }

implementation: final String formatStr = Configuration . getAttribute ( Configuration . ConfigAttribute . FORMAT_DATETIME ) ; return formatStr . matches ( "^[S,M,L,F,-]{2}$" ) ? DateTimeFormat . patternForStyle ( formatStr , Context . getThreadContext ( ) . getLocale ( ) ) : formatStr ;


signature:
public class UIFieldStructurBrowser { /** * { @ inheritDoc } */
@ Override protected UIStructurBrowser getNewStructurBrowser ( final Instance _instance , final UIStructurBrowser _parent ) throws EFapsException { } }

implementation: final FieldTable field = FieldTable . get ( ( ( UIFieldStructurBrowser ) _parent ) . getFieldTabelId ( ) ) ; final UIFieldStructurBrowser ret = new UIFieldStructurBrowser ( _parent . getCommandUUID ( ) , _instance == null ? null : _instance . getKey ( ) , _parent . getSortDirection ( ) , field ) ; ret . setParentBrws ( this ) ; ret . setLevel ( getLevel ( ) + 1 ) ; return ret ;


signature:
public class UIFieldStructurBrowser { /** * { @ inheritDoc } */
@ Override protected void initialise ( ) throws EFapsException { } }

implementation:
if ( getCommand ( ) == null ) { super . initialise ( ) ; } else { try { if ( Context . getThreadContext ( ) . containsUserAttribute ( getCacheKey ( UITable . UserCacheKey . SORTKEY ) ) ) { setSortKeyInternal ( Context . getThreadContext ( ) . getUserAttribute ( getCacheKey ( UITable . UserCacheKey . SORTKEY ) ) ) ; } if ( Context . getThreadContext ( ) . containsUserAttribute ( getCacheKey ( UITable . UserCacheKey . SORTDIRECTION ) ) ) { setSortDirection ( SortDirection . getEnum ( Context . getThreadContext ( ) . getUserAttribute ( getCacheKey ( UITable . UserCacheKey . SORTDIRECTION ) ) ) ) ; } } catch ( final EFapsException e ) { // we don ' t throw an error because this are only Usersettings
UIFieldStructurBrowser . LOG . error ( "error during the retrieve of UserAttributes" , e ) ; } }


signature:
public class FileServlet { /** * Search for the requested file in the folder corresponding to the user of the context .
 * @ param _ req request variable
 * @ param _ resp response variable
 * @ throws ServletException on error */
@ Override protected void doGet ( final HttpServletRequest _req , final HttpServletResponse _resp ) throws ServletException { } }

implementation: String fileName = _req . getRequestURI ( ) ; fileName = fileName . substring ( fileName . lastIndexOf ( '/' ) + 1 ) ; try { final Person pers = Context . getThreadContext ( ) . getPerson ( ) ; if ( pers != null ) { final File file = getFile ( pers . getId ( ) , fileName ) ; if ( file != null && file . exists ( ) ) { _resp . setContentType ( getServletContext ( ) . getMimeType ( file . getName ( ) ) ) ; _resp . setContentLength ( ( int ) file . length ( ) ) ; _resp . setDateHeader ( "Last-Modified" , System . currentTimeMillis ( ) ) ; _resp . setDateHeader ( "Expires" , System . currentTimeMillis ( ) ) ; _resp . addHeader ( "Content-Disposition" , "inline; filename=\"" + file . getName ( ) + "\"" ) ; _resp . setHeader ( "Cache-Control" , "max-age=10" ) ; final FileInputStream input = new FileInputStream ( file ) ; IOUtils . copy ( input , _resp . getOutputStream ( ) ) ; } } } catch ( final EFapsException e ) { FileServlet . LOG . error ( "EFapsException" , e ) ; throw new ServletException ( e ) ; } catch ( final IOException e ) { FileServlet . LOG . error ( "IOException" , e ) ; throw new ServletException ( e ) ; }


signature:
public class HelpServlet { /** * The method checks the file from the object out and returns them in a
 * output stream to the web client . The object id must be given with
 * paramter { @ link # PARAM _ OID } . < br / >
 * @ 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:
HelpServlet . LOG . debug ( "Recieved Request for Help Servlet: {}" , _req ) ; try { final List < String > wikis = new ArrayList < String > ( ) ; String path = _req . getPathInfo ( ) . substring ( 1 ) ; final String end = path . substring ( path . lastIndexOf ( "." ) , path . length ( ) ) ; if ( end . equalsIgnoreCase ( ".png" ) || end . equalsIgnoreCase ( ".jpg" ) || end . equalsIgnoreCase ( ".jpeg" ) || end . equalsIgnoreCase ( ".gif" ) ) { final QueryBuilder queryBldr = new QueryBuilder ( CIAdminProgram . WikiImage ) ; queryBldr . addWhereAttrEqValue ( "Name" , path ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribute ( "FileLength" ) ; multi . execute ( ) ; if ( multi . next ( ) ) { final Long length = multi . < Long > getAttribute ( "FileLength" ) ; final Checkout checkout = new Checkout ( multi . getCurrentInstance ( ) ) ; _res . setContentType ( getServletContext ( ) . getMimeType ( end ) ) ; _res . setContentLength ( length . intValue ( ) ) ; _res . setDateHeader ( "Expires" , System . currentTimeMillis ( ) + ( 3600 * 1000 ) ) ; _res . setHeader ( "Cache-Control" , "max-age=3600" ) ; checkout . execute ( _res . getOutputStream ( ) ) ; checkout . close ( ) ; } } else { if ( ! path . contains ( "." ) ) { String referer = _req . getHeader ( "Referer" ) ; if ( referer . contains ( ":" ) ) { final String [ ] paths = referer . split ( ":" ) ; referer = paths [ 0 ] ; } final String [ ] pack = referer . substring ( referer . lastIndexOf ( "/" ) + 1 ) . split ( "\\." ) ; final StringBuilder newPath = new StringBuilder ( ) ; for ( int i = 0 ; i < pack . length - 2 ; i ++ ) { newPath . append ( pack [ i ] ) . append ( "." ) ; } newPath . append ( path ) . append ( ".wiki" ) ; path = newPath . toString ( ) ; wikis . add ( path ) ; } else if ( path . contains ( ":" ) ) { final String [ ] paths = path . split ( ":" ) ; for ( final String apath : paths ) { wikis . add ( apath ) ; } } else { wikis . add ( path ) ; } final String menuStr ; if ( Context . getThreadContext ( ) . containsSessionAttribute ( HelpServlet . MENU_SESSION_KEY ) ) { menuStr = ( String ) Context . getThreadContext ( ) . getSessionAttribute ( HelpServlet . MENU_SESSION_KEY ) ; } else { menuStr = getMenu ( ) ; Context . getThreadContext ( ) . setSessionAttribute ( HelpServlet . MENU_SESSION_KEY , menuStr ) ; } final StringBuilder html = new StringBuilder ( ) ; html . append ( "" ) . append ( "\n" ) . append ( "\n" ) . append ( "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../wicket/resource/" ) . append ( AbstractDojoBehavior . CSS_TUNDRA . getScope ( ) . getName ( ) ) . append ( "/" ) . append ( AbstractDojoBehavior . CSS_TUNDRA . getName ( ) ) . append ( "\" />" ) . append ( "<link rel=\"stylesheet\" type=\"text/css\" " ) . append ( " href=\"../../servlet/static/org.efaps.help.Help.css?" ) . append ( "\" />" ) . append ( "" ) . append ( "
" ) . append ( "
" ) . append ( "
" ) . append ( menuStr ) . append ( "

" ) . append ( "

" ) ; for ( final String wiki : wikis ) { final QueryBuilder queryBldr = new QueryBuilder ( CIAdminProgram . WikiCompiled ) ; queryBldr . addWhereAttrEqValue ( "Name" , wiki ) ; final InstanceQuery query = queryBldr . getQuery ( ) ; query . execute ( ) ; if ( query . next ( ) ) { final Checkout checkout = new Checkout ( query . getCurrentValue ( ) ) ; final InputStreamReader in = new InputStreamReader ( checkout . execute ( ) , "UTF8" ) ; if ( in != null ) { final BufferedReader reader = new BufferedReader ( in ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { html . append ( line ) ; } } } } html . append ( "

" ) ; _res . setContentType ( "text/html;charset=UTF-8" ) ; _res . setContentLength ( html . length ( ) ) ; _res . getOutputStream ( ) . write ( html . toString ( ) . getBytes ( "UTF8" ) ) ; } } catch ( final EFapsException e ) { throw new ServletException ( e ) ; } catch ( final IOException e ) { throw new ServletException ( e ) ; }


signature:
public class HelpServlet { /** * get the CharSequence for the menu .
 * @ return the menu
 * @ throws EFapsException on error */
private String getMenu ( ) throws EFapsException { } }

implementation:
HelpServlet . LOG . debug ( "Reading Main Help Menu" ) ; final StringBuilder ret = new StringBuilder ( ) ; ret . append ( "
" ) ; final QueryBuilder queryBldr = new QueryBuilder ( Type . get ( "Admin_Help_Menu" ) ) ; // Admin _ Help _ MainMenu
queryBldr . addWhereAttrEqValue ( "UUID" , "dead549e-5cc6-49f9-9a79-8e33aa139f6d" ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribute ( "Name" ) ; multi . addSelect ( "linkfrom[Admin_Help_Menu2Wiki#FromLink].linkto[ToLink].attribute[Name]" ) ; multi . execute ( ) ; if ( multi . next ( ) ) { final String name = multi . < String > getAttribute ( "Name" ) ; String link = "" ; final Object links = multi . getSelect ( "linkfrom[Admin_Help_Menu2Wiki#FromLink].linkto[ToLink].attribute[Name]" ) ; if ( links instanceof List < ? > ) { for ( final Object alink : ( List < ? > ) links ) { link = link + ":" + alink ; } } else { link = ( String ) links ; } ret . append ( "
" ) . append ( DBProperties . getProperty ( name + ".Label" ) ) . append ( "
" ) ; ret . append ( getSubMenues ( multi . getCurrentInstance ( ) ) ) ; } ret . append ( "
" ) ; return ret . toString ( ) ;


signature:
public class HelpServlet { /** * Recursive method to get the CharSequence for the sub menu .
 * @ param _ instance Instance of the parent menu
 * @ return the menu
 * @ throws EFapsException on error */
private CharSequence getSubMenues ( final Instance _instance ) throws EFapsException { } }

implementation:
HelpServlet . LOG . debug ( "Reading Submenues for OID: {}" , _instance . getOid ( ) ) ; final StringBuilder ret = new StringBuilder ( ) ; final QueryBuilder queryBldr = new QueryBuilder ( Type . get ( "Admin_Help_Menu2Menu" ) ) ; queryBldr . addWhereAttrEqValue ( "FromLink" , _instance . getId ( ) ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addSelect ( "linkto[ToLink].attribute[Name]" , "linkto[ToLink].oid" ) ; multi . execute ( ) ; final Map < Long , String > subs = new TreeMap < Long , String > ( ) ; while ( multi . next ( ) ) { final String name = multi . < String > getSelect ( "linkto[ToLink].attribute[Name]" ) ; final String oid = multi . < String > getSelect ( "linkto[ToLink].oid" ) ; final PrintQuery print = new PrintQuery ( oid ) ; print . addSelect ( "linkfrom[Admin_Help_Menu2Wiki#FromLink].linkto[ToLink].attribute[Name]" ) ; print . execute ( ) ; String link = "" ; final Object links = print . getSelect ( "linkfrom[Admin_Help_Menu2Wiki#FromLink].linkto[ToLink].attribute[Name]" ) ; if ( links instanceof List < ? > ) { for ( final Object alink : ( List < ? > ) links ) { link = link + ":" + alink ; } } else { link = ( String ) links ; } HelpServlet . LOG . debug ( "  Submenue '{}' with OID: {}" , name , print . getCurrentInstance ( ) . getOid ( ) ) ; final StringBuilder menu = new StringBuilder ( ) . append ( "
" ) . append ( DBProperties . getProperty ( name + ".Label" ) ) . append ( "
" ) . append ( getSubMenues ( print . getCurrentInstance ( ) ) ) ; subs . put ( multi . getCurrentInstance ( ) . getId ( ) , menu . toString ( ) ) ; } if ( ! subs . isEmpty ( ) ) { ret . append ( "
" ) ; for ( final String sub : subs . values ( ) ) { ret . append ( sub ) . append ( "\n" ) ; } ret . append ( "
" ) ; } return ret ;


signature:
public class UITable { /** * Method that initializes the TableModel .
 * @ throws EFapsException on error */
private void initialise ( ) throws EFapsException { } }

implementation:
final AbstractCommand command = getCommand ( ) ; if ( command == null ) { setShowCheckBoxes ( false ) ; } else { // set target table
if ( command . getTargetTable ( ) != null ) { setTableUUID ( command . getTargetTable ( ) . getUUID ( ) ) ; if ( Context . getThreadContext ( ) . containsSessionAttribute ( getCacheKey ( UITable . UserCacheKey . FILTER ) ) ) { @ SuppressWarnings ( "unchecked" ) final Map < String , TableFilter > sessfilter = ( Map < String , TableFilter > ) Context . getThreadContext ( ) . getSessionAttribute ( getCacheKey ( UITable . UserCacheKey . FILTER ) ) ; for ( final Field field : command . getTargetTable ( ) . getFields ( ) ) { if ( sessfilter . containsKey ( field . getName ( ) ) ) { final TableFilter filter = sessfilter . get ( field . getName ( ) ) ; filter . setHeaderFieldId ( field . getId ( ) ) ; this . filters . put ( field . getName ( ) , filter ) ; } } } else { // add the filter here , if it is a required filter or a default value is set , that must be
// applied against the database
for ( final Field field : command . getTargetTable ( ) . getFields ( ) ) { if ( field . hasAccess ( getMode ( ) , getInstance ( ) , getCommand ( ) , getInstance ( ) ) && ( field . getFilter ( ) . isRequired ( ) || field . getFilter ( ) . getDefaultValue ( ) != null && ! field . getFilter ( ) . getDefaultValue ( ) . isEmpty ( ) ) && field . getFilter ( ) . getBase ( ) . equals ( FilterBase . DATABASE ) ) { this . filters . put ( field . getName ( ) , new TableFilter ( field . getId ( ) ) ) ; } } } } // set default sort
if ( command . getTargetTableSortKey ( ) != null ) { setSortKeyInternal ( command . getTargetTableSortKey ( ) ) ; setSortDirection ( command . getTargetTableSortDirection ( ) ) ; } setEnforceSorted ( "true" . equalsIgnoreCase ( command . getProperty ( "TargetEnforceSorted" ) ) ) ; setShowCheckBoxes ( command . isTargetShowCheckBoxes ( ) ) ; // get the User specific Attributes if exist overwrite the defaults
try { if ( Context . getThreadContext ( ) . containsUserAttribute ( getCacheKey ( UITable . UserCacheKey . SORTKEY ) ) ) { setSortKeyInternal ( Context . getThreadContext ( ) . getUserAttribute ( getCacheKey ( UITable . UserCacheKey . SORTKEY ) ) ) ; } if ( Context . getThreadContext ( ) . containsUserAttribute ( getCacheKey ( UITable . UserCacheKey . SORTDIRECTION ) ) ) { setSortDirection ( SortDirection . getEnum ( Context . getThreadContext ( ) . getUserAttribute ( getCacheKey ( UITable . UserCacheKey . SORTDIRECTION ) ) ) ) ; } } catch ( final EFapsException e ) { // we don ' t throw an error because this are only Usersettings
UITable . LOG . error ( "error during the retrieve of UserAttributes" , e ) ; } }


signature:
public class UITable { /** * Method to get the list of instance .
 * @ return List of instances
 * @ throws EFapsException on error */
@ SuppressWarnings ( "unchecked" ) protected List < Instance > getInstanceList ( ) throws EFapsException { } }

implementation:
// get the filters that must be applied against the database
final IFilterList filterList = new FilterList ( ) ; final Iterator < Entry < String , TableFilter > > iter = this . filters . entrySet ( ) . iterator ( ) ; this . filterTempCache . clear ( ) ; while ( iter . hasNext ( ) ) { final Entry < String , TableFilter > entry = iter . next ( ) ; if ( entry . getValue ( ) . getUiTableHeader ( ) == null || entry . getValue ( ) . getUiTableHeader ( ) != null && entry . getValue ( ) . getUiTableHeader ( ) . getFilter ( ) . getBase ( ) . equals ( FilterBase . DATABASE ) ) { filterList . add ( entry . getValue ( ) . getFilter ( ) ) ; } this . filterTempCache . put ( entry . getKey ( ) , entry . getValue ( ) ) ; iter . remove ( ) ; } final List < Return > ret = getCommand ( ) . executeEvents ( EventType . UI_TABLE_EVALUATE , ParameterValues . INSTANCE , getInstance ( ) , ParameterValues . PARAMETERS , Context . getThreadContext ( ) . getParameters ( ) , ParameterValues . CLASS , this , ParameterValues . OTHERS , filterList ) ; List < Instance > lists = null ; if ( ret . size ( ) < 1 ) { throw new EFapsException ( UITable . class , "getInstanceList" ) ; } else { lists = ( List < Instance > ) ret . get ( 0 ) . get ( ReturnValues . VALUES ) ; } return lists ;


signature:
public class UITable { /** * { @ inheritDoc } */
@ Override public void execute ( ) { } }

implementation: try { if ( isCreateMode ( ) ) { execute4NoInstance ( ) ; } else { final List < Instance > instances = getInstanceList ( ) ; if ( instances . isEmpty ( ) && isEditMode ( ) ) { execute4NoInstance ( ) ; } else { execute4Instance ( instances ) ; } } } catch ( final EFapsException e ) { throw new RestartResponseException ( new ErrorPage ( e ) ) ; } super . setInitialized ( true ) ;


signature:
public class UITable { /** * Executes this model for the case that no instance is given . Currently
 * only create !
 * @ throws EFapsException on error */
private void execute4NoInstance ( ) throws EFapsException { } }

implementation: final List < Field > fields = getUserSortedColumns ( ) ; final List < Integer > userWidthList = getUserWidths ( ) ; int i = 1 ; for ( final Field field : fields ) { if ( field . hasAccess ( getMode ( ) , getInstance ( ) , getCommand ( ) , getInstance ( ) ) && ! field . isNoneDisplay ( getMode ( ) ) && ! field . isHiddenDisplay ( getMode ( ) ) ) { SortDirection sortdirection = SortDirection . NONE ; if ( field . getName ( ) . equals ( getSortKey ( ) ) ) { sortdirection = getSortDirection ( ) ; } final FieldConfiguration fieldConfig = new FieldConfiguration ( field . getId ( ) ) ; final UITableHeader headermodel = new UITableHeader ( this , fieldConfig , sortdirection , null ) ; headermodel . setSortable ( false ) ; headermodel . setFilter ( false ) ; getHeaders ( ) . add ( headermodel ) ; if ( ! fieldConfig . isFixedWidth ( ) ) { if ( userWidthList != null && ( isShowCheckBoxes ( ) && i + 1 < userWidthList . size ( ) || ! isShowCheckBoxes ( ) && i < userWidthList . size ( ) ) ) { if ( isShowCheckBoxes ( ) ) { headermodel . setWidth ( userWidthList . get ( i + 1 ) ) ; } else { headermodel . setWidth ( userWidthList . get ( i ) ) ; } } setWidthWeight ( getWidthWeight ( ) + fieldConfig . getWidthWeight ( ) ) ; } i ++ ; } } final Type type = getTypeFromEvent ( ) ; final UIRow row = new UIRow ( this ) ; Attribute attr = null ; for ( final Field field : fields ) { if ( field . hasAccess ( getMode ( ) , getInstance ( ) , getCommand ( ) , getInstance ( ) ) && ! field . isNoneDisplay ( getMode ( ) ) ) { attr = null ; if ( type != null ) { if ( field . getAttribute ( ) != null ) { attr = type . getAttribute ( field . getAttribute ( ) ) ; } else if ( field . getSelect ( ) != null ) { final PrintQuery print = new PrintQuery ( Instance . get ( type , 0 ) ) ; print . addSelect ( field . getSelect ( ) ) ; print . dryRun ( ) ; attr = print . getAttribute4Select ( field . getSelect ( ) ) ; } } final UIField uiField = new UIField ( this , null , UIValue . get ( field , attr , null ) . setInstance ( getInstance ( ) ) . setClassObject ( this ) . setCallInstance ( getInstance ( ) ) ) ; if ( field . isHiddenDisplay ( getMode ( ) ) ) { row . addHidden ( uiField ) ; } else { row . add ( uiField ) ; } } } this . values . add ( row ) ; if ( getSortKey ( ) != null ) { sort ( ) ; }


signature:
public class UITable { /** * Method used to evaluate the type for this table from the connected
 * events .
 * @ return type if found
 * @ throws EFapsException on error */
private Type getTypeFromEvent ( ) throws EFapsException { } }

implementation:
final List < EventDefinition > events = getEvents ( EventType . UI_TABLE_EVALUATE ) ; String typeName = null ; if ( events . size ( ) > 1 ) { throw new EFapsException ( this . getClass ( ) , "execute4NoInstance.moreThanOneEvaluate" ) ; } else { final EventDefinition event = events . get ( 0 ) ; // TODO remove deprecated Types
if ( event . getProperty ( "Types" ) != null ) { typeName = event . getProperty ( "Types" ) . split ( ";" ) [ 0 ] ; } // test for basic or abstract types
if ( event . getProperty ( "Type" ) != null ) { typeName = event . getProperty ( "Type" ) ; } // no type yet search alternatives
if ( typeName == null ) { for ( int i = 1 ; i < 100 ; i ++ ) { final String nameTmp = "Type" + String . format ( "%02d" , i ) ; if ( event . getProperty ( nameTmp ) != null ) { typeName = event . getProperty ( nameTmp ) ; } else { break ; } } } } return typeName == null ? null : Type . get ( typeName ) ;


signature:
public class UITable { /** * Add a filterlist to the filters of this UiTable .
 * @ param _ uitableHeader UitableHeader this filter belongs to
 * @ param _ list lsi of value to filter */
public void addFilterList ( final UITableHeader _uitableHeader , final Set < ? > _list ) { } }

implementation: final TableFilter filter = new TableFilter ( _uitableHeader , _list ) ; this . filters . put ( _uitableHeader . getFieldName ( ) , filter ) ; final UITableHeader orig = getHeader4Id ( _uitableHeader . getFieldId ( ) ) ; if ( orig != null ) { orig . setFilterApplied ( true ) ; } storeFilters ( ) ;


signature:
public class UITable { /** * Add a range to the filters of this UiTable .
 * @ param _ uitableHeader UitableHeader this filter belongs to
 * @ param _ from from value
 * @ param _ expertMode expert mode
 * @ param _ ignoreCase ignore case
 * @ throws EFapsException on error */
public void addFilterTextLike ( final UITableHeader _uitableHeader , final String _from , final boolean _expertMode , final boolean _ignoreCase ) throws EFapsException { } }

implementation: final TableFilter filter = new TableFilter ( _uitableHeader , _from , _expertMode , _ignoreCase ) ; this . filters . put ( _uitableHeader . getFieldName ( ) , filter ) ; final UITableHeader orig = getHeader4Id ( _uitableHeader . getFieldId ( ) ) ; if ( orig != null ) { orig . setFilterApplied ( true ) ; } storeFilters ( ) ;


signature:
public class UITable { /** * Add a range to the filters of this UiTable .
 * @ param _ uitableHeader UitableHeader this filter belongs to
 * @ param _ from from value
 * @ param _ to to value
 * @ throws EFapsException on error */
public void addFilterRange ( final UITableHeader _uitableHeader , final String _from , final String _to ) throws EFapsException { } }

implementation: final TableFilter filter = new TableFilter ( _uitableHeader , _from , _to ) ; this . filters . put ( _uitableHeader . getFieldName ( ) , filter ) ; final UITableHeader orig = getHeader4Id ( _uitableHeader . getFieldId ( ) ) ; if ( orig != null ) { orig . setFilterApplied ( true ) ; } storeFilters ( ) ;


signature:
public class UITable { /** * Add a classification based filters of this UiTable .
 * @ param _ uitableHeader UitableHeader this filter belongs to
 * @ param _ uiClassification classification based filters
 * @ throws EFapsException on error */
public void addFilterClassifcation ( final UITableHeader _uitableHeader , final UIClassification _uiClassification ) throws EFapsException { } }

implementation: final TableFilter filter = new TableFilter ( _uitableHeader , _uiClassification ) ; this . filters . put ( _uitableHeader . getFieldName ( ) , filter ) ; final UITableHeader orig = getHeader4Id ( _uitableHeader . getFieldId ( ) ) ; if ( orig != null ) { orig . setFilterApplied ( true ) ; } storeFilters ( ) ;


signature:
public class UITable { /** * Add a range to the filters of this UiTable .
 * @ param _ uitableHeader UitableHeader this filter belongs to
 * @ param _ parameters the parameters
 * @ throws EFapsException on error */
public void addFilterParameters ( final UITableHeader _uitableHeader , final Map < String , String [ ] > _parameters ) throws EFapsException { } }

implementation: final TableFilter filter = new TableFilter ( _uitableHeader ) ; filter . setParameters ( _parameters ) ; this . filters . put ( _uitableHeader . getFieldName ( ) , filter ) ; final UITableHeader orig = getHeader4Id ( _uitableHeader . getFieldId ( ) ) ; if ( orig != null ) { orig . setFilterApplied ( true ) ; } storeFilters ( ) ;


signature:
public class UITable { /** * Method to get a Filter from the list of filters belonging to this
 * UITable .
 * @ param _ uitableHeader UitableHeader this filter belongs to
 * @ return filter
 * @ throws EFapsException on error */
public TableFilter getFilter ( final UITableHeader _uitableHeader ) throws EFapsException { } }

implementation: TableFilter ret = this . filters . get ( _uitableHeader . getFieldName ( ) ) ; if ( ret != null && ret . getUiTableHeader ( ) == null ) { ret = new TableFilter ( _uitableHeader ) ; this . filters . put ( _uitableHeader . getFieldName ( ) , ret ) ; } return ret ;


signature:
public class UITable { /** * Get the List of values for a PICKERLIST .
 * @ param _ uitableHeader UitableHeader this filter belongs to
 * @ return List of Values
 * @ throws EFapsException on error */
public List < String > getFilterPickList ( final UITableHeader _uitableHeader ) throws EFapsException { } }

implementation: final List < String > ret = new ArrayList < > ( ) ; for ( final UIRow rowmodel : this . values ) { for ( final IFilterable cell : rowmodel . getCells ( ) ) { if ( cell . belongsTo ( _uitableHeader . getFieldId ( ) ) ) { final String value = cell . getPickListValue ( ) ; if ( ! ret . contains ( value ) ) { ret . add ( value ) ; } break ; } } } Collections . sort ( ret ) ; return ret ;


signature:
public class UITable { /** * Recursive method to get all status for a Type representing a StatusGrp .
 * @ param _ type Type the status list is wanted for
 * @ return list of status
 * @ throws CacheReloadException on error */
private List < Status > getStatus4Type ( final Type _type ) throws CacheReloadException { } }

implementation: final List < Status > ret = new ArrayList < > ( ) ; final StatusGroup grp = Status . get ( _type . getUUID ( ) ) ; if ( grp != null ) { ret . addAll ( grp . values ( ) ) ; } else { for ( final Type type : _type . getChildTypes ( ) ) { ret . addAll ( getStatus4Type ( type ) ) ; } } return ret ;


signature:
public class UITable { /** * Store the Filter in the Session . */
private void storeFilters ( ) { } }

implementation: final Map < String , TableFilter > sessFilter = new HashMap < > ( ) ; for ( final Entry < String , TableFilter > entry : this . filters . entrySet ( ) ) { sessFilter . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } try { Context . getThreadContext ( ) . setSessionAttribute ( getCacheKey ( UITable . UserCacheKey . FILTER ) , sessFilter ) ; } catch ( final EFapsException e ) { UITable . LOG . error ( "Error storing Filtermap for Table called by Command with UUID: {}" , getCommandUUID ( ) , e ) ; }


signature:
public class UITable { /** * This is the getter method for the instance variable { @ link # values } .
 * @ return value of instance variable { @ link # values }
 * @ see # values
 * @ see # setValues
 * @ throws EFapsException on error */
public List < UIRow > getValues ( ) throws EFapsException { } }

implementation: List < UIRow > ret = new ArrayList < > ( ) ; if ( isFiltered ( ) ) { for ( final UIRow row : this . values ) { boolean filtered = false ; for ( final TableFilter filter : this . filters . values ( ) ) { filtered = filter . filterRow ( row ) ; if ( filtered ) { break ; } } if ( ! filtered ) { ret . add ( row ) ; } } } else { ret = this . values ; } setSize ( ret . size ( ) ) ; return ret ;


signature:
public class UITable { /** * Method to remove a filter from the filters .
 * @ param _ uiTableHeader UITableHeader the filter is removed for */
public void removeFilter ( final UITableHeader _uiTableHeader ) { } }

implementation: this . filters . remove ( _uiTableHeader . getFieldName ( ) ) ; final UITableHeader orig = getHeader4Id ( _uiTableHeader . getFieldId ( ) ) ; if ( orig != null ) { orig . setFilterApplied ( false ) ; } storeFilters ( ) ;


signature:
public class UITable { /** * { @ inheritDoc } */
@ Override public void resetModel ( ) { } }

implementation: super . setInitialized ( false ) ; this . values . clear ( ) ; getHeaders ( ) . clear ( ) ; getHidden ( ) . clear ( ) ;


signature:
public class UITable { /** * The instance method sorts the table values depending on the sort key in
 * { @ link # sortKey } and the sort direction in { @ link # sortDirection } .
 * @ throws EFapsException on error */
@ Override public void sort ( ) throws EFapsException { } }

implementation: if ( getSortKey ( ) != null && getSortKey ( ) . length ( ) > 0 ) { int sortKeyTmp = 0 ; final List < Field > fields = getUserSortedColumns ( ) ; for ( int i = 0 ; i < fields . size ( ) ; i ++ ) { final Field field = fields . get ( i ) ; if ( field . hasAccess ( getMode ( ) , getInstance ( ) , getCommand ( ) , getInstance ( ) ) && ! field . isNoneDisplay ( getMode ( ) ) && ! field . isHiddenDisplay ( getMode ( ) ) ) { if ( field . getName ( ) . equals ( getSortKey ( ) ) ) { break ; } sortKeyTmp ++ ; } } if ( sortKeyTmp < getTable ( ) . getFields ( ) . size ( ) ) { final int index = sortKeyTmp ; Collections . sort ( this . values , new Comparator < UIRow > ( ) { @ Override public int compare ( final UIRow _rowModel1 , final UIRow _rowModel2 ) { final ISortable cellModel1 = _rowModel1 . getCells ( ) . get ( index ) ; final ISortable cellModel2 = _rowModel2 . getCells ( ) . get ( index ) ; return cellModel1 . compareTo ( cellModel2 ) ; } } ) ; if ( getSortDirection ( ) == SortDirection . DESCENDING ) { Collections . reverse ( this . values ) ; } } }


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

implementation: final Component ret = super . getReadOnly ( _wicketId , _abstractUIField ) ; if ( ret != null ) { ( ( LabelField ) ret ) . setEscapeModelStrings ( false ) ; } return ret ;


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

implementation: final Attribute attr = _abstractUIField . getValue ( ) . getAttribute ( ) ; String ret = null ; if ( attr != null ) { try { final Class < ? > clazz = Class . forName ( attr . getClassName ( ) , false , EFapsClassLoader . getInstance ( ) ) ; final IJaxb jaxb = ( IJaxb ) clazz . newInstance ( ) ; ret = jaxb . getUISnipplet ( _abstractUIField . getParent ( ) . getMode ( ) , _abstractUIField . getValue ( ) ) ; } catch ( final ClassNotFoundException e ) { JaxbUIFactory . LOG . error ( "ClassNotFoundException" , e ) ; } catch ( final InstantiationException e ) { JaxbUIFactory . LOG . error ( "InstantiationException" , e ) ; } catch ( final IllegalAccessException e ) { JaxbUIFactory . LOG . error ( "IllegalAccessException" , e ) ; } } return ret ;


signature:
public class StructurBrowserPage { /** * Method to add the components to this page .
 * @ throws EFapsException on error */
protected void addComponents ( ) throws EFapsException { } }

implementation: final UIStructurBrowser uiObject = ( UIStructurBrowser ) super . getDefaultModelObject ( ) ; if ( ! uiObject . isInitialized ( ) ) { uiObject . execute ( ) ; } final FormContainer form = new FormContainer ( "form" ) ; this . add ( form ) ; super . addComponents ( form ) ; form . add ( AttributeModifier . append ( "class" , uiObject . getMode ( ) . toString ( ) ) ) ; form . add ( new StructurBrowserTreeTablePanel ( "structurBrowserTable" , Model . of ( uiObject ) ) ) ;


signature:
public class UIGrid { /** * Inits the .
 * @ throws EFapsException the e faps exception */
private void init ( ) throws EFapsException { } }

implementation:
if ( ! this . initialized ) { this . initialized = true ; final List < Field > fields = getTable ( ) . getFields ( ) ; boolean check4Filter = true ; if ( Context . getThreadContext ( ) . containsSessionAttribute ( getCacheKey ( CacheKey . DBFILTER ) ) ) { check4Filter = false ; final FilterList tmpFilterList = ( FilterList ) Context . getThreadContext ( ) . getSessionAttribute ( getCacheKey ( CacheKey . DBFILTER ) ) ; for ( final IFilter filter : tmpFilterList ) { this . filterList . add ( filter ) ; } } for ( final Field field : fields ) { if ( field . hasAccess ( TargetMode . VIEW , null , getCommand ( ) , null ) && ! field . isNoneDisplay ( TargetMode . VIEW ) ) { final GridColumn column = new GridColumn ( ) . setFieldConfig ( new FieldConfiguration ( field . getId ( ) ) ) ; this . columns . add ( column ) ; // before executing the esjp add the filters that are
// working against the database to
// get them filled with the defaults
if ( check4Filter && FilterBase . DATABASE . equals ( field . getFilter ( ) . getBase ( ) ) ) { this . filterList . add ( getFilter4Field ( column . getField ( ) ) ) ; } } } if ( isStructureTree ( ) ) { load ( getPrint ( getMainQueryStmt ( ) ) , Collections . emptyMap ( ) ) ; } else { final List < Instance > instances = getInstances ( ) ; setColumnsUpToDate ( CollectionUtils . isNotEmpty ( instances ) ) ; load ( instances ) ; } }


signature:
public class UIGrid { /** * Gets the cell .
 * @ param _ column the column
 * @ param _ uiValue the ui value
 * @ param _ sortValue the sort value
 * @ param _ fields the fields
 * @ return the cell
 * @ throws EFapsException the e faps exception */
protected GridCell getCell ( final GridColumn _column , final UIValue _uiValue , final Object _sortValue , final Map < Long , JSField > _fields ) throws EFapsException { } }

implementation: JSField jsField ; if ( _fields . containsKey ( _uiValue . getField ( ) . getId ( ) ) ) { jsField = _fields . get ( _uiValue . getField ( ) . getId ( ) ) ; } else { jsField = new JSField ( _uiValue ) ; final IComponentFactory fact = jsField . getFactory ( ) ; if ( fact == null ) { _fields . put ( _uiValue . getField ( ) . getId ( ) , null ) ; jsField = null ; } else { _fields . put ( _uiValue . getField ( ) . getId ( ) , jsField ) ; if ( fact instanceof DateUIFactory ) { _column . setDataType ( "date" ) ; } else if ( fact instanceof DateTimeUIFactory ) { _column . setDataType ( "datetime" ) ; } else if ( fact instanceof DecimalUIFactory || fact instanceof NumberUIFactory ) { _column . setDataType ( "number" ) ; } else if ( fact instanceof BooleanUIFactory ) { _column . setDataType ( "enum" ) ; @ SuppressWarnings ( "unchecked" ) final Map < String , ? > enumValues = ( Map < String , ? > ) _uiValue . getReadOnlyValue ( TargetMode . VIEW ) ; _column . setEnumValues ( enumValues . keySet ( ) ) ; } } } final String value ; if ( jsField == null ) { value = "" ; } else { jsField . setValue ( _uiValue ) ; value = jsField . getFactory ( ) . getStringValue ( jsField ) ; } return new GridCell ( ) . setValue ( value ) . setSortValue ( _sortValue ) . setFieldConfig ( _column . getFieldConfig ( ) ) ;


signature:
public class UIGrid { /** * Gets the instances .
 * @ return the instances
 * @ throws EFapsException the e faps exception */
@ SuppressWarnings ( "unchecked" ) protected List < Instance > getInstances ( ) throws EFapsException { } }

implementation: final List < Return > returns = getEventObject ( ) . executeEvents ( EventType . UI_TABLE_EVALUATE , ParameterValues . INSTANCE , getCallInstance ( ) , ParameterValues . CALL_INSTANCE , getCallInstance ( ) , ParameterValues . PARAMETERS , Context . getThreadContext ( ) . getParameters ( ) , ParameterValues . CLASS , this , ParameterValues . OTHERS , this . filterList ) ; List < Instance > ret = null ; if ( returns . size ( ) < 1 ) { throw new EFapsException ( UIGrid . class , "getInstanceList" ) ; } else { final Object result = returns . get ( 0 ) . get ( ReturnValues . VALUES ) ; if ( result instanceof List ) { ret = ( List < Instance > ) result ; } } return ret ;


signature:
public class UIGrid { /** * Gets the command .
 * @ return the command
 * @ throws CacheReloadException the cache reload exception */
@ Override public AbstractCommand getCommand ( ) throws CacheReloadException { } }

implementation: AbstractCommand cmd = Command . get ( getCmdUUID ( ) ) ; if ( cmd == null ) { cmd = Menu . get ( getCmdUUID ( ) ) ; } return cmd ;


signature:
public class UIGrid { /** * This method retrieves the Value for the Title from the eFaps Database .
 * @ return Value of the Title */
public String getTitle ( ) { } }

implementation:
String title = "" ; try { final String key = getCommand ( ) . getTargetTitle ( ) == null ? getCommand ( ) . getName ( ) + ".Title" : getCommand ( ) . getTargetTitle ( ) ; title = DBProperties . getProperty ( key ) ; if ( title != null && getCallInstance ( ) != null ) { final PrintQuery print = new PrintQuery ( getCallInstance ( ) ) ; final ValueParser parser = new ValueParser ( new StringReader ( title ) ) ; final ValueList list = parser . ExpressionString ( ) ; list . makeSelect ( print ) ; if ( print . execute ( ) ) { title = list . makeString ( getCallInstance ( ) , print , TargetMode . VIEW ) ; } // Administration
if ( Configuration . getAttributeAsBoolean ( Configuration . ConfigAttribute . SHOW_OID ) && Context . getThreadContext ( ) . getPerson ( ) . isAssigned ( Role . get ( UUID . fromString ( "1d89358d-165a-4689-8c78-fc625d37aacd" ) ) ) ) { title = title + " " + getCallInstance ( ) . getOid ( ) ; } } } catch ( final EFapsException | ParseException e ) { throw new RestartResponseException ( new ErrorPage ( new EFapsException ( this . getClass ( ) , "" , "Error reading the Title" ) ) ) ; } return title ;


signature:
public class UIGrid { /** * Method used to evaluate the type for this table from the connected
 * events .
 * @ return type if found
 * @ throws EFapsException on error */
protected Type getType ( ) throws EFapsException { } }

implementation:
init ( ) ; final Type ret ; if ( getValues ( ) . isEmpty ( ) ) { final List < EventDefinition > events = getCommand ( ) . getEvents ( EventType . UI_TABLE_EVALUATE ) ; String typeName = null ; if ( events . size ( ) > 1 ) { throw new EFapsException ( this . getClass ( ) , "execute4NoInstance.moreThanOneEvaluate" ) ; } else { final EventDefinition event = events . get ( 0 ) ; // test for basic or abstract types
if ( event . getProperty ( "Type" ) != null ) { typeName = event . getProperty ( "Type" ) ; } // no type yet search alternatives
if ( typeName == null ) { for ( int i = 1 ; i < 100 ; i ++ ) { final String nameTmp = "Type" + String . format ( "%02d" , i ) ; if ( event . getProperty ( nameTmp ) != null ) { typeName = event . getProperty ( nameTmp ) ; } else { break ; } } } } ret = typeName == null ? null : Type . get ( typeName ) ; } else { ret = getValues ( ) . get ( 0 ) . getInstance ( ) . getType ( ) ; } return ret ;


signature:
public class UIGrid { /** * Checks if is date filter .
 * @ param _ filter the filter
 * @ return true , if is date filter
 * @ throws EFapsException the e faps exception */
public boolean isDateFilter ( final IFilter _filter ) throws EFapsException { } }

implementation:
final boolean ret ; final Field field = Field . get ( _filter . getFieldId ( ) ) ; // Explicitly set UIProvider
if ( field . getUIProvider ( ) != null && ( field . getUIProvider ( ) instanceof DateTimeUI || field . getUIProvider ( ) instanceof DateUI ) ) { ret = true ; } else { final Attribute attr = getType ( ) . getAttribute ( field . getAttribute ( ) ) ; if ( attr == null ) { ret = false ; } else { final IUIProvider uiProvider = attr . getAttributeType ( ) . getUIProvider ( ) ; ret = uiProvider instanceof DateTimeUI || uiProvider instanceof DateUI ; } } return ret ;


signature:
public class UIGrid { /** * Reload .
 * @ throws EFapsException the e faps exception */
public void reload ( ) throws EFapsException { } }

implementation: if ( ! this . initialized ) { init ( ) ; } else { this . values . clear ( ) ; Context . getThreadContext ( ) . setSessionAttribute ( getCacheKey ( CacheKey . DBFILTER ) , this . filterList ) ; load ( getInstances ( ) ) ; }


signature:
public class UIGrid { /** * Gets the row for id .
 * @ param _ rowId the row id
 * @ return the row for id
 * @ throws EFapsException the e faps exception */
public GridRow getRow4Id ( final String _rowId ) throws EFapsException { } }

implementation: final String [ ] rowIds = _rowId . split ( "-" ) ; GridRow row = null ; for ( final String id : rowIds ) { if ( row == null ) { row = getValues ( ) . get ( Integer . parseInt ( id ) ) ; } else { row = row . getChildren ( ) . get ( Integer . parseInt ( id ) ) ; } } return row ;


signature:
public class UIGrid { /** * Gets the .
 * @ param _ commandUUID the command UUID
 * @ param _ pagePosition the page position
 * @ return the UI grid */
public static UIGrid get ( final UUID _commandUUID , final PagePosition _pagePosition ) { } }

implementation: final UIGrid ret = new UIGrid ( ) ; ret . setCmdUUID ( _commandUUID ) . setPagePosition ( _pagePosition ) ; return ret ;


signature:
public class UIGrid { /** * Prints the .
 * @ param _ uiGrid the ui grid
 * @ return the file */
public static File print ( final UIGrid _uiGrid ) { } }

implementation: File ret = null ; final String clazzName = Configuration . getAttribute ( ConfigAttribute . GRIDPRINTESJP ) ; try { UIGrid . LOG . debug ( "Print method executed for {}" , _uiGrid ) ; final Class < ? > clazz = Class . forName ( clazzName , false , EFapsClassLoader . getInstance ( ) ) ; final EventExecution event = ( EventExecution ) clazz . newInstance ( ) ; final Parameter param = new Parameter ( ) ; param . put ( ParameterValues . PARAMETERS , Context . getThreadContext ( ) . getParameters ( ) ) ; param . put ( ParameterValues . CLASS , _uiGrid ) ; final Return retu = event . execute ( param ) ; if ( retu != null ) { ret = ( File ) retu . get ( ReturnValues . VALUES ) ; } } catch ( final ClassNotFoundException | InstantiationException | IllegalAccessException e ) { UIGrid . LOG . error ( "Catched" , e ) ; } catch ( final EFapsException e ) { UIGrid . LOG . error ( "Catched" , e ) ; } return ret ;


signature:
public class IndexSearch { /** * Gets the query .
 * @ return the query */
protected String getQuery ( ) { } }

implementation: final StringBuilder ret = new StringBuilder ( ) ; try { final String clazzname ; if ( EFapsSystemConfiguration . get ( ) . containsAttributeValue ( "org.efaps.kernel.index.QueryBuilder" ) ) { clazzname = EFapsSystemConfiguration . get ( ) . getAttributeValue ( "org.efaps.kernel.index.QueryBuilder" ) ; } else { clazzname = "org.efaps.esjp.admin.index.LucenceQueryBuilder" ; } final Class < ? > clazz = Class . forName ( clazzname , false , EFapsClassLoader . getInstance ( ) ) ; final Object obj = clazz . newInstance ( ) ; final Method method = clazz . getMethod ( "getQuery4DimValues" , String . class , List . class , List . class ) ; final Object newQuery = method . invoke ( obj , getCurrentQuery ( ) , getIncluded ( ) , getExcluded ( ) ) ; ret . append ( newQuery ) ; } catch ( final EFapsException | ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException e ) { IndexSearch . LOG . error ( "Catched" , e ) ; ret . append ( getCurrentQuery ( ) ) ; } return ret . toString ( ) ;


signature:
public class IndexSearch { /** * Gets the excluded .
 * @ return the excluded */
private List < DimValue > getExcluded ( ) { } }

implementation: final List < DimValue > ret = new ArrayList < > ( ) ; for ( final DimTreeNode node : getDimensionProvider ( ) . getRootList ( ) ) { ret . addAll ( node . getExcluded ( ) ) ; } return ret ;


signature:
public class IndexSearch { /** * Check if a dimension filter applied .
 * @ param _ nodes the nodes
 * @ return true , if successful */
private boolean dimFilterApplied ( final List < DimTreeNode > _nodes ) { } }

implementation: final List < DimTreeNode > nodes = _nodes == null ? getDimensionProvider ( ) . getRootList ( ) : _nodes ; boolean ret = false ; for ( final DimTreeNode node : nodes ) { if ( node . getStatus ( ) != null ) { ret = true ; break ; } ret = dimFilterApplied ( node . getChildren ( ) ) ; if ( ret ) { break ; } } return ret ;


signature:
public class IndexSearch { /** * Fill dimension provider .
 * @ param _ updateDim the update dim */
private void fillDimensionProvider ( final boolean _updateDim ) { } }

implementation:
final DimensionProvider provider = getDimensionProvider ( ) ; final Iterator < ? extends DimTreeNode > currentIter = provider . getRoots ( ) ; final List < Dimension > dims = getDimensions ( ) ; if ( _updateDim && dims . isEmpty ( ) ) { provider . getRootList ( ) . clear ( ) ; } else { Collections . sort ( dims , new Comparator < Dimension > ( ) { @ Override public int compare ( final Dimension _arg0 , final Dimension _arg1 ) { final String dim0 = DBProperties . getProperty ( DimensionPanel . class . getName ( ) + "." + _arg0 . getKey ( ) ) ; final String dim1 = DBProperties . getProperty ( DimensionPanel . class . getName ( ) + "." + _arg1 . getKey ( ) ) ; return dim0 . compareTo ( dim1 ) ; } } ) ; final Iterator < Dimension > newDimsIter = dims . iterator ( ) ; while ( currentIter . hasNext ( ) ) { final DimTreeNode current = currentIter . next ( ) ; if ( newDimsIter . hasNext ( ) ) { final Dimension newDim = newDimsIter . next ( ) ; if ( ! newDim . getKey ( ) . equals ( ( ( Dimension ) current . getValue ( ) ) . getKey ( ) ) ) { currentIter . remove ( ) ; } else if ( _updateDim ) { current . update ( newDim . getValues ( ) ) ; } } } // add new ones
while ( newDimsIter . hasNext ( ) ) { final DimTreeNode node = new DimTreeNode ( ) . setValue ( newDimsIter . next ( ) ) ; provider . getRootList ( ) . add ( node ) ; } }


signature:
public class RecentObjectLink { /** * { @ inheritDoc } */
@ Override public void open ( final Component _openComponent ) throws EFapsException { } }

implementation: Page page ; try { page = new ContentContainerPage ( this . menuUUID , getInstance ( ) . getOid ( ) , this . cmdUUID ) ; } catch ( final EFapsException e ) { page = new ErrorPage ( e ) ; } RequestCycle . get ( ) . setResponsePage ( page ) ;


signature:
public class RecentObjectLink { /** * { @ inheritDoc } */
@ Override public String getLabel ( final int _maxLength ) throws EFapsException { } }

implementation: String labelTmp = getLabel ( ) ; if ( labelTmp . length ( ) > _maxLength ) { labelTmp = labelTmp . substring ( 0 , _maxLength - 3 ) + "..." ; } return labelTmp ;


signature:
public class AbstractDojoBehavior { /** * Render the links for the head .
 * @ see org . apache . wicket . behavior . AbstractBehavior # renderHead ( org . apache . wicket . markup . html . IHeaderResponse )
 * @ 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 ( new PriorityHeaderItem ( new DojoHeaderItem ( AbstractDojoBehavior . JS_DOJO , AbstractDojoBehavior . class . getName ( ) ) ) ) ; final String clazz = Configuration . getAttribute ( ConfigAttribute . DOJO_CLASS ) ; ResourceReference reference = null ; if ( "tundra" . equals ( clazz ) ) { reference = AbstractDojoBehavior . CSS_TUNDRA ; } else if ( "claro" . equals ( clazz ) ) { reference = AbstractDojoBehavior . CSS_CLARO ; } else if ( "nihilo" . equals ( clazz ) ) { reference = AbstractDojoBehavior . CSS_NIHILO ; } else if ( "soria" . equals ( clazz ) ) { reference = AbstractDojoBehavior . CSS_TUNDRA ; } if ( reference != null ) { _response . render ( CssHeaderItem . forReference ( reference ) ) ; }


signature:
public class FormPage { /** * Method to add the components to this page .
 * @ throws EFapsException on error */
protected void addComponents ( ) throws EFapsException { } }

implementation: final UIForm uiForm = ( UIForm ) super . getDefaultModelObject ( ) ; if ( ! uiForm . isInitialized ( ) ) { uiForm . execute ( ) ; } final FormContainer form = new FormContainer ( "form" ) ; this . add ( form ) ; form . add ( AttributeModifier . append ( "class" , uiForm . getMode ( ) . toString ( ) ) ) ; if ( uiForm . isMultiPart ( ) && ( uiForm . isCreateMode ( ) || uiForm . isEditMode ( ) ) ) { form . setMultiPart ( true ) ; form . setMaxSize ( this . getApplication ( ) . getApplicationSettings ( ) . getDefaultMaximumUploadSize ( ) ) ; } super . addComponents ( form ) ; final WebMarkupContainer script = new WebMarkupContainer ( "selectscript" ) ; this . add ( script ) ; script . setVisible ( uiForm . isCreateMode ( ) || uiForm . isEditMode ( ) || uiForm . isSearchMode ( ) ) ; FormPage . updateFormContainer ( this , form , uiForm ) ;


signature:
public class FormPage { /** * Method used to update the Form Container .
 * @ param _ page page
 * @ param _ form formcontainer
 * @ param _ uiForm model
 * @ throws EFapsException on error */
public static void updateFormContainer ( final Page _page , final FormContainer _form , final UIForm _uiForm ) throws EFapsException { } }

implementation:
if ( ! _uiForm . isInitialized ( ) ) { _uiForm . execute ( ) ; } // the hidden cells must be marked as not added yet .
for ( final IHidden cell : _uiForm . getHidden ( ) ) { cell . setAdded ( false ) ; } int i = 0 ; final RepeatingView elementRepeater = new RepeatingView ( "elementRepeater" ) ; _form . add ( elementRepeater ) ; for ( final Element element : _uiForm . getElements ( ) ) { switch ( element . getType ( ) ) { case FORM : elementRepeater . add ( new FormPanel ( elementRepeater . newChildId ( ) , _page , Model . of ( _uiForm ) , ( FormElement ) element . getElement ( ) , _form ) ) ; break ; case HEADING : final UIHeading headingmodel = ( UIHeading ) element . getElement ( ) ; elementRepeater . add ( new HeadingPanel ( elementRepeater . newChildId ( ) , Model . of ( headingmodel ) ) ) ; break ; case TABLE : i ++ ; final UIFieldTable fieldTable = ( UIFieldTable ) element . getElement ( ) ; fieldTable . setTableId ( i ) ; final TablePanel table = new TablePanel ( elementRepeater . newChildId ( ) , Model . of ( fieldTable ) , _page ) ; final HeaderPanel header = new HeaderPanel ( elementRepeater . newChildId ( ) , table ) ; elementRepeater . add ( header ) ; elementRepeater . add ( table ) ; break ; case GRID : final UIFieldGrid grid = ( UIFieldGrid ) element . getElement ( ) ; final GridXPanel gridPanel = new GridXPanel ( elementRepeater . newChildId ( ) , Model . of ( grid ) ) ; elementRepeater . add ( gridPanel ) ; break ; case CLASSIFICATION : elementRepeater . add ( new ClassificationPathPanel ( elementRepeater . newChildId ( ) , Model . of ( ( UIClassification ) element . getElement ( ) ) ) ) ; break ; case STRUCBRWS : i ++ ; final UIFieldStructurBrowser strBrwsr = ( UIFieldStructurBrowser ) element . getElement ( ) ; strBrwsr . setTableId ( i ) ; final StructurBrowserTreeTablePanel strucBrws = new StructurBrowserTreeTablePanel ( elementRepeater . newChildId ( ) , Model . of ( strBrwsr ) ) ; elementRepeater . add ( strucBrws ) ; break ; case SUBFORM : final UIFieldForm uiFieldForm = ( UIFieldForm ) element . getElement ( ) ; if ( ! uiFieldForm . isInitialized ( ) ) { if ( uiFieldForm . getInstance ( ) == null && uiFieldForm . isCreateMode ( ) ) { uiFieldForm . setInstanceKey ( _uiForm . getInstanceKey ( ) ) ; } uiFieldForm . execute ( ) ; } final List < Element > elements = uiFieldForm . getElements ( ) ; for ( final Element subElement : elements ) { if ( subElement . getType ( ) . equals ( ElementType . FORM ) ) { elementRepeater . add ( new FormPanel ( elementRepeater . newChildId ( ) , _page , Model . of ( uiFieldForm ) , ( FormElement ) subElement . getElement ( ) , _form ) ) ; } else if ( subElement . getType ( ) . equals ( ElementType . HEADING ) ) { elementRepeater . add ( new HeadingPanel ( elementRepeater . newChildId ( ) , Model . of ( ( UIHeading ) subElement . getElement ( ) ) ) ) ; } else if ( subElement . getType ( ) . equals ( ElementType . TABLE ) ) { i ++ ; final UIFieldTable fieldTable2 = ( UIFieldTable ) subElement . getElement ( ) ; fieldTable2 . setTableId ( i ) ; final TablePanel table2 = new TablePanel ( elementRepeater . newChildId ( ) , Model . of ( fieldTable2 ) , _page ) ; final HeaderPanel header2 = new HeaderPanel ( elementRepeater . newChildId ( ) , table2 ) ; elementRepeater . add ( header2 ) ; elementRepeater . add ( table2 ) ; } } break ; default : break ; } }


signature:
public class GroupsServiceImpl { /** * Build the hierarchy parameters map for a create group request */
private Map < String , Object > buildHierarchyParameters ( final List < String > parents , final List < String > children ) { } }

implementation: final MultiMap < String , Object > parameters = new MultiMap < > ( ) ; if ( parents != null ) { for ( final String parent : parents ) { parameters . put ( "parents" , parent ) ; } } if ( children != null ) { for ( final String child : children ) { parameters . put ( "children" , child ) ; } } return parameters ;


signature:
public class XMLFileFilter { /** * Matches a file resource for being an XML file with a specific root
 * element .
 * @ param fileResource
 * The file resource .
 * @ param path
 * The path of the file resource .
 * @ param expectedRootElement
 * The expected local name of the root element .
 * @ return ` true ` If the file is an XML file and contains the
 * expected root element .
 * @ throws IOException
 * If the file resource cannot be read . */
public static boolean rootElementMatches ( FileResource fileResource , String path , String expectedRootElement ) throws IOException { } }

implementation: try ( InputStream stream = fileResource . createStream ( ) ) { XMLStreamReader reader = factory . createXMLStreamReader ( stream ) ; while ( reader . hasNext ( ) ) { int event = reader . next ( ) ; switch ( event ) { case XMLStreamConstants . START_ELEMENT : String rootElement = reader . getLocalName ( ) ; return expectedRootElement . equals ( rootElement ) ; } } } catch ( XMLStreamException e ) { LOGGER . warn ( "Cannot parse XML file '{}'." , path ) ; } return false ;


signature:
public class Example { /** * Simple Test */
public static void main ( final String [ ] args ) throws Throwable { } }

implementation: final Preferences config = Preferences . systemNodeForPackage ( Example . class ) ; System . out . println ( config . get ( "mykey" , "my-default-value1" ) ) ; System . out . println ( config . get ( "mykey2" , "my-default-value2" ) ) ; System . out . println ( config . get ( "other.key" , "my-default-value3" ) ) ; System . out . println ( config . get ( "urlbase" , "my-default-value4" ) ) ; System . out . println ( config . get ( "urlsearch" , "my-default-value5" ) ) ;


signature:
public class CustomMapper { /** * Map PropertyName in format " keyName : default - value " to
 * { @ link ClassLoaderMap # get ( ClassLoader , String , String ) } or { @ link System # getProperty ( String ) } or
 * { @ code default - value }
 * @ param propName string in format keyName [ : default - value ]
 * @ return maped value */
@ Override public String map ( final String propName ) { } }

implementation: if ( propName == null ) return null ; String keyName = propName , defValue = null ; final int offsetDefault = propName . indexOf ( ':' ) ; if ( offsetDefault != - 1 ) { keyName = propName . substring ( 0 , offsetDefault ) ; defValue = propName . substring ( offsetDefault + 1 ) ; } final ClassLoader ctxLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; String value = ClassLoaderMap . get ( ctxLoader , keyName , null ) ; if ( value == null ) { value = System . getProperty ( propName , defValue ) ; } return value ;


signature:
public class ClusteredRedisCacheFactory { /** * Creates a new { @ link JedisCluster } , with default timeout .
 * @ param hostsAndPorts
 * format { @ code host1 : port1 , host2 : port2 . . . }
 * @ param password
 * @ return */
public static JedisCluster newJedisCluster ( String hostsAndPorts , String password ) { } }

implementation: return newJedisCluster ( hostsAndPorts , password , Protocol . DEFAULT_TIMEOUT ) ;


signature:
public class ClusteredRedisCacheFactory { /** * Creates a new { @ link JedisCluster } .
 * @ param hostsAndPorts
 * format { @ code host1 : port1 , host2 : port2 . . . }
 * @ param password
 * @ param timeoutMs
 * @ return */
public static JedisCluster newJedisCluster ( String hostsAndPorts , String password , long timeoutMs ) { } }

implementation:
final int maxTotal = Runtime . getRuntime ( ) . availableProcessors ( ) ; final int maxIdle = maxTotal / 2 ; JedisPoolConfig poolConfig = new JedisPoolConfig ( ) ; poolConfig . setMaxTotal ( maxTotal ) ; poolConfig . setMinIdle ( 1 ) ; poolConfig . setMaxIdle ( maxIdle > 0 ? maxIdle : 1 ) ; poolConfig . setMaxWaitMillis ( timeoutMs + 1000 ) ; // poolConfig . setTestOnBorrow ( true ) ;
poolConfig . setTestWhileIdle ( true ) ; Set < HostAndPort > clusterNodes = new HashSet < > ( ) ; String [ ] hapList = hostsAndPorts . split ( "[,;\\s]+" ) ; for ( String hostAndPort : hapList ) { String [ ] tokens = hostAndPort . split ( ":" ) ; String host = tokens . length > 0 ? tokens [ 0 ] : Protocol . DEFAULT_HOST ; int port = tokens . length > 1 ? Integer . parseInt ( tokens [ 1 ] ) : Protocol . DEFAULT_PORT ; clusterNodes . add ( new HostAndPort ( host , port ) ) ; } JedisCluster jedisCluster = new JedisCluster ( clusterNodes , ( int ) timeoutMs , ( int ) timeoutMs , DEFAULT_MAX_ATTEMPTS , password , poolConfig ) ; return jedisCluster ;


signature:
public class XMemcachedCache { /** * Attach a { @ link XMemcachedConnector } to this cache .
 * @ param memcachedConnector
 * @ param setMyOwnMemcachedConnector
 * set { @ link # myOwnMemcachedConnector } to { @ code true } or not .
 * @ return
 * @ since 0.6.3.3 */
protected XMemcachedCache setMemcachedConnector ( XMemcachedConnector memcachedConnector , boolean setMyOwnMemcachedConnector ) { } }

implementation: if ( myOwnMemcachedConnector && this . memcachedConnector != null ) { this . memcachedConnector . close ( ) ; } this . memcachedConnector = memcachedConnector ; myOwnMemcachedConnector = setMyOwnMemcachedConnector ; return this ;


signature:
public class XMemcachedCache { /** * { @ inheritDoc } */
@ Override public XMemcachedCache init ( ) { } }

implementation:
super . init ( ) ; long expireAfterWrite = getExpireAfterWrite ( ) ; long expireAfterAccess = getExpireAfterAccess ( ) ; if ( expireAfterAccess > 0 || expireAfterWrite > 0 ) { timeToLiveSeconds = expireAfterAccess > 0 ? expireAfterAccess : expireAfterWrite ; } else { timeToLiveSeconds = - 1 ; } /* * Parse custom property : key - mode */
KeyMode oldKeyMode = this . keyMode ; try { this . keyMode = KeyMode . valueOf ( getCacheProperty ( CACHE_PROP_KEY_MODE ) . toUpperCase ( ) ) ; } catch ( Exception e ) { this . keyMode = oldKeyMode ; if ( getCacheProperty ( CACHE_PROP_KEY_MODE ) != null ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } } /* * Parse custom property : ttl - seconds */
long oldTTL = this . timeToLiveSeconds ; try { this . timeToLiveSeconds = Long . parseLong ( getCacheProperty ( CACHE_PROP_TTL_SECONDS ) ) ; } catch ( Exception e ) { this . timeToLiveSeconds = oldTTL ; if ( getCacheProperty ( CACHE_PROP_TTL_SECONDS ) != null ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } } /* * Parse custom property : memcached - hosts - and - ports */
String hostsAndPorts = getCacheProperty ( CACHE_PROP_MEMCACHED_HOSTS_AND_PORTS ) ; if ( ! StringUtils . isBlank ( hostsAndPorts ) ) { this . memcachedHostsAndPorts = hostsAndPorts ; } if ( memcachedConnector == null ) { try { memcachedConnector = buildXmemcachedConnector ( ) ; } catch ( Exception e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } myOwnMemcachedConnector = true ; } return this ;


signature:
public class XMemcachedCache { /** * { @ inheritDoc } */
@ Override public void destroy ( ) { } }

implementation: try { super . destroy ( ) ; } finally { if ( memcachedConnector != null && myOwnMemcachedConnector ) { try { memcachedConnector . destroy ( ) ; } catch ( Exception e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } finally { memcachedConnector = null ; } } }


signature:
public class XMemcachedCache { /** * { @ inheritDoc } */
@ Override public void set ( String key , Object entry ) { } }

implementation: if ( entry instanceof CacheEntry ) { CacheEntry ce = ( CacheEntry ) entry ; set ( key , ce , ce . getExpireAfterWrite ( ) , ce . getExpireAfterAccess ( ) ) ; } else { set ( key , entry , getExpireAfterWrite ( ) , getExpireAfterAccess ( ) ) ; }


signature:
public class XMemcachedCache { /** * { @ inheritDoc } */
@ Override public void set ( String key , Object entry , long expireAfterWrite , long expireAfterAccess ) { } }

implementation: long ttl = TTL_NO_CHANGE ; if ( ! ( entry instanceof CacheEntry ) ) { CacheEntry ce = new CacheEntry ( key , entry , expireAfterWrite , expireAfterAccess ) ; entry = ce ; ttl = expireAfterAccess > 0 ? expireAfterAccess : ( expireAfterWrite > 0 ? expireAfterWrite : ( timeToLiveSeconds > 0 ? timeToLiveSeconds : 0 ) ) ; } else { CacheEntry ce = ( CacheEntry ) entry ; ttl = ce . getExpireAfterAccess ( ) ; } byte [ ] _data = serializeCacheEntry ( ( CacheEntry ) entry ) ; String data = Base64 . encodeBase64String ( _data ) ; final int TTL = ( int ) ttl ; switch ( keyMode ) { case MONOPOLISTIC : case NAMESPACE : { final String KEY = keyMode == KeyMode . MONOPOLISTIC ? key : calcCacheKeyNamespace ( key ) ; try { getMemcachedClient ( ) . set ( KEY , TTL , data ) ; } catch ( Exception e ) { throw e instanceof CacheException ? ( CacheException ) e : new CacheException ( e ) ; } break ; } case XNAMESPACE : { try { getMemcachedClient ( ) . withNamespace ( getName ( ) , new MemcachedClientCallable < Void > ( ) { @ Override public Void call ( MemcachedClient client ) throws MemcachedException , InterruptedException , TimeoutException { client . set ( key , TTL , data ) ; return null ; } } ) ; } catch ( Exception e ) { throw e instanceof CacheException ? ( CacheException ) e : new CacheException ( e ) ; } break ; } default : throw new IllegalStateException ( "Invalid key mode: " + keyMode ) ; }


signature:
public class XMemcachedCache { /** * { @ inheritDoc } */
@ Override public void delete ( String key ) { } }

implementation: switch ( keyMode ) { case MONOPOLISTIC : case NAMESPACE : final String KEY = keyMode == KeyMode . MONOPOLISTIC ? key : calcCacheKeyNamespace ( key ) ; try { getMemcachedClient ( ) . deleteWithNoReply ( KEY ) ; } catch ( Exception e ) { throw e instanceof CacheException ? ( CacheException ) e : new CacheException ( e ) ; } break ; case XNAMESPACE : try { getMemcachedClient ( ) . withNamespace ( getName ( ) , new MemcachedClientCallable < Void > ( ) { @ Override public Void call ( MemcachedClient client ) throws InterruptedException , MemcachedException { client . deleteWithNoReply ( key ) ; return null ; } } ) ; } catch ( Exception e ) { throw e instanceof CacheException ? ( CacheException ) e : new CacheException ( e ) ; } break ; default : throw new IllegalStateException ( "Invalid key mode: " + keyMode ) ; }