Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      None

      Description

      Define rule to permit plugins to overwrite spark properties values

      Spark defines values like: Login Page image, background, Application name etc in
      spark.properties or default.properties
      By this task it should be allowed to overwrite such properties from plugin

      1. SPARK-1313.patch
        8 kB
        Mircea Carasel

        Issue Links

          Activity

          Hide
          Mircea Carasel added a comment - - edited

          The attached patch contains:

          -improved Spark Resources management: SparkRes.java and Default.java
          by adding a new SparkPropertyResourceBundle as a wrapper around resource bundles
          instances from SparkRes or Default

          When a property value is retrieved, first is looked in a specific plugin location.
          If not found it falls back to the Spark default property value

          You simply add spark.properties and default.properties with keys/values you want overwritten by plugin
          inside plugin's .jar archive file

          NOTE: this patch needs SPARK-1312 attached patch

          Please review
          Thanks

          Show
          Mircea Carasel added a comment - - edited The attached patch contains: -improved Spark Resources management: SparkRes.java and Default.java by adding a new SparkPropertyResourceBundle as a wrapper around resource bundles instances from SparkRes or Default When a property value is retrieved, first is looked in a specific plugin location. If not found it falls back to the Spark default property value You simply add spark.properties and default.properties with keys/values you want overwritten by plugin inside plugin's .jar archive file NOTE: this patch needs SPARK-1312 attached patch Please review Thanks
          Hide
          Mircea Carasel added a comment -

          I am attaching a test plugin as an example how spark properties values can be overwritten
          The class plugin has no functionality (java source included in jar)

          I changed the application name into: My Spark

          APPLICATION_NAME = My Spark
          in default.properties inside testPlugin.jar

          Show
          Mircea Carasel added a comment - I am attaching a test plugin as an example how spark properties values can be overwritten The class plugin has no functionality (java source included in jar) I changed the application name into: My Spark APPLICATION_NAME = My Spark in default.properties inside testPlugin.jar
          Hide
          Mircea Carasel added a comment -

          The attached patch does not scale very well when many plugins are installed, some of the properties are not correctly overwritten in this schenario.

          I will post a new patch that better handles resource props overriding

          Show
          Mircea Carasel added a comment - The attached patch does not scale very well when many plugins are installed, some of the properties are not correctly overwritten in this schenario. I will post a new patch that better handles resource props overriding
          Hide
          Mircea Carasel added a comment -

          New patch attached
          Patch description:

          -load plugin resources into dedicated HashMaps at plugin loading phase
          -in spark look for plugin key/value pair in hashmaps first. If not found - fall back to spark key-value pair

          Show
          Mircea Carasel added a comment - New patch attached Patch description: -load plugin resources into dedicated HashMaps at plugin loading phase -in spark look for plugin key/value pair in hashmaps first. If not found - fall back to spark key-value pair
          Hide
          Mircea Carasel added a comment -

          commited an improved version of the patch
          we now are offering full spark resource overwriting support through plugin:
          spark.properties, default.properties, spark_118n.properties (including localization) and preferences.properties to overwrite preferences defaults

          r12573 = 8b197eb26154943ea40c9e68346e55fb5d92a889

          Description:

          -improved Spark Resources management: SparkRes.java, Default.java, Res.java, LocalPreferences.java
          by adding a new PluginRes.java that contains hash maps with plugin resource values for
          spark.properties, default.properties, spark_i18n.properties (and localization support), preferences.properties
          that you want to be overwritten in plugin
          The plugin can overwrite few preferences as well in preferences.properties:
          toasterPopup
          notifyOnOffline
          notifyOnOnline
          showTypingNotification
          useAdHocRoom

          PluginManager calls loadPluginResources() to load all plugin resources using the plugin' class loader
          and puts them in dedicated hashMaps.
          When a property value is retrieved, first is looked in the PluginRes corresponding's hashMap.
          If not found it falls back to the Spark default property value

          You simply add spark.properties, default.properties, spark_i18n.properties (and language specific spark_i18n_xx.proeprties),
          preferences.properties with keys/values you want overwritten by plugin inside plugin's .jar archive file

          Show
          Mircea Carasel added a comment - commited an improved version of the patch we now are offering full spark resource overwriting support through plugin: spark.properties, default.properties, spark_118n.properties (including localization) and preferences.properties to overwrite preferences defaults r12573 = 8b197eb26154943ea40c9e68346e55fb5d92a889 Description: -improved Spark Resources management: SparkRes.java, Default.java, Res.java, LocalPreferences.java by adding a new PluginRes.java that contains hash maps with plugin resource values for spark.properties, default.properties, spark_i18n.properties (and localization support), preferences.properties that you want to be overwritten in plugin The plugin can overwrite few preferences as well in preferences.properties: toasterPopup notifyOnOffline notifyOnOnline showTypingNotification useAdHocRoom PluginManager calls loadPluginResources() to load all plugin resources using the plugin' class loader and puts them in dedicated hashMaps. When a property value is retrieved, first is looked in the PluginRes corresponding's hashMap. If not found it falls back to the Spark default property value You simply add spark.properties, default.properties, spark_i18n.properties (and language specific spark_i18n_xx.proeprties), preferences.properties with keys/values you want overwritten by plugin inside plugin's .jar archive file
          Hide
          Mircea Carasel added a comment -

          commited

          r12593 = 5154538af5f9667b329f2d8db5a474bbcd77f3bc

          -make Spark user personal directory configurable through plugin (create dedicated properties key/value pairs in default.properties)

          Show
          Mircea Carasel added a comment - commited r12593 = 5154538af5f9667b329f2d8db5a474bbcd77f3bc -make Spark user personal directory configurable through plugin (create dedicated properties key/value pairs in default.properties)
          Hide
          Walter Ebeling added a comment -

          Mass closing of resolved issues

          Show
          Walter Ebeling added a comment - Mass closing of resolved issues

            People

            • Assignee:
              Mircea Carasel
              Reporter:
              Mircea Carasel
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: