com.ptc.wvs.server.util
Class PublishUtils

java.lang.Object
  extended bycom.ptc.wvs.server.util.PublishUtils

public class PublishUtils
extends Object


Field Summary
private static boolean allowAdminDeleteRepresentation
           
private static boolean allowAdminMakeDefaultRepresentation
           
private static boolean allowAdminPublishEPMDocument
           
private static boolean allowAdminPublishWTDocument
           
private static boolean allowAdminPublishWTPart
           
private static boolean allowDeleteRepresentation
           
private static boolean allowMakeDefaultRepresentation
           
private static boolean allowPublishEPMDocument
           
private static boolean allowPublishWTDocument
           
private static boolean allowPublishWTPart
           
static String CC
           
static String CCZ
           
private static double DCM
           
private static double DDM
           
private static double DFT
           
private static double DIN
           
private static double DKM
           
private static double DM
           
private static double DMI
           
private static double DMM
           
private static double DTOR
           
static String DWG
           
static String DXF
           
static String ED
           
static String ED_LOWER
           
private static String edzPrefDefault
           
static String END_URLHIDE
           
private static String EPM_PROP_GROUP
           
(package private) static ArrayList explicitNameList
           
private static boolean flagRepOutOfDate
           
private static Method getAllPartsForEPMDocMethod
           
private static Method getEPMDocForPartMethod
           
private static Method getPartForEPMDocMethod
           
static String HPGL
           
(package private) static String IBA_START_1
           
(package private) static String IBA_START_2
           
(package private) static String IBA_START_3
           
(package private) static String IBA_VALUE_1
           
(package private) static String IBA_VALUE_2
           
(package private) static String IBA_VALUE_3
           
(package private) static ArrayList ibaSkipNameList
           
private static boolean includeWorkingInEPMDocSB
           
private static boolean includeWorkingInPartSB
           
static RepresentationType INTERCOMM_REPRESENTATION_TYPE
           
private static boolean intercommEnabled
           
static int LEN_END_URLHIDE
           
static String OL
           
private static String PART_PROP_GROUP
           
static String PLT
           
private static boolean SHOW_PROP_PAGE_LINK
           
private static boolean SHOW_WT_PROPS
           
static String START_URLHIDE
           
static String THUMBNAIL_PROPERTIES
           
private static boolean VERBOSE_BUILD
           
private static WVSProperties wvsProperties
           
 
Constructor Summary
PublishUtils()
           
 
Method Summary
static void addEPMDocumentProperties(DefaultMutableTreeNode n, Persistable doc)
           
static void addEPMDocumentProperties(Hashtable p, Persistable doc)
           
static void addEPMMemberLinkProperties(DefaultMutableTreeNode n, Persistable link)
           
static void addEPMMemberLinkProperties(Hashtable p, Persistable link)
           
static void addIBAProperties(Hashtable p, String prefix, String propGroup, Persistable persist)
           
static void addPartLinkProperties(DefaultMutableTreeNode n, Persistable link)
           
static void addPartLinkProperties(Hashtable p, Persistable link)
           
static void addPartProperties(DefaultMutableTreeNode n, Hashtable p, Persistable part)
           
static void addPartProperties(DefaultMutableTreeNode n, Persistable part)
           
static void addPartProperties(Hashtable p, Persistable part)
           
static void addSignatureProperties(Hashtable p, String prefix, String propGroup, Persistable persist)
           
static ConfigSpec createEPMDocConfigSpec(ConfigSpec incs)
           
static void createThumbnailPropertiesFile(String dir, String shapeType)
          generate the thumbnail.properties file
static String escapeForCADAgentRUN(String in)
           
static QueryResult findAllRepresentables(EPMDocument d)
           
static WTKeyedMap findAllRepresentables(WTCollection collection)
           
static QueryResult findDescribedBy(Iterated part)
           
static QueryResult findDescribes(Iterated part)
           
static EPMDocument findEPMDocument(Persistable d)
           
static WTValuedMap findEPMDocument(WTCollection collection)
           
static EPMFamilyTable findFamilyTableFromEPMDocument(EPMDocument doc, ConfigSpec cs)
           
static Persistable[] findGenericFromInstance(EPMDocument it, ConfigSpec cs)
           
static Persistable[] findInstanceFromFamilyTable(EPMFamilyTable ft, String itname, ConfigSpec cs)
           
static Persistable[] findInstanceFromFamilyTable(EPMFamilyTable ft, String itname, ConfigSpec cs, boolean useCADName)
           
static Persistable[] findInstanceFromGeneric(EPMDocument gen, String itname, ConfigSpec cs)
           
static Persistable[] findInstanceFromGeneric(EPMDocument gen, String itname, ConfigSpec cs, boolean useCADName)
           
static WTPart findPart(Persistable d)
           
static WTProduct findProductForConfiguration(WTProductConfiguration productConfig)
           
static Representable findRepresentable(Persistable d)
           
static WTValuedMap findRepresentable(WTCollection collection)
           
static File forceEDFile(File tempDir)
           
static File forceEDFile(File tempDir, Properties props)
           
static File forceEDFile(File tempDir, Properties props, String charset)
           
static String getAltTag(String msg)
           
static ApplicationData getApplicationDataFromContentURL(String url)
           
static Class getClassFromRef(String refString)
           
static ConfigSpec getConfigSpecFor(Iterated p)
           
static ConfigSpec getConfigSpecFor(Iterated p, WTContainerRef currentContainerRef)
           
static WTValuedMap getDerivedFromConfigSpec(WTCollection collection)
           
static EPMDocument getDocFromMaster(Mastered dm, ConfigSpec cs)
           
static String getIterationIdentifier(Versioned v)
          Get a display String for the iteration identifier.
static javax.vecmath.Matrix4d getMatrix4dFromLocation(double ax, double ay, double az, double x, double y, double z, double scale)
          Creates a Matrix4d from rotation angles (in degrees) and translations

Supported API: false
static Persistable getObjectFromRef(String refString)
           
static WTReference getObjectRefFromRef(String refString)
           
static String getPreferedViewURL(Representation rep)
           
static String getPreferedViewURL(Representation rep, boolean addOutOfDate)
           
static WTKeyedMap getPreferedViewURL(WTCollection reps)
           
static WTKeyedMap getPreferedViewURL(WTCollection reps, boolean addOutOfDate)
           
static String getPropertyPageURL(Persistable object)
           
static String getPropertyPageURL(String oid)
           
static String getRefFromObject(Persistable obj)
           
static String getRefFromObjectRef(WTReference obj)
           
static WTValuedMap getRepresentableConfigSpec(WTCollection collection)
           
static Representation getRepresentation(Persistable d)
           
static Representation getRepresentation(Persistable d, boolean defaultRep, String repName)
           
static Representation getRepresentation(Persistable d, boolean defaultRep, String repName, boolean doFindRepresentable)
           
static Representation getRepresentation(Persistable d, String repName)
           
static WTValuedMap getRepresentation(WTCollection collection)
           
static WTValuedMap getRepresentation(WTCollection collection, boolean defaultRep, String repName)
           
static WTValuedMap getRepresentation(WTCollection collection, boolean defaultRep, String repName, boolean doFindRepresentable)
           
static WTValuedMap getRepresentation(WTCollection collection, String repName)
           
static QueryResult getRepresentations(Persistable d)
           
static QueryResult getRepresentations(Persistable d, boolean doFindRepresentable)
           
static WTKeyedMap getRepresentations(WTCollection collection)
           
static WTKeyedMap getRepresentations(WTCollection collection, boolean doFindRepresentable)
           
static javax.vecmath.Vector3d getRotationFromMatrix4d(javax.vecmath.Matrix4d mat)
          Extracts the rotation angles (in degrees) from a Matrix4d mirroring changes are from Erik Rieger multiply all components of the rotational matrix with the determinant, so that mirroring along an axis is covered.
static double getScaleFromMatrix4d(javax.vecmath.Matrix4d mat)
          Extracts the uniform scale from a Matrix4d the sign of the scale will indicate if the matrix is mirrored or not

Supported API: false
static double getScaleToM(String unit)
          Determines the scale to Meters for a given unit string representing the units of IN, INCH, MM, CM, DM, M, FT

Supported API: false
static javax.vecmath.Vector3d getTranslationFromMatrix4d(javax.vecmath.Matrix4d mat)
          Extracts the translations from a Matrix4d

Supported API: false
static String getVisTextFromProductViewURL(String url)
           
static String hideURL(String url, String visText)
           
static boolean isAdministrator()
          Determines if the current user is a Windchill administrator

Supported API: false
static boolean isAdministrator(WTContainerRef containerRef)
          Determines if the current user is a Windchill administrator or an administrator on the specified container

Supported API: false
static boolean isDeleteRepresentationAllowed(Representable repable, Representation rep)
           
static boolean isEPMDocGeneric(EPMDocument doc)
           
static boolean isEPMDocInstance(EPMDocument doc)
           
static boolean isMakeDefaultRepresentationAllowed(Representable repable, Representation rep)
           
static boolean isMarkedAsPositioningAssembly(Persistable p)
           
static boolean isMarkedNotPublishable(Persistable p, boolean forUI)
           
static WTCollection isMarkedNotPublishable(WTCollection collection, boolean forUI)
           
static boolean isMarkedNotPublishableForUI(Persistable p)
           
static boolean isMarkedNotThumbnailable(Persistable p)
           
static boolean isRepresentationPositioningAssembly(Representation rep)
           
static boolean removeDir(File dir, boolean recursive)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ED_LOWER

public static final String ED_LOWER
See Also:
Constant Field Values

ED

public static final String ED
See Also:
Constant Field Values

OL

public static final String OL
See Also:
Constant Field Values

PLT

public static final String PLT
See Also:
Constant Field Values

DWG

public static final String DWG
See Also:
Constant Field Values

DXF

public static final String DXF
See Also:
Constant Field Values

HPGL

public static final String HPGL
See Also:
Constant Field Values

CCZ

public static final String CCZ
See Also:
Constant Field Values

CC

public static final String CC
See Also:
Constant Field Values

START_URLHIDE

public static final String START_URLHIDE
See Also:
Constant Field Values

END_URLHIDE

public static final String END_URLHIDE
See Also:
Constant Field Values

LEN_END_URLHIDE

public static final int LEN_END_URLHIDE

THUMBNAIL_PROPERTIES

public static final String THUMBNAIL_PROPERTIES
See Also:
Constant Field Values

INTERCOMM_REPRESENTATION_TYPE

public static RepresentationType INTERCOMM_REPRESENTATION_TYPE

SHOW_WT_PROPS

private static boolean SHOW_WT_PROPS

SHOW_PROP_PAGE_LINK

private static boolean SHOW_PROP_PAGE_LINK

PART_PROP_GROUP

private static String PART_PROP_GROUP

EPM_PROP_GROUP

private static String EPM_PROP_GROUP

flagRepOutOfDate

private static boolean flagRepOutOfDate

allowPublishEPMDocument

private static boolean allowPublishEPMDocument

allowAdminPublishEPMDocument

private static boolean allowAdminPublishEPMDocument

allowPublishWTPart

private static boolean allowPublishWTPart

allowAdminPublishWTPart

private static boolean allowAdminPublishWTPart

allowPublishWTDocument

private static boolean allowPublishWTDocument

allowAdminPublishWTDocument

private static boolean allowAdminPublishWTDocument

allowDeleteRepresentation

private static boolean allowDeleteRepresentation

allowAdminDeleteRepresentation

private static boolean allowAdminDeleteRepresentation

allowMakeDefaultRepresentation

private static boolean allowMakeDefaultRepresentation

allowAdminMakeDefaultRepresentation

private static boolean allowAdminMakeDefaultRepresentation

getEPMDocForPartMethod

private static Method getEPMDocForPartMethod

getPartForEPMDocMethod

private static Method getPartForEPMDocMethod

getAllPartsForEPMDocMethod

private static Method getAllPartsForEPMDocMethod

edzPrefDefault

private static String edzPrefDefault

intercommEnabled

private static boolean intercommEnabled

VERBOSE_BUILD

private static boolean VERBOSE_BUILD

includeWorkingInPartSB

private static boolean includeWorkingInPartSB

includeWorkingInEPMDocSB

private static boolean includeWorkingInEPMDocSB

wvsProperties

private static WVSProperties wvsProperties

IBA_VALUE_1

static final String IBA_VALUE_1
See Also:
Constant Field Values

IBA_VALUE_2

static final String IBA_VALUE_2
See Also:
Constant Field Values

IBA_VALUE_3

static final String IBA_VALUE_3
See Also:
Constant Field Values

IBA_START_1

static final String IBA_START_1
See Also:
Constant Field Values

IBA_START_2

static final String IBA_START_2
See Also:
Constant Field Values

IBA_START_3

static final String IBA_START_3
See Also:
Constant Field Values

ibaSkipNameList

static ArrayList ibaSkipNameList

explicitNameList

static ArrayList explicitNameList

DTOR

private static final double DTOR
See Also:
Constant Field Values

DMM

private static final double DMM
See Also:
Constant Field Values

DCM

private static final double DCM
See Also:
Constant Field Values

DDM

private static final double DDM
See Also:
Constant Field Values

DM

private static final double DM
See Also:
Constant Field Values

DKM

private static final double DKM
See Also:
Constant Field Values

DIN

private static final double DIN
See Also:
Constant Field Values

DFT

private static final double DFT
See Also:
Constant Field Values

DMI

private static final double DMI
See Also:
Constant Field Values
Constructor Detail

PublishUtils

public PublishUtils()
Method Detail

removeDir

public static boolean removeDir(File dir,
                                boolean recursive)
                         throws Exception
Throws:
Exception

forceEDFile

public static File forceEDFile(File tempDir)

forceEDFile

public static File forceEDFile(File tempDir,
                               Properties props)

forceEDFile

public static File forceEDFile(File tempDir,
                               Properties props,
                               String charset)

getRefFromObject

public static String getRefFromObject(Persistable obj)

getRefFromObjectRef

public static String getRefFromObjectRef(WTReference obj)

getObjectFromRef

public static Persistable getObjectFromRef(String refString)

getObjectRefFromRef

public static WTReference getObjectRefFromRef(String refString)

getClassFromRef

public static Class getClassFromRef(String refString)

getPropertyPageURL

public static String getPropertyPageURL(String oid)

getApplicationDataFromContentURL

public static ApplicationData getApplicationDataFromContentURL(String url)

getPropertyPageURL

public static String getPropertyPageURL(Persistable object)

getIterationIdentifier

public static String getIterationIdentifier(Versioned v)
Get a display String for the iteration identifier. The display string will include view information if 'v' is ViewManageable. Example display strings include A.1 (version id + iteration id), A-1.7 (one off version id + iteration id), A.A.4 (Mfg) (version id + iteratio id + view).

Supported API: false

Returns:
String

isAdministrator

public static boolean isAdministrator()
Determines if the current user is a Windchill administrator

Supported API: false

Returns:
boolean

isAdministrator

public static boolean isAdministrator(WTContainerRef containerRef)
Determines if the current user is a Windchill administrator or an administrator on the specified container

Supported API: false

Returns:
boolean

getVisTextFromProductViewURL

public static String getVisTextFromProductViewURL(String url)

hideURL

public static String hideURL(String url,
                             String visText)

getPreferedViewURL

public static String getPreferedViewURL(Representation rep)

getPreferedViewURL

public static String getPreferedViewURL(Representation rep,
                                        boolean addOutOfDate)

getPreferedViewURL

public static WTKeyedMap getPreferedViewURL(WTCollection reps)

getPreferedViewURL

public static WTKeyedMap getPreferedViewURL(WTCollection reps,
                                            boolean addOutOfDate)

getAltTag

public static String getAltTag(String msg)

getRepresentation

public static Representation getRepresentation(Persistable d)

getRepresentation

public static Representation getRepresentation(Persistable d,
                                               String repName)

getRepresentation

public static Representation getRepresentation(Persistable d,
                                               boolean defaultRep,
                                               String repName)

getRepresentation

public static Representation getRepresentation(Persistable d,
                                               boolean defaultRep,
                                               String repName,
                                               boolean doFindRepresentable)

getRepresentation

public static WTValuedMap getRepresentation(WTCollection collection)

getRepresentation

public static WTValuedMap getRepresentation(WTCollection collection,
                                            String repName)

getRepresentation

public static WTValuedMap getRepresentation(WTCollection collection,
                                            boolean defaultRep,
                                            String repName)

getRepresentation

public static WTValuedMap getRepresentation(WTCollection collection,
                                            boolean defaultRep,
                                            String repName,
                                            boolean doFindRepresentable)

getRepresentations

public static QueryResult getRepresentations(Persistable d)

getRepresentations

public static QueryResult getRepresentations(Persistable d,
                                             boolean doFindRepresentable)

getRepresentations

public static WTKeyedMap getRepresentations(WTCollection collection)

getRepresentations

public static WTKeyedMap getRepresentations(WTCollection collection,
                                            boolean doFindRepresentable)

findDescribes

public static QueryResult findDescribes(Iterated part)

findDescribedBy

public static QueryResult findDescribedBy(Iterated part)

findEPMDocument

public static WTValuedMap findEPMDocument(WTCollection collection)

findEPMDocument

public static EPMDocument findEPMDocument(Persistable d)

findPart

public static WTPart findPart(Persistable d)

findRepresentable

public static WTValuedMap findRepresentable(WTCollection collection)

findRepresentable

public static Representable findRepresentable(Persistable d)

findAllRepresentables

public static WTKeyedMap findAllRepresentables(WTCollection collection)

findAllRepresentables

public static QueryResult findAllRepresentables(EPMDocument d)

addEPMDocumentProperties

public static void addEPMDocumentProperties(DefaultMutableTreeNode n,
                                            Persistable doc)

addEPMDocumentProperties

public static void addEPMDocumentProperties(Hashtable p,
                                            Persistable doc)

addPartProperties

public static void addPartProperties(DefaultMutableTreeNode n,
                                     Persistable part)

addPartProperties

public static void addPartProperties(Hashtable p,
                                     Persistable part)

addPartProperties

public static void addPartProperties(DefaultMutableTreeNode n,
                                     Hashtable p,
                                     Persistable part)

addEPMMemberLinkProperties

public static void addEPMMemberLinkProperties(DefaultMutableTreeNode n,
                                              Persistable link)

addEPMMemberLinkProperties

public static void addEPMMemberLinkProperties(Hashtable p,
                                              Persistable link)

addPartLinkProperties

public static void addPartLinkProperties(DefaultMutableTreeNode n,
                                         Persistable link)

addPartLinkProperties

public static void addPartLinkProperties(Hashtable p,
                                         Persistable link)

addIBAProperties

public static void addIBAProperties(Hashtable p,
                                    String prefix,
                                    String propGroup,
                                    Persistable persist)
                             throws Exception
Throws:
Exception

addSignatureProperties

public static void addSignatureProperties(Hashtable p,
                                          String prefix,
                                          String propGroup,
                                          Persistable persist)

createEPMDocConfigSpec

public static ConfigSpec createEPMDocConfigSpec(ConfigSpec incs)
                                         throws Exception
Throws:
Exception

getDerivedFromConfigSpec

public static WTValuedMap getDerivedFromConfigSpec(WTCollection collection)
                                            throws WTException
Throws:
WTException

getRepresentableConfigSpec

public static WTValuedMap getRepresentableConfigSpec(WTCollection collection)
                                              throws WTException
Throws:
WTException

getConfigSpecFor

public static ConfigSpec getConfigSpecFor(Iterated p)
                                   throws WTException
Throws:
WTException

getConfigSpecFor

public static ConfigSpec getConfigSpecFor(Iterated p,
                                          WTContainerRef currentContainerRef)
                                   throws WTException
Throws:
WTException

getDocFromMaster

public static EPMDocument getDocFromMaster(Mastered dm,
                                           ConfigSpec cs)

isEPMDocInstance

public static boolean isEPMDocInstance(EPMDocument doc)

