wt.ixb.handlers.netmarkets
Class FolderStructureIXHandler

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.ixb.handlers.netmarkets.FolderStructureIXHandler
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter

public class FolderStructureIXHandler
extends ClassExporterImporterTemplate


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
private static String _rb
           
private static NMProjectConstants.FolderAclInfo aclTags
           
private static NMProjectConstants.FolderStructInfo folderTags
           
private static int[] FROM_INDICES
           
private static NMProjectConstants.TeamInfo teamTags
           
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
FolderStructureIXHandler()
           
 
Method Summary
static String constructFolderPath(String root_path, String folder_name)
           
 Object createObject(IxbElement elem, Importer imp)
           /Default Default / Design Alpha Alpha Beta Gamma Testing Initial Final
private static void exportFolderAdHocAcls(OrderedFolder folderSet, IxbElement elem, Exporter exp)
           
static void exportFolderStructure(Folder folder, IxbElement elem, boolean doAcls, boolean doLinks, Exporter exporter)
           
static void exportFolderStructure(Folder folder, IxbElement elem, boolean doAcls, Exporter exporter)
           
static void exportFolderStructure(IxbElement elem, boolean doAcls, boolean doLinks, Exporter exp)
           
static void exportFolderStructure(IxbElement elem, boolean doAcls, Exporter exp)
           FolderStructure cabinet rootPath (subFolder | bookmark | folderContentObjectReference)*, folderAcl* folderContentObjectReference folderPath (referenceName, referenceNumber) | ObjectID
static void exportFolderStructure(IxbElement elem, Exporter exp)
           
static void exportNestedFolder(AdminDomainRef parentDomain, SubFolder folder, boolean doAcls, IxbElement elem)
           
 void exportObject(Object fs, Exporter exp)
          Exports the specified object in context given by parameter exporter.
 Object findAmongExistingObjects(IxbElement elem, Importer imp)
          Implements typical way of finding whether object from given XML file exists already in Windchill database.
static QueryResult findFolderLinks(WTContainerRef contRef)
           
static boolean folderExists(String folderPath, WTContainerRef ref)
           
private  String getCabinet(IxbElement elem, Importer imp)
           
static Folder getFolder(String folderPath, WTContainerRef ref)
           
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
private static ObjectIdentifier getOid(Object obj)
           
private  String getRootPath(String cabinet, AdminDomainRef domain, IxbElement elem, Importer imp)
           
private  AdminDomainRef getTopDomain(IxbElement elem, Importer imp)
           
private  void importFolderAcl(IxbElement elem, String rootPath, Importer imp, WTContainerRef cont_ref)
           
 void importFolderACL(String cabinet, AdminDomainRef domainRef, String rootPath, IxbElement elem, Importer imp)
           
 void importFolderLink(String cabinet, AdminDomainRef domainRef, String rootPath, IxbElement elem, Importer imp)
           
 void importNestedFolder(String cabinet, AdminDomainRef domainRef, String rootPath, IxbElement elem, Importer imp)
           
 void importSubFolder(String cabinet, AdminDomainRef domainRef, String rootPath, IxbElement elem, Importer imp)
           
private  void resetFolderAcl(IxbElement elem, String rootPath, Importer imp, WTContainerRef cont_ref, List folder_list)
           
private  String showPermissions(List permissions)
           
 Object storeObject(Object obj, IxbElement elem, Importer imp)
          That is the general template how to store object.
private static List writeXML(String subFolder, RolePermissionMap currMap, List alreadyDone, IxbElement topElem, Exporter exp)
           
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportAttributes, finalizeImportObject, 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

_rb

private static final String _rb
See Also:
Constant Field Values

FROM_INDICES

private static final int[] FROM_INDICES

folderTags

private static final NMProjectConstants.FolderStructInfo folderTags

aclTags

private static final NMProjectConstants.FolderAclInfo aclTags

teamTags

private static final NMProjectConstants.TeamInfo teamTags
Constructor Detail

FolderStructureIXHandler

public FolderStructureIXHandler()
Method Detail

exportObject

public void exportObject(Object fs,
                         Exporter exp)
                  throws WTException
Description copied from class: ClassExporterImporterTemplate
Exports the specified object in context given by parameter exporter.
The implementation of this method is partitioned into several protected methods. Individual class handlers can override the following protected methods: Also, export actions from either client or system registry will be performed. Specifically, the two methods wt.ixb.tuner.ExportActionHelper.performPreExportAction () and wt.ixb.tuner.ExportActionHelper.performPostExportAction () will be called before and after th above three protected methods, respectively.

Supported API: true

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

exportFolderStructure

public static void exportFolderStructure(IxbElement elem,
                                         Exporter exp)
                                  throws WTException
Throws:
WTException

exportFolderStructure

public static void exportFolderStructure(IxbElement elem,
                                         boolean doAcls,
                                         Exporter exp)
                                  throws WTException
  FolderStructure
      cabinet
      rootPath
      (subFolder | bookmark | folderContentObjectReference)*, folderAcl*

  folderContentObjectReference
      folderPath
      (referenceName, referenceNumber) | ObjectID
 
Assumes current project is the project passed as argument.

Throws:
WTException

exportFolderStructure

public static void exportFolderStructure(IxbElement elem,
                                         boolean doAcls,
                                         boolean doLinks,
                                         Exporter exp)
                                  throws WTException
Throws:
WTException

exportFolderStructure

public static void exportFolderStructure(Folder folder,
                                         IxbElement elem,
                                         boolean doAcls,
                                         Exporter exporter)
                                  throws WTException
Throws:
WTException

exportNestedFolder

public static void exportNestedFolder(AdminDomainRef parentDomain,
                                      SubFolder folder,
                                      boolean doAcls,
                                      IxbElement elem)
                               throws WTException
Throws:
WTException

exportFolderStructure

public static void exportFolderStructure(Folder folder,
                                         IxbElement elem,
                                         boolean doAcls,
                                         boolean doLinks,
                                         Exporter exporter)
                                  throws WTException
Throws:
WTException

getCabinet

private String getCabinet(IxbElement elem,
                          Importer imp)
                   throws WTException
Throws:
WTException

getTopDomain

private AdminDomainRef getTopDomain(IxbElement elem,
                                    Importer imp)
                             throws WTException
Throws:
WTException

getRootPath

private String getRootPath(String cabinet,
                           AdminDomainRef domain,
                           IxbElement elem,
                           Importer imp)
                    throws WTException
Throws:
WTException

importNestedFolder

public void importNestedFolder(String cabinet,
                               AdminDomainRef domainRef,
                               String rootPath,
                               IxbElement elem,
                               Importer imp)
                        throws WTException
Throws:
WTException

importSubFolder

public void importSubFolder(String cabinet,
                            AdminDomainRef domainRef,
                            String rootPath,
                            IxbElement elem,
                            Importer imp)
                     throws WTException
Throws:
WTException

importFolderLink

public void importFolderLink(String cabinet,
                             AdminDomainRef domainRef,
                             String rootPath,
                             IxbElement elem,
                             Importer imp)
                      throws WTException
Throws:
WTException

importFolderACL

public void importFolderACL(String cabinet,
                            AdminDomainRef domainRef,
                            String rootPath,
                            IxbElement elem,
                            Importer imp)
                     throws WTException
Throws:
WTException

createObject

public Object createObject(IxbElement elem,
                           Importer imp)
                    throws WTException
  
    /Default
    Default
    /
    
      Design
      Alpha
      
        Alpha
      
      
        Beta
      
      
        Gamma
      
    
    
      Testing
      
        Initial
      
      
        Final
      
    
  
  

Specified by:
createObject in class ClassExporterImporterTemplate
Parameters:
elem -
imp -
Returns:
Object
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

findAmongExistingObjects

public Object findAmongExistingObjects(IxbElement elem,
                                       Importer imp)
                                throws WTException
Description copied from class: ClassExporterImporterTemplate
Implements typical way of finding whether object from given XML file exists already in Windchill database.

Supported API: true

Overrides:
findAmongExistingObjects in class ClassExporterImporterTemplate
Parameters:
elem -
imp -
Returns:
Object
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

resetFolderAcl

private void resetFolderAcl(IxbElement elem,
                            String rootPath,
                            Importer imp,
                            WTContainerRef cont_ref,
                            List folder_list)
                     throws WTException
Throws:
WTException

importFolderAcl

private void importFolderAcl(IxbElement elem,
                             String rootPath,
                             Importer imp,
                             WTContainerRef cont_ref)
                      throws WTException
Throws:
WTException

exportFolderAdHocAcls

private static void exportFolderAdHocAcls(OrderedFolder folderSet,
                                          IxbElement elem,
                                          Exporter exp)
                                   throws WTException
Throws:
WTException

writeXML

private static List writeXML(String subFolder,
                             RolePermissionMap currMap,
                             List alreadyDone,
                             IxbElement topElem,
                             Exporter exp)
                      throws WTException
Throws:
WTException

findFolderLinks

public static QueryResult findFolderLinks(WTContainerRef contRef)
                                   throws WTException
Throws:
WTException

folderExists

public static boolean folderExists(String folderPath,
                                   WTContainerRef ref)
                            throws WTException
Throws:
WTException

getFolder

public static Folder getFolder(String folderPath,
                               WTContainerRef ref)
                        throws WTException
Throws:
WTException

constructFolderPath

public static String constructFolderPath(String root_path,
                                         String folder_name)

showPermissions

private String showPermissions(List permissions)

getOid

private static ObjectIdentifier getOid(Object obj)