wt.ixb.publicforhandlers
Interface ElementImporter

All Known Subinterfaces:
ClassExporterImporter
All Known Implementing Classes:
ClassExporterImporterTemplateGeneral

public interface ElementImporter

Interface for all class handrlers for import.

Supported API: true

Extendable: true


Method Summary
 void checkConflicts(IxbElement elem, Importer importer)
          Checks conflicts that can arise while import process.
 void finalizeCheckConflicts(Importer importer)
          Called in the end of conflict check process.
 void finalizeImport(Importer importer)
          Called in the end of the whole ipport process to execute any import process finalization.
 int getAdditionalImportPriority(IxbElement fileXML)
          Return the additional import priority based on the XML file, supplemented to getImportPriority().
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
 String getObjectDisplayID(IxbElement elem, Importer importer)
          Return the localized identity of the element that will be used in import operation.
 Object importElement(IxbElement elem, Importer importer)
          Imports XML element in context given by importer parameter.
 void outputLog(Object ob, Importer importer)
          Output log for imported object.
 void prepareForCheckConflicts(Importer importer)
          Called in the beginning of conflict check process prior to the real import or preview.
 void prepareForImport(Importer importer)
          Called in the end of conflict check process and prior to the real import process.
 void previewElement(IxbElement elem, Importer importer)
          Preview XML element in context given by importer parameter.
 

Method Detail

prepareForCheckConflicts

public void prepareForCheckConflicts(Importer importer)
                              throws WTException
Called in the beginning of conflict check process prior to the real import or preview.

Supported API: true

Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

checkConflicts

public void checkConflicts(IxbElement elem,
                           Importer importer)
                    throws WTException
Checks conflicts that can arise while import process.

Supported API: true

Parameters:
elem - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

finalizeCheckConflicts

public void finalizeCheckConflicts(Importer importer)
                            throws WTException
Called in the end of conflict check process.

Supported API: true

Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

prepareForImport

public void prepareForImport(Importer importer)
                      throws WTException
Called in the end of conflict check process and prior to the real import process.

Supported API: true

Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

getImportPriority

public int getImportPriority()
                      throws WTException
Return the import priority of the object type represented by this import handler.
Import priority defines the order in which objects will be imported. This method does not carry parameters in the signature. The return value can not be negative. Those XML files will have a higher import priority for smaller returned values.

Supported API: true

Returns:
int
Throws:
WTException

getAdditionalImportPriority

public int getAdditionalImportPriority(IxbElement fileXML)
                                throws WTException
Return the additional import priority based on the XML file, supplemented to getImportPriority().
The returned number defines the order in which XML file will be imported if getImportPriority() returns the same value. In general, if getImportPriority() returns a smaller value, it will have a higher import priority; for the XML files with the same value of getImportPriority(), the one with a smaller value from this method will have a higher import priority.The returned value must be at least 0.

Supported API: true

Parameters:
fileXML -
Returns:
int
Throws:
WTException

importElement

public Object importElement(IxbElement elem,
                            Importer importer)
                     throws WTException
Imports XML element in context given by importer parameter. Returns the imported object.

Supported API: true

Parameters:
elem - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Returns:
Object
Throws:
WTException

finalizeImport

public void finalizeImport(Importer importer)
                    throws WTException
Called in the end of the whole ipport process to execute any import process finalization.

Supported API: true

Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

previewElement

public void previewElement(IxbElement elem,
                           Importer importer)
                    throws WTException
Preview XML element in context given by importer parameter. Usually it will check conflicts without performing real import.

Supported API: true

Parameters:
elem - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

getObjectDisplayID

public String getObjectDisplayID(IxbElement elem,
                                 Importer importer)
                          throws WTException
Return the localized identity of the element that will be used in import operation. This is mostly for localized log purpose.

Supported API: true

Parameters:
elem - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Returns:
String
Throws:
WTException

outputLog

public void outputLog(Object ob,
                      Importer importer)
               throws WTException
Output log for imported object.

Supported API: true

Parameters:
ob - he object for the log. It can be a new imported object or an existing one in the datastore.
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException