A Configuring Oracle Multimedia JSP Tag Library

This appendix provides information on configuring the Oracle Multimedia JSP Tag Library within Oracle Database and other environments.

This appendix includes the following sections:

For details about installation and configuration, see the online README.txt file included in this kit.

Note:

In this appendix, <ORACLE_HOME> represents the Oracle home directory.

A.1 Prerequisite Products

You must have installed the following products on your system before using the Oracle Multimedia JSP Tag Library:

A.2 Oracle Multimedia JSP Tag Library Components

The Oracle Multimedia JSP Tag Library is packaged with a set of components in the JAR file ordjsptag.jar. Table A-1 lists the components in this file.

Table A-1 Components of the Oracle Multimedia JSP Tag Library

Name Description

ordim-tag-library

The Java class library

multimedia-taglib.tld

The tag library descriptor (TLD) file

OrdGetMediaServlet

The default media delivery component


The Oracle Multimedia JSP Tag Library JAR file ordjsptag.jar depends on the following Oracle Multimedia library JAR files:

  • ordim.jar - Contains the Oracle Multimedia Java library.

  • ordhttp.jar - Contains the Oracle Multimedia Servlets and JSP Java library.

Thus, to use the Oracle Multimedia JSP Tag Library, applications must package the JAR files ordim.jar and ordhttp.jar with the application or configure those files with the application server.

The Oracle Multimedia library JAR files are available with the Oracle installation, in the directory <ORACLE_HOME>/ord/jlib.

A.3 Configuring Oracle Multimedia JSP Tag Library with Applications

This section describes configuration parameters and deployment configurations that you might have to specify when deploying your application with the Oracle Multimedia JSP Tag Library.

A.3.1 Specifying the TLD File in a JSP Page

The Oracle Multimedia JSP Tag Library tag library descriptor (TLD) file is included in the Oracle Multimedia JSP Tag Library JAR file (ordjsptag.jar). To use the Oracle Multimedia JSP Tag Library in a Web application JSP page, Web applications must use the following namespace as the value of the uri attribute for the JSP taglib directive:

http://xmlns.oracle.com/jsp/ord/multimedia-taglib.tld

A.3.2 Specifying the Media Delivery Component

Oracle Multimedia JSP Tag Library provides two media delivery components, a media delivery servlet and a media delivery JSP page. You can specify the media delivery JSP page or use the media delivery servlet by default. Web applications can specify which media delivery component to use by defining the media-retrieval-path element in the tag library configuration file OrdJspTag.xml.

The media delivery servlet, oracle.ord.im.jsp.OrdGetMediaServlet, is packaged with the tag library. It is the default media delivery component. Specify the virtual path to the servlet in the web.xml file for your Web application, similar to Example A-1:

Example A-1 Virtual Path Specification for the Media Delivery Servlet

<servlet>
    <servlet-name>oracle_ord_im_jsp_media_servlet</servlet-name>
    <servlet-class>oracle.ord.im.jsp.OrdGetMediaServlet</servlet-class>
</servlet>
 
  <servlet-mapping>
    <servlet-name>oracle_ord_im_jsp_media_servlet</servlet-name>
    <url-pattern>/OrdGetMediaServlet</url-pattern>
  </servlet-mapping>

You can download the media delivery JSP page, OrdGetMediaJsp.jsp, from OTN. First, define the JSP page in the tag library configuration file. Then, copy it to the JSP directory for your Web application.

Using a JSP page to deliver media data is convenient because it requires no additional configuration beyond copying the supplied page into the JSP page directory for the application. For performance reasons, however, it might be desirable, or even necessary, to deliver media data from a servlet, rather than a JSP page.

A.3.3 Authorizing Access to Media Data

All Oracle Multimedia JSP Tag Library actions that construct URLs also register table name and column name information within each user session. By default, the media delivery components verify this information when responding to a media retrieval request. If the verification check fails, media retrieval requests are rejected. Such verification ensures that malicious users cannot retrieve media data from any data source, table, or column using user-created URLs.

Some applications must support general access to specific tables and columns. For example, applications where media URLs might be exchanged by users in mail messages might need such access to data. For these applications, a mechanism is provided to enable anyone to access columns in tables in specific data sources. This mechanism involves setting the access-control attribute within the tag library configuration file OrdJspTag.xml.

Note:

To use this mechanism, applications must specify database connection information using a dataSourceName attribute in the tag.

A.3.4 Setting Cache Control Attributes

Oracle Multimedia JSP Tag Library permits limited setting of cache control attributes. In this version, you can set the max-age, no-store, or no-store-remote directives of the Surrogate-Control header for all media retrieved from a particular named column in a specified table. The values of these directives are specified by the tag attributes expiration and cache.

expiration Attribute

The format for the expiration attribute is as follows:

expiration_time[+removal_time]

where:

  • expiration_time: the time-to-live (TTL), in seconds.

  • removal_time: the delay, in seconds, before the resource is removed from the cache after it expires.

This example specifies the expiration time only: 1800

This example specifies both the expiration time and the removal time: 10000+600

cache Attribute

The values for the cache attribute are: no, no-remote, or yes.

The values no and no-remote are translated into the no-store and no-store-remote directives in the Surrogate-Control header, respectively.

The value yes means that the Web cache is used.

Note:

Applications that require more fine-grained control over setting cache control attributes must either avoid using the Oracle Multimedia JSP Tag Library or design their own media delivery mechanism by replacing the default media delivery component.

For more information about Oracle Web Cache, see media-cache-control-attributes. See also Oracle Fusion Middleware Administrator's Guide for Oracle Web Cache in the Oracle Fusion Middleware Online Documentation Library.

A.3.5 Sample Tag Library Configuration File

This section describes the sample tag library configuration file OrdJspTag.xml. Because this XML file is application-specific, place it in the same directory as the web.xml file for the Web application. The tag library configuration file is read at the first requirement, and then put into application context for further retrieval.

Example A-2 shows the sample tag library configuration file OrdJspTag.xml.

Example A-2 Sample Configuration File

<?xml version="1.0" encoding="ISO-8859-1"?>
 
<!DOCTYPE ordim-tag-library [
<!ELEMENT ordim-tag-library (media-control?, media-access?, media-player*,
    media-retrieval-path?)> 
<!ELEMENT media-control (data-source?)>
<!ELEMENT data-Source (table+)>
<!ELEMENT table (column+)>
<!ELEMENT column (access-control)> 
<!ELEMENT access-control EMPTY>
<!ELEMENT media-access (access-unit+)>
<!ELEMENT access-unit EMPTY>
<!ELEMENT media-player (class-id)> 
<!ELEMENT class-id EMPTY>
<!ELEMENT media-retrieval-path (#PCDATA)> 
<!ATTLIST media-control filtering (true | false) #IMPLIED>
<!ATTLIST data-source name CDATA #REQUIRED>
<!ATTLIST table name CDATA #REQUIRED>
<!ATTLIST column name CDATA #REQUIRED>
<!ATTLIST access-control enabled (true | false) #REQUIRED>
<!ATTLIST access-unit name CDATA #REQUIRED>
<!ATTLIST access-unit dataSourceName CDATA #IMPLIED>
<!ATTLIST access-unit table CDATA #REQUIRED>
<!ATTLIST access-unit keyColumn CDATA #IMPLIED>
<!ATTLIST access-unit column CDATA #REQUIRED>
<!ATTLIST access-unit expiration CDATA #IMPLIED>
<!ATTLIST access-unit cache (yes|no|no-remote) #IMPLIED>
<!ATTLIST media-player name (mediaPlayer|realPlayer|quicktimePlayer) #REQUIRED>
<!ATTLIST class-id clsid CDATA #REQUIRED>
 ]>

<ordim-tag-library>
<media-control filtering="true">
  <data-source name="myMediaDataDS">
    <table name="public_photos">
      <column name="photo">
        <access-control enabled="false"/>
      </column>
      <column name="thumb">
        <access-control enabled="false"/>
      </column>
    </table>
    <table name="public_videos">
      <column name="movie">
        <access-control enabled="false"/>
      </column>
    </table>
  </data-source>
</media-control>
<media-access>
  <access-unit name="photoUnit" 
                 dataSourceName="myMediaDataDS" 
                 table="public_photos" 
                 keyColumn="ename" 
                 column="photo"
                 expiration="3600+60"/>
  <access-unit name="thumbUnit" 
                 dataSourceName="myMediaDataDS" 
                 table="public_photos" 
                 keyColumn="ename" 
                 column="photo"
                 expiration="3600+60"/>
  <access-unit name="movieUnit" 
                 dataSourceName="myMediaDataDS" 
                 table="public_videos" 
                 column="movie"
                 expiration="3600+60"
                 cache="no"/>
  <access-unit name="mp3Unit" 
                 table="musics" 
                 column="mp3"
                 expiration="3600+60"
                 cache="no"/>
</media-access>
<media-player name="mediaPlayer">
  <class-id clsid="22D6F312-B0F6-11D0-94AB-0080C74C7E95"/>
</media-player>
<media-retrieval-path>
  GetMediaServlet
</media-retrieval-path>
</ordim-tag-library>

The OrdJspTag.xml file contains these elements, which provide the media retrieval tags with flexibility and simplicity:

  • media-control

  • media-access

  • media-player

  • media-retrieval-path

media-control Element

The media-control element is used to control access to the media data. This element is optional. By default, media data can be accessed only within the session in which the media retrieval tags are used. However, to make the media data accessible to all clients (including clients outside the session), the application manager can set the enabled attribute of the access-control subelement to false.

The filtering attribute of the media-control subelement can be set to true. This setting ensures that the media delivery component filters the special characters when HTML files are delivered to the browser.

media-access Element

The media-access element is used to define media access units, thus simplifying usage of the media retrieval tags. This element is optional. Each access-unit subelement defines a media access unit with a name and attributes that correspond to the following media retrieval tag common attributes: database-connection-attributes, table-and-column-attributes, and media-cache-control-attributes. The attributes defined in each media access unit can be overridden by the attributes defined in the media retrieval tag.

media-player Element

The media-player element defines the class identifier (clsid) used in the generated HTML <OBJECT> tag for the media player. This element is defined only when an application requires a specific media player in the Internet Explorer browser.

media-retrieval-path Element

The media-retrieval-path element is used to specify the media delivery component used by the Oracle Multimedia JSP Tag Library. This element is defined only when an application requires a media delivery component other than the default media delivery component (OrdGetMediaServlet).