Class ApplicationDictionaryCachedStructures
- java.lang.Object
-
- org.openbravo.client.application.window.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 Summary
Constructors Constructor Description ApplicationDictionaryCachedStructures()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AuxiliaryInput>
getAuxiliarInputList(String tabId)
List<Column>
getColumnsOfTable(String tableId)
ComboTableData
getComboTableData(Field field)
Returns the combo for the given field from cache if present, if not it also gets cached if applicable.List<Field>
getFieldsOfTab(String tabId)
List<Field>
getFieldsOfTab(Tab tab)
List<Parameter>
getMethodMetadataParameters(String strAttMethodId, String strTabId)
Gets the list of parameters associated to an Attachment Method and a Tab.Tab
getTab(String tabId)
In case caching is enabled, Tab for tabId is returned from cache if present.Table
getTable(String tableId)
Window
getWindow(String windowId)
In case caching is enabled, Window for windowId is returned from cache if present.void
init()
Resets cache and sets whether cache should be used.List<Column>
initializeColumnsOfTable(String tableId)
boolean
isInDevelopment()
boolean
isInDevelopment(String moduleId)
Checks whether a module is "in development" status.void
setNotInDevelopment()
Marks all modules as not in development and updates the cache statusboolean
useCache()
Can cache be used, AD components are cacheable if there are no modules in development
-
-
-
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)
orgetTab(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)
orgetTab(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
-
getAuxiliarInputList
public List<AuxiliaryInput> getAuxiliarInputList(String tabId)
-
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 idstrTabId
- 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, returnfalse
-
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, returnfalse
-
setNotInDevelopment
public void setNotInDevelopment()
Marks all modules as not in development and updates the cache status
-
-