Package io.jmix.ui.sys
Class ScreensHelper
java.lang.Object
io.jmix.ui.sys.ScreensHelper
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected org.springframework.context.ApplicationContext
protected CurrentAuthentication
protected Dom4jTools
protected LayoutLoaderConfig
protected MessageTools
protected Metadata
protected MetadataTools
protected Resources
protected WindowConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
cacheCaption
(String key, String value) protected void
cacheScreens
(String key, Map<String, String> value) protected boolean
checkWindowType
(Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType) void
protected org.dom4j.Element
elementByID
(org.dom4j.Element root, String elementId) protected String
findLookupElementDataAttributeId
(org.dom4j.Element lookupElement, String dataAttribute) getAvailableBrowserScreens
(Class entityClass) getAvailableScreens
(Class entityClass) getAvailableScreens
(Class entityClass, boolean useComplexSearch) Method returns a map of the screens that use the provided entity class in a data element (data container or datasource)getAvailableScreens
(Class entityClass, List<String> facets, boolean useComplexSearch) Method returns a map of the screens that use the provided entity class in a data element (data container or datasource) and contain specific facetsgetAvailableScreensMap
(Class entityClass, ScreensHelper.ScreenType filterScreenType, List<String> facets, boolean useComplexSearch) protected String
getCaptionCacheKey
(String src, Locale locale) getCompositionAndAssociationFieldNames
(MetaClass editedEntityClass, MetaClass targetEntityClass) protected String
getDataContainerId
(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType) getDataElementsIdForComposition
(org.dom4j.Element data, Class entityClass, String editedEntityDeId) protected String
getDatasourceId
(org.dom4j.Element window, ScreensHelper.ScreenType filterScreenType) getDefaultBrowseScreen
(MetaClass metaClass) getDetailedScreenCaption
(WindowInfo windowInfo) getDetailedScreenCaption
(WindowInfo windowInfo, Locale locale) protected String
getDetailedScreenCaption
(String caption, String windowId) protected org.dom4j.Element
getScreenCaption
(WindowInfo windowInfo) getScreenCaption
(WindowInfo windowInfo, Locale locale) protected String
getScreenCaption
(org.dom4j.Element window, String src) protected String
getScreenCaption
(org.dom4j.Element window, String src, Locale locale) protected String
getScreensCacheKey
(String className, Locale locale, ScreensHelper.ScreenType filterScreenType, List<String> facets, boolean useComplexSearch) protected org.dom4j.Element
getWindowElement
(String src) protected boolean
isEntityAvailable
(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass, Class entityClass, ScreensHelper.ScreenType filterScreenType, boolean useComplexSearch) protected boolean
isEntityAvailableForClass
(Class entityClass, String className) protected boolean
isEntityAvailableInDataElement
(Class entityClass, org.dom4j.Element dataContainer) protected boolean
isEntityAvailableInDataElement
(Class entityClass, org.dom4j.Element dataElement, String datasourceId) protected boolean
isFacetAvailable
(org.dom4j.Element window, List<String> facetNames) protected String
packageFromFilePath
(String path) protected String
resolveEditedEntityContainerId
(Class<? extends FrameOwner> controllerClass) protected String
resolveLookupComponentId
(Class<? extends FrameOwner> controllerClass) protected String
resolveLookupDataContainer
(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass) protected String
resolveLookupDatasource
(org.dom4j.Element window) void
sortWindowInfos
(List<WindowInfo> windowInfoCollection) Sorts window infos alphabetically, takes into account $ mark.
-
Field Details
-
windowConfig
-
messageTools
-
resources
-
currentAuthentication
-
metadataTools
-
metadata
-
layoutLoaderConfig
-
applicationContext
@Autowired protected org.springframework.context.ApplicationContext applicationContext -
dom4JTools
-
accessManager
-
availableScreensCache
-
-
Constructor Details
-
ScreensHelper
public ScreensHelper()
-
-
Method Details
-
sortWindowInfos
Sorts window infos alphabetically, takes into account $ mark.- Parameters:
windowInfoCollection
- mutable list of window infos
-
getDefaultBrowseScreen
-
getAvailableBrowserScreens
-
getAvailableScreens
-
getAvailableScreens
Method returns a map of the screens that use the provided entity class in a data element (data container or datasource)- Parameters:
entityClass
- entity class used to searchuseComplexSearch
- if the value is 'true', all screens that use provided entity class in some data element will be returned (including screens for entities that contain the provided class as a composition or association). if value equals 'false', only main screens (browser, lookup, editor) for the provided entity class will be returned.
-
getAvailableScreens
public Map<String,String> getAvailableScreens(Class entityClass, List<String> facets, boolean useComplexSearch) Method returns a map of the screens that use the provided entity class in a data element (data container or datasource) and contain specific facets- Parameters:
entityClass
- entity class used to searchfacets
- facet names used to searchuseComplexSearch
- if the value is 'true', all screens that use provided entity class in some data element will be returned (including screens for entities that contain the provided class as a composition or association). if value equals 'false', only main screens (browser, lookup, editor) for the provided entity class will be returned.
-
getAvailableScreensMap
-
isEntityAvailable
protected boolean isEntityAvailable(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass, Class entityClass, ScreensHelper.ScreenType filterScreenType, boolean useComplexSearch) -
isFacetAvailable
-
getDataContainerId
@Nullable protected String getDataContainerId(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType) -
resolveLookupComponentId
-
resolveLookupDataContainer
@Nullable protected String resolveLookupDataContainer(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass) -
checkWindowType
protected boolean checkWindowType(Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType) -
getDataElementsIdForComposition
-
getCompositionAndAssociationFieldNames
-
isEntityAvailableForClass
-
isEntityAvailableInDataElement
protected boolean isEntityAvailableInDataElement(Class entityClass, @Nullable org.dom4j.Element dataContainer) -
isEntityAvailableInDataElement
-
resolveEditedEntityContainerId
@Nullable protected String resolveEditedEntityContainerId(Class<? extends FrameOwner> controllerClass) -
getDatasourceId
@Nullable protected String getDatasourceId(org.dom4j.Element window, ScreensHelper.ScreenType filterScreenType) -
resolveLookupDatasource
-
findLookupElementDataAttributeId
-
elementByID
-
getWindowElement
- Throws:
FileNotFoundException
-
getRootLayoutElement
- Throws:
FileNotFoundException
-
getScreenCaption
- Throws:
FileNotFoundException
-
getScreenCaption
@Nullable public String getScreenCaption(WindowInfo windowInfo, Locale locale) throws FileNotFoundException - Throws:
FileNotFoundException
-
getScreenCaption
-
getScreenCaption
-
getDetailedScreenCaption
- Throws:
FileNotFoundException
-
getDetailedScreenCaption
public String getDetailedScreenCaption(WindowInfo windowInfo, Locale locale) throws FileNotFoundException - Throws:
FileNotFoundException
-
getDetailedScreenCaption
-
packageFromFilePath
-
cacheCaption
-
cacheScreens
-
getCaptionCacheKey
-
getScreensCacheKey
-
clearCache
public void clearCache()
-