com.ptc.wvs.server.publish
Class CadConvertPROE

java.lang.Object
  extended bycom.ptc.wvs.server.publish.CadConvertPROE
All Implemented Interfaces:
CadConvert, FileConvert, Serializable

public class CadConvertPROE
extends Object
implements CadConvert

See Also:
Serialized Form

Field Summary
private  boolean additionalFiles
           
private  ArrayList additionalFilesVetoList
           
private static String ASM
           
private static String AUTH_GATEWAY_KEY
           
private static String AUTH_GATEWAY_PROPERTIES
           
private static Properties authData
           
private static boolean authDataLoaded
           
private  String cadoptions
           
private static String DGM
           
private  String distributedCadAgent
           
protected  EPMDocument doc
           
private  String[] doc_ret
           
private static String DRW
           
private  EPMDocument familyInstanceGeneric
           
private  String familyInstanceName
           
private  EPMFamilyTable familyTable
           
private  Hashtable fileLookup
           
private  boolean fileVaultList
           
private  boolean fileVaultLookup
           
private static String FRM
           
private static String GPH
           
private  boolean hasContent
           
private static String INSTANCE_NAME
           
private  boolean isPackage
           
private  boolean isPositioningAssembly
           
private static String LAY
           
protected  String options
           
protected  Representable part
           
private static String PROE_DRAWING
           
private static String PROE_MODEL
           
private static Properties proeAuth
           
private  boolean proeFileAdapter
           
private  String proeFileAdapterAuthFile
           
private  boolean proeFileAdapterStatus
           
private  String proeName
           
private static String PRT
           
protected  PublishJob publishJob
           
private static String RESOURCE
           
private static String SEC
           
private  EPMDocument srcDoc
           
private  boolean startContent
           
private  boolean usePnfsUrls
           
protected static boolean VERBOSE
           
private  boolean wildfireWorker
           
private  String[] wildfireWorkerData
           
protected static WVSProperties wvsProperties
           
private  Object xmlDocument
           
 
Fields inherited from interface com.ptc.wvs.server.publish.CadConvert
ASSEMBLY, BOTTOMUP, CADAGENT_ERROR, CADAGENT_NOTHING, COMPONENT, DRAWING, ERROR, NOOP, NOTHING_TO_PROCESS, POSASSEMBLY, TOPDOWN, UNKNOWN
 
Constructor Summary
CadConvertPROE()
           
 
Method Summary
private  void addWindchillIDInfo(boolean drawingStructure)
           
private  void deleteTempWorkspace()
           
 String doAssemblyConversion(boolean doConversion, boolean doChildren, int count)
           
 String doComponentConversion(boolean doConversion, int count)
           
 String doDrawingConversion(boolean doConversion, int count)
           
private  boolean downloadWithFileAdapter(EPMDocument thisDoc, ConfigSpec epmConfig, File directory)
           
private  boolean downloadWithFileAdapter(EPMDocument thisDoc, ConfigSpec epmConfig, File directory, String authFileName)
           
 int getAssemblyContent(boolean getContent, boolean doChildren)
           
 String getAssemblyName()
           
 int getAssemblyType()
           
 String getAuthenticationString(URLData urlData)
          Gets a encrypted authentication string for the specified url data This is will be passed to the distributed CadAgent to allow it to retieve file from the source, typicall ProIntralink Called by file download for URLData items

Supported API: false
static String getAuthenticationStringForHost(String host, String port)
           
static String[] getCADRepList(EPMDocument d, ConfigSpec cs, Locale locale)
           
private  String getCadRepName()
           
 int getComponentContent(boolean getContent)
           
 String getComponentName()
           
 int getDrawingContent(boolean getContent)
           
 String getDrawingName()
           
private  String getDrawingShapetype()
           
private  String getFileVaultsString(EPMDocument doc)
           
private  String getInstanceName(String contentName)
           
 boolean getLocalFileContentFromContentItem(ContentItem ci, File localFile)
          Downloads the ContentItem for this CAD system to the local file specified.
 String getLocalFileNameFromContentItem(ContentItem ci)
          Returns the local file name for a ContentItem of this CAD system Called by file download for both ApplicationData and URLData items

Supported API: false
static String getProEAuthString(String authFileName, EPMDocument thisDoc)
           
private  String getPROEWindchillName()
           
private static String[] getPROEWindchillName(EPMDocument nameDoc, EPMFamilyTable ft)
           
 int getType(boolean doConversion, boolean doChildren)
           
 URLConnection getURLDataConnection(URLData urlData)
          Gets a URLConnection for the default mechanisn to download file content.
private  String getWildfireWorkerString()
           
 boolean init(PublishJob publishJob, EPMDocument doc, Representable part, String options)
           
