@Component(value="ui_ScreensHelper")
public class ScreensHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
ScreensHelper.ScreenType |
Modifier and Type | Field and Description |
---|---|
protected io.jmix.core.AccessManager |
accessManager |
protected org.springframework.context.ApplicationContext |
applicationContext |
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
availableScreensCache |
protected java.util.Map<java.lang.String,java.lang.String> |
captionCache |
protected io.jmix.core.security.CurrentAuthentication |
currentAuthentication |
protected io.jmix.core.common.xmlparsing.Dom4jTools |
dom4JTools |
protected LayoutLoaderConfig |
layoutLoaderConfig |
protected io.jmix.core.MessageTools |
messageTools |
protected io.jmix.core.Metadata |
metadata |
protected io.jmix.core.MetadataTools |
metadataTools |
protected io.jmix.core.Resources |
resources |
protected WindowConfig |
windowConfig |
Constructor and Description |
---|
ScreensHelper() |
Modifier and Type | Method and Description |
---|---|
protected void |
cacheCaption(java.lang.String key,
java.lang.String value) |
protected void |
cacheScreens(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> value) |
protected boolean |
checkWindowType(java.lang.Class<? extends FrameOwner> controllerClass,
ScreensHelper.ScreenType filterScreenType) |
void |
clearCache() |
protected org.dom4j.Element |
elementByID(org.dom4j.Element root,
java.lang.String elementId) |
protected java.lang.String |
findLookupElementDataAttributeId(org.dom4j.Element lookupElement,
java.lang.String dataAttribute) |
java.util.Map<java.lang.String,java.lang.String> |
getAvailableBrowserScreens(java.lang.Class entityClass) |
java.util.Map<java.lang.String,java.lang.String> |
getAvailableScreens(java.lang.Class entityClass) |
java.util.Map<java.lang.String,java.lang.String> |
getAvailableScreens(java.lang.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)
|
java.util.Map<java.lang.String,java.lang.String> |
getAvailableScreens(java.lang.Class entityClass,
java.util.List<java.lang.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
|
protected java.util.Map<java.lang.String,java.lang.String> |
getAvailableScreensMap(java.lang.Class entityClass,
ScreensHelper.ScreenType filterScreenType,
java.util.List<java.lang.String> facets,
boolean useComplexSearch) |
protected java.lang.String |
getCaptionCacheKey(java.lang.String src,
java.util.Locale locale) |
protected java.util.List<java.lang.String> |
getCompositionAndAssociationFieldNames(io.jmix.core.metamodel.model.MetaClass editedEntityClass,
io.jmix.core.metamodel.model.MetaClass targetEntityClass) |
protected java.lang.String |
getDataContainerId(org.dom4j.Element window,
java.lang.Class<? extends FrameOwner> controllerClass,
ScreensHelper.ScreenType filterScreenType) |
protected java.util.List<java.lang.String> |
getDataElementsIdForComposition(org.dom4j.Element data,
java.lang.Class entityClass,
java.lang.String editedEntityDeId) |
protected java.lang.String |
getDatasourceId(org.dom4j.Element window,
ScreensHelper.ScreenType filterScreenType) |
WindowInfo |
getDefaultBrowseScreen(io.jmix.core.metamodel.model.MetaClass metaClass) |
protected java.lang.String |
getDetailedScreenCaption(java.lang.String caption,
java.lang.String windowId) |
java.lang.String |
getDetailedScreenCaption(WindowInfo windowInfo) |
java.lang.String |
getDetailedScreenCaption(WindowInfo windowInfo,
java.util.Locale locale) |
protected org.dom4j.Element |
getRootLayoutElement(java.lang.String src) |
protected java.lang.String |
getScreenCaption(org.dom4j.Element window,
java.lang.String src) |
protected java.lang.String |
getScreenCaption(org.dom4j.Element window,
java.lang.String src,
java.util.Locale locale) |
java.lang.String |
getScreenCaption(WindowInfo windowInfo) |
java.lang.String |
getScreenCaption(WindowInfo windowInfo,
java.util.Locale locale) |
protected java.lang.String |
getScreensCacheKey(java.lang.String className,
java.util.Locale locale,
ScreensHelper.ScreenType filterScreenType,
java.util.List<java.lang.String> facets,
boolean useComplexSearch) |
protected org.dom4j.Element |
getWindowElement(java.lang.String src) |
protected boolean |
isEntityAvailable(org.dom4j.Element window,
java.lang.Class<? extends FrameOwner> controllerClass,
java.lang.Class entityClass,
ScreensHelper.ScreenType filterScreenType,
boolean useComplexSearch) |
protected boolean |
isEntityAvailableForClass(java.lang.Class entityClass,
java.lang.String className) |
protected boolean |
isEntityAvailableInDataElement(java.lang.Class entityClass,
org.dom4j.Element dataContainer) |
protected boolean |
isEntityAvailableInDataElement(java.lang.Class entityClass,
org.dom4j.Element dataElement,
java.lang.String datasourceId) |
protected boolean |
isFacetAvailable(org.dom4j.Element window,
java.util.List<java.lang.String> facetNames) |
protected java.lang.String |
packageFromFilePath(java.lang.String path) |
protected java.lang.String |
resolveEditedEntityContainerId(java.lang.Class<? extends FrameOwner> controllerClass) |
protected java.lang.String |
resolveLookupComponentId(java.lang.Class<? extends FrameOwner> controllerClass) |
protected java.lang.String |
resolveLookupDataContainer(org.dom4j.Element window,
java.lang.Class<? extends FrameOwner> controllerClass) |
protected java.lang.String |
resolveLookupDatasource(org.dom4j.Element window) |
void |
sortWindowInfos(java.util.List<WindowInfo> windowInfoCollection)
Sorts window infos alphabetically, takes into account $ mark.
|
@Autowired protected WindowConfig windowConfig
@Autowired protected io.jmix.core.MessageTools messageTools
@Autowired protected io.jmix.core.Resources resources
@Autowired protected io.jmix.core.security.CurrentAuthentication currentAuthentication
@Autowired protected io.jmix.core.MetadataTools metadataTools
@Autowired protected io.jmix.core.Metadata metadata
@Autowired protected LayoutLoaderConfig layoutLoaderConfig
@Autowired protected org.springframework.context.ApplicationContext applicationContext
@Autowired protected io.jmix.core.common.xmlparsing.Dom4jTools dom4JTools
@Autowired protected io.jmix.core.AccessManager accessManager
protected java.util.Map<java.lang.String,java.lang.String> captionCache
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> availableScreensCache
public void sortWindowInfos(java.util.List<WindowInfo> windowInfoCollection)
windowInfoCollection
- mutable list of window infos@Nullable public WindowInfo getDefaultBrowseScreen(io.jmix.core.metamodel.model.MetaClass metaClass)
public java.util.Map<java.lang.String,java.lang.String> getAvailableBrowserScreens(java.lang.Class entityClass)
public java.util.Map<java.lang.String,java.lang.String> getAvailableScreens(java.lang.Class entityClass)
public java.util.Map<java.lang.String,java.lang.String> getAvailableScreens(java.lang.Class entityClass, boolean useComplexSearch)
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.public java.util.Map<java.lang.String,java.lang.String> getAvailableScreens(java.lang.Class entityClass, java.util.List<java.lang.String> facets, boolean useComplexSearch)
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.protected java.util.Map<java.lang.String,java.lang.String> getAvailableScreensMap(java.lang.Class entityClass, ScreensHelper.ScreenType filterScreenType, java.util.List<java.lang.String> facets, boolean useComplexSearch)
protected boolean isEntityAvailable(org.dom4j.Element window, java.lang.Class<? extends FrameOwner> controllerClass, java.lang.Class entityClass, ScreensHelper.ScreenType filterScreenType, boolean useComplexSearch)
protected boolean isFacetAvailable(org.dom4j.Element window, java.util.List<java.lang.String> facetNames)
@Nullable protected java.lang.String getDataContainerId(org.dom4j.Element window, java.lang.Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType)
@Nullable protected java.lang.String resolveLookupComponentId(java.lang.Class<? extends FrameOwner> controllerClass)
@Nullable protected java.lang.String resolveLookupDataContainer(org.dom4j.Element window, java.lang.Class<? extends FrameOwner> controllerClass)
protected boolean checkWindowType(java.lang.Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType)
protected java.util.List<java.lang.String> getDataElementsIdForComposition(org.dom4j.Element data, java.lang.Class entityClass, java.lang.String editedEntityDeId)
protected java.util.List<java.lang.String> getCompositionAndAssociationFieldNames(io.jmix.core.metamodel.model.MetaClass editedEntityClass, io.jmix.core.metamodel.model.MetaClass targetEntityClass)
protected boolean isEntityAvailableForClass(java.lang.Class entityClass, java.lang.String className)
protected boolean isEntityAvailableInDataElement(java.lang.Class entityClass, @Nullable org.dom4j.Element dataContainer)
protected boolean isEntityAvailableInDataElement(java.lang.Class entityClass, org.dom4j.Element dataElement, java.lang.String datasourceId)
@Nullable protected java.lang.String resolveEditedEntityContainerId(java.lang.Class<? extends FrameOwner> controllerClass)
@Nullable protected java.lang.String getDatasourceId(org.dom4j.Element window, ScreensHelper.ScreenType filterScreenType)
@Nullable protected java.lang.String resolveLookupDatasource(org.dom4j.Element window)
@Nullable protected java.lang.String findLookupElementDataAttributeId(org.dom4j.Element lookupElement, java.lang.String dataAttribute)
@Nullable protected org.dom4j.Element elementByID(org.dom4j.Element root, java.lang.String elementId)
@Nullable protected org.dom4j.Element getWindowElement(java.lang.String src) throws java.io.FileNotFoundException
java.io.FileNotFoundException
@Nullable protected org.dom4j.Element getRootLayoutElement(java.lang.String src) throws java.io.FileNotFoundException
java.io.FileNotFoundException
@Nullable public java.lang.String getScreenCaption(WindowInfo windowInfo) throws java.io.FileNotFoundException
java.io.FileNotFoundException
@Nullable public java.lang.String getScreenCaption(WindowInfo windowInfo, java.util.Locale locale) throws java.io.FileNotFoundException
java.io.FileNotFoundException
protected java.lang.String getScreenCaption(org.dom4j.Element window, java.lang.String src)
protected java.lang.String getScreenCaption(org.dom4j.Element window, java.lang.String src, java.util.Locale locale)
public java.lang.String getDetailedScreenCaption(WindowInfo windowInfo) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.lang.String getDetailedScreenCaption(WindowInfo windowInfo, java.util.Locale locale) throws java.io.FileNotFoundException
java.io.FileNotFoundException
protected java.lang.String getDetailedScreenCaption(@Nullable java.lang.String caption, java.lang.String windowId)
@Nullable protected java.lang.String packageFromFilePath(java.lang.String path)
protected void cacheCaption(java.lang.String key, java.lang.String value)
protected void cacheScreens(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> value)
protected java.lang.String getCaptionCacheKey(java.lang.String src, java.util.Locale locale)
protected java.lang.String getScreensCacheKey(java.lang.String className, java.util.Locale locale, ScreensHelper.ScreenType filterScreenType, java.util.List<java.lang.String> facets, boolean useComplexSearch)
public void clearCache()