com.wewebu.ow.server.ecm
Interface OwContentElement

All Known Implementing Classes:
OwDocumentImportItemContentElement, OwFileObject, OwStandardContentCollection

public interface OwContentElement

Base interface for Content Elements. Content Elements hold a piece of date, page etc.

To be implemented with the specific ECM system.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Method Summary
 String getContentFilePath()
          get the file path to the content (optional, only available if content is stored locally) NOTE: This function is only used for ECM Systems which can only download through files If a FilePath exists, a stream will also exist.
 Object getContentObject()
          get the content object The content representation is of type Object
 int getContentRepresentation()
          get the content representation, which can be either URL, stream or object
 InputStream getContentStream(OutputStream out_p)
          get the content from the object.
 String getContentURL()
          get the content URL The content representation is of type URL (String)
 String getMIMEParameter()
          retrieve the MIME parameter for the specified page number
 String getMIMEType()
          retrieve the MIME type for the specified page number
 int getPageNumber(int lPageIndex_p)
          retrieve the page number for the given zero based index NOTE: the Page numbers might be arbitrary in the collection in order to submit specific page content
 boolean isInputStreamNative()
          check if getContentStream is based on an native InputStream or OutputStream NOTE: getContentStream must implement for Input- and OutputStream.
 void releaseResources()
          method is called e.g.
 

Method Detail

getContentFilePath

String getContentFilePath()
                          throws Exception
get the file path to the content (optional, only available if content is stored locally) NOTE: This function is only used for ECM Systems which can only download through files If a FilePath exists, a stream will also exist. The FilePath is optional, it can not be guaranteed to exist.

Returns:
String with path to a file where the content can be found or null if file is not available
Throws:
Exception

getContentURL

String getContentURL()
                     throws Exception
get the content URL The content representation is of type URL (String)

Returns:
String with URL to the resource where the content can be retrieved
Throws:
Exception

getContentObject

Object getContentObject()
                        throws Exception
get the content object The content representation is of type Object

Returns:
Object to content access
Throws:
Exception

getContentRepresentation

int getContentRepresentation()
                             throws Exception
get the content representation, which can be either URL, stream or object

Returns:
int with content representation type
Throws:
Exception

isInputStreamNative

boolean isInputStreamNative()
check if getContentStream is based on an native InputStream or OutputStream NOTE: getContentStream must implement for Input- and OutputStream. However for optimization the ContentCollection will tell, whether it is based on an InputStream or an OutputStream.

Returns:
true = InputStream is native, false = OutputStream is native

getContentStream

InputStream getContentStream(OutputStream out_p)
                             throws Exception
get the content from the object. If the document is a multipage document, the first page is retrieved unless otherwise set in setPage(...) The content representation is of type Stream NOTE: For performance and optimization reasons both the optional return of an InputStream and writing to the given OutputStream MUST be implemented

Parameters:
out_p - optional OutputStream, if set the method writes the OutputStream and returns null, otherwise it returns an InputStream
Returns:
content from the object, or throws OwContentNotFoundException if no content is available
Throws:
Exception

getPageNumber

int getPageNumber(int lPageIndex_p)
                  throws Exception
retrieve the page number for the given zero based index NOTE: the Page numbers might be arbitrary in the collection in order to submit specific page content

Returns:
long actual page number
Throws:
Exception

getMIMEType

String getMIMEType()
                   throws Exception
retrieve the MIME type for the specified page number

Returns:
String Mimetype
Throws:
Exception

getMIMEParameter

String getMIMEParameter()
                        throws Exception
retrieve the MIME parameter for the specified page number

Returns:
String MMIME Parameter
Throws:
Exception

releaseResources

void releaseResources()
method is called e.g. by GetContent servlet after the content is consumed. Can be used to release resources e.g. streams, Interactions, Connections etc. AFTER content is fetched.



Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.