PICTURE

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.

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 WebServer 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 of resources 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>