wt.ixb.handlers.forclasses
Class ExpImpForRepresentation

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.ixb.publicforhandlers.AbsExpImpForNonIteratedObject
              extended bywt.ixb.handlers.forclasses.ExpImpForRepresentation
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter, ElementImportHandlerIfc, ExpImpOfObjectRefIfc, ExpOfObjectRefIfc, ImpOfObjectRefIfc, IxbSimpleAttributeHolderIfc

public class ExpImpForRepresentation
extends AbsExpImpForNonIteratedObject
implements IxbSimpleAttributeHolderIfc


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
static Representer representer
           
private static WVSProperties wvsProps
           
static String XML_ATTR_REPRESENTABLE_CLASSNAME
           
static String XML_ATTR_REPRESENTATION_CONTENT_ID
           
static String XML_ATTR_REPRESENTATION_DEFAULT
           
static String XML_ATTR_REPRESENTATION_DESCR
           
static String XML_ATTR_REPRESENTATION_NAME
           
static String XML_ATTR_REPRESENTATION_REF
           
static String XML_ATTR_REPRESENTATION_REF_ID
           
static String XML_ATTR_REPRESENTATION_REPUBLISHABLE
           
static String XML_SUBSTITUTE_REPRESENTATION_NAME
           
static String XML_TAG_REPRESENTABLE
           
static String XML_TAG_REPRESENTABLE_OBJ_REF
           
 
Fields inherited from class wt.ixb.publicforhandlers.AbsExpImpForNonIteratedObject
nonOverridableAttrVec, overridableAttrVec
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
ExpImpForRepresentation()
           
 
Method Summary
 Object _createObject(IxbElement fileXML, Importer importer)
          Create a Representation based on localId.
protected  Object _createSubstituteObject(IxbElement fileXML, Importer importer)
           
private  Representation _findAmongExistingRepresentations(Representable repable, IxbElement fileXML, Importer importer)
           
 Object _importObjectAttributes(Object object, boolean objectExistPriorImport, IxbElement element, Importer importer)
           
 void addAttrConflicts(Object existing, String newObjectId, IxbElement fileXML, Importer importer)
           
private  Representation createRepresentation(IxbElement fileXML, Importer importer)
           
private  Representation createRepresentation(String repName, IxbElement fileXML, Importer importer)
           
protected  void exportObjectAttributes(Object object, IxbElement fileXML, Exporter exporter)
           
 void exportObjectRef(Object object, IxbElement element, Exporter exporter)
           
private  void exportRepresentable(Representation object, IxbElement element, Exporter exporter)
           
private  void exportRepresentationContent(Object object, IxbElement fileXML, Exporter exporter)
           
 Object findObjectExistingPriorImport(IxbElement fileXML, Importer importer)
           
private  Representable findRepresentable(IxbElement fileXML, Importer importer)
           
protected  Object findSubstituteObjectExistingPriorImport(IxbElement fileXML, Importer importer)
           
 String getAttributeVal(Object object, String attrTag)
           
protected  String getExistingObjectIdString(Object object)
           
protected  String getImportedObjectIdString(IxbElement element)
           
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
 String getObjectDisplayID(IxbElement element, Importer importer)
          Return the localized identity of the element that will be used in import operation.
protected  String getObjectDisplayID(Object object)
           
protected  String getRootTag()
          Returns the desired root tag for the object type to be exported, e.g.
protected  String getSubstituteName(IxbElement fileXML)
           
 Object importObjectAttributes(Object object, IxbElement fileXML, Importer importer)
          Imports class specific atributes from the XML file.
 void setAttributeVal(Object object, String attrTag, String attrVal)
           
 Object storeObject(Object object, IxbElement fileXML, Importer importer)
          That is the general template how to store object.
private  boolean unzipRepresentationContent(File dir, IxbElement fileXML, Importer importer)
           
 
Methods inherited from class wt.ixb.publicforhandlers.AbsExpImpForNonIteratedObject
actionIsApplicable, addAttributeConflicts, addObjectConflict, addSimpleAttributeConflicts, checkConflicts, createObject, createSubstituteObject, devError, didObjectExistPriorImport, exportAttributes, exportSimpleAttributes, findAmongExistingObjects, findExistingSubstituteObject, findNCacheObjectFromXML, findObjectFromCache, findObjectFromXML, getActionName, getDefaultActionName, importElement, importObjectAttributesAfterStore, importSimpleAttributes, importSimpleAttributes, isObjectInConflict, logAndThrowWTException, logWTException, needToUpdate, objectExistPriorImport, outputLog, printLog, putObjectInfoInCache, resetObjectConflictContext, setObjectConflictContext, supportsImportActors
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportObject, finalizeImportObject, isObjectIgnored, isObjectNew, rememberNewObInfo, setObjectIgnored, setObjectIsNew, storeAdditionalInfo, storeElement
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
finalizeCheckConflicts, finalizeExport, finalizeImport, getAdditionalImportPriority, prepareForCheckConflicts, prepareForImport, previewElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_TAG_REPRESENTABLE

