public class OwStandardContentCollection extends Object implements OwContentCollection, OwContentElement
Standard Implementation of the OwContentCollection interface for just one content type and page.
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
CONTENT_REPRESENTATION_TYPE_NONE, CONTENT_REPRESENTATION_TYPE_OBJECT, CONTENT_REPRESENTATION_TYPE_STREAM, CONTENT_REPRESENTATION_TYPE_URL, CONTENT_REPRESENTATION_TYPE_USER_START, CONTENT_TYPE_ANNOTATION, CONTENT_TYPE_DOCUMENT, CONTENT_TYPE_SECURITY, CONTENT_TYPE_USER_START
Constructor and Description |
---|
OwStandardContentCollection(InputStream input_p,
int iContentType_p,
int iPageNumber_p)
construct a content collection with just one page and one content type
|
OwStandardContentCollection(InputStream input_p,
int iContentType_p,
int iPageNumber_p,
String sMimeType_p)
construct a content collection with just one page and one content type
|
Modifier and Type | Method and Description |
---|---|
OwContentElement |
getContentElement(int iContentType_p,
int iPage_p)
get a content element for the given type and page
|
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.
|
Collection |
getContentTypes()
get a list of content types used in this object
|
String |
getContentURL()
get the content URL from the object.
|
String |
getMIMEParameter()
retrieve the MIME parameter for the specified page number
|
String |
getMIMEType()
retrieve the MIME type for the specified page number
|
int |
getPageCount()
retrieve the page count
|
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.
|
public OwStandardContentCollection(InputStream input_p, int iContentType_p, int iPageNumber_p)
input_p
- InputStream to the contentiContentType_p
- int the one and only content typeiPageNumber_p
- int the page number of the one and only pagepublic OwStandardContentCollection(InputStream input_p, int iContentType_p, int iPageNumber_p, String sMimeType_p)
input_p
- InputStream to the contentiContentType_p
- int the one and only content typeiPageNumber_p
- int the page number of the one and only pagesMimeType_p
- MIME Typepublic String getContentURL() throws Exception
getContentURL
in interface OwContentElement
Exception
public Object getContentObject() throws Exception
getContentObject
in interface OwContentElement
Exception
public int getContentRepresentation() throws Exception
getContentRepresentation
in interface OwContentElement
Exception
public boolean isInputStreamNative()
isInputStreamNative
in interface OwContentElement
public OwContentElement getContentElement(int iContentType_p, int iPage_p) throws Exception
getContentElement
in interface OwContentCollection
iContentType_p
- intiPage_p
- intException
public InputStream getContentStream(OutputStream out_p) throws Exception
getContentStream
in interface OwContentElement
out_p
- optional OutputStream, if set the method writes the OutputStream and returns null, otherwise it returns an InputStreamException
public Collection getContentTypes() throws Exception
getContentTypes
in interface OwContentCollection
Exception
public int getPageNumber(int lPageIndex_p) throws Exception
getPageNumber
in interface OwContentElement
lPageIndex_p
- zero based page index for the pages in the collectionException
public String getMIMEType() throws Exception
getMIMEType
in interface OwContentElement
Exception
public String getMIMEParameter() throws Exception
getMIMEParameter
in interface OwContentElement
Exception
public int getPageCount() throws Exception
getPageCount
in interface OwContentCollection
Exception
public String getContentFilePath() throws Exception
getContentFilePath
in interface OwContentElement
Exception
public void releaseResources()
OwContentElement
releaseResources
in interface OwContentElement
OwContentElement.releaseResources()
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.