Resource deployment overview

Before deploying applications, it is recommended that you plan how images are going to be used by your applications so as to take advantage of the optimization and caching feature provided by the GAS for Web and GDC applications.

For examples, you can divide your images into these two categories:
Public images
Images that are common or that can be shared by all your applications
Private images
Images that are private or specific to an application

Public images shared by your applications

Images (e.g. logos, background images, etc.) that are common to all or several of your Genero Web Client for JavaScript (GWC-JS) applications and that do not change during an application's lifetime, are considered "public".

This means that at runtime images found in subdirectory paths of the $(res.public.resources) and the $(res.appdata.path)/public/deployment directory (see Paths to application resources) will be put in the browser cache where they can be delivered quickly to the front end without having to access an application's configuration file each time.

You can deploy public images in either of the following ways:
  • Using the fglgar tool. (Recommended):

    Before running fglgar, place public images in a specific directory in the application archive, see Building an archive with public resources. The resources switch of fglgar (e.g. fglgar --resources) specifies the directory in the archive with your public images. Then when you deploy the archive, it is deployed as follows:

    • A subdirectory is created in your $(res.appdata.path)/deployment directory identified by the archive name and the date and time deployed, e.g. $(res.appdata.path)/deployment/myApp1_20150423-130838.

      The application configuration file (xcf) and all the source files contained in the archive (gar) are placed in this directory.

    • Another subdirectory is created in your $(res.appdata.path)/public/deployment/ directory identified by just the archive name, e.g. $(res.appdata.path)/public/deployment/myApp1.

      All the image files contained in the archive's resource directory are copied into this directory and the xcf files of the archive will get updated in order to have their public directory resource $(res.public.resources) set to this directory.

  • Or if you would prefer not to use fglgar, you must then copy your public images by hand into the directory specified in your PUBLIC_IMAGEPATH.
    CAUTION:
    Public images should not be placed in the /public root directory as the fglrun does not look for images to be served via the GAS there. Searches start in subdirectory paths, public/common and public/deployment.

Sample application and image deployment

 │───$(res.appdata.path)
 │     │───deployment
 │     │     │───myApp1_dateTimeStamp (deployed application and private images)
 │     │     │     │───webcomponents (deployed application's Web components)
 │     │───public
 │     │     │───common (default PUBLIC_IMAGEPATH directory containing public images)
 │     │     │      
 │     │     │───deployment 
 │     │     │     │───myApp1 (public images deployed with application by fglgar)

Private images of your application

Private images are resources that are only used by one application. Before deploying, you should place them in the root directory of the application's archive. Then when you deploy the application with fglgar, they will be placed in the $(res.appdata.path)/deployment/ directory created for the application. The fglrun automatically searches for application resources in the application's root directory.
Note: If you change your application’s private resource location down into subdirectories of the root, you will need to ensure that the environment variable FGLIMAGEPATH is included in the application's configuration file (.xcf ) and is configured correctly, as shown in the example.
<ENVIRONMENT_VARIABLE Id="FGLIMAGEPATH">pics$(sep)images$(sep)private/images</ENVIRONMENT_VARIABLE>
You can specify a hierarchy of directories, e.g. "private/images", but then only the $(root)/private/images directory will be searched by fglrun for images, not the parent directory. If there are resources in several subdirectories then you have to specify each subdirectory separately (note $(sep) is a built-in path delimiter which can be used for both Windows® and UNIX™ platforms). For more details on FGLIMAGEPATH, see the Genero Business Development Language User Guide.