wt.pdmlink
Class ProductTemplateIXHandler

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.pdmlink.ProductTemplateIXHandler
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter

public class ProductTemplateIXHandler
extends ClassExporterImporterTemplate

This handler updates the project seed object. Changes to organization name are not allowed, although an organization must exist.


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
private static String _rb
           
private  List fileNameList
           
private static int[] FROM_INDICES
           
private static PDMProductConstants.ProductConfigInfo projConfigTags
           
private static String SYSTEM_FOLDER
           
private static PDMProductConstants.ProductTemplateInfo tags
           
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
ProductTemplateIXHandler()
           
 
Method Summary
private  void cleanupContentDirectory(String contName, String tmplName)
           
 Object createObject(IxbElement topElement, Importer imp)
          Create a project template object.
 void exportObject(Object seed, Exporter exporter)
          Export of a project template is not supported at this time.
 Object finalizeImportObject(boolean isNew, Object origpt, IxbElement elem, Importer imp)
          Finalize import object is called when the project template already exists.
 Object findAmongExistingObjects(IxbElement elem, Importer imp)
          Reads the data from the sub elements to determine if the project exists.
private  File generateOutputDir(String orgName, String templateName)
           
private  Tuner generateTuner(String orgName, String templateName)
          This method generates the appropriate tuner for use in transforming a foreign project config into a a local project config.
 int getImportPriority()
          Needs to be implemented, but the meaning of the return value has never been documented.
private  IxbElement getLobTag(IxbElement topElement)
           
private  DefaultWTContainerTemplate importLob(DefaultWTContainerTemplate tmpl, IxbElement topElement, Importer imp)
           
private  DefaultWTContainerTemplate importTextLob(DefaultWTContainerTemplate tmpl, IxbElement xmlLob)
           
private  DefaultWTContainerTemplate importXMLFromLoadPath(DefaultWTContainerTemplate tmpl, IxbElement elem)
           
private  DefaultWTContainerTemplate importXMLFromZipEntry(DefaultWTContainerTemplate tmpl, IxbElement zipEntry, Importer imp)
           
private  DefaultWTContainerTemplate populateAttributes(DefaultWTContainerTemplate tmpl, IxbElement topElement, Importer imp)
           
private  DefaultWTContainerTemplate populateAttributes(IxbElement topElement, Importer imp)
           
private  void storeHashReference(IxbElement elem, WTContainerTemplate pt, Importer imp)
           
 Object storeObject(Object obj, IxbElement elem, Importer imp)
          That is the general template how to store object.
private  void writeContentToFileSystem(String orgName, String tmplName, IxbElement currTemplate, ImportHandler ih)
           
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportAttributes, getRootTag, importElement, importObjectAttributes, importObjectAttributesAfterStore, isObjectIgnored, isObjectNew, outputLog, rememberNewObInfo, setObjectIgnored, setObjectIsNew, storeAdditionalInfo, storeElement
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
checkConflicts, finalizeCheckConflicts, finalizeExport, finalizeImport, getAdditionalImportPriority, getObjectDisplayID, prepareForCheckConflicts, prepareForImport, previewElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSTEM_FOLDER

private static String SYSTEM_FOLDER

_rb

private static final String _rb
See Also:
Constant Field Values

tags

private static final PDMProductConstants.ProductTemplateInfo tags

projConfigTags

private static final PDMProductConstants.ProductConfigInfo projConfigTags

FROM_INDICES

private static final int[] FROM_INDICES

fileNameList

private List fileNameList
Constructor Detail

ProductTemplateIXHandler

public ProductTemplateIXHandler()
Method Detail

exportObject

public void exportObject(Object seed,
                         Exporter exporter)
                  throws WTException
Export of a project template is not supported at this time.

Specified by:
exportObject in interface ClassExporter
Overrides:
exportObject in class ClassExporterImporterTemplate
Parameters:
seed -
exporter - The Exporter instance that represents the context of the export operation.
Throws:
WTException

createObject

public Object createObject(IxbElement topElement,
                           Importer imp)
                    throws WTException
Create a project template object. An exception is thrown if the tag is not .

Specified by:
createObject in class ClassExporterImporterTemplate
Parameters:
topElement - : IxbElement, a node in the XML tree which correpsonds to the tag.
imp - : Importer the application which is controlling the import process.
Returns:
Object The newly created ProductTemplate object.
Throws:
WTException

populateAttributes

private DefaultWTContainerTemplate populateAttributes(IxbElement topElement,
                                                      Importer imp)
                                               throws WTException
Throws:
WTException

populateAttributes

private DefaultWTContainerTemplate populateAttributes(DefaultWTContainerTemplate tmpl,
                                                      IxbElement topElement,
                                                      Importer imp)
                                               throws WTException
Throws:
WTException

importLob

private DefaultWTContainerTemplate importLob(DefaultWTContainerTemplate tmpl,
                                             IxbElement topElement,
                                             Importer imp)
                                      throws WTException
Throws:
WTException

importXMLFromZipEntry

private DefaultWTContainerTemplate importXMLFromZipEntry(DefaultWTContainerTemplate tmpl,
                                                         IxbElement zipEntry,
                                                         Importer imp)
                                                  throws WTException
Throws:
WTException

cleanupContentDirectory

private void cleanupContentDirectory(String contName,
                                     String tmplName)

writeContentToFileSystem

private void writeContentToFileSystem(String orgName,
                                      String tmplName,
                                      IxbElement currTemplate,
                                      ImportHandler ih)
                               throws WTException
Throws:
WTException

importTextLob

private DefaultWTContainerTemplate importTextLob(DefaultWTContainerTemplate tmpl,
                                                 IxbElement xmlLob)
                                          throws WTException
Throws:
WTException

getLobTag

private IxbElement getLobTag(IxbElement topElement)
                      throws WTException
Throws:
WTException

importXMLFromLoadPath

private DefaultWTContainerTemplate importXMLFromLoadPath(DefaultWTContainerTemplate tmpl,
                                                         IxbElement elem)
                                                  throws WTException
Throws:
WTException

getImportPriority

public int getImportPriority()
                      throws WTException
Needs to be implemented, but the meaning of the return value has never been documented.

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

findAmongExistingObjects

public Object findAmongExistingObjects(IxbElement elem,
                                       Importer imp)
                                throws WTException
Reads the data from the sub elements to determine if the project exists. If so the project is returned.

Overrides:
findAmongExistingObjects in class ClassExporterImporterTemplate
Parameters:
elem -
imp -
Returns:
Object
Throws:
WTException

finalizeImportObject

public Object finalizeImportObject(boolean isNew,
                                   Object origpt,
                                   IxbElement elem,
                                   Importer imp)
                            throws WTException
Finalize import object is called when the project template already exists. The action here is to create a new iteration.

Overrides:
finalizeImportObject in class ClassExporterImporterTemplate
Throws:
WTException

storeHashReference

private void storeHashReference(IxbElement elem,
                                WTContainerTemplate pt,
                                Importer imp)
                         throws WTException
Throws:
WTException

generateOutputDir

private File generateOutputDir(String orgName,
                               String templateName)
                        throws WTException
Throws:
WTException

generateTuner

private Tuner generateTuner(String orgName,
                            String templateName)
                     throws WTException
This method generates the appropriate tuner for use in transforming a foreign project config into a a local project config. The only thing that needs to be changed is the contentId tag.

Throws:
WTException

storeObject

public Object storeObject(Object obj,
                          IxbElement elem,
                          Importer imp)
                   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

Overrides:
storeObject in class ClassExporterImporterTemplate
Parameters:
obj -
elem -
imp -
Returns:
Object
Throws:
WTException