public class OwStandardDocumentImportItem extends Object implements OwDocumentImportItem
The OwStandardDocumentImportItem
is a default implementation
that can be used if collecting the imported file(s), identified by a numerical
ID, in some temporary directory.
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
Modifier and Type | Field and Description |
---|---|
protected int |
m_id
the ID of the imported file.
|
protected String |
m_mimeParameter
the MIME parameter of the imported file
|
protected String |
m_mimeType
the MIME type of the imported file
|
protected String |
m_originalFileName
the original file name
|
protected String |
m_tempDir
the temporary directory where the import file is stored
|
Constructor and Description |
---|
OwStandardDocumentImportItem(String tempDir_p,
int id_p,
String originalFileName_p)
Create a new
OwStandardDocumentImportItem with the given parameters. |
Modifier and Type | Method and Description |
---|---|
Boolean |
getCheckinAsMajor()
Return a Boolean representing the checkin status
for this item, possible values are:
Boolean.TRUE : create/checkin as major version
Boolean.FALSE : create/checkin as minor version
null : action should be request from user/or ignore
|
String |
getContentMimeParameter(int i_p)
Returns the MIME parameter of the i-th content stream.
|
String |
getContentMimeType(int i_p)
Returns the MIME type of the i-th content stream.
|
InputStream |
getContentStream(int i_p)
Returns the ith content stream of the imported document as InputStream.
|
int |
getContentStreamCount()
Returns the number of content elements associated with this imported document.
|
String |
getDisplayName()
Returns a String that represents this imported Document.
Used for example for the stack of imported documents. |
String |
getObjectClassName()
Return the ECM classification name for this OwDocumentItem, which should be used
to save the document in the back-end system.
|
String |
getPreviewFilePath(int i_p)
Returns the full path to a file that can be used for preview of the i-th content
stream.
|
Map |
getPropertyValueMap()
Returns a Map with property class to value mappings.
|
String |
getProposedDocumentName()
Returns the proposed Document name.
Nearly every ECM back-end knows some name property or represents item property that is used by this ECM system as a name of the document. |
void |
release()
Release this imported document by freeing all temporarily acquired resources like
deleting temporary files.
Please note: This method must be able to deal with (a) multiple calls of this method, and (b) calls to this method AFTER a call to releaseAll of the creating importer. |
protected String m_tempDir
protected int m_id
protected String m_originalFileName
protected String m_mimeType
protected String m_mimeParameter
public OwStandardDocumentImportItem(String tempDir_p, int id_p, String originalFileName_p) throws Exception
OwStandardDocumentImportItem
with the given parameters.tempDir_p
- the directory where the imported file is locatedid_p
- the numeric ID of the imported file. The file must be stored in the
temporary directory by this ID as file name without a file extension,
e.g. /foo/bar/123 where /foo/bar is the temp directory and 123 is the
numeric IDoriginalFileName_p
- the original file name of the imported fileException
- if the MIME type can not be detectedpublic InputStream getContentStream(int i_p) throws Exception
OwDocumentImportItem
getContentStream
in interface OwDocumentImportItem
i_p
- zero-based index in the list of imported content streamsException
- if the InputStream
of this imported document can not be createdpublic String getPreviewFilePath(int i_p)
OwDocumentImportItem
getPreviewFilePath
in interface OwDocumentImportItem
i_p
- zero-based index in the list of imported conent streamspublic int getContentStreamCount()
OwDocumentImportItem
getContentStreamCount
in interface OwDocumentImportItem
public String getDisplayName()
OwDocumentImportItem
getDisplayName
in interface OwDocumentImportItem
public Map getPropertyValueMap()
OwDocumentImportItem
getPropertyValueMap
in interface OwDocumentImportItem
public String getProposedDocumentName()
OwDocumentImportItem
getProposedDocumentName
in interface OwDocumentImportItem
public void release() throws Exception
OwDocumentImportItem
releaseAll
of the creating importer.release
in interface OwDocumentImportItem
Exception
- if there are problems freeing the ocupied resourcespublic String getContentMimeParameter(int i_p)
OwDocumentImportItem
getContentMimeParameter
in interface OwDocumentImportItem
i_p
- zero-based index in the list of imported content streamspublic String getContentMimeType(int i_p)
OwDocumentImportItem
getContentMimeType
in interface OwDocumentImportItem
i_p
- zero-based index in the list of imported content streamspublic Boolean getCheckinAsMajor()
OwDocumentImportItem
Boolean.TRUE
: create/checkin as major versionBoolean.FALSE
: create/checkin as minor versionnull
: action should be request from user/or ignoregetCheckinAsMajor
in interface OwDocumentImportItem
public String getObjectClassName()
OwDocumentImportItem
Can return null
, so the default handling
or user action should be processed.
getObjectClassName
in interface OwDocumentImportItem
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.