multimedia-enabled how to develop - oracle · ingeniux cms – content created as xml files on...

38

Upload: others

Post on 13-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom
Page 2: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

How to Develop Multimedia-enabled Oracle 10g ApplicationsOracle10g interMedia

Session ID: 1207

Page 3: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Joseph Mauro Principal Product Manager Server Technologies Oracle Corporation

Major Ramon LaoScot GreberInformation Technology CenterUS Department of Defense

Page 4: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Agenda

� Oracle’s Multimedia Capabilities

� Developing Multimedia Java Applications

� Dept. of Defense Portal Application

Development

Page 5: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Objective

� Extend Oracle’s leadership as a platform capable of managing multimedia content as naturally as it does all other business information.

� Lower the cost and complexity of developing, deploying and managing business applications which make extensive use of multimedia data.

Page 6: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

The Media-enabled Oracle Platform� Oracle Database 10g

– Storage, management, & retrieval of image, audio, video data

– Native format understanding, metadata extraction, methods for image processing

– Support for leading streaming media servers

� Oracle Application Server 10g

– JSP, servlet and PL/SQL application development support

– Media Adaptation Services for Wireless

– JDeveloper (BC4J/UIX) and Portal integration

� Oracle Collaboration Suite– Metadata extraction for OCS Files

Page 7: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

The Complete interMedia Architecture

Streaming Servers

RTP/RTSPApplication

Servers

Thick ClientsinterMedia Java

ClassesJAI/JMF

Thin Client Browser Protocol Plugin

HTTPJDBC

Image Processor

JAI

Media Parser

JVM

Oracle Database10g

External File

Storage

Third Party Media

ProcessorsJDBC

OCI

Oracle Application Server 10g

Oracle JDeveloper

BC4J

interMedia Java Classes

JSP Tag Libraries

PL/SQL Toolkit

Oracle Portal

JDBC OCI OCI

HTTP

Page 8: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

D E M O N S T R A T I O N

A Simple Java Application

Page 9: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Common SchemaOn-Line Media Table

PM.Online_Media table

� product_id INT� product_photo ORDSYS.ORDIMAGE� product_thumbnail ORDSYS.ORDIMAGE� product_video ORDSYS.ORDVIDEO� product_audio ORDSYS.ORDAUDIO

Page 10: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Establish Connection

1) public OracleConnection connect(String user, Stringpassword)

2) throws Exception

3) {

4) String connectString;

5) DriverManager.registerDriver(neworacle.jdbc.OracleDriver());

6) connectString = "jdbc:oracle:oci:@";

7) OracleConnection conn = (OracleConnection)

8) DriverManager.getConnection(connectString,user,password);

9) conn.setAutoCommit(false);

10) return conn;

11) }

Page 11: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Upload from File1) public void upload(OracleConnection conn, String

fileName, int productId) throws Exception

2) {

3) OracleCallableStatement cstmt = null;

4) String queryInit = new String( "begin insert intopm.online_media " + " (product_id, product_photo,product_thumbnail) " + " values(?,ORDSYS.ORDImage.init(), ORDSYS.ORDImage.init()) " + "returning product_photo into ?; end; ");

5) cstmt = (OracleCallableStatement)

6) conn.prepareCall(queryInit);

7) cstmt.setInt(1, productId);

8) cstmt.registerOutParameter(2, OrdImage._SQL_TYPECODE,

9) OrdImage._SQL_NAME);

10) cstmt.execute();

11) OrdImage=(OrdImage)cstmt.getORAData(2,OrdImage.

12) getORADataFactory(();

Page 12: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Upload from File (con’t)

1) cstmt.close();

2) img.loadDataFromFile(fileName);

3) String queryUpload = new String( "update pm.online_media

4) set product_photo = ? where product_id = ?");

5) OraclePreparedStatement pstmt =(OraclePreparedStatement)conn.prepareStatement

6) (queryUpload);

7) pstmt.setORAData(1, img);

8) pstmt.setInt(2, productId);

9) pstmt.execute();

10) pstmt.close();

11) conn.commit();

12) }

Page 13: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Set Properties1) public void setPhotoProperties(OracleConnection conn,

int productId) throws Exception

2) {

3) String querySelect = new String( "select product_photofrom

4) pm.online_media where product_id = ? forupdate");

5) OraclePreparedStatement pstmt =(OraclePreparedStatement)conn.prepareStatement(querySelect);

6) pstmt.setInt(1, productId);

7) OracleResultSet rs =(OracleResultSet)pstmt.executeQuery();

8) OrdImage img = null;

9) if (rs.next() == true)

10) { img = (OrdImage)rs.getORAData(1,

11) OrdImage.getORADataFactory());

12) } else throw new Exception("No row found for" +productId);

Page 14: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Set Properties (con’t)

1) rs.close();

2) pstmt.close();

3) img.setProperties();

4) String queryUpdate = new String( "update pm.online_media

5) set product_photo = ? where product_id = ?");

6) pstmt =(OraclePreparedStatement)conn.prepareStatement(queryUpdate);

7) pstmt.setORAData(1, img);

8) pstmt.setInt(2, productId);

9) pstmt.execute();

10) pstmt.close();

11) conn.commit();

12) }

Page 15: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Get Properties1) public void getPhotoProperties(OracleConnection conn, int

productId) throws Exception2) {3) String querySelect = new String( "select product_photo

from4) pm.online_media where product_id =

?");5) OraclePreparedStatement pstmt =6)

(OraclePreparedStatement)conn.prepareStatement(querySelect);

7) pstmt.setInt(1, productId);8) OracleResultSet rs =

(OracleResultSet)pstmt.executeQuery();9) OrdImage img = null;10) if (rs.next() == true)11) { img = (OrdImage)rs.getORAData(1,12) OrdImage.getORADataFactory()); }13) else throw new Exception("No row found for" +

productId);14) rs.close();15) pstmt.close();16) System.out.println("MIME Type: " + img.getMimeType());17) System.out.println("Height: " + img.getHeight());18) System.out.println("Width: " + img.getWidth());19) System.out.println("Content Length: " +

img.getContentLength());20) }

Page 16: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Get Application Metadata

1) Public void parseMetadata() throws Exception;

2) try {

3) oracle.xdb.XMLType[] metaArray = null;

4) // request all types of metadata

5) metaArray = imgObj.getMetadata( "ALL" );

6) // no metadata found

7) if( 0 == metaArray.length )

8) { System.out.println(" No metadata found." ); }

9) else // print the root element name for eachdocument

10) { for ( int i=0 i<metaArray.length; i++ )

11) System.out.println("found metadata element:" +

12) metaArray[i].getRootElement() );

13) }

14) }

15) catch( Exception e )

16) { System.out.println("metdata exception: " +e.toString() ); }

17) }

Page 17: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Process Image - Thumbnail1) public void generateThumbnail(OracleConnection conn, int

productId) throws Exception2) {3) String queryGetThumb = new String( "select product_photo,4) product_thumbnail from pm.online_media " + " where5) product_id = ? for update");6) OraclePreparedStatement pstmt =7)

(OraclePreparedStatement)conn.prepareStatement(queryGetThumb);

8) pstmt.setInt(1, productId);9) OracleResultSet rs = (OracleResultSet)pstmt.executeQuery();10) OrdImage img = null;11) OrdImage imgThumb = null;12) if (rs.next() == true)13) { img = (OrdImage)rs.getORAData(1,14) OrdImage.getORADataFactory());15) imgThumb =16)

(OrdImage)rs.getORAData(2,OrdImage.getORADataFactory());17) } else throw new Exception("No row found for " +

productId);

Page 18: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Process Image (con’t)

1) rs.close();

2) pstmt.close();

3) img.processCopy("maxScale=64 64, fileFormat=GIFF",

4) imgThumb);

5) String queryUpdate = new String( "update pm.online_mediaset product_thumbnail = ? where product_id = ?");

6) pstmt = (OraclePreparedStatement)conn.prepareStatement

7) (queryUpdate);

8) pstmt.setORAData(1, imgThumb);

9) pstmt.setInt(2, productId);

10) pstmt.execute();

11) pstmt.close();

12) conn.commit();

13) }

Page 19: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Down Load to File1) public void downloadThumbnail(OracleConnection conn, int

productId, String fileName) throws Exception2) {3) String queryGetThumb = new String( "select

product_thumbnail from4) pm.online_media where

product_id = ?");5) OraclePreparedStatement pstmt =6)

(OraclePreparedStatement)conn.prepareStatement(queryGetThumb);

7)8) pstmt.setInt(1, productId);9) OracleResultSet rs = (OracleResultSet)pstmt.executeQuery();10) OrdImage imgThumb = null;11) if (rs.next() == true)12) { imgThumb = (OrdImage)rs.getORAData(1,13) OrdImage.getORADataFactory());14) }15) else throw new Exception("No row found for " +

productId);16) rs.close();17) pstmt.close();18) OrdMediaUtil.getDataInFile(fileName,

imgThumb.getContent());19) System.out.println("Download thumbnail for product " +20) productId + " is successful");21) }

Page 20: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom
Page 21: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Multimedia-Enabled Oracle 10g ApplicationsThrough PL/SQL, Java, XML,Oracle Intermedia and Oracle Portal

Major Ramon Lao Mr. Scot Greber

Page 22: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Major Ramon LaoInformation Technology Center Chief Information Officer (ITC CIO)

� Duties:– Active Duty Marine Major– Occupational Specialty – Judge Advocate– Oversees prime contractors delivery of services and

products; ensures compliance with DoD IT policy requirements.

Co-Presenters

Page 23: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Mr. Scot GreberSenior DoDITC System/Information Architect(Independent Oracle Consultant/Previously worked for Oracle Corporation)

� Duties: – DoDITC platform Architect, DBA, Web/Application Developer– DoDITC infrastructure Support

Co-Presenters

Page 24: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� The DoDITC is the website and applications development support for the Office of the Under Secretary of Defense, Personnel and Readiness (Military Community and Family Policy) (OUSD, P&R (MC&FP).

� Sampling of over 25 websites and applications:

www.commanderspage.dod.mil

www.lifelines.navy.mil

www.militaryhomefront.dod.mil

www.usa4militaryfamilies.org

Organization - DoDITC

Page 25: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Content Management Component– Ingeniux CMS (XML File Based Content Management)

� Database Component (Pre-Production/Production)– PL/SQL (XML/XSL API’s)– Intermedia (ORDDOC, ORDVIDEO, ORDAUDIO, ORDIMAGE)– WEBDAV Storage Containers

� Presentation Component– Oracle Application Server 9i/10g– Oracle Portal

� Portal Page Parameters� Portlets

– J2EE Compliant Source Code– WEBDAV

� Web-based Distributed Authoring and Versioning

Application Architecture

Page 26: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Data Exchange Component– Oracle Collaboration Suite R2

� Oracle Files (HTTP/WEBDAV)

Application Architecture

Page 27: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Application Architecture

Page 28: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Ingeniux CMS– Content Created as XML Files on Windows Server

� Easy to use Interface� Data Entry Templates easily customizable

– Custom hooks have been added to Interface w/ Oracle� Ingeniux/Oracle Interface provides

- Ability to Read CMS Files into the Oracle database (Store XML files as XML Data in Oracle)

- Ability to Update CMS Files with Database generated information

- Ability to store and scale content images via Intermedia

Application Architecture -Content

Page 29: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Application Architecture -Content

Page 30: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Two Databases (Pre-Production/Production)– CMS interfaces w/ Pre-Production Database (9i)

� Washington Navy Yard– Oracle Replication pushes content to Production (9i/10g)

� MOBCOM (Kansas City, Missouri)� Content replicates to Production every hour

� Database Components– PL/SQL Stored Packages/Procedures

� Store CMS Content into Rows/Tables/XML Structures

� Transform XML content into HTML via XSL- CONTENT Table

� Content Display Business Rules - Approval/Expiration/Review/Disable Dates

Application Architecture -Database

Page 31: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Components (Cont’d)– Intermedia Content

� ORDDOC (4550) (Stores pdf, doc, xls, …)� ORDVIDEO (4381) Stores Microsoft and Real Media� ORDIMAGE (1926) Stores Images

- 5 different image scales to meet Web Page design layouts

– WEBDAV Storage Containers� Web-based Distributed Authoring and Versioning� Store pointers to the Intermedia Content for HTTP access� New quick way to upload Videos

- LSNMEDIA Container - /Clipboard/servlet/Navigator?dad=lsnmedia

Application Architecture -Database

Page 32: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Application Architecture -Database

Page 33: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Akamai Caching Services– Speed content Delivery– Control Failover

� Oracle Application Server (Platform)– 9i is currently Production– 10g is operational and undergoing testing and quality control– J2EE Compliant Source Code

� 6 Application OC4J Containers in use� Application EAR (Enterprise Application aRchive) files� JAVA Code generated using JDeveloper� Used to extract and format Database Content for the Applications

– WEBDAV� Web-based Distributed Authoring and Versioning� Used in XML/XSL to display Intermedia Content out of the

Database

Application Architecture -Presentation

Page 34: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� Oracle Portal (Component)– Applications Displayed via Portal Pages

– Separate Portal Pages for each application� Portal Pages contain Portlets� Portlet functionality based on Parameters� Portlets have evolved over the Development

cycle- More Generic

Application Architecture -Presentation

Page 35: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Site (Portlet Occurances, Unique Portlets, Pages)

rev1 (Specific Portlets) www.lifelines.navy.mil (349/58/80)www.militarystudent.org (317/58/73)www.deploymentconnections.org (349/58/15)www.lifelines.navy.mil/Familyline (349/58/72)

rev2 (Generic Portlets)www.unifiedexchange.org (52/19/19)www.usa4militaryfamilies.org (20/19/8) www.commanderspage.dod.mil (43/19/15)

rev3 (Generic Portlets w/ CMS XML)www.militaryhomefront.dod.mil (108/6/17)

Application Architecture -Presentation

Page 36: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

Place Identity herePlace Identity here

(Remove Red Box)(Remove Red Box)

D E M O N S T R A T I O N

DOD Portal Sites

Page 37: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� What is Data Exchange System (DES)?– DES is a Methodology by which ITC Content can be shared– Utilizes Oracle’s Collaboration Suite to Store HTML Content

� HTML Content accessible via Oracle Files HTTP and WEBDAV Interfaces- HTTP (Upload/Download)- WEBDAV (Drag & Drop)

� Why?– To enable Partners to post ITC Content to their WebSites

� Provide content in a structured format

� How?– Transform XML content into HTML via the Database and PL/SQL

� Content XML and XSL is stored in the Database as XMLTYPE� HTML Content is stored as CLOB data

– FTP HTML Content from the Production Database into Collaboration Suite Storage Repository

Application Architecture - DES

Page 38: Multimedia-enabled How to Develop - Oracle · Ingeniux CMS – Content Created as XML Files on Windows Server Easy to use Interface Data Entry Templates easily customizable – Custom

� The ITC Platform utilizes interMedia support of storage of popular file formats, including desktop publishing image, and streaming audio and video formats in databases.

� Through interMedia the ITC is able to add audio, image, and video, or other heterogeneous media columns or objects to existing tables, and insert and retrieve multimedia data.

� This enables the Senior Architect to extend existing databases with multimedia data, or to build new end-user multimedia database applications (e.g., Data Exchange)

Conclusion