com.ptc.wvs.server.publish
Class CadConvertSOLIDWORKS

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

public class CadConvertSOLIDWORKS
extends Object
implements CadConvert

See Also:
Serialized Form

Field Summary
private static String ASM
           
private  String cadoptions
           
private static String CONFIGURATION
           
protected  EPMDocument doc
           
private static String DRW
           
private  EPMDocument familyInstanceGeneric
           
private  String familyInstanceName
           
private  EPMFamilyTable familyTable
           
private  Hashtable fileLookup
           
private  boolean hasContent
           
protected  String options
           
protected  Representable part
           
private static String PRT
           
protected  PublishJob publishJob
           
private static String RESOURCE
           
private static String SLDASM
           
private static String SLDDRW
           
private static String SLDPRT
           
private static String SOLIDWORKS_MODEL
           
private  String solidworksName
           
protected static WVSProperties wvsProperties
           
 
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
CadConvertSOLIDWORKS()
           
 
Method Summary
private  void addWindchillIDInfo(boolean drawingStructure)
           
 String doAssemblyConversion(boolean doConversion, boolean doChildren, int count)
           
 String doComponentConversion(boolean doConversion, int count)
           
 String doDrawingConversion(boolean doConversion, int count)
           
 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[] getCADRepList(EPMDocument d, ConfigSpec cs, Locale locale)
           
private  String getCadRepName()
           
 int getComponentContent(boolean getContent)
           
 String getComponentName()
           
 int getDrawingContent(boolean getContent)
           
 String getDrawingName()
           
private  String getInstanceName(String contentName, boolean fixSpaces)
           
 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
private  String getSOLIDWORKSWindchillName()
           
private static String getSOLIDWORKSWindchillName(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.
 boolean init(PublishJob publishJob, EPMDocument doc, Representable part, String options)
           
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

publishJob

protected PublishJob publishJob

doc

protected EPMDocument doc

part

protected Representable part

options

protected String options

SOLIDWORKS_MODEL

private static final String SOLIDWORKS_MODEL
See Also:
Constant Field Values

CONFIGURATION

private static final String CONFIGURATION
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

SLDPRT

private static final String SLDPRT
See Also:
Constant Field Values

SLDASM

private static final String SLDASM
See Also:
Constant Field Values

SLDDRW

private static final String SLDDRW
See Also:
Constant Field Values

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

solidworksName

private String solidworksName

hasContent

private boolean hasContent

familyInstanceName

private String familyInstanceName

familyInstanceGeneric

private EPMDocument familyInstanceGeneric

familyTable

private EPMFamilyTable familyTable

fileLookup

private Hashtable fileLookup

cadoptions

private String cadoptions
Constructor Detail

CadConvertSOLIDWORKS

public CadConvertSOLIDWORKS()
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

getSOLIDWORKSWindchillName

private String getSOLIDWORKSWindchillName()

getSOLIDWORKSWindchillName

private static String getSOLIDWORKSWindchillName(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

getInstanceName

private String getInstanceName(String contentName,
                               boolean fixSpaces)

getCadRepName

private String getCadRepName()

addWindchillIDInfo

private void addWindchillIDInfo(boolean drawingStructure)

matchNames

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