Interface ViewConfigModel


  • public interface ViewConfigModel
    A container for config topics.

    Config topics can be accessed by their type URI. A view config can contain only one config topic with a certain type URI.

    Author:
    Jörg Richter
    • Method Detail

      • getConfigTopic

        TopicModel getConfigTopic​(String configTypeUri)
        Returns:
        the config topic for the given type URI, or null if there is none.
      • addConfigTopic

        ViewConfigModel addConfigTopic​(TopicModel configTopic)
        Adds a config topic to this view config.
        Throws:
        RuntimeException - if this view config already contains a config topic for that type URI.
      • updateConfigTopic

        void updateConfigTopic​(TopicModel configTopic)
        Overrides a config topic with the given one.
        Throws:
        RuntimeException - if this view config does not contain a config topic for that type URI.
      • setConfigValue

        ViewConfigModel setConfigValue​(String configTypeUri,
                                       String childTypeUri,
                                       Object value)
        Sets a single value of a certain config topic. If no such config topic exists in this view config it is created.
        Parameters:
        configTypeUri - The type URI of the config topic, e.g. "dmx.webclient.view_config"
        childTypeUri - The child type URI of the config value to set, e.g. "dmx.webclient.icon"
        value - The config value (String, Integer, Long, Double, or Boolean)
      • getConfigValue

        Object getConfigValue​(String configTypeUri,
                              String childTypeUri)
        ### TODO: drop method? Lookup a view config value.

        Compare to client-side counterpart: function get_view_config() in webclient.js

        Parameters:
        configTypeUri - The type URI of the config topic, e.g. "dmx.webclient.view_config"
        childTypeUri - The child type URI of the config value to lookup, e.g. "dmx.webclient.icon"
        Returns:
        The config value, or null if no value is set
      • toJSONArray

        org.codehaus.jettison.json.JSONArray toJSONArray()