Document Storage and EBS
By Tim Dexter on Aug 28, 2006
Couple more delivery channels to cover and we'll have exhausted the options for document delivery from EBS. For this article Im turning to document management. Many of you will have a document management system in your company this may be as simple as scanning invoice documents and storing them in some LOBS table in the EBS schema for later retrieval or you may have Oracle Files or maybe a third party solution.
To get the documents to the repository may involve some third party or custom code interfacing into the EBS stack. XML Publisher can help you get the documents to the repository directly from the concurrent manager. Whats more you can do this while you are delivering the document to the end user at the same time and even do some post processing to maybe add a watermark to the archived document with the word "COPY" striped across it.
Same again please ...
With all the work we have done with email and faxing we now know how the whole solution hangs together and how we can call APIs to get the documents delivered. All we need do is add the code to send the document(s) to the correct place in the repository. Just about all the document management solutions offer a webdav channel to push documents into the document repositiory. They may also have the ability to push in some metadata about the document. I have naturally picked on Oracle Files in the example below, but its still generic for all webdav servers.
/*create delivery manager instance*/
DeliveryManager dm = new DeliveryManager();
// create a delivery request
DeliveryRequest req = dm.createRequest(DeliveryManager.TYPE_WEBDAV);
// set document content type
// set the WebDAV server hostname
// set the WebDAV server port number
// set the target remote directory
// set the remote filename
// set username and password to access WebDAV server
// set the document
// submit the request
// close the request
I want to watermark ...
To add a watermark to the document its just a simple API call.
// You already have the document locally so call the PDFDoc merger
// and create input and output streams for it
PDFDocMerger docMerger = new PDFDocMerger(inputStreams, outputStream);
// You can use setTextDefaultWatermark() without these detailed setting
docMerger.setTextWatermark("COPY", 200f, 200f); //set text and place
docMerger.setTextWatermarkAngle(80); //set angle
docMerger.setTextWatermarkColor(1.0f, 0.3f, 0.5f); // set RGB Color
// Merge PDF Documents and generates new PDF Document
Pretty straightforward right?
There are a couple of points here:
1.There is a need to get the username/pwd for the repository. There are ways around this, putting documents into a public directory, passing the username/pwd from the EBS instance ... Im not going to cover this in this article thou.
2. Metadata - all of the repositories I have come across have a java interface to push meta data in. You could use the XML parsing techniques in the fax article to grab pertinent information about the document to join it in the repository.
Short but sweet ... next, custom channels