org.eclnt.jsfserver.resources

## Class ResourceManager

- java.lang.Object
- - org.eclnt.jsfserver.resources.ResourceManager

-     public class ResourceManager
      extends java.lang.Object

  Access to default resource management of CaptainCasa Enterprise Client. The resource management allows to access text (or other) resource via #{rr.resourceName.key} expression. It internally resolves a resource bundle. - Via the functions of this class you also can access the resource management from your program, e.g. for accessing literals at runtime.
  The key methods are:
  `getRuntimeInstance()`
  `readProperty(String, String)`
  The configuration is done by accessing configuration file /eclntjsfserver/config/resources.xml. In addition there is a runtime configuration which is done through method `addResourceConfiguration(String, String, String)`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ResourceManager.MyParser`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceManager()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addResourceConfiguration(java.lang.String resourceName, java.lang.String packageName, java.lang.String defaultValue)` Runtime configuration interface to add resources dynamically via API.
    `static java.lang.String` | `findLiteral(java.lang.String resourceName, java.lang.String literalId)` Find text for a resource / literal-id within the current runtime instance.
    `static java.lang.String` | `findLiteral(java.lang.String resourceName, java.lang.String literalId, java.util.Locale locale)` Find text for a resource / literal-id within the current runtime instance.
    `static java.lang.String` | `findText(java.lang.String text)` If the text is an id ("#{rr.xxx.yyy}", or "#{rr.xxx['yyy']}") ==> return text, that is defined behind the literal.
    `static ResourceManager` | `getInstanceViaFileSystem(java.lang.String resourcesConfigDirectory)` Passes back an instance for a given file name.
    `java.lang.String` | `getResourceReaderExpression(java.lang.String resource)`
    `java.util.Map<java.lang.String,java.lang.String>` | `getResources()`
    `static ResourceManager` | `getRuntimeInstance()` Passes back the default runtime instance that is used within the current web application.
    `static void` | `init(ServletContext context)` Initialization of the runtime instance.
    `java.lang.String` | `readProperty(java.lang.String resourceName, java.lang.String property)` Read text for property within the resource bundle.
    `java.lang.String` | `readProperty(java.lang.String resourceName, java.lang.String property, java.util.Locale locale)` Read text for property within the resource bundle.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResourceManager

          public ResourceManager()

  - ### Method Detail

    - #### init

          public static void init(ServletContext context)

      Initialization of the runtime instance. Called at startup of Enterprise Client server environment.

    - #### getRuntimeInstance

          public static ResourceManager getRuntimeInstance()

      Passes back the default runtime instance that is used within the current web application. Within the runtime instance resource configuration files are accessed via the web resource reader.

    - #### getInstanceViaFileSystem

          public static ResourceManager getInstanceViaFileSystem(java.lang.String resourcesConfigDirectory)

      Passes back an instance for a given file name. Usage outside the runtime environment, e.g. at design time.

    - #### readProperty

          public java.lang.String readProperty(java.lang.String resourceName,
                                               java.lang.String property,
                                               java.util.Locale locale)

      Read text for property within the resource bundle.

    - #### readProperty

          public java.lang.String readProperty(java.lang.String resourceName,
                                               java.lang.String property)

      Read text for property within the resource bundle.

    - #### getResources

          public java.util.Map<java.lang.String,java.lang.String> getResources()

      Returns:
        Map with resources as defined in eclntjsfserver/config/resources.xml. Key = name of resource, Argument = package name of resource.

    - #### findLiteral

          public static java.lang.String findLiteral(java.lang.String resourceName,
                                                     java.lang.String literalId)

      Find text for a resource / literal-id within the current runtime instance.

    - #### findLiteral

          public static java.lang.String findLiteral(java.lang.String resourceName,
                                                     java.lang.String literalId,
                                                     java.util.Locale locale)

      Find text for a resource / literal-id within the current runtime instance.

    - #### findText

          public static java.lang.String findText(java.lang.String text)

      If the text is an id ("#{rr.xxx.yyy}", or "#{rr.xxx['yyy']}") ==> return text, that is defined behind the literal. If not ("Normal text") then the original text is passed back.

    - #### addResourceConfiguration

          public void addResourceConfiguration(java.lang.String resourceName,
                                               java.lang.String packageName,
                                               java.lang.String defaultValue)

      Runtime configuration interface to add resources dynamically via API. By default resources are added via configuration, but you can also add configuration information at runtime.
      Parameters:
        `resourceName` - Name of the resource file(s).
        `packageName` - Package in which to look for the resource files.
        `defaultValue` - (maybe passed as null) Default value if a literal is not part of the resource files.

    - #### getResourceReaderExpression

          public java.lang.String getResourceReaderExpression(java.lang.String resource)

Copyright © CaptainCasa Gmbh. All Rights Reserved.