wt.ixb.handlers.netmarkets
Class NMACLRuleIXHandler

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

public class NMACLRuleIXHandler
extends ClassExporterImporterTemplate


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
private static String _rb
           
private static String ACCESS_RESOURCE
           
private static String ADMIN_RESOURCE
           
private static AccessPermission[] ALLPERMS
           
private static Map AP2DTDMAP
           
private static int DENY
           
private static int DENY_MAP
           
private static int DOMAIN_REF
           
private static int GRANT
           
private static int GRANT_MAP
           
private static String NO_RULE_FOUND
           
private static String ORG_RESOURCE
           
private static NMProjectConstants.AclPermissionInfo permAttrs
           
private static String PERMISSIONS_KEY
           
private static NMProjectConstants.PolicyRulesInfo policyTags
           
private static int PRINC_REF
           
private static int STATE
           
private static int TYPE_ID
           
private static Class WTGROUP_CLASS
           
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
NMACLRuleIXHandler()
           
 
Method Summary
private static void addPerm(AccessPermission perm, IxbElement permElem)
           
private  DirectoryContextProvider[] computeContexts(WTContainerRef contRef)
           
 Object createObject(IxbElement element, Importer importer)
          Creates new instance of Windchill object.
private  Hashtable createRulePermissionMap(AccessPolicyRule rule)
           
private  String displayPermissions(Vector permissions)
           
static void exportContainerPolicyRules(IxbElement element, Exporter exp)
           
private static void exportDomainRules(EnumeratorVector allRules, IxbElement element, Exporter exp)
           
 void exportObject(Object seed, Exporter exp)
          Exports the specified object in context given by parameter exporter.
 Object findAmongExistingObjects(IxbElement element, Importer importer)
          Implements typical way of finding whether object from given XML file exists already in Windchill database.
private static EnumeratorVector getAccessControlRules(AdminDomainRef domain_ref)
           
private  AccessSelector getAccessSelector(IxbElement element, Importer importer)
           
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
private  Map getKeyMap(IxbElement perms)
           
private  WTPrincipalReference getRulePrincipal(IxbElement element, Importer importer)
           
private  List populateContextProviders(WTContainerRef contRef, List contextList)
           
private  String prepareState(IxbElement element)
           
private  String prepareTypeId(IxbElement element)
           
 Object storeObject(Object entry, IxbElement element, Importer importer)
          That is the general template how to store object.
private static void writeXML(String domainPath, String typeId, String princName, String stateName, List perms, IxbElement element, Exporter exp, boolean grantFlag)
           
 
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

ACCESS_RESOURCE

private static final String ACCESS_RESOURCE
See Also:
Constant Field Values

ADMIN_RESOURCE

private static final String ADMIN_RESOURCE
See Also:
Constant Field Values

ORG_RESOURCE

private static final String ORG_RESOURCE
See Also:
Constant Field Values

WTGROUP_CLASS

private static final Class WTGROUP_CLASS

NO_RULE_FOUND

private static final String NO_RULE_FOUND
See Also:
Constant Field Values

PERMISSIONS_KEY

private static final String PERMISSIONS_KEY

policyTags

private static final NMProjectConstants.PolicyRulesInfo policyTags

permAttrs

private static final NMProjectConstants.AclPermissionInfo permAttrs

ALLPERMS

private static final AccessPermission[] ALLPERMS

AP2DTDMAP

private static final Map AP2DTDMAP

DOMAIN_REF

private static final int DOMAIN_REF
See Also:
Constant Field Values

TYPE_ID

private static final int TYPE_ID
See Also:
Constant Field Values

STATE

private static final int STATE
See Also:
Constant Field Values

PRINC_REF

private static final int PRINC_REF
See Also:
Constant Field Values

GRANT_MAP

private static final int GRANT_MAP
See Also:
Constant Field Values

DENY_MAP

private static final int DENY_MAP
See Also:
Constant Field Values

GRANT

private static final int GRANT
See Also:
Constant Field Values

DENY

private static final int DENY
See Also:
Constant Field Values
Constructor Detail

NMACLRuleIXHandler

public NMACLRuleIXHandler()
Method Detail

exportObject

public void exportObject(Object seed,
                         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:
seed -
exp - The Exporter instance that represents the context of the export operation.
Throws:
WTException

exportContainerPolicyRules

public static void exportContainerPolicyRules(IxbElement element,
                                              Exporter exp)
                                       throws WTException
Throws:
WTException

exportDomainRules

private static final void exportDomainRules(EnumeratorVector allRules,
                                            IxbElement element,
                                            Exporter exp)
                                     throws WTException
Throws:
WTException

createObject

public Object createObject(IxbElement element,
                           Importer importer)
                    throws WTException
Description copied from class: ClassExporterImporterTemplate
Creates new instance of Windchill object. Every class requires its own method to create object of this class. So, this method must be overriden by any class specific import handler

Supported API: true

Specified by:
createObject in class ClassExporterImporterTemplate
Parameters:
element -
importer -
Returns:
Object
Throws:
WTException

createRulePermissionMap

private Hashtable createRulePermissionMap(AccessPolicyRule rule)
                                   throws WTException
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 element,
                                       Importer importer)
                                throws WTException
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:
element -
importer -
Returns:
Object
Throws:
WTException

storeObject

public Object storeObject(Object entry,
                          IxbElement element,
                          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

Overrides:
storeObject in class ClassExporterImporterTemplate
Parameters:
entry -
element -
importer -
Returns:
Object
Throws:
WTException

displayPermissions

private String displayPermissions(Vector permissions)

getAccessSelector

private AccessSelector getAccessSelector(IxbElement element,
                                         Importer importer)
                                  throws WTException
Throws:
WTException

getRulePrincipal

private WTPrincipalReference getRulePrincipal(IxbElement element,
                                              Importer importer)
                                       throws WTException
Throws:
WTException

getKeyMap

private Map getKeyMap(IxbElement perms)
               throws WTException
Throws:
WTException

prepareState

private String prepareState(IxbElement element)
                     throws WTException
Throws:
WTException

prepareTypeId

private String prepareTypeId(IxbElement element)
                      throws WTException
Throws:
WTException

computeContexts

private DirectoryContextProvider[] computeContexts(WTContainerRef contRef)
                                            throws WTException
Throws:
WTException

populateContextProviders

private List populateContextProviders(WTContainerRef contRef,
                                      List contextList)
                               throws WTException
Throws:
WTException

getAccessControlRules

private static EnumeratorVector getAccessControlRules(AdminDomainRef domain_ref)
                                               throws WTException
Throws:
WTException

writeXML

private static void writeXML(String domainPath,
                             String typeId,
                             String princName,
                             String stateName,
                             List perms,
                             IxbElement element,
                             Exporter exp,
                             boolean grantFlag)
                      throws WTException
Throws:
WTException

addPerm

private static void addPerm(AccessPermission perm,
                            IxbElement permElem)
                     throws WTException
Throws:
WTException