public static final String XML_TAG_REPRESENTABLE
See Also:
Constant Field Values

XML_ATTR_REPRESENTABLE_CLASSNAME

public static final String XML_ATTR_REPRESENTABLE_CLASSNAME
See Also:
Constant Field Values

XML_ATTR_REPRESENTATION_NAME

public static final String XML_ATTR_REPRESENTATION_NAME
See Also:
Constant Field Values

XML_ATTR_REPRESENTATION_DESCR

public static final String XML_ATTR_REPRESENTATION_DESCR
See Also:
Constant Field Values

XML_ATTR_REPRESENTATION_DEFAULT

public static final String XML_ATTR_REPRESENTATION_DEFAULT
See Also:
Constant Field Values

XML_ATTR_REPRESENTATION_REF

public static final String XML_ATTR_REPRESENTATION_REF
See Also:
Constant Field Values

XML_TAG_REPRESENTABLE_OBJ_REF

public static final String XML_TAG_REPRESENTABLE_OBJ_REF
See Also:
Constant Field Values

XML_ATTR_REPRESENTATION_REF_ID

public static final String XML_ATTR_REPRESENTATION_REF_ID
See Also:
Constant Field Values

XML_ATTR_REPRESENTATION_CONTENT_ID

public static final String XML_ATTR_REPRESENTATION_CONTENT_ID
See Also:
Constant Field Values

XML_ATTR_REPRESENTATION_REPUBLISHABLE

public static final String XML_ATTR_REPRESENTATION_REPUBLISHABLE
See Also:
Constant Field Values

XML_SUBSTITUTE_REPRESENTATION_NAME

public static final String XML_SUBSTITUTE_REPRESENTATION_NAME
See Also:
Constant Field Values

representer

public static final Representer representer

wvsProps

private static final WVSProperties wvsProps
Constructor Detail

ExpImpForRepresentation

public ExpImpForRepresentation()
Method Detail

getRootTag

protected String getRootTag()
Description copied from class: ClassExporterImporterTemplate
Returns the desired root tag for the object type to be exported, e.g. "WTDocument". Individual class handlers are expected to implement this method, otherwise the importer might be confused to choosed the exact class handler during import.

Supported API: true

Overrides:
getRootTag in class ClassExporterImporterTemplate
Returns:
String

getExistingObjectIdString

protected String getExistingObjectIdString(Object object)
                                    throws WTException
Specified by:
getExistingObjectIdString in class AbsExpImpForNonIteratedObject
Throws:
WTException

getImportedObjectIdString

protected String getImportedObjectIdString(IxbElement element)
                                    throws WTException
Specified by:
getImportedObjectIdString in class AbsExpImpForNonIteratedObject
Throws:
WTException

exportObjectRef

public void exportObjectRef(Object object,
                            IxbElement element,
                            Exporter exporter)
                     throws WTException
Specified by:
exportObjectRef in interface ExpOfObjectRefIfc
Throws:
WTException

exportObjectAttributes

protected void exportObjectAttributes(Object object,
                                      IxbElement fileXML,
                                      Exporter exporter)
                               throws WTException
Overrides:
exportObjectAttributes in class AbsExpImpForNonIteratedObject
Throws:
WTException

exportRepresentationContent

private void exportRepresentationContent(Object object,
                                         IxbElement fileXML,
                                         Exporter exporter)
                                  throws WTException
Throws:
WTException

exportRepresentable

private void exportRepresentable(Representation object,
                                 IxbElement element,
                                 Exporter exporter)
                          throws WTException
Throws:
WTException

_createObject

public Object _createObject(IxbElement fileXML,
                            Importer importer)
                     throws WTException
Create a Representation based on localId.

Supported API: true

Specified by:
_createObject in class AbsExpImpForNonIteratedObject
Parameters:
fileXML - XML file that contains information about the WTPartUsageLink
Returns:
the link if it is successfully created, or null
Throws:
WTException

importObjectAttributes

public Object importObjectAttributes(Object object,
                                     IxbElement fileXML,
                                     Importer importer)
                              throws WTException
Description copied from class: ClassExporterImporterTemplate
Imports class specific atributes from the XML file. This method should be implemented for most of the class handlers. If the object class inherits from another replicated class (for example, inherits from WTPart) then it generally should give a new implementation for this method; in this implementation it should at first call importObjectAttributes of its ansector

Supported API: true

Specified by:
importObjectAttributes in interface ElementImportHandlerIfc
Overrides:
importObjectAttributes in class AbsExpImpForNonIteratedObject
Throws:
WTException

createRepresentation

private Representation createRepresentation(IxbElement fileXML,
                                            Importer importer)
                                     throws WTException,
                                            IOException
Throws:
WTException
IOException

createRepresentation

private Representation createRepresentation(String repName,
                                            IxbElement fileXML,
                                            Importer importer)
                                     throws WTException,
                                            IOException
Throws:
WTException
IOException

unzipRepresentationContent

private boolean unzipRepresentationContent(File dir,
                                           IxbElement fileXML,
                                           Importer importer)
                                    throws WTException,
                                           IOException
Throws:
WTException
IOException

_findAmongExistingRepresentations

private Representation _findAmongExistingRepresentations(Representable repable,
                                                         IxbElement fileXML,
                                                         Importer importer)
                                                  throws WTException
Throws:
WTException

findRepresentable

private Representable findRepresentable(IxbElement fileXML,
                                        Importer importer)
                                 throws WTException
Throws:
WTException

findObjectExistingPriorImport

public Object findObjectExistingPriorImport(IxbElement fileXML,
                                            Importer importer)
                                     throws WTException
Specified by:
findObjectExistingPriorImport in class AbsExpImpForNonIteratedObject
Throws:
WTException

addAttrConflicts

public void addAttrConflicts(Object existing,
                             String newObjectId,
                             IxbElement fileXML,
                             Importer importer)
                      throws WTException
Overrides:
addAttrConflicts in class AbsExpImpForNonIteratedObject
Throws:
WTException

_importObjectAttributes

public Object _importObjectAttributes(Object object,
                                      boolean objectExistPriorImport,
                                      IxbElement element,
                                      Importer importer)
                               throws WTException
Overrides:
_importObjectAttributes in class AbsExpImpForNonIteratedObject
Throws:
WTException

getImportPriority

public int getImportPriority()
                      throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
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

Specified by:
getImportPriority in interface ElementImporter
Specified by:
getImportPriority in class ClassExporterImporterTemplateGeneral
Returns:
int
Throws:
WTException

storeObject

public Object storeObject(Object object,
                          IxbElement fileXML,
                          Importer importer)
                   throws WTException
Description copied from class: ClassExporterImporterTemplate
That is the general template how to store object. It looks like it will be good for many classes. If for some class it is not good then it can be override this method

Supported API: true

Specified by:
storeObject in interface ElementImportHandlerIfc
Overrides:
storeObject in class AbsExpImpForNonIteratedObject
Throws:
WTException

getAttributeVal

public String getAttributeVal(Object object,
                              String attrTag)
                       throws WTException
Specified by:
getAttributeVal in interface IxbSimpleAttributeHolderIfc
Overrides:
getAttributeVal in class AbsExpImpForNonIteratedObject
Throws:
WTException

setAttributeVal

public void setAttributeVal(Object object,
                            String attrTag,
                            String attrVal)
                     throws WTException,
                            WTPropertyVetoException
Specified by:
setAttributeVal in interface IxbSimpleAttributeHolderIfc
Overrides:
setAttributeVal in class AbsExpImpForNonIteratedObject
Throws:
WTException
WTPropertyVetoException

_createSubstituteObject

protected Object _createSubstituteObject(IxbElement fileXML,
                                         Importer importer)
                                  throws WTException
Specified by:
_createSubstituteObject in class AbsExpImpForNonIteratedObject
Throws:
WTException

findSubstituteObjectExistingPriorImport

protected Object findSubstituteObjectExistingPriorImport(IxbElement fileXML,
                                                         Importer importer)
                                                  throws WTException
Specified by:
findSubstituteObjectExistingPriorImport in class AbsExpImpForNonIteratedObject
Throws:
WTException

getSubstituteName

protected String getSubstituteName(IxbElement fileXML)
                            throws WTException
Throws:
WTException

getObjectDisplayID

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

Supported API: true

Specified by:
getObjectDisplayID in interface ElementImporter
Overrides:
getObjectDisplayID in class ClassExporterImporterTemplateGeneral
Parameters:
element - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Returns:
String
Throws:
WTException

getObjectDisplayID

protected String getObjectDisplayID(Object object)
                             throws WTException
Overrides:
getObjectDisplayID in class AbsExpImpForNonIteratedObject
Throws:
WTException