Package io.jmix.ui.sys
Class ScreensHelper
java.lang.Object
io.jmix.ui.sys.ScreensHelper
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AccessManagerprotected org.springframework.context.ApplicationContextprotected CurrentAuthenticationprotected Dom4jToolsprotected LayoutLoaderConfigprotected MessageToolsprotected Metadataprotected MetadataToolsprotected Resourcesprotected WindowConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcacheCaption(String key, String value) protected voidcacheScreens(String key, Map<String, String> value) protected booleancheckWindowType(Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType) voidprotected org.dom4j.ElementelementByID(org.dom4j.Element root, String elementId) protected StringfindLookupElementDataAttributeId(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 StringgetCaptionCacheKey(String src, Locale locale) getCompositionAndAssociationFieldNames(MetaClass editedEntityClass, MetaClass targetEntityClass) protected StringgetDataContainerId(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType) getDataElementsIdForComposition(org.dom4j.Element data, Class entityClass, String editedEntityDeId) protected StringgetDatasourceId(org.dom4j.Element window, ScreensHelper.ScreenType filterScreenType) getDefaultBrowseScreen(MetaClass metaClass) getDetailedScreenCaption(WindowInfo windowInfo) getDetailedScreenCaption(WindowInfo windowInfo, Locale locale) protected StringgetDetailedScreenCaption(String caption, String windowId) protected org.dom4j.ElementgetScreenCaption(WindowInfo windowInfo) getScreenCaption(WindowInfo windowInfo, Locale locale) protected StringgetScreenCaption(org.dom4j.Element window, String src) protected StringgetScreenCaption(org.dom4j.Element window, String src, Locale locale) protected StringgetScreensCacheKey(String className, Locale locale, ScreensHelper.ScreenType filterScreenType, List<String> facets, boolean useComplexSearch) protected org.dom4j.ElementgetWindowElement(String src) protected booleanisEntityAvailable(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass, Class entityClass, ScreensHelper.ScreenType filterScreenType, boolean useComplexSearch) protected booleanisEntityAvailableForClass(Class entityClass, String className) protected booleanisEntityAvailableInDataElement(Class entityClass, org.dom4j.Element dataContainer) protected booleanisEntityAvailableInDataElement(Class entityClass, org.dom4j.Element dataElement, String datasourceId) protected booleanisFacetAvailable(org.dom4j.Element window, List<String> facetNames) protected StringpackageFromFilePath(String path) protected StringresolveEditedEntityContainerId(Class<? extends FrameOwner> controllerClass) protected StringresolveLookupComponentId(Class<? extends FrameOwner> controllerClass) protected StringresolveLookupDataContainer(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass) protected StringresolveLookupDatasource(org.dom4j.Element window) voidsortWindowInfos(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
-
captionCache
-
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()
-