|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.wgmecad.xml.DocCreationHelper
Created by IntelliJ IDEA. User: barky Date: Aug 19, 2003 Time: 4:11:53 PM To change this template use Options | File Templates. 20-Jan-2004 tguski changed to add Describes tag & reference DTD on server
Field Summary | |
private static HashMap |
_itemToDocMap
|
private static String[] |
elementOrder
|
(package private) static org.apache.log4j.Logger |
logger
|
private URL |
windchillSystem
|
private Document |
xmldoc
|
Constructor Summary | |
DocCreationHelper(URL windchillSystem)
|
Method Summary | |
void |
addFileItem(Element ecadDesign,
ECADContentItem item,
File root)
search for each doc in the ecadDesign add the file item |
private void |
addFileItemToDoc(Element doc,
ECADContentItem item,
File root)
add a file item to the file group within this doc it it exists, else create the file group with this item as its only member. |
private void |
appendChildren(Element e,
Element[] children)
|
Element |
createAssembly(DesignAll dsn,
String assemblyNumber,
String assemblyName,
String assemblyRevision,
String assemblyDescription)
create an assembly element |
Element |
createAttribute(String name,
String value)
create an attribure node |
Element |
createBoard(DesignAll dsn)
create a Board Element |
Element |
createComponent(Object[] refDess,
String number,
String name,
String qty)
create a component based on an array of refDes' and a number |
Element |
createContent(File fn,
File root)
create a content xml node |
Element |
createDescribes(String number,
String version,
String view)
create a describes xml node |
Element |
createECADDesign(DesignAll dsn,
Element board,
Element schematic,
ArrayList assemblies)
create the ECAD Design |
Element |
createECADDesignBlank(DesignAll dsn,
Collection asmList,
boolean createSchematic,
boolean createBoard)
|
Element |
createECADDesignDesign(DesignAll dsn,
boolean createAssembly,
boolean createSchematic,
boolean createBoard)
|
Element |
createFileGroup(File[] files,
String name,
String describes,
File root,
Element parentDoc)
create a files xml node |
Element |
createFileGroup(File[] files,
String name,
String describes,
File root,
Element parentDoc,
String type)
|
Element |
createRefDes(String refDes)
create a refDes node |
Element |
createSchematic(DesignAll dsn)
create a Schematic Element |
static boolean |
doesIBADefinitionExist(String name)
|
Element |
findChildWithAttribute(Element root,
String tag,
String attrName,
String attrVal)
look for an immediate child of the root which has the specified tag and the attribute name/value pair. |
static HashMap |
getDocTypeToTagMap()
|
Vector |
getSubElements(Element root,
String[] childTags)
walk down the chain of child tags returning a vector of all the elements which have the specified heirarchy of tags. |
static void |
insertChildInOrder(Element parent,
Element child)
|
static boolean |
isInOrder(Node first,
Node second)
|
static boolean |
isInOrder(String first,
String second)
|
static boolean |
validateAttribute(String attributeName,
String attributeValue)
|
void |
writeECADDesignXMLFile(File outputFile,
Element ecadDesign)
persist this ecadDesign to a file in XML |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Document xmldoc
private URL windchillSystem
static org.apache.log4j.Logger logger
private static final String[] elementOrder
private static HashMap _itemToDocMap
Constructor Detail |
public DocCreationHelper(URL windchillSystem)
Method Detail |
public static boolean isInOrder(Node first, Node second) throws InvalidArgumentException
InvalidArgumentException
public static boolean isInOrder(String first, String second) throws InvalidArgumentException
InvalidArgumentException
public Element createAttribute(String name, String value)
name
- value
-
public Element createRefDes(String refDes)
refDes
-
public Element createComponent(Object[] refDess, String number, String name, String qty) throws XMLCompWithNoRefdesException
refDess
- number
-
XMLCompWithNoRefdesException
public Element createContent(File fn, File root)
fn
- File object representing the path to the file in the file system
public Element createFileGroup(File[] files, String name, String describes, File root, Element parentDoc)
files
- File objects representing the path to the file in the file systemname
- Name of the fileGroup
public Element createFileGroup(File[] files, String name, String describes, File root, Element parentDoc, String type)
public Element createDescribes(String number, String version, String view) throws InvalidArgumentException
number
- - number of the part that the EPMDocument describes (REQUIRED)version
- - version of the part - if null LATEST is used (OPTIONAL)view
- - view of the part - if null view from ecad props used (OPTIONAL)
InvalidArgumentException
private void appendChildren(Element e, Element[] children)
public Element createBoard(DesignAll dsn)
public Element createSchematic(DesignAll dsn)
public Element createAssembly(DesignAll dsn, String assemblyNumber, String assemblyName, String assemblyRevision, String assemblyDescription)
public Element createECADDesignDesign(DesignAll dsn, boolean createAssembly, boolean createSchematic, boolean createBoard) throws InvalidDesignArgumentException, IOException, VariantFileBadFormatException
InvalidDesignArgumentException
IOException
VariantFileBadFormatException
public Element createECADDesignBlank(DesignAll dsn, Collection asmList, boolean createSchematic, boolean createBoard) throws InvalidDesignArgumentException
InvalidDesignArgumentException
public Element createECADDesign(DesignAll dsn, Element board, Element schematic, ArrayList assemblies) throws InvalidDesignArgumentException
board
- schematic
-
InvalidDesignArgumentException
public void writeECADDesignXMLFile(File outputFile, Element ecadDesign) throws IOException
outputFile
- ecadDesign
-
IOException
public static HashMap getDocTypeToTagMap()
public void addFileItem(Element ecadDesign, ECADContentItem item, File root)
ecadDesign
- item
- private void addFileItemToDoc(Element doc, ECADContentItem item, File root)
doc
- item
- public Element findChildWithAttribute(Element root, String tag, String attrName, String attrVal)
root
- tag
- attrName
- attrVal
-
public Vector getSubElements(Element root, String[] childTags)
root
- childTags
- public static void insertChildInOrder(Element parent, Element child)
public static boolean doesIBADefinitionExist(String name)
public static boolean validateAttribute(String attributeName, String attributeValue)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |