1 Introduction to Oracle Multimedia JSP Tag Library

Oracle Multimedia provides a custom JavaServer Pages (JSP) tag library that lets users easily generate multimedia HTML tags in JavaServer Pages, and upload multimedia data into Oracle Multimedia objects.

This chapter briefly describes selected Oracle Multimedia and Java concepts to show how the Oracle Multimedia JSP Tag Library fits into a JSP-based multimedia Web application.

This chapter includes the following sections:

1.1 Oracle Multimedia Overview

Oracle Multimedia enables the Oracle Database software to store, retrieve, manage, and manipulate images, audio, video, and other media data, while integrating it with other enterprise information.

Specifically, Oracle Multimedia supports media storage, retrieval, management, and manipulation of media data managed by Oracle Database and stored in one of the following: binary large objects, file-based large objects, URLs that contain media data, and user-defined storage. Oracle Multimedia media storage and retrieval services enhance the management of Web content.

Oracle Multimedia is accessible to applications through both relational and object interfaces. Database applications written in Java, C++, or traditional 3GLs can interact with Oracle Multimedia through modern class library interfaces, or PL/SQL and Oracle Call Interface.

Oracle Multimedia uses object types that are similar to Java or C++ classes to describe media data. These Oracle Multimedia object types are called ORDAudio, ORDDoc, ORDImage, ORDVideo, and ORDDicom. Oracle Multimedia objects have a common media data storage model.

Note:

Currently, Oracle Multimedia JSP Tag Library does not include support for the ORDDicom object type.

See Oracle Multimedia DICOM Developer's Guide for more information about the ORDDicom object type.

Oracle Multimedia also provides Java APIs to support Java application development, including the use of Java servlets and JavaServer Pages (see Section 1.2.2 and Section 1.2.3, respectively).

Oracle Multimedia Java API enables users to write Java applications using Oracle Multimedia objects. Oracle Multimedia lets you store your media information in a database table, retrieve it from the table, and manipulate it. Oracle Multimedia Java API lets you write your own Java applications to use, manipulate, and modify media data stored in the database. Oracle Multimedia Java API lets an application retrieve an object from a result set and manipulate the contents of the object (see Section 1.1.1).

Oracle Multimedia Servlets and JSP Java API facilitates retrieving and uploading media data from and to the database (see Section 1.1.2).

See Oracle Multimedia User's Guide and Oracle Multimedia Reference for additional information about Oracle Multimedia and Oracle Multimedia objects. See Oracle Multimedia Java API Reference and Oracle Multimedia Servlets and JSP Java API Reference for information about using Oracle Multimedia in Java applications.

1.1.1 Media Retrieval Concepts

Oracle Multimedia Servlets and JSP Java API uses the OrdHttpResponseHandler class to retrieve media data from an Oracle database and deliver it to a browser or other HTTP client from a Java servlet or JSP page.

Oracle Multimedia JSP Tag Library provides media retrieval tags, which JSP developers can use to generate complete HTML multimedia tags or create multimedia retrieval URLs for inclusion in the customized use of an HTML multimedia tag. The media retrieval tags are listed and briefly described in Table 1-1.

Table 1-1 Oracle Multimedia JSP Tag Library Media Retrieval Tags

JSP Tag Summary Description

embedAudio

Builds an HTML <OBJECT> tag and <EMBED> tag to embed an audio object in a page.

embedImage

Builds an HTML <IMG> tag to embed an image in a page.

embedVideo

Builds an HTML <OBJECT> tag and <EMBED> tag to embed a video object in a page.

mediaUrl

Generates a media retrieval URL object that can be used in the tag body.


See General Format for Media Retrieval Tags and Media Retrieval URL Format for additional reference information.

1.1.2 Media Upload Concepts

Oracle Multimedia Servlets and JSP Java API uses the OrdHttpUploadFile class to facilitate the handling of uploaded media files. This class provides a simple application programming interface (API) that applications call to load media data into the database.

File uploading using HTML forms encodes form data and uploaded files in POST requests using the multipart/form-data format. The OrdHttpUploadFormData class facilitates the processing of such requests by parsing the POST data and making the contents of regular form fields and the contents of uploaded files readily accessible to a Java servlet or JSP page.

Oracle Multimedia JSP Tag Library provides media upload tags, which facilitate the development of multimedia applications that upload media data into the database. The media upload tags are listed and briefly described in Table 1-2:

Table 1-2 Oracle Multimedia JSP Tag Library Media Upload Tags

JSP Tag Summary Description

storeMedia

Operates within the body of the uploadFormData tag by implicitly using the form-data object created by the uploadFormData tag to load the uploaded media data from the HTML form into the OrdImage, OrdAudio, OrdVideo, or OrdDoc object in the specified table, row, and column in the database.

uploadFile

Operates within the uploadFormData tag to provide access to uploaded file information by using the object created by the uploadFormData tag implicitly.

uploadFormData

Parses the multipart/form-data HTTP request to provide access to text-based form parameters and the contents of uploaded files transmitted from a browser to a Web server.


1.2 Java Concepts

Java is an object-oriented programming language developed by Sun Microsystems. Java programs can run on any computer platform that includes a Java Virtual Machine (JVM). The JVM is a special software environment that compiles the code. It provides the software that the Java program uses to perform tasks including collecting user or system input, displaying information, and allocating memory. Java can be used to develop small Web applications or large network applications.

For more information about Java, see the Web site for Sun Microsystems at

http://java.sun.com

1.2.1 J2EE

Java2 Enterprise Edition (J2EE) is an integrated development environment developed by Sun Microsystems that extends the capabilities of the earlier Java2 Standard Edition (J2SE) platform. Among other features, J2EE supports Java servlets, JSP pages, and XML.

1.2.2 Java Servlets

Java servlets are Java programs that let Web developers extend and enhance the features of a Web server. Java servlets encourage modular programming using the latest features of the Java language, including Java classes and streams. Java servlets can access the latest Java APIs and a collection of calls specific to HTTP. Java servlets are supported on any platform that has a JVM, and a Web server that supports servlets.

Most Java servlets receive requests from a client, generate dynamic HTML text in response, and then send that text back to the client to be displayed by the Web browser. Java servlets can also generate XML text to encapsulate data and send the data to the client or to other parts of the application. Java servlets are often used to create interactive applications.

1.2.3 JavaServer Pages

JavaServer Pages (JSP) technology is an extension of Java servlet technology. It enables users to include portions of Java code in an HTML page or another type of document, such as an XML file.

In a typical JSP page, form is separate from function. The form or layout of information is determined by the JSP page author, while other functions, such as database access, are handled by calls to JavaBeans or by other mechanisms.

1.2.4 JSP Tag Libraries

All JSP tag libraries extend JSP technology. Typically, JSP tag libraries include specific, modular functions encapsulated within a set of tags that can be used by any JSP page.

Custom JSP tag libraries provide the capability to include Java functions without having to enter Java code specifically. Each JSP tag library defines a specialized sublanguage, thus enabling a more natural use of those Java functions with JSP pages. For example, Oracle Containers for Java EE (OC4J) provides the JSP Markup Language (JML) Tag Library. Along with other features, JML enables application developers to write JSP pages that include conditional logic and loop constructs without having to use the syntax for Java code scripts directly.

1.3 Choosing the Appropriate Oracle Multimedia Java Interface

Deciding whether to use Oracle Multimedia Servlets and JSP Java API or the Oracle Multimedia JSP Tag Library depends on the type of application you want to develop and your level of experience with Java programming.

Java servlets and JSP pages offer flexibility by enabling you to customize the application output. This customization requires a moderate level of skill with the Java programming language, and with servlet and JSP technology. Thus, servlets and JSP pages are best suited for complex applications developed by reasonably experienced Java programmers.

The tags provided by the Oracle Multimedia JSP Tag Library offer speed and ease of use, enabling you to write simple Java applications requiring little or no customization. These JSP tags are appropriate for less experienced Java programmers who want to develop common applications quickly, using limited Java code.