com.ptc.windchill.cadx.common.util
Class NamingAndNumberingPolicyHelper

java.lang.Object
  extended bycom.ptc.windchill.cadx.common.util.NamingAndNumberingPolicyHelper

public class NamingAndNumberingPolicyHelper
extends Object


Field Summary
static int AUTO_NUMBERING
           
private static String AUTOASSOCIATE_DROP_NAME_EXTENSION_PARAMETER
           
private static String AUTOASSOCIATE_DROP_NUMBER_EXTENSION_PARAMETER
           
private static String AUTOASSOCIATE_NAME_PARAMETER
           
private static String AUTOASSOCIATE_NUMBER_PARAMETER
           
static int CUSTOM
           
static int DEFAULT
           
static int NAME_DRIVEN
           
static int PARAMETER_DRIVEN
           
private static String PARAMETERS_SOURCE
           
private static String POLICY_SECTION
           
private static String UPLOAD_DROP_NAME_EXTENSION_PARAMETER
           
private static String UPLOAD_DROP_NUMBER_EXTENSION_PARAMETER
           
private static String UPLOAD_NAME_PARAMETER
           
private static String UPLOAD_NUMBER_PARAMETER
           
 
Constructor Summary
NamingAndNumberingPolicyHelper()
           
 
Method Summary
static String getAutoAssociateNameParameter()
          Returns the parameter on the source object that should be used to set the name of the object being created in auto-associate
static String getAutoAssociateNumberParameter()
          Returns the parameter on the source object that should be used to set the number of the object being created in auto-associate
static int getAutoAssociatePolicy(WTContainer container, Class objectClass)
          Returns the naming and numbering policy set for the specified container.
static int getPolicy(WTContainer container, Class objectClass)
          Returns the naming and numbering policy set for the specified container.
static String getUploadNameParameter()
          Returns the model parameter that should be used to set the name of the EPMDocument being created in upload
static String getUploadNumberParameter()
          Returns the model parameter that should be used to set the number of the EPMDocument being created in upload
static int getUploadPolicy(WTContainer container, Class objectClass)
          Returns the naming and numbering policy set for the specified container.
static boolean isAutoAssociateDropNameFileExtension()
          Checks if the file extension should be droped from the Name of newly created object during Auto-associate
static boolean isAutoAssociateDropNumberFileExtension()
          Checks if the file extension should be droped from the number of newly created object during Auto-associate
private static boolean isAutoNumberingOn(WTContainer container, Class objectClass)
           
private static boolean isCustom(WTContainer container, Class objectClass)
           
static boolean isUploadDropNameFileExtension()
          Checks if the file extension should be droped from the Name of the EPMDocument that is being created during upload
static boolean isUploadDropNumberFileExtension()
          Checks if the file extension should be droped from the Number of the EPMDocument that is being created during upload
static void main(String[] args)
           
static String removeFileExtension(String string)
          Removes the file extension from the string if it exists If it has a dot and 3 characters after the dot, the dot and these 3 characters will be removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final int DEFAULT
See Also:
Constant Field Values

AUTO_NUMBERING

public static final int AUTO_NUMBERING
See Also:
Constant Field Values

PARAMETER_DRIVEN

public static final int PARAMETER_DRIVEN
See Also:
Constant Field Values

NAME_DRIVEN

public static final int NAME_DRIVEN
See Also:
Constant Field Values

CUSTOM

public static final int CUSTOM
See Also:
Constant Field Values

UPLOAD_NAME_PARAMETER

private static final String UPLOAD_NAME_PARAMETER
See Also:
Constant Field Values

UPLOAD_NUMBER_PARAMETER

private static final String UPLOAD_NUMBER_PARAMETER
See Also:
Constant Field Values

UPLOAD_DROP_NAME_EXTENSION_PARAMETER

private static final String UPLOAD_DROP_NAME_EXTENSION_PARAMETER
See Also:
Constant Field Values

UPLOAD_DROP_NUMBER_EXTENSION_PARAMETER

private static final String UPLOAD_DROP_NUMBER_EXTENSION_PARAMETER
See Also:
Constant Field Values

AUTOASSOCIATE_NAME_PARAMETER

private static final String AUTOASSOCIATE_NAME_PARAMETER
See Also:
Constant Field Values

AUTOASSOCIATE_NUMBER_PARAMETER

private static final String AUTOASSOCIATE_NUMBER_PARAMETER
See Also:
Constant Field Values

AUTOASSOCIATE_DROP_NAME_EXTENSION_PARAMETER

private static final String AUTOASSOCIATE_DROP_NAME_EXTENSION_PARAMETER
See Also:
Constant Field Values

AUTOASSOCIATE_DROP_NUMBER_EXTENSION_PARAMETER

private static final String AUTOASSOCIATE_DROP_NUMBER_EXTENSION_PARAMETER
See Also:
Constant Field Values

PARAMETERS_SOURCE

private static final String PARAMETERS_SOURCE
See Also:
Constant Field Values

POLICY_SECTION

private static final String POLICY_SECTION
See Also:
Constant Field Values
Constructor Detail

NamingAndNumberingPolicyHelper

public NamingAndNumberingPolicyHelper()
Method Detail

getPolicy

public static int getPolicy(WTContainer container,
                            Class objectClass)
                     throws WTException
Returns the naming and numbering policy set for the specified container. This method should be called from actions where new objects are being created by user (create dialogs).

Returns:
Throws:
WTException

getUploadPolicy

public static int getUploadPolicy(WTContainer container,
                                  Class objectClass)
                           throws WTException
Returns the naming and numbering policy set for the specified container. This method should be called from Upload Action

Returns:
Throws:
WTException

getAutoAssociatePolicy

public static int getAutoAssociatePolicy(WTContainer container,
                                         Class objectClass)
                                  throws WTException
Returns the naming and numbering policy set for the specified container. This method should be called from Auto- Associate Action

Returns:
Throws:
WTException

isAutoNumberingOn

private static boolean isAutoNumberingOn(WTContainer container,
                                         Class objectClass)
                                  throws WTException
Throws:
WTException

isCustom

private static boolean isCustom(WTContainer container,
                                Class objectClass)
                         throws WTException
Throws:
WTException

getUploadNumberParameter

public static String getUploadNumberParameter()
Returns the model parameter that should be used to set the number of the EPMDocument being created in upload

Returns:

getUploadNameParameter

public static String getUploadNameParameter()
Returns the model parameter that should be used to set the name of the EPMDocument being created in upload

Returns:

getAutoAssociateNumberParameter

public static String getAutoAssociateNumberParameter()
Returns the parameter on the source object that should be used to set the number of the object being created in auto-associate

Returns:

getAutoAssociateNameParameter

public static String getAutoAssociateNameParameter()
Returns the parameter on the source object that should be used to set the name of the object being created in auto-associate

Returns:

isUploadDropNameFileExtension

public static boolean isUploadDropNameFileExtension()
Checks if the file extension should be droped from the Name of the EPMDocument that is being created during upload

Returns:

isUploadDropNumberFileExtension

public static boolean isUploadDropNumberFileExtension()
Checks if the file extension should be droped from the Number of the EPMDocument that is being created during upload

Returns:

isAutoAssociateDropNameFileExtension

public static boolean isAutoAssociateDropNameFileExtension()
Checks if the file extension should be droped from the Name of newly created object during Auto-associate

Returns:

isAutoAssociateDropNumberFileExtension

public static boolean isAutoAssociateDropNumberFileExtension()
Checks if the file extension should be droped from the number of newly created object during Auto-associate

Returns:

removeFileExtension

public static String removeFileExtension(String string)
Removes the file extension from the string if it exists If it has a dot and 3 characters after the dot, the dot and these 3 characters will be removed. Otherwise the same string will be returned

Returns:

main

public static void main(String[] args)