Class ApplicationDictionaryCachedStructures


  • @ApplicationScoped
    public class ApplicationDictionaryCachedStructures
    extends Object
    This class caches some AD structures used by the Form Initialization component. Basically, it caches: AD components (fields, columns, auxiliary inputs) and ComboTableData instances. This caching occurs to obtain better performance in FIC computations. For this cache to be used, the system needs to be on 'production' mode, that is, all the modules need to be not in development
    • Constructor Detail

      • ApplicationDictionaryCachedStructures

        public ApplicationDictionaryCachedStructures()
    • Method Detail

      • init

        @PostConstruct
        public void init()
        Resets cache and sets whether cache should be used. This method is automatically invoked on creation.
      • getTab

        public Tab getTab​(String tabId)
        In case caching is enabled, Tab for tabId is returned from cache if present. If it is not, this tab and all the ones in the same window are initialized and cached.

        Note as this method is in charge of doing the full initialization, getWindow(String) or getTab(String) should be invoked before any other getter in this class. Other case, partially initialized object could be cached, being potentially harmful if obtained from another thread and tried to be initialized.

        Parameters:
        tabId - ID of the tab to look for
        Returns:
        Tab for the tabId, from cache if it is enabled
      • getWindow

        public Window getWindow​(String windowId)
        In case caching is enabled, Window for windowId is returned from cache if present. If it is not, this window and its tabs are initialized and cached.

        Note as this method is in charge of doing the full initialization, getWindow(String) or getTab(String) should be invoked before any other getter in this class. Other case, partially initialized object could be cached, being potentially harmful if obtained from another thread and tried to be initialized.

        Parameters:
        windowId - ID of the window to look for
        Returns:
        Window for the windowId, from cache if it is enabled
      • getFieldsOfTab

        public List<Field> getFieldsOfTab​(Tab tab)
      • initializeColumnsOfTable

        public List<Column> initializeColumnsOfTable​(String tableId)
      • getComboTableData

        public ComboTableData getComboTableData​(Field field)
        Returns the combo for the given field from cache if present, if not it also gets cached if applicable.
      • getMethodMetadataParameters

        public List<Parameter> getMethodMetadataParameters​(String strAttMethodId,
                                                           String strTabId)
        Gets the list of parameters associated to an Attachment Method and a Tab. The list is sorted so the fixed parameters are returned first.
        Parameters:
        strAttMethodId - active attachment method id
        strTabId - tab id to take metadata
        Returns:
        List of parameters by attachment method and tab sorted by Fixed and Sequence Number where fixed parameters are first.
      • useCache

        public boolean useCache()
        Can cache be used, AD components are cacheable if there are no modules in development
      • isInDevelopment

        public boolean isInDevelopment()
        Returns:
        true if there are modules in "in development" status. Otherwise, return false
      • isInDevelopment

        public boolean isInDevelopment​(String moduleId)
        Checks whether a module is "in development" status.
        Parameters:
        moduleId - the ID of the AD_Module to be checked if it is in "in development".
        Returns:
        true if the module passed as parameter is in "in development" status. Otherwise, return false
      • setNotInDevelopment

        public void setNotInDevelopment()
        Marks all modules as not in development and updates the cache status