Class ScreensHelper

java.lang.Object
io.jmix.ui.sys.ScreensHelper

@Component("ui_ScreensHelper") public class ScreensHelper extends Object
  • Field Details

    • windowConfig

      @Autowired protected WindowConfig windowConfig
    • messageTools

      @Autowired protected MessageTools messageTools
    • resources

      @Autowired protected Resources resources
    • currentAuthentication

      @Autowired protected CurrentAuthentication currentAuthentication
    • metadataTools

      @Autowired protected MetadataTools metadataTools
    • metadata

      @Autowired protected Metadata metadata
    • layoutLoaderConfig

      @Autowired protected LayoutLoaderConfig layoutLoaderConfig
    • applicationContext

      @Autowired protected org.springframework.context.ApplicationContext applicationContext
    • dom4JTools

      @Autowired protected Dom4jTools dom4JTools
    • accessManager

      @Autowired protected AccessManager accessManager
    • captionCache

      protected Map<String,String> captionCache
    • availableScreensCache

      protected Map<String,Map<String,String>> availableScreensCache
  • Constructor Details

    • ScreensHelper

      public ScreensHelper()
  • Method Details

    • sortWindowInfos

      public void sortWindowInfos(List<WindowInfo> windowInfoCollection)
      Sorts window infos alphabetically, takes into account $ mark.
      Parameters:
      windowInfoCollection - mutable list of window infos
    • getDefaultBrowseScreen

      @Nullable public WindowInfo getDefaultBrowseScreen(MetaClass metaClass)
    • getAvailableBrowserScreens

      public Map<String,String> getAvailableBrowserScreens(Class entityClass)
    • getAvailableScreens

      public Map<String,String> getAvailableScreens(Class entityClass)
    • getAvailableScreens

      public Map<String,String> 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)
      Parameters:
      entityClass - entity class used to search
      useComplexSearch - 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 search
      facets - facet names used to search
      useComplexSearch - 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

      protected Map<String,String> getAvailableScreensMap(Class entityClass, ScreensHelper.ScreenType filterScreenType, List<String> facets, boolean useComplexSearch)
    • isEntityAvailable

      protected boolean isEntityAvailable(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass, Class entityClass, ScreensHelper.ScreenType filterScreenType, boolean useComplexSearch)
    • isFacetAvailable

      protected boolean isFacetAvailable(org.dom4j.Element window, List<String> facetNames)
    • getDataContainerId

      @Nullable protected String getDataContainerId(org.dom4j.Element window, Class<? extends FrameOwner> controllerClass, ScreensHelper.ScreenType filterScreenType)
    • resolveLookupComponentId

      @Nullable protected String resolveLookupComponentId(Class<? extends FrameOwner> controllerClass)
    • 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

      protected List<String> getDataElementsIdForComposition(org.dom4j.Element data, Class entityClass, String editedEntityDeId)
    • getCompositionAndAssociationFieldNames

      protected List<String> getCompositionAndAssociationFieldNames(MetaClass editedEntityClass, MetaClass targetEntityClass)
    • isEntityAvailableForClass

      protected boolean isEntityAvailableForClass(Class entityClass, String className)
    • isEntityAvailableInDataElement

      protected boolean isEntityAvailableInDataElement(Class entityClass, @Nullable org.dom4j.Element dataContainer)
    • isEntityAvailableInDataElement

      protected boolean isEntityAvailableInDataElement(Class entityClass, org.dom4j.Element dataElement, String datasourceId)
    • resolveEditedEntityContainerId

      @Nullable protected String resolveEditedEntityContainerId(Class<? extends FrameOwner> controllerClass)
    • getDatasourceId

      @Nullable protected String getDatasourceId(org.dom4j.Element window, ScreensHelper.ScreenType filterScreenType)
    • resolveLookupDatasource

      @Nullable protected String resolveLookupDatasource(org.dom4j.Element window)
    • findLookupElementDataAttributeId

      @Nullable protected String findLookupElementDataAttributeId(org.dom4j.Element lookupElement, String dataAttribute)
    • elementByID

      @Nullable protected org.dom4j.Element elementByID(org.dom4j.Element root, String elementId)
    • getWindowElement

      @Nullable protected org.dom4j.Element getWindowElement(String src) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • getRootLayoutElement

      @Nullable protected org.dom4j.Element getRootLayoutElement(String src) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • getScreenCaption

      @Nullable public String getScreenCaption(WindowInfo windowInfo) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • getScreenCaption

      @Nullable public String getScreenCaption(WindowInfo windowInfo, Locale locale) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • getScreenCaption

      protected String getScreenCaption(org.dom4j.Element window, String src)
    • getScreenCaption

      protected String getScreenCaption(org.dom4j.Element window, String src, Locale locale)
    • getDetailedScreenCaption

      public String getDetailedScreenCaption(WindowInfo windowInfo) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • getDetailedScreenCaption

      public String getDetailedScreenCaption(WindowInfo windowInfo, Locale locale) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • getDetailedScreenCaption

      protected String getDetailedScreenCaption(@Nullable String caption, String windowId)
    • packageFromFilePath

      @Nullable protected String packageFromFilePath(String path)
    • cacheCaption

      protected void cacheCaption(String key, String value)
    • cacheScreens

      protected void cacheScreens(String key, Map<String,String> value)
    • getCaptionCacheKey

      protected String getCaptionCacheKey(String src, Locale locale)
    • getScreensCacheKey

      protected String getScreensCacheKey(String className, Locale locale, ScreensHelper.ScreenType filterScreenType, List<String> facets, boolean useComplexSearch)
    • clearCache

      public void clearCache()