Uploaded image for project: 'Click'
  1. Click
  2. CLK-393

Improve Control resource deployment

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5 M2
    • Fix Version/s: 1.5 M2
    • Component/s: core
    • Labels:
      None

      Description

      Currently Control resource deployment is a two step process:

      #1 override onDeploy and copy the resources to the web folder
      #2 register each Control that must deploy resources in click.xml

      A disadvantage of this approach is that Controls must be instantiated to call their onDeploy method. This means that Context cannot be used in a Control constructor, without explicit checking for Context availability.

      One of the side effects of module support (CLK-347) is that another option became available for deploying resources. This option is based upon convention. When creating a jar containing Click resources simply make the resources available under the folder 'META-INF/web' and Click will automatically copy all the resources to the application web folder. Click will keep the directory structure as defined under 'META-INF/web' when copying resources.

      This makes the deployment a bit easier as everything is done in one step.

      Using this approach there is also no need to instantiate Controls to invoke the deploy method. Thus Context can safely be used in a Control constructor.

        Activity

        Hide
        sabob Bob Schellink added a comment -

        Fix checked into trunk

        Show
        sabob Bob Schellink added a comment - Fix checked into trunk
        Hide
        sabob Bob Schellink added a comment -

        Doco updated, will be available in 1.5-M2

        Show
        sabob Bob Schellink added a comment - Doco updated, will be available in 1.5-M2

          People

          • Assignee:
            sabob Bob Schellink
            Reporter:
            sabob Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development