|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.wgmecad.WindchillIntegrationManager
User: barky Date: Feb 5, 2003 Time: 3:34:14 PM Change History: 2004.01.24 NickV: Added Comments
Constructor Summary | |
private |
WindchillIntegrationManager()
|
Method Summary | |
private void |
addECADContentItems(Boolean modState,
Boolean defState,
File projDir,
File tempDir,
ValueEPMDoc epmDoc,
String fileGroupName,
File fileParentDir,
String filePattern,
ValueEPMDoc epmDescribes,
DesignAll design)
Iterate thru the ECAD Content as configured resolving it to specific files |
void |
addFileGroupsToEcadDesign(DocCreationHelper dch,
Element ecadDesign,
File root,
DesignAll design)
add configurations/filegroup informatoin to xml. |
boolean |
cancelCheckout(String functionName,
DesignAll design)
cancel a checkout |
private URL |
checkForConnectionToServer(String wcURL)
|
boolean |
checkin(String functionName,
DesignAll dsn,
boolean skipCheckinStep,
boolean checkout,
boolean newRev,
boolean getCopy,
boolean create)
prepareFileSystemForCheckin must have already been called |
private Vector |
convertECADAttributesDef2AttributeStatus(ECADAttributes attrs,
String epmDoc)
|
boolean |
createnew(String functionName,
DesignAll dsn)
prepareFileSystemForCreateNew must have already been called |
private void |
createSubdir(File dir)
|
boolean |
download(String functionName,
DesignAll dsn,
boolean checkout)
This function covers all windchill operations that download files from the server. |
private void |
extractDesign(File archive,
File dir,
File[] excludeDirs,
String progressCnt,
String progressMsg)
|
Vector |
generateBOM(DesignAll dsn,
boolean variants)
|
static DesignAll[] |
getAllDesignsFromECADDocs(ECADDocument[] ecadDocArr)
|
File |
getArgumentMapFile(String filePath,
String fileName)
loads a secondary argument file (usually WGMHookSettingsFileName = hook.ini) |
File |
getAttributeDefinitionFile()
|
AttributeStatus[] |
getAttributeStatusForCheckin()
|
String[] |
getAvailableCabinets(String solution,
String context)
|
String[] |
getAvailableProducts()
|
String[] |
getAvailableProjects()
|
String[] |
getAvailableTeams(String solution,
String context)
|
private File |
getBoardZipFile()
checks for the attributes file in the temp dir and uses it to generate the zip file name, otherwise specifies it. |
File |
getBomFile(String asmNum)
|
private int |
getBOMOption(boolean isInitialization,
boolean bomInclude,
boolean genBOMForDoc)
|
File |
getBrdAttributeFile()
|
Properties |
getBrdECADAttributes()
|
ClientInterface |
getClientInterface()
|
File |
getCompFileName(DesignAll dsn)
|
private static String |
getContainerSubdirFromMentorZip(File pkgFile)
|
private File |
getDefaultAttributeDefinitionFile()
|
File |
getDesignAttributeFile()
|
Properties |
getDesignECADAttributes()
|
private File |
getDesignZipFile()
checks for the attributes file in the temp dir and uses it to generate the zip file name, otherwise specifies it. |
static WindchillIntegrationManager |
getInstance()
|
private File |
getLegacyCadenceZipFile()
|
private File |
getLegacyMentorZipFile(DesignAll dsn)
|
static File |
getLocalResourceContext()
|
private File |
getMainDesignZipFile(File tempDesignDir)
checks for the attributes file in the temp dir and uses it to generate the zip file name, otherwise specifies it. |
File |
getSchAttributeFile()
|
Properties |
getSchECADAttributes()
|
private File |
getSchematicZipFile()
checks for the attributes file in the temp dir and uses it to generate the zip file name, otherwise specifies it. |
static String[] |
getStringArrayFromVector(Vector v)
Converts the vector to a string array. |
int |
getTotalInitTime()
|
int |
getTotalOperation()
|
int |
getTotalPre()
|
String |
getVersion(boolean server,
boolean fromClassPath)
|
String |
getVersionString()
|
URL |
getWindchillURL()
|
void |
initializeFileSystem()
Initiaize the file system and for an upload operation. |
void |
initializeWCConnection()
Initiaize the file system and for an upload operation. |
void |
initWindchillSubdirs(File designDir)
setup the attribure def file , temp file and project directory, and make sure the client inteface is initialized. |
static boolean |
isDesignTempZipFile(String filename)
helper function to indicate whether the filename indicated is the one of the upload zip files (e.g. |
boolean |
isDocInWindchill(String number,
String revision,
String solution,
String context)
|
boolean |
isWindchillPDMInstalled()
|
static boolean |
isWindchillPDMLinkInstalled()
|
static boolean |
isWindchillProjectLinkInstalled()
|
void |
loadFileGroups(DesignAll _design,
boolean preLoad,
String fromWhere)
Call this to initalize FileGroups |
EPMDocument |
lookupDocument(String number,
String revision,
String solution,
String context)
|
boolean |
newRevision(String functionName,
DesignAll design)
cancel a checkout |
private void |
postCleanup(Vector filesToCleanup,
File[] tempDirs,
File[] protectedDirs,
int action,
int actionOption)
|
void |
prepareFileSystemForCheckin(DesignAll design)
Prepare the file system and for an upload operation. |
void |
prepareFileSystemForCheckout(DesignAll design)
Prepare the file system and for an upload operation. |
void |
prepareFileSystemForCreateNew(DesignAll design)
Prepare the file system and for an upload operation. |
void |
prepareGeneratedItems(DesignAll design)
|
private void |
prepareGeneratedItems(DesignAll design,
File dnZipFile,
File schZipFile,
File brdZipFile)
|
boolean |
prepareVariantBOM(DesignAll design)
|
private void |
processFileGroups(File projDir,
File tempDir,
DesignAll design,
boolean preLoad)
|
private void |
processHookFileGroups(File projDir,
File tempDir,
DesignAll design,
boolean preLoad)
process WGMHookSettingsFileName = hook.ini configurations |
boolean |
revise(String functionName,
DesignAll dsn,
boolean getCopy,
boolean checkout)
this is a simple revise operation without any checkin |
static void |
setLocalResourceContext()
|
private void |
updateAndSaveCurrentDesign(DesignAll dsn)
|
Vector |
writeBrdCompAndAttributesFiles(DesignAll dsn,
File tarFile,
boolean isInitialization)
returns a vector of the comp file lines |
private Vector |
writeCompAndAttributesFiles(DesignAll dsn,
File tarFile,
File attribute_file,
int bomOption,
boolean separatedDesign,
boolean forSch)
returns a vector of the comp file lines |
Vector |
writeDnCompAndAttributesFiles(DesignAll dsn,
File tarFile,
boolean isInitialization)
returns a vector of the comp file lines |
private void |
writeNullCompFile(File compFile)
returns a vector of the comp file lines |
Vector |
writeSchCompAndAttributesFiles(DesignAll dsn,
File tarFile,
boolean isInitialization)
returns a vector of the comp file lines |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
ProcessManager processmanager
private static boolean DEBUG_USE_EXISTING_ZIPS
private static boolean DEBUG_DONT_CREATE_CORE_ZIPS
public static final String defaultMainDesignTarFileName
public static final String defaultSchematicTarFileName
public static final String defaultBoardTarFileName
public static final String defaultDesignTarFileName
public static final String tmpExtractToDir
public static final String projConfigFileName
private static ArgumentMap argMap
private static ArgumentRegister argReg
private static SecondaryArgumentMap sargMap
private static SecondaryArgumentRegister sargReg
private ClientInterface clientinterface
private File attrdef_file
private URL windchillServerURL
private static final int BOM_OPTION_NONE
private static final int BOM_OPTION_NULL
private static final int BOM_OPTION_BUILD
static org.apache.log4j.Logger logger
private static WindchillIntegrationManager instance
private static int brdDirLogCount
public static final int prepStart
public static final int prepInitFileNames
public static final int prepGetZipFile
public static final int prepGetCPMFile
public static final int prepCreateBom
public static final int prepAttr
public static final int prepContentStructure
public static final int prepZip
public static final int prepTotal
public static final int totalOperation
Constructor Detail |
private WindchillIntegrationManager()
Method Detail |
public ClientInterface getClientInterface() throws WGMException, CancelledException
WGMException
CancelledException
private URL checkForConnectionToServer(String wcURL)
public static WindchillIntegrationManager getInstance()
public boolean cancelCheckout(String functionName, DesignAll design) throws WGMException
design
- - the design for which to cancel the checkout
WGMException
public boolean newRevision(String functionName, DesignAll design) throws WGMException, CancelledException, WTException
design
- - the design for which to cancel the checkout
WGMException
CancelledException
WTException
private static String getContainerSubdirFromMentorZip(File pkgFile) throws WGMException, IOException
WGMException
IOException
private void extractDesign(File archive, File dir, File[] excludeDirs, String progressCnt, String progressMsg) throws IOException, CancelledException
IOException
CancelledException
public boolean download(String functionName, DesignAll dsn, boolean checkout) throws WGMException, CancelledException
functionName
- they key for the function name in the CadenceWGM.properties file that
is referenced by I18N.getStr() for the name of the function being executed.
WGMException
CancelledException
private void updateAndSaveCurrentDesign(DesignAll dsn)
public File getAttributeDefinitionFile()
public File getArgumentMapFile(String filePath, String fileName)
private File getDefaultAttributeDefinitionFile()
public static File getLocalResourceContext()
public static void setLocalResourceContext()
public boolean createnew(String functionName, DesignAll dsn) throws WGMException, MissingAttributeException, DesignNotCheckedOutException, DesignNotInWindchillException, ECADPropertiesMissingException, CancelledException
functionName
-
WindchillFunctionException
MissingAttributeException
DesignNotCheckedOutException
DesignNotInWindchillException
ECADPropertiesMissingException
WGMException
CancelledException
public boolean checkin(String functionName, DesignAll dsn, boolean skipCheckinStep, boolean checkout, boolean newRev, boolean getCopy, boolean create) throws WGMException, MissingAttributeException, DesignNotCheckedOutException, DesignNotInWindchillException, ECADPropertiesMissingException, CancelledException
functionName
-
WindchillFunctionException
MissingAttributeException
DesignNotCheckedOutException
DesignNotInWindchillException
ECADPropertiesMissingException
WGMException
CancelledException
private void postCleanup(Vector filesToCleanup, File[] tempDirs, File[] protectedDirs, int action, int actionOption)
private void createSubdir(File dir) throws IOException
IOException
public void initWindchillSubdirs(File designDir) throws IOException
IOException
public URL getWindchillURL()
public File getDesignAttributeFile()
public File getSchAttributeFile()
public File getBrdAttributeFile()
public void prepareFileSystemForCreateNew(DesignAll design) throws IOException, WGMException, CancelledException
design
- the current design
IOException
WGMException
CancelledException
public boolean prepareVariantBOM(DesignAll design) throws IOException, WGMException, CancelledException
IOException
WGMException
CancelledException
public void prepareFileSystemForCheckin(DesignAll design) throws IOException, WGMException, CancelledException
design
- the current design
IOException
WGMException
CancelledException
public void prepareGeneratedItems(DesignAll design) throws Main.ReturnNow
Main.ReturnNow
private void prepareGeneratedItems(DesignAll design, File dnZipFile, File schZipFile, File brdZipFile) throws InvalidArgumentException, UnexpectedArgumentException
InvalidArgumentException
UnexpectedArgumentException
public void prepareFileSystemForCheckout(DesignAll design) throws IOException, WGMException, CancelledException
design
- the current design
IOException
WGMException
CancelledException
public void loadFileGroups(DesignAll _design, boolean preLoad, String fromWhere) throws IOException, WGMException, CancelledException
IOException
WGMException
CancelledException
public void initializeWCConnection() throws IOException, WGMException, CancelledException
IOException
WGMException
CancelledException
public void initializeFileSystem() throws IOException, WGMException, CancelledException
IOException
WGMException
CancelledException
private void processFileGroups(File projDir, File tempDir, DesignAll design, boolean preLoad)
private void processHookFileGroups(File projDir, File tempDir, DesignAll design, boolean preLoad)
projDir
- tempDir
- public void addFileGroupsToEcadDesign(DocCreationHelper dch, Element ecadDesign, File root, DesignAll design)
dch
- ecadDesign
- root
- private void addECADContentItems(Boolean modState, Boolean defState, File projDir, File tempDir, ValueEPMDoc epmDoc, String fileGroupName, File fileParentDir, String filePattern, ValueEPMDoc epmDescribes, DesignAll design) throws ProjectDirectoryMacroInMidPathException
projDir
- root directory of the projecttempDir
- epmDoc
- fileGroupName
- fileParentDir
- filePattern
-
ProjectDirectoryMacroInMidPathException
private File getMainDesignZipFile(File tempDesignDir) throws IOException
IOException
private File getDesignZipFile() throws IOException
IOException
private File getSchematicZipFile() throws IOException
IOException
private File getBoardZipFile() throws IOException
IOException
private File getLegacyCadenceZipFile() throws IOException
IOException
private File getLegacyMentorZipFile(DesignAll dsn) throws MissingAttributeException
MissingAttributeException
public Properties getBrdECADAttributes() throws IOException
IOException
public Properties getSchECADAttributes() throws IOException
IOException
public Properties getDesignECADAttributes() throws IOException
IOException
private Vector writeCompAndAttributesFiles(DesignAll dsn, File tarFile, File attribute_file, int bomOption, boolean separatedDesign, boolean forSch) throws InternalBomFailedException, IOException, NoCPMFileFoundException, CancelledException, VariantFileBadFormatException
dsn
- tarFile
- used to wrtie name to ecad attribute file
InternalBomFailedException
IOException
NoCPMFileFoundException
CancelledException
VariantFileBadFormatException
private int getBOMOption(boolean isInitialization, boolean bomInclude, boolean genBOMForDoc)
public Vector writeBrdCompAndAttributesFiles(DesignAll dsn, File tarFile, boolean isInitialization) throws InternalBomFailedException, IOException, NoCPMFileFoundException, CancelledException, VariantFileBadFormatException
dsn
- tarFile
- used to wrtie name to ecad attribute file
InternalBomFailedException
IOException
NoCPMFileFoundException
CancelledException
VariantFileBadFormatException
public Vector writeSchCompAndAttributesFiles(DesignAll dsn, File tarFile, boolean isInitialization) throws InternalBomFailedException, IOException, NoCPMFileFoundException, CancelledException, VariantFileBadFormatException
dsn
- tarFile
- used to wrtie name to ecad attribute file
InternalBomFailedException
IOException
NoCPMFileFoundException
CancelledException
VariantFileBadFormatException
public Vector writeDnCompAndAttributesFiles(DesignAll dsn, File tarFile, boolean isInitialization) throws InternalBomFailedException, IOException, NoCPMFileFoundException, CancelledException, VariantFileBadFormatException
dsn
- tarFile
- used to wrtie name to ecad attribute file
InternalBomFailedException
IOException
NoCPMFileFoundException
CancelledException
VariantFileBadFormatException
public Vector generateBOM(DesignAll dsn, boolean variants) throws InternalBomFailedException, IOException, NoCPMFileFoundException, CancelledException, VariantFileBadFormatException, UnexpectedFilesInVariantDir
InternalBomFailedException
IOException
NoCPMFileFoundException
CancelledException
VariantFileBadFormatException
UnexpectedFilesInVariantDir
private void writeNullCompFile(File compFile) throws IOException
InternalBomFailedException
IOException
NoCPMFileFoundException
CancelledException
public File getBomFile(String asmNum) throws VariantFileBadFormatException
VariantFileBadFormatException
public File getCompFileName(DesignAll dsn)
public static String[] getStringArrayFromVector(Vector v) throws EmptyVectorException
v
-
EmptyVectorException
- if the vector has no elementspublic String[] getAvailableCabinets(String solution, String context) throws WGMException, CancelledException
WGMException
CancelledException
public String[] getAvailableProjects() throws WGMException, CancelledException
WGMException
CancelledException
public String[] getAvailableTeams(String solution, String context) throws WGMException, CancelledException
WGMException
CancelledException
public String[] getAvailableProducts() throws WGMException, CancelledException
WGMException
CancelledException
public boolean isWindchillPDMInstalled()
public static boolean isWindchillPDMLinkInstalled()
public static boolean isWindchillProjectLinkInstalled()
public EPMDocument lookupDocument(String number, String revision, String solution, String context)
public boolean isDocInWindchill(String number, String revision, String solution, String context)
public boolean revise(String functionName, DesignAll dsn, boolean getCopy, boolean checkout) throws WGMException, CancelledException
functionName
-
WGMException
CancelledException
public static DesignAll[] getAllDesignsFromECADDocs(ECADDocument[] ecadDocArr)
public AttributeStatus[] getAttributeStatusForCheckin() throws WindchillFunctionException
WindchillFunctionException
private Vector convertECADAttributesDef2AttributeStatus(ECADAttributes attrs, String epmDoc) throws InvalidArgumentException
InvalidArgumentException
public int getTotalPre()
getTotalPre
in interface IRegisterProgress
public int getTotalOperation()
getTotalOperation
in interface IRegisterProgress
public int getTotalInitTime()
getTotalInitTime
in interface IRegisterProgress
public static boolean isDesignTempZipFile(String filename)
filename
-
public String getVersion(boolean server, boolean fromClassPath) throws WindchillFunctionException
WindchillFunctionException
public String getVersionString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |