Professional Documents
Culture Documents
Static methods have been added to each of the media types, ORDImage, ORDAudio,
ORDVideo, and ORDDoc, which allow for easy initialization of instances of these types.
Oracle recommends that you begin using the new init() method as soon as possible, as we may
evolve the interMedia object types in the future. ORDDoc is a new object type added to interMedia
in this version. It is discussed in lesson 4.
• init() sets:
– updateTime to SYSDATE
– local to 1
– LOBs to empty
– All other attributes to NULL
• init(srcType, srcLocation, srcName)sets:
– updateTime to SYSDATE
– local to 0
– LOBs to empty
– srcType, srcLocation, srcName to input
parameters
– All other attributes to NULL
The construction method is called init and can be used in one of two variations:
• The first specification takes no parameters and initializes all the media type's attributes to
NULL, with the exceptions noted on the slide. Use this method if you intend the media
source to be local, and you intend to populate the BLOB by a mechanism other than the
import method
• The second variation takes three string parameters and sets the attributes as noted on the
slide. Use this method if you intend the media source to be external, or you intend to
populate the BLOB by the import method.
The local variable indicates where the data is stored. If 1, then the data is stored in a LOB in the
database. A zero indicates that the data is stored in an external source location.
INSERT
INSERT INTO
INTO mediatable
mediatable VALUES
VALUES ((
3154,
3154,
ORDSYS.ORDImage.init
ORDSYS.ORDImage.init ((
'FILE','MEDIADIR',
'FILE','MEDIADIR',
'product3154.jpg'),
'product3154.jpg'),
ORDSYS.ORDAudio.init(),
ORDSYS.ORDAudio.init(),
...
... );
);
Export now works for srcType FILE. The semantics for export are as follows:
• It is similar to a file copy operation. That is, the original data stored in the BLOB is
not touched other than for reading purposes.
• It is not an exact mirror operation to import(), because clearLocal() is not
called automatically by export() whereas import() calls setLocal().
If your intent is to no longer manage the multimedia data within the database after the
export() method is used but you do intend to continue to reference the multimedia
data, such as a BFILE, then you should call deleteContent() to free up the BLOB
storage and clear the local flag.
The ability to write a file on the database server is a powerful one. This ability could
potentially be used in malicious ways. One might attempt to overwrite critical database
files or simply write large or numerous files in order to fill the server's disks.
Because of these possibilities certain privileges must be in place before export() will
work for a user:
• export() will only write to an Oracle directory object the user has privilege to
access. That is, a directory the user has either created themselves with the SQL
CREATE DIRECTORY command or one that they have been granted read privileges
on.
• To further restrict which files can be written to,
DBMS_JAVA.GRANT_PERMISSIONmust be used to specify which files can be
written to
GRANT
GRANT READ
READ
ON
ON DIRECTORY
DIRECTORY MEDIADIR
MEDIADIR
TO
TO mediauser
mediauser
WITH
WITH GRANT
GRANT OPTION;
OPTION;
CALL
CALL DBMS_JAVA.GRANT_PERMISSION
DBMS_JAVA.GRANT_PERMISSION ((
'MEDIAUSER',
'MEDIAUSER',
'java.io.FilePermission',
'java.io.FilePermission',
'C:\MEDIAFILES\product3145.wav',
'C:\MEDIAFILES\product3145.wav',
'write'
'write' );
);
This call allows the user MEDIAUSER to write the file product3145.wav to the specified
file system directory.
See the Oracle9i Java Developer’s Guide, Security and Performance for more information.
DECLARE
DECLARE
aud
aud ORDSYS.ORDAudio;
ORDSYS.ORDAudio;
ctx
ctx RAW(4000)
RAW(4000) :=
:= NULL;
NULL;
BEGIN
BEGIN
SELECT
SELECT audio
audio INTO
INTO aud
aud
FROM
FROM mediatable
mediatable WHERE
WHERE NN == 3145;
3145;
aud.export
aud.export (ctx,'FILE',
(ctx,'FILE',
'MEDIADIR','product3145.wav');
'MEDIADIR','product3145.wav');
END;
END;
//
Exports the audio data stored in the audio column of the MEDIATABLE table to the file
product3145.wav in the file system directory pointed to by the Oracle directory
MEDIADIR.
Application developers, who created multimedia applications without using the interMedia objects
to store and manage media data in database tables and who do not want to migrate their existing
multimedia applications to use interMedia objects, can use the interMedia relational interface for
storing and managing their media data.
Rather than storing media in interMedia object columns, users store media in BLOB columns and
metadata in separate table columns. It is up to the application to associate media with metadata
when interMedia object types are not used to manage the association for you.
Oracle interMedia Java Classes enable Java applications to manipulate and modify audio, document,
image, and video data stored in Oracle9i.
Applications connect to the database, select the media object, copy that object from the database,
perform various operations and store the new media object in Oracle9i.
interMedia Java Classes support JDBC access to rich content. This support enables applications to
select and operate on a result set that contains sets of interMedia columns plus other relational data.
These classes also enable access to object attributes and invocation of object methods.
The new interMedia Java Classes work with an Oracle8i Server, version 8.1.5 or higher.
To support JDBC, changes have been made to the interMedia Java classes' syntax and semantics.
It is no longer necessary to explicitly bind an application's copy of the object to a database object. It
is also no longer necessary to refresh and flush the application's copy of the object to synchronize it
with the corresponding database object. Instead, users retrieve interMedia objects in their Java
programs using the standard JDBC executeQuery() function call.
Rather than flushing the application's copy of the object to the database, an explicit update is
performed by executing a standard SQL UPDATE statement using the JDBC API.
Another fundamental change is that all methods, with the exception of those that load data from an
external data source into the BLOB, change the state of the application's copy of the object. The user
must perform an explicit update as mentioned above in order to propagate changes to the database
object.
while(rs.next())
while(rs.next()) {{
OrdAudio
OrdAudio audObj
audObj == (OrdAudio)
(OrdAudio)
rs.getCustomDatum(2,OrdAudio.getFactory());
rs.getCustomDatum(2,OrdAudio.getFactory());
audObj.setProperties(ctx);
audObj.setProperties(ctx);
OraclePreparedStatement
OraclePreparedStatement stmt1
stmt1 ==
(OraclePreparedStatement)conn.prepareCall(
(OraclePreparedStatement)conn.prepareCall(
"UPDATE
"UPDATE taud
taud SET
SET aud
aud == ?? WHERE
WHERE nn == "" ++ index);
index);
stmt1.setCustomDatum(1,audObj);
stmt1.setCustomDatum(1,audObj);
stmt1.execute();
stmt1.execute();
stmt1.close()
stmt1.close() ;;
}}
Oracle interMedia custom DataSource and DataSink classes are an extension to the current
Java Media Framework (JMF) version 2.0/2.1 developed by Sun Microsystems.
Oracle interMedia custom DataSource and DataSink classes are an extension to the current
Java Media Framework (JMF) version 2.0/2.1 developed by Sun Microsystems. This software allows
a JMF application to upload and retrieve time-based media data stored in Oracle9i using interMedia
ORDAudio and ORDVideo objects. A protocol is defined that permits media data stored in an
Oracle database to be accessed through a URL that contains information necessary to select the
multimedia data from the database.
This feature is available on Oracle Technology Network. It is not available on the Oracle9i beta kit.
See technet.oracle.com for more information.
See www.java.sun.com/jmffor more information on Java Media Framework.
OrdHttpResponseHandler
This class helps with retrieval of multimedia data from the database and delivery to a browser or
other HTTP client from a Java Servlet.
OrdHttpJspResponseHandler
This class performs a similar function for JavaServer pages.
OrdHttpUploadRequest
The class enables form-based file uploading using HTML forms, encodes form data, and uploaded
files in POST requests using multipart/form-data format. This class facilitates the processing of such
POST 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.
OrdHttpUploadFile
This class facilitates the handling of uploaded files. Provides an easy to use API that can load image,
audio and video data into a database.
JSP engines are not required to support access to the servlet binary output stream. Therefore, all JSP
engines do not support the delivery of multimedia data using the
OrdHttpJspResponseHandlerclass.
All multimedia data stored in the database using the interMedia types, including text documents
stored using the ORDDOC type, is stored using a binary LOB data type. Therefore, all multimedia data
is delivered to the browser through the servlet binary output stream.
All send methods in the OrdHttpJspResponseHandlerclass mirror the initial processing of
the jsp:forward tag by calling the JspWriter.clear method to clear the page's output buffer
prior to obtaining the binary output stream. However, JSP engines are not required to support a call to
the ServletResponse.getOutputStreammethod from within a JSP.
If your JSP engine does not support access to the binary output stream from within a JSP, then you
must use a servlet to deliver multimedia data. For example:
- Use the jsp:forward tag to forward a multimedia retrieval request to a servlet, or
- Construct multimedia retrieval URLs to retrieve the data directly from a servlet.
The Java Advanced Imaging API extends the Java platform for developing image processing
applications and applets in Java. It streamlines the process of creating powerful imaging software
solutions.
This interface is essentially the same as the Oracle8i PL/SQL interface to ORDImage. All the
additional formats will be supported through this interface, and additional verbs will be added to
the Process() methods. The SetProperties() method will also use the new functionality,
and so image object attribute values will include new values supported by JAI. The PL/SQL
methods will still mostly be forwarding functions, but they will now forward the calls into Java and
JAI.
The EXIF format is essentially a variation on the JFIF format and as such the
ORDImage.setProperties()method sets the fileFormat attribute to JFIF.
See previous slides for new allowed values for fileFormat, contentFormat, and
compressionFormat.
The following values are not allowed for compressionFormat on process and
processCopy:
• JPEG-PROGRESSIVE
• GIFLZW-INTERLACED
• DEFLATE-ADAM7
ContentFormat
The following lists provides additional information related to the slide.
• The format MONOCHROME is two levels off black and white.
• Sample model definitions are:
– BIP: band interleaved by pixel (optional and default)
– BIL: band interleaved by line
– BSQ: band sequential
• Color model definitions are:
– LUT: pixel values are indices into a lookup table
– DRCT: pixel values directly encode color values (optional and default)
• Color space definitions are:
– GRAY: Grayscale
– RGB: Red/Green/Blue additive
• Special attributes suffix definitions are:
– A: contains an alpha channel
– T: contains a transparency color
• CompressionFormat definitions includes:
– DEFLATE: ZIP Deflate (used by PNG)
– DEFLATE-ADAM7: Interlaced ZIP Deflate (used by PNG)
– ASCII: ASCII encoding for PNM types
– RAW: Binary encoding for PNM types
– JPEG-PROGRESSIVE: Interlaced JPEG
– GIFLZW-INTERLACED: Interlaced GIF
Oracle interMedia New Features 3-6
Image Matching Concepts
Inexpensive image-capture and storage technologies have allowed massive collections of digital
images to be created. However, as a database grows, the difficulty of finding relevant images
increases. Two general approaches to this problem have been developed, both of which use
metadata for image retrieval:
• Using information manually entered or included in the table design, such as titles,
descriptive keywords from a limited vocabulary, and predetermined classification
schemes
• Using automated image feature extraction and object recognition to classify image
content; that is, using capabilities unique to content-based retrieval
With interMedia image, you can combine both approaches in designing a table to accommodate
images: use traditional text columns to describe the semantic significance of the image. For
example, that the pictured automobile won a particular award, or that its engine has six or eight
cylinders), and use the ORDImage type for the image, to permit content-based queries based on
intrinsic attributes of the image. For example, how closely its color and shape match a picture of a
specific automobile.
A Web-based interface to a retail clothing catalog might allow users to search by traditional
categories, such as style or price range, and also by image properties, such as color or texture.
Thus, a user might ask for formal shirts in a particular price range that are off-white with pin
stripes. Similarly, fashion designers could use a database with images of fabric swatches, designs,
concept sketches, and finished garments to facilitate their creative processes.
A content-based retrieval system processes the information contained in image data and creates
an abstraction of its content in terms of visual attributes. Any query operations deal solely with
this abstraction rather than with the image itself. Thus, every image inserted into the database is
analyzed, and a compact representation of its content is stored in a feature vector, or signature.
The signature contains information about the following visual attributes:
• Color represents the distribution of colors within the entire image. This distribution
includes the amounts of each color, but not the locations of colors.
• Texture represents the low-level patterns and textures within the image, such as
graininess or smoothness. Unlike shape, texture is very sensitive to features that appear
with great frequency in the image.
• Shape represents the shapes that appear in the image, as determined by shape-
characterization techniques such as edge detection.
• Location represents color distributions and where they occur in an image, such as the fact
that a red-green-blue (RGB) vector for sky blue occurs in the upper half of an image.
Images in the database can be retrieved by matching them with a comparison image. The
comparison image can be any image inside or outside the current database, a sketch, an
algorithmically generated image, and so forth. The matching process requires that signatures be
generated for the comparison image and each image to be compared with it. Images are seldom
identical, and therefore matching is based on a similarity-measuring function for the visual
attributes and a set of weights for each attribute. The score is the relative distance between two
images being compared. The score for each attribute is used to determine the degree of similarity
when images are compared, with a smaller distance reflecting a closer match.
When you match images, you assign an importance measure, or weight, to each of the visual
attributes, and interMedia image calculates a similarity measure for each visual attribute.
The similarity measure for each visual attribute is calculated as the score or distance between the
two images with respect to that attribute. The score can range from 0, indicating no difference, to
100, indicating the maximum possible difference. Thus, the more similar two images are with
respect to a visual attribute, the smaller the score will be for that attribute.
The signature and image are stored as separate columns of the table.
myimg.setProperties();
myimg.setProperties();
mysig.generateSignature(myimg);
mysig.generateSignature(myimg);
UPDATE
UPDATE image_tab
image_tab tt
SET
SET t.photo
t.photo == myimg,
myimg,
t.photo_signature
t.photo_signature == mysig
mysig
WHERE
WHERE t.photo_id
t.photo_id == 1;
1;
SELECT
SELECT q.photo_id,
q.photo_id,
ORDSYS.IMGScore(123)
ORDSYS.IMGScore(123) AS
AS score
score
FROM
FROM image_tab
image_tab q,
q,
image_tab
image_tab ee
WHERE
WHERE e.photo_id
e.photo_id == '42'
'42'
AND
AND q.photo_id
q.photo_id !=!= e.photo_id
e.photo_id
AND
AND ORDSYS.IMGSimilar
ORDSYS.IMGSimilar ((
q.photo_signature,
q.photo_signature,
e.photo_signature,
e.photo_signature,
'texture=1',
'texture=1', 20.0,
20.0, 123)
123) == 1;
1;
The results of the previous query indicate that the best matches for the query image. In this
example, three rows are returned with a score less than 20. The image with a PHOTO_ID of 2 is a
perfect match with a score of zero.
A domain index, or extensible index, is a new approach for supporting complex data objects.
Oracle and interMedia image cooperate to define, build, and maintain an index for image data.
This index is of type ORDIMAGEINDEX. Once it is created, the index automatically updates itself
every time an image is inserted, updated, or removed from the database table. The index is created,
managed, and accessed by routines supplied by the index type.
For better performance with large image databases, you should always create and use an index for
searching through the image signatures. The default search model compares the signature of the
query image to the signatures of all images stored in the database. This works well for simple
queries against a few images such as, "Does this picture of an automobile match the image stored
with the client’s insurance records?" However, if you want to compare that image with thousands
or millions of images to determine what kind of vehicle it is, then a linear search though the
database would be impractical. In this case, an index based on the image signatures would greatly
improve performance.
ANALYZE
ANALYZE INDEX
INDEX idx1
idx1 COMPUTE
COMPUTE STATISTICS;
STATISTICS;
The ORDDoc object type can be used in applications that require you to store different types of
documents, such as audio, image, video, and any other type of document in the same column so
you can build a common metadata index on all the different types of documents and search across
different types of documents using this index. Note that you cannot use this same search technique
if the different types of documents are stored in different types of objects in different columns of
relational tables.
Documents may be produced by application software, text conversion utilities, speech to text
processing software, and so forth. Documents can be ASCII text files or binary files formatted by a
particular application.
Documents consist of the document data (digitized bits) and attributes that describe and
characterize the document data.
Documents can have different formats depending upon the application generating the document
data. interMedia document can store and retrieve document data of any data format. interMedia
document automatically extracts metadata from documents of known image, audio and video
formats. To automatically extract metadata from other formats, you can write your own format
plugin.
CREATE
CREATE OR
OR REPLACE
REPLACE TYPE
TYPE ORDDoc
ORDDoc AS
AS OBJECT
OBJECT ((
--
-- ATTRIBUTES
ATTRIBUTES
source
source ORDSource,
ORDSource,
format
format VARCHAR2(80),
VARCHAR2(80),
mimeType
mimeType VARCHAR2(80),
VARCHAR2(80),
contentLength
contentLength INTEGER,
INTEGER,
comments
comments CLOB,.
CLOB,. .. ..
• Source: where the document is stored
• Format: the format type of the document
• Mimetype: the mime type of the document
• ContentLength: the length of the document data
• Comments: metadata in XML format
Constructors
•init(): initialize with local set to 1
•init(srcType, srcLocation, srcName): initialize with local set to 0 and src
information set from the parameters passed
Source Methods
•get/setUpdateTime: get or set time document was last updated
•isLocal, setLocal, clearLocal: determines if data is local, that is, is stored in a BLOB
•setSource, getSource, getSourceType, getSourceLocation, getSourceName:
set and get source type and location information
•import, importFrom: import from file system
•export: export to file system
•getContentInLob, getContent, deleteContent: get and delete document data
•getBFILE: return a BFILE handle
•processSourceCommand: process command in source plugin
•openSource, closeSource, readFromSource, writeToSource, trimSource: file
operations on source data
Attribute Methods
•get/setMimeType
•get/setFormat
•setProperties: automatically extract properties if possible
•getContentLength
INSERT
INSERT INTO
INTO TDOC
TDOC VALUES
VALUES (( 1,
1,
ORDSYS.ORDDoc.init
ORDSYS.ORDDoc.init ((
'FILE',
'FILE', 'DOCDIR',
'DOCDIR', 'audio.wav')
'audio.wav') );
);
INSERT
INSERT INTO
INTO TDOC
TDOC VALUES
VALUES (( 2,
2,
ORDSYS.ORDDoc.init
ORDSYS.ORDDoc.init ((
'FILE',
'FILE', 'DOCDIR',
'DOCDIR', 'image.jpg'));
'image.jpg'));
Create a table called TDOC with two columns and insert two rows. The first row points to an
audio file and the second points to an image file.
interMedia Clipboard for Oracle 8.1.6 and higher allows users to store and retrieve multimedia data
stored in any schema quickly and easily through a browser. The interface uses interMedia Annotation
Services to automatically annotate multimedia objects and store annotations in a CLOB when they are
loaded in the database, and to view annotations. This means users can use a single interMedia utility
to:
• Upload and download files using a browser interface
• Create and view media annotations
The Java Servlet implementation of the interMedia Clipboard for Oracle9i provides the benefit of a
single installation per server for all users.
Clipboard users can organize media data as files within hierarchically folders in the database, and have
the capability to:
• Create new folders
• Move, copy, or delete folders and files
Clipboard allows users to apply file access controls to files and folders, and authenticates users before
allowing access to protected files and folders. Clipboard support for Access Control Lists (ACLs)
allows users to:
• Grant or Deny rights to files and folders
• Read (download), and write (upload, delete, move, copy) to files
• Read and write ACLs
Media data previously viewed as tables is now viewed hierarchically as files within folders that can be
created by users.
Automatic URL generation to retrieve an object from the database previously occurred when
multimedia was dragged into a Web authoring tool. Now, the Clipboard displays the URL for each
media object, which can be copied into an Web authoring tool. Media objects can no longer be
dragged from Clipboard into Web Authoring tools
Images from Twain compliant external sources, such as digital cameras and scanners, can no longer
captured directly by Clipboard for storage in the database. Store the image in a file and load the file
using Clipboard.
Previously, multimedia objects were edited within Clipboard. Now, edit media objects in the database
directly using DAV compliant editing tools or use Clipboard to download the media into a file, edit the
media and then reload the file into the database with Clipboard.
The Web Agent is no longer needed to access multimedia data, as the Clipboard can either generate its
own URLs for access through the servlet or use DAV URLs. Web Agent authentication has been
replaced by Authentication/Authorization plus access control lists (ACLs) for all files and folders. The
code wizard that created PL/SQL procedures to retrieve and store multimedia objects in the database
and set attributes of the object is no longer necessary.
Sort order for table has been replaced by Sorting of folders by type, size, date, name and delete,
update, insert row are replaced by delete, update, insert file.
At installation time, the administrator must specify the database name, schema name, and whether to
expose annotation capability to end users in a configuration file which is stored on the web server.
A set of PL/SQL procedures provided in the Clipboard package or a browser-based wizard accessible
through the Administration page can be used to expose already existing interMedia objects
(ORDImage, ORDAudio, ORDVideo, ORDDoc) or BLOBs in any table and schema as files with
associated URLs in the Clipboard.
Once the clipboard has been properly installed, a user name admin (default password
manager)with administration privileges will already exist. admin is the only user which may
access the online Administration page, which allows the admin user to add, delete, modify, or view
Clipboard users. Initially, the Clipboard will not be enabled for security, meaning no ACLs may be
created anywhere. However, admin can easily enable security by visiting the admin page, and
clicking on a link which will enable security.
Once security has been enabled, all users have read, write, read ACL, and write ACL access to all files
and folders in the Clipboard. It is up to the admin user to set up the proper ACLs on existing folders.
The clipboard user interface is similar to other interfaces to directories and files:
• An icon identifies whether an item is a folder or file, that is, the icons identify files of different
types.
• Each file is represented by a hyperlink of the URL which accesses the corresponding multimedia
data in the database.
• Each folder can contain folders and files. Thus, you can have a multilevel hierarchy of folders.
For example, the top-level folder, which is the view of the entire container, contains a folder,
which contains another folder, which contains another folder, and so on.
• To select a folder or file to perform an operation on it, click the box to the left of its icon or its
name. To deselect a selected item, click the box. You can select all items in a folder by clicking
Check All, and deselect all items in a folder by clicking Uncheck All.
• To perform an operation on a folder or file, select it, and then click the appropriate command
text link or button.
• To view Annotations for a file, click on the pencil. A pencil with a small plus sign indicates that
the file has been annotated.
• To add, delete, modify, or view the ACL for a file or folder, click on the pencil.
The window on the slide displays the contents of a single folder.
The Clipboard provides four different views of your multimedia data. By clicking on one of the four
tabs in the upper-right corner of the Clipboard interface, you can view either images, audio, video or
all of your media in one view. Navigation through folders and sorting is available in each media view.
This Clipboard in the example screen has been configured so that a column of ORDImage objects
have been exposed.
Once the objects have been exposed, they can be copied, downloaded or deleted. Support for other
operations, such as move and update, are planned for future releases. Either a whole column of objects
or a single object can be exposed.
An option to create triggers so that any update, insert, or delete into the external table will update the
corresponding Clipboard information is provided.
As seen in the screen, the ORDImage objects appear as image files in the Clipboard folder
HOUSE_PIX. The image media data can be downloaded via the Clipboard URLs.
The Clipboard maintains a table of paths, each of which represents the path of a folder or file viewable
from the Clipboard. Therefore, each ORDImage has an associated path stored in the table.
The screen shows the database table and column where the images in the HOUSE_PIX folder reside.
The HOUSES table is located in the SCOTT schema. The HOUSE_PIX column of ORDImage
objects in the HOUSES table has been exposed through the Clipboard as Clipboard image files.
Every media file in the Clipboard has an associated URL which enables users to either download or
view the media object in the browser.
In this example, the file named “1002.jpg” has been clicked in the folder HOUSE_PIX. Its associated
URL is:
http://host.us.oracle.com:8014/oradav/SCOTT/HOUSES/HOUSE_PIX/100
2.jp
g
Using the URL enables users to view the media in the browser. In this case, the underlying data is
stored as an ORDImage object in the table described in previous slides. This URL can be copied and
pasted from the Location or Address toolbar in the browser to the desired web authoring tool.
This screen enables the user to upload any rich media file from the local file system. Selecting the
Browse button on the previous screen enables you to browse your file system for the appropriate
content. The Clipboard uses the OS filename for naming new files.
In the production release of the Clipboard, users will also be able to upload media from anywhere in
the Internet.
If the Annotator engine has been installed, users will be given the option to annotate the media file
transparently during the upload, by a call in the database to the Annotator engine at the end of the
upload. Depending on the configuration of the Clipboard, the annotations will be stored either as a
CLOB or parsed into name-value pairs and stored in the Clipboard properties table.
Currently, there is no support for creating new ORD objects in the database but support is being
planned for the future.
If the user would simply like to store the uploaded file as a BLOB and has not specified a table or
schema in which this file should be stored, a Clipboard table of BLOBs will be used and a new row
will be inserted into this default table. This default table will have been created at Clipboard
installation time.
Note: currently there is no limit on file size as long as the tablespace used for the Clipboard tables has
not been exceeded.
ACLs can be edited and viewed by clicking on the pencil icon for any file or folder.
Additionally, annotations and other properties, such as file size, last modified and creation dates, can
be viewed by first clicking on the pencil icon, then clicking on View Properties under the
Properties menu.
The screen shows the annotations for the file just uploaded: 1002.jpg. In this example, the
annotations have been stored as XML in a CLOB. Additional attributes, such as namespace, language,
and tag are automatically generated by the Clipboard at annotation time and stored in separate columns
in a default table in the database.
In later releases of the Clipboard, users will be able to edit annotations directly in the Clipboard
interface. Users will also be able to insert and maintain their own custom properties.
The user in the screen has been logged in as admin, so ACLs on any item can be viewed.
As seen in the screen, all users (*) have been denied all rights on the file named 1002.jpg.
Since the 1002.jpg file has an ACL in which all users have been denied all access, anyone except
admin will be denied access to the file.
Therefore, clicking on 1002.jpg will force a username/password dialog box to appear. If you log in as
admin, you will be allowed to view the file. However, any other user will be shown a Not
Authorized page.
If the admin user is logged in, pressing the Delete button in the screen will delete the ACE on
1002.jpg. This means that the ACE from the previous example, in which all users have been
denied all rights, will be deleted. The admin user will be able to delete any ACE on any item, no
matter what the existing ACL on the item is.
You can use the Clipboard to organize your content by creating folders to organize interMedia content.
In the above example, a folder named other will be created within the HOUSE_PIX folder once the
Create folder button has been clicked.
A folder can correspond to a table; however, it is possible to have a folder contain items from various
tables. Folders are uniquely identified by their paths in the Clipboard. The path of a folder and its
content location in the database are separate.
The folder hierarchy is stored in a Clipboard table which maintains path information.
This screen is used to move or copy multiple files and folders in a single operation.
The 1002.jpg can be moved or copied to any folder to which the current user has Write access.
Moving the file will simply change the Clipboard path of the file. For example, if 1002.jpg is
moved from /oradav/SCOTT/HOUSES/HOUSE_PIXto
/oradav/SCOTT/HOUSES/HOUSE_PIX/other, the corresponding path for the 1002.jpg will
be modified to reflect the new path. The actual ORDImage object, however, will stay in the same
table and column, HOUSES.HOUSE_PIX.
Since currently the Clipboard is unable to create new rows in external ORD object or BLOB tables,
any ORD objects copied in the Clipboard will be copied to a newly created BLOB in a default storage
table maintained by the Clipboard. The original ORD object being copied, however, will stay in the
same table.
The ADMIN user can create, delete, modify and view Clipboard users via online
Administration page
The Clipboard provides an online User Administration page which provides forms
for adding, deleting, modifying, and viewing Clipboard users.
Only the user admin is allowed access to any of these pages. Any other users
attempting to access these pages will be shown a not authorized message.
The User Administration page can be accessed via the Clipboard entry page or by the
URL:
http://host:port/servlet/oracle.ord.im.clipboard.Nav
igator?op=admin
Clipboard users are in no way related to Oracle users. Clipboard user data is stored
in a Clipboard maintained table in the database. Clipboard user passwords are stored
in an encrypted format.
What’s new:
• Callable interMedia Annotation Services
• Sample code to modify existing Java parsers
• APIs to add new parsers to Annotation Services
• Pass-through parser
– describe a group of items as a real world
object
– manually annotate a format not currently
supported by existing parsers
Through its detailed understanding of media formats, the Oracle9i interMedia annotation
services can automatically parse and extract media format and application metadata, generate
indices based upon this data, and map the metadata into XML documents or database schema.
Use of application metadata makes it easy to locate media content, while mapping it into
database schema makes the query process highly efficient and tightly integrated into an
application’s existing schema. Mapping the application metadata into an XML document makes
it easy to interchange of this information. In either case, annotation services are aware of the
industry standard metadata and allow the user to add additional metadata to that found in the
media. Annotation services can also sample the media content to give sub samples such as a
simple video story board.
The interMedia annotation services are conveniently packaged as a Java Bean. Implemented in
Java, they will run on any platform with a JVM. These Java Bean APIs allow for programmatic
invocation of metadata services by any application or scripting language that can use Java APIs
including JavaScript, and AppleScript. Sample code for each of the existing Java parsers is
included to allow customization, reuse or a rewrite to meet specific parsing needs, and an API
allows new new parsers to be plugged into Annotation Services.
The Pass-through parser can be used to describe a group of items as a real world object - for
example the music clips, album graphic, liner notes and music video associated with a Music
CD. It can also be used to manually annotate and store in Oracle9i, a format not currently
supported by existing parsers.
The three examples in the slide can be found under the demo/examples/src/directory
in the kit. Refer to the Annotator.bat file for the CLASSPATH setup.
Java documentation for Annotation Services can be found under /docs/apidoc/. Also see
the package documentation for oracle.ord.media.annotator.
Annotation Services require the following:
• lib/Annotator.jar
• lib/xmlparserv2.jar
• Oracle JDBC driver
• QuickTime for Java library is needed if QuickTime For Java is used
Annotation Services reads a set of initialization files during startup. The default is the current
directory. It can be overwritten by adding ORACLE_HOME properties to your Java command
line:
-D ORACLE_HOME=/your/oracle/home
Annotation Services root directory is located at $ORACLE_HOME/ord/Annotator.
Classes include methods to start various annotation operations, and to access and modify
annotations.
• oracle.ord.media.annotator.annotations.Annotation: Access or
modify an annotation through the methods provided in this class.
• addSubAnnotation()and getSubAnnotations()are methods to add and
retrieve subannotations.
• createAnnotationByName(String)has the AnnotationFactory method used to
create an instance of annotation.
• oracle.ord.media.annotator.handlers.db.OrdFileMapping:
– Is used to uploading an annotation into the database
– Each instance of OrdFileMapping should be created using the filename of the
PL/SQL template to be used
Oracle File Mapping (OFM), maps Annotator attributes to individual columns in a database.
oracle.ord.media.annotator
• .utils.Preferences: retrieve and update
preferences
• .utils.Status: a helper class that generates
tracing messages.
• .handlers.AnnTaskMonitor: provides information
on the status of the current action
• .descriptors.AnnotationDesc: exposes
metadata for specific annotation types
• .descriptors.ParserDesc: provides metadata for
specific parsers
oracle.ord.media.annotator.utils.Preferences
• Retrieves and updates preferences from Annotator.prefs file
• Applications use this mechanism to serialize, or store, their application preferences which are
used in subsequent invocation of the annotation services
• Preferences are retrieved by the static method Preferences.getPrefs()from the
preference file located at:
<ANNOTATOR_HOME>/lib/conf/Annotator.prefs
oracle.ord.media.annotator.utils.Status
• A helper class with methods that generates trace information
• Initialize the Status class before initializing AnnotationHandler)
oracle.ord.media.annotator.listener.OutputListener. Optionally
implement to process status output, such as, printing trace into a log file.
oracle.ord.media.annotator.handlers.AnnTaskMonitor
• Provides information on the status of the current action to the end user
• Multi-threading issues exist with AnnotationHandler, so instantiate one instance. Refer
to the Javadoc, AnnotationHandler class for details.
The next several slides show code snippets from the SimpleAnnotator code example
program included in the kit. The program shows how to implement a synchronous client of the
annotator engine. The client can take any parsable URL and feed it to the engine for parsing
and uploading into the database.
This particular program operates synchronously. Parsable files are those whose format the
annotator engine recognizes. The code snippets are organized much the way a sample java
program would be, including main, init, and other methods. Much code has be stripped out to
format the slides. See the sample code for a complete code listing.
This section of the code implements the Annlistner and OutputListner interfaces
Main creates a new annotator, initializes it, and then uses it to parse a media file.
This section of code covers client manipulation of parsed data before database upload.
It shows how to access the attributes that may have been parsed out.
This section of code uploads the parsed data into the database. Note that it uses both the
parsed data, ann, and a file, ofm, that describes where to put the parsed data, that is, which
columns in which tables to insert the data into.
The interMedia annotation services are conveniently packaged as a Java Bean. Implemented in
Java, they will run on any platform with a JVM. These Java Bean APIs allow for programmatic
invocation of metadata services by any application or scripting language that can use Java APIs
including JavaScript, and AppleScript. Sample code for each of the existing Java parsers is
included to allow customization, reuse or a rewrite to meet specific parsing needs, and an API
allows new new parsers to be plugged into Annotation Services.
The Pass-through parser can be used to describe a group of items as a real world object - for
example the music clips, album graphic, liner notes and music video associated with a Music
CD. It can also be used to manually annotate and store in Oracle9i, a format not currently
supported by existing parsers.