com.wewebu.ow.server.app
Interface OwDocumentImporter


public interface OwDocumentImporter

Interface for document importers.
A document importer can be used by plugins that gather content like the add document, the save or the checkin plugins to receive the content from the user.

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


Field Summary
static int IMPORT_CONTEXT_CHECKIN
          context used in getView() if the view is used during the checkin of checked-out documents
static int IMPORT_CONTEXT_NEW
          context used in getView() if the view is used during the creation of new documents
static int IMPORT_CONTEXT_SAVE
          context used in getView() if the view is used to save new content to existing documents
 
Method Summary
 String getDisplayName()
          Get the display name representing this document importer in the UI.
 String getIconURL()
          Get the URL of the icon representing this document importer in the UI.
 OwView getPostProcessView(int importContext_p, OwObject savedObj_p)
          Return the view which should be displayed for post processing.
 OwView getView(int context_p, OwDocumentImporterCallback callback_p)
          Returns the UI view of this document importer.
 boolean hasPostProcessView(int importContext_p)
          Should return a boolean value which define if a post process view should be displayed or not after saving document into the back-end system.
 void init(OwMainAppContext context_p, OwXMLUtil config_p)
          Initialize this document importer from the XML fragment in the OwXMLUtil.
 void releaseAll()
          Releases all OwDocumentImportItems created by this importer during instantiation or the last invokation of this method.
 void setSingleFileImports(boolean singleFileImports_p)
          Each imported document becomes a document in the back-end ECM system.
 

Field Detail

IMPORT_CONTEXT_NEW

static final int IMPORT_CONTEXT_NEW
context used in getView() if the view is used during the creation of new documents

See Also:
Constant Field Values

IMPORT_CONTEXT_SAVE

static final int IMPORT_CONTEXT_SAVE
context used in getView() if the view is used to save new content to existing documents

See Also:
Constant Field Values

IMPORT_CONTEXT_CHECKIN

static final int IMPORT_CONTEXT_CHECKIN
context used in getView() if the view is used during the checkin of checked-out documents

See Also:
Constant Field Values
Method Detail

init

void init(OwMainAppContext context_p,
          OwXMLUtil config_p)
          throws OwConfigurationException
Initialize this document importer from the XML fragment in the OwXMLUtil.

Parameters:
context_p - The current OwMainAppContext for the importer
config_p - OwXMLUtil with the XML fragment configuring this document importer
Throws:
OwConfigurationException - if this document importer can not be initialized.

getIconURL

String getIconURL()
Get the URL of the icon representing this document importer in the UI.

Returns:
String containing the URL to the icon

getDisplayName

String getDisplayName()
Get the display name representing this document importer in the UI.

Returns:
String containing the display name

setSingleFileImports

void setSingleFileImports(boolean singleFileImports_p)
Each imported document becomes a document in the back-end ECM system. But documents can have multiple content streams in many ECM systems. This option defines if the document importer should only allow document imports to consist of one single file.

Parameters:
singleFileImports_p - true if the importer must accept at most one file per document

getView

OwView getView(int context_p,
               OwDocumentImporterCallback callback_p)
Returns the UI view of this document importer. This view has to use this document importer as document in the sense of the MVC design pattern. Multiple calls of this method will always return the same view. The context_p describes where the view should be used (new, checkin or save).
The view contains at least a button that invokes the import process and leads to a subsequent invocation of the onDocumentImported() method of the OwDocumentImporterCallback interface.

Parameters:
context_p -
callback_p -
Returns:
the UI view of this document importer

releaseAll

void releaseAll()
Releases all OwDocumentImportItems created by this importer during instantiation or the last invokation of this method. Also releases all addition resources like the temporary folder itself.
The OwView returned by getView(int, OwDocumentImporterCallback)} might create multiple OwDocumentImportItems during its lifetime. Although each item has it's own release() method, this might not be sufficient. Many implementations of this interface create a temporary folder upon instantiation or upon first usage that contains all temporary files associated with the imported documents. So there is a need to remove the containing folder itself and not only all files in it.
Please note 1:
The importer and all it's views must still be able to import documents after this method has been called. In fact, this method gets called multiple times. So it is wise for an importer to create its temporary folder upon first usage and remove it whenever this method is called. So it is re-created as soon as the importer is invoked after an releaseAll() call.
Please note 2:
This method must not rely on the fact that the release() method of all imported items has been called or has not been called. It must be able to deal with any situation.


hasPostProcessView

boolean hasPostProcessView(int importContext_p)
Should return a boolean value which define if a post process view should be displayed or not after saving document into the back-end system.

Parameters:
importContext_p - int representing one of OwDocumentImporter.IMPORT_CONTEXT_... value
Returns:
boolean true only if importer has a post process view for the given context

getPostProcessView

OwView getPostProcessView(int importContext_p,
                          OwObject savedObj_p)
Return the view which should be displayed for post processing.

Can return null, but should correspond with the hasPostProcessView(int) method by returning false for the same importContext_p

Parameters:
importContext_p - int representing one of OwDocumentImporter.IMPORT_CONTEXT_... value
savedObj_p - OwObject which was saved before (non-null reference)
Returns:
OwView or null if not exist for given context


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.