private static boolean initAuthData()
           
static void main(String[] args)
           
private  void matchNames(DefaultMutableTreeNode n)
           
 int storeAssemblyRepresentation(boolean store, boolean doChildren, File outDir)
           
 int storeComponentRepresentation(boolean store, File outDir)
           
 int storeDrawingRepresentation(boolean store, File outDir)
           
 boolean useDistributedCadAgent(String url)
          Returns if a distributed CadAgent could service the conversion of the url data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wvsProperties

protected static WVSProperties wvsProperties

VERBOSE

protected static boolean VERBOSE

publishJob

protected PublishJob publishJob

doc

protected EPMDocument doc

part

protected Representable part

options

protected String options

PROE_MODEL

private static final String PROE_MODEL
See Also:
Constant Field Values

PROE_DRAWING

private static final String PROE_DRAWING
See Also:
Constant Field Values

INSTANCE_NAME

private static final String INSTANCE_NAME
See Also:
Constant Field Values

PRT

private static final String PRT
See Also:
Constant Field Values

ASM

private static final String ASM
See Also:
Constant Field Values

DRW

private static final String DRW
See Also:
Constant Field Values

LAY

private static final String LAY
See Also:
Constant Field Values

FRM

private static final String FRM
See Also:
Constant Field Values

DGM

private static final String DGM
See Also:
Constant Field Values

SEC

private static final String SEC
See Also:
Constant Field Values

GPH

private static final String GPH
See Also:
Constant Field Values

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

xmlDocument

private Object xmlDocument

srcDoc

private EPMDocument srcDoc

proeName

private String proeName

hasContent

private boolean hasContent

familyInstanceName

private String familyInstanceName

familyInstanceGeneric

private EPMDocument familyInstanceGeneric

familyTable

private EPMFamilyTable familyTable

fileLookup

private Hashtable fileLookup

distributedCadAgent

private String distributedCadAgent

cadoptions

private String cadoptions

fileVaultLookup

private boolean fileVaultLookup

fileVaultList

private boolean fileVaultList

usePnfsUrls

private boolean usePnfsUrls

proeFileAdapter

private boolean proeFileAdapter

proeFileAdapterStatus

private boolean proeFileAdapterStatus

proeFileAdapterAuthFile

private String proeFileAdapterAuthFile

wildfireWorker

private boolean wildfireWorker

wildfireWorkerData

private String[] wildfireWorkerData

startContent

private boolean startContent

additionalFiles

private boolean additionalFiles

additionalFilesVetoList

private ArrayList additionalFilesVetoList

isPackage

private boolean isPackage

isPositioningAssembly

private boolean isPositioningAssembly

doc_ret

private String[] doc_ret

proeAuth

private static Properties proeAuth

AUTH_GATEWAY_PROPERTIES

private static final String AUTH_GATEWAY_PROPERTIES
See Also:
Constant Field Values

AUTH_GATEWAY_KEY

private static final String AUTH_GATEWAY_KEY
See Also:
Constant Field Values

authDataLoaded

private static boolean authDataLoaded

authData

private static Properties authData
Constructor Detail

CadConvertPROE

public CadConvertPROE()
Method Detail

init

public boolean init(PublishJob publishJob,
                    EPMDocument doc,
                    Representable part,
                    String options)
Specified by:
init in interface CadConvert

getCADRepList

public static String[] getCADRepList(EPMDocument d,
                                     ConfigSpec cs,
                                     Locale locale)

getType

public int getType(boolean doConversion,
                   boolean doChildren)
Specified by:
getType in interface CadConvert

getAssemblyType

public int getAssemblyType()
Specified by:
getAssemblyType in interface CadConvert

getLocalFileNameFromContentItem

public String getLocalFileNameFromContentItem(ContentItem ci)
Description copied from interface: FileConvert
Returns the local file name for a ContentItem of this CAD system Called by file download for both ApplicationData and URLData items

Supported API: false

Specified by:
getLocalFileNameFromContentItem in interface FileConvert
Parameters:
ci - the ContentItem
Returns:
String local file name

getLocalFileContentFromContentItem

public boolean getLocalFileContentFromContentItem(ContentItem ci,
                                                  File localFile)
Description copied from interface: FileConvert
Downloads the ContentItem for this CAD system to the local file specified. The local file will be the full path, an the file name portion of this will have been determined by a call to getLocalFileNameFromContentItem This method can decide if it will download the file, and return true. if this method decides not to download the file it should return false. The download mechanism will then use ContentServerHelper.service.writeContentStream for Application data and a read of the URL (see getURLDataConnection) for URLData. It is expected that most CAD conveters will simply return false for this method and allow the default mechanism to be used. Called by file download for both ApplicationData and URLData items

Supported API: false

Specified by:
getLocalFileContentFromContentItem in interface FileConvert
Parameters:
ci - the ContentItem
localFile - the local file name
Returns:
true this the file has been downloaded, false if not

getAuthenticationString

public String getAuthenticationString(URLData urlData)
Description copied from interface: FileConvert
Gets a encrypted authentication string for the specified url data This is will be passed to the distributed CadAgent to allow it to retieve file from the source, typicall ProIntralink Called by file download for URLData items

Supported API: false

Specified by:
getAuthenticationString in interface FileConvert
Parameters:
urlData - the URLData
Returns:
String

useDistributedCadAgent

public boolean useDistributedCadAgent(String url)
Description copied from interface: FileConvert
Returns if a distributed CadAgent could service the conversion of the url data. Although this will be called for each url assocaited to the content of the object, the first takes precedence Currently only Gateway data will return true. Called by file download for URLData items

Supported API: false

Specified by:
useDistributedCadAgent in interface FileConvert
Parameters:
url - the url String
Returns:
boolean

getURLDataConnection

public URLConnection getURLDataConnection(URLData urlData)
Description copied from interface: FileConvert
Gets a URLConnection for the default mechanisn to download file content. If getLocalFileContentFRomContentItem has returned true, then that will have downloaded the data and this method will not be called. Typically this method would deal with authentication. Called by file download for URLData items

Supported API: false

Specified by:
getURLDataConnection in interface FileConvert
Parameters:
urlData - the URLData
Returns:
URLConnection

getPROEWindchillName

private String getPROEWindchillName()

getPROEWindchillName

private static String[] getPROEWindchillName(EPMDocument nameDoc,
                                             EPMFamilyTable ft)
                                      throws Exception
Throws:
Exception

getComponentName

public String getComponentName()
Specified by:
getComponentName in interface CadConvert

getComponentContent

public int getComponentContent(boolean getContent)
Specified by:
getComponentContent in interface CadConvert

doComponentConversion

public String doComponentConversion(boolean doConversion,
                                    int count)
Specified by:
doComponentConversion in interface CadConvert

storeComponentRepresentation

public int storeComponentRepresentation(boolean store,
                                        File outDir)
Specified by:
storeComponentRepresentation in interface CadConvert

getAssemblyName

public String getAssemblyName()
Specified by:
getAssemblyName in interface CadConvert

getAssemblyContent

public int getAssemblyContent(boolean getContent,
                              boolean doChildren)
Specified by:
getAssemblyContent in interface CadConvert

doAssemblyConversion

public String doAssemblyConversion(boolean doConversion,
                                   boolean doChildren,
                                   int count)
Specified by:
doAssemblyConversion in interface CadConvert

storeAssemblyRepresentation

public int storeAssemblyRepresentation(boolean store,
                                       boolean doChildren,
                                       File outDir)
Specified by:
storeAssemblyRepresentation in interface CadConvert

getDrawingName

public String getDrawingName()
Specified by:
getDrawingName in interface CadConvert

getDrawingContent

public int getDrawingContent(boolean getContent)
Specified by:
getDrawingContent in interface CadConvert

doDrawingConversion

public String doDrawingConversion(boolean doConversion,
                                  int count)
Specified by:
doDrawingConversion in interface CadConvert

storeDrawingRepresentation

public int storeDrawingRepresentation(boolean store,
                                      File outDir)
Specified by:
storeDrawingRepresentation in interface CadConvert

getDrawingShapetype

private String getDrawingShapetype()

getInstanceName

private String getInstanceName(String contentName)

getCadRepName

private String getCadRepName()

getWildfireWorkerString

private String getWildfireWorkerString()

addWindchillIDInfo

private void addWindchillIDInfo(boolean drawingStructure)

matchNames

private void matchNames(DefaultMutableTreeNode n)
                 throws Exception
Throws:
Exception

getProEAuthString

public static String getProEAuthString(String authFileName,
                                       EPMDocument thisDoc)

downloadWithFileAdapter

private boolean downloadWithFileAdapter(EPMDocument thisDoc,
                                        ConfigSpec epmConfig,
                                        File directory)

downloadWithFileAdapter

private boolean downloadWithFileAdapter(EPMDocument thisDoc,
                                        ConfigSpec epmConfig,
                                        File directory,
                                        String authFileName)

deleteTempWorkspace

private void deleteTempWorkspace()

getFileVaultsString

private String getFileVaultsString(EPMDocument doc)

initAuthData

private static boolean initAuthData()

getAuthenticationStringForHost

public static String getAuthenticationStringForHost(String host,
                                                    String port)

main

public static void main(String[] args)