PICTURE

Starting with Genero 3.00, the PICTURE element is deprecated and used by GWC for HTML5 applications only.

Note:

UI applications that are using Genero Web Client for JavaScript (GWC-JS), see the PUBLIC_IMAGEPATH under the UA_OUTPUT element instead.

The PICTURE element specifies the picture parameters required by this Web application. It takes an attribute Using, where you can reference a predefined WEB_APPLICATION_PICTURE_COMPONENT (to inherit the picture parameters of that component), or you can specify the path to the image directory by including a PATH element.

Syntax

<PICTURE Using ="componentID">
  <PATH Id="pathID" Type="pathType">Path</PATH>
</PICTURE>

Syntax notes

  1. componentID is the unique identifier for a Web application picture component.

Child elements

The PICTURE element may contain the following child elements:

  1. Zero to many PATH elements.

Usage example

<PICTURE Using="cpn.gwc.html5.picture" />
<PICTURE>
  <PATH>$(connector.uri)/iiug/images</PATH>
</PICTURE>

Each application output map can define a PICTURE element. This element will be used to look for images and resources handled by URLs generated by the resourceURI() SBRE function or the legacy imageURI() SBRE function.

There are several ways to define a PICTURE element:

  1. The PICTURE element can simply refer to a previously defined picture component:

    <?xml version="1.0"?>
    <APPLICATION Parent="defaultgwc"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/2.21/cfextwa.xsd">
      <EXECUTION>
        <PATH>$(res.path.demo.app)/card/src</PATH>
        <MODULE>card.42r</MODULE>
      </EXECUTION>
      <OUTPUT>
        <MAP Id="DUA_HTML5">
        <PICTURE Using="cpn.gwc.picture.appserver"/>
        </MAP>
      </OUTPUT>
    </APPLICATION>
    <?xml version="1.0"?>
    <APPLICATION Parent="defaultgwc"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/2.21/cfextwa.xsd">
      <EXECUTION>
        <PATH>$(res.path.demo.app)/card/src</PATH>
        <MODULE>card.42r</MODULE>
      </EXECUTION>
      <OUTPUT>
        <MAP Id="DUA_HTML5">
        <PICTURE Using="cpn.gwc.picture.webserver"/>
        </MAP>
      </OUTPUT>
    </APPLICATION>
    
  2. The PICTURE element can define its own picture component based on the Web Server behavior:

    <?xml version="1.0"?>
    <APPLICATION Parent="defaultgwc"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/2.21/cfextwa.xsd">
      <EXECUTION>
        <PATH>$(res.path.demo.app)/card/src</PATH>
        <MODULE>card.42r</MODULE>
      </EXECUTION>
      <OUTPUT>
        <MAP Id="DUA_HMTL5">
          <PICTURE>
            <PATH Id="Image" Type="WEBSERVER">$(connector.uri)/card/img</PATH>
          </PICTURE>
        </MAP>
      </OUTPUT>
    </APPLICATION>
    
  3. The PICTURE element can define its own picture component based on the AppServer behavior:

    <?xml version="1.0"?>
    <APPLICATION Parent="defaultgwc"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/2.21/cfextwa.xsd">
      <EXECUTION>
        <PATH>$(res.path.demo.app)/card/src</PATH>
        <MODULE>card.42r</MODULE>
      </EXECUTION>
      <OUTPUT>
        <MAP Id="DUA_HTML5">
          <PICTURE>
            <PATH Id="Image" Type="APPSERVER">
             $(res.path.demo.app)/card/img;$(defaultPicturePath)
            </PATH>
          </PICTURE>
        </MAP>
      </OUTPUT>
    </APPLICATION>
    
  4. For each application output map, you can define several PATH element using different IDs inside a PICTURE element. This allows the use of a mixed mechanism for resource referencing:

    <?xml version="1.0"?>
    <APPLICATION Parent="defaultgwc"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/2.21/cfextwa.xsd">
      <EXECUTION>
        <PATH>$(res.path.demo.app)/card/src</PATH>
        <MODULE>card.42r</MODULE>
      </EXECUTION>
      <OUTPUT>
        <MAP Id="DUA_HTML5">
         <PICTURE Using="cpn.gwc.picture.webserver">
            <PATH Id="AppServerImage" Type="APPSERVER">
             $(res.path.demo.app)/card/img;$(defaultPicturePath)</PATH>
            <PATH Id="WebServerImage" Type="WEBSERVER">
             $(connector.uri)/mypics</PATH>
          </PICTURE>
        </MAP>
      </OUTPUT>
    </APPLICATION>

Parent elements

This element is a child of one of the following elements: MAP