isEPMDocGeneric

public static boolean isEPMDocGeneric(EPMDocument doc)

findFamilyTableFromEPMDocument

public static EPMFamilyTable findFamilyTableFromEPMDocument(EPMDocument doc,
                                                            ConfigSpec cs)

findGenericFromInstance

public static Persistable[] findGenericFromInstance(EPMDocument it,
                                                    ConfigSpec cs)

findInstanceFromGeneric

public static Persistable[] findInstanceFromGeneric(EPMDocument gen,
                                                    String itname,
                                                    ConfigSpec cs)

findInstanceFromGeneric

public static Persistable[] findInstanceFromGeneric(EPMDocument gen,
                                                    String itname,
                                                    ConfigSpec cs,
                                                    boolean useCADName)

findInstanceFromFamilyTable

public static Persistable[] findInstanceFromFamilyTable(EPMFamilyTable ft,
                                                        String itname,
                                                        ConfigSpec cs)

findInstanceFromFamilyTable

public static Persistable[] findInstanceFromFamilyTable(EPMFamilyTable ft,
                                                        String itname,
                                                        ConfigSpec cs,
                                                        boolean useCADName)

findProductForConfiguration

public static WTProduct findProductForConfiguration(WTProductConfiguration productConfig)

isMakeDefaultRepresentationAllowed

public static boolean isMakeDefaultRepresentationAllowed(Representable repable,
                                                         Representation rep)

isDeleteRepresentationAllowed

public static boolean isDeleteRepresentationAllowed(Representable repable,
                                                    Representation rep)

isMarkedNotPublishable

public static WTCollection isMarkedNotPublishable(WTCollection collection,
                                                  boolean forUI)

isMarkedNotPublishable

public static boolean isMarkedNotPublishable(Persistable p,
                                             boolean forUI)

isMarkedNotPublishableForUI

public static boolean isMarkedNotPublishableForUI(Persistable p)

isMarkedNotThumbnailable

public static boolean isMarkedNotThumbnailable(Persistable p)

isMarkedAsPositioningAssembly

public static boolean isMarkedAsPositioningAssembly(Persistable p)

isRepresentationPositioningAssembly

public static boolean isRepresentationPositioningAssembly(Representation rep)

escapeForCADAgentRUN

public static String escapeForCADAgentRUN(String in)

createThumbnailPropertiesFile

public static void createThumbnailPropertiesFile(String dir,
                                                 String shapeType)
                                          throws IOException
generate the thumbnail.properties file

Throws:
IOException

getMatrix4dFromLocation

public static javax.vecmath.Matrix4d getMatrix4dFromLocation(double ax,
                                                             double ay,
                                                             double az,
                                                             double x,
                                                             double y,
                                                             double z,
                                                             double scale)
Creates a Matrix4d from rotation angles (in degrees) and translations

Supported API: false

Returns:
a new Matrix4d

getRotationFromMatrix4d

public static javax.vecmath.Vector3d getRotationFromMatrix4d(javax.vecmath.Matrix4d mat)
Extracts the rotation angles (in degrees) from a Matrix4d mirroring changes are from Erik Rieger multiply all components of the rotational matrix with the determinant, so that mirroring along an axis is covered. (of course, the determinant is then also considered when calculating the scale) only use the upper 3*3 elements to calculate the determinant, also make certain passed in Matrix is not changed.

Supported API: false

Returns:
rotation angles

getTranslationFromMatrix4d

public static javax.vecmath.Vector3d getTranslationFromMatrix4d(javax.vecmath.Matrix4d mat)
Extracts the translations from a Matrix4d

Supported API: false

Returns:
translations

getScaleFromMatrix4d

public static double getScaleFromMatrix4d(javax.vecmath.Matrix4d mat)
Extracts the uniform scale from a Matrix4d the sign of the scale will indicate if the matrix is mirrored or not

Supported API: false

Returns:
scale

getScaleToM

public static double getScaleToM(String unit)
Determines the scale to Meters for a given unit string representing the units of IN, INCH, MM, CM, DM, M, FT

Supported API: false

Returns:
scale factor