ComponentStaticInformation
- Component
- ComponentOverview
- ComponentName
- Summary
- Description
- Author
- ComponentAuthor
- UniqueID
- ComponentProperties
- Languages
- Ports
- ProvidesPort
- PortName
- PortType
- Summary
- Description
- MaxConnections
- MinConnections
- SIDL
- NameValuePairs
- Name
- Value
- UsesPort
- PortName
- PortType
- Summary
- Description
- MaxConnections
- MinConnections
- SIDL
- NameValuePairs
- Name
- Value
- SIDL
- Implementation
- ExecutionEnvironment
- URI
- Libraries
- Creation
- ExecScript
- OuputDir
- Architecture/Compiler Version
- EnvironmentVariables
- Variable
- Value
- NameValuePairs
- Name
- Value
- GUIDescription
- Description
- Img
- Parameter
- Widget
- Label
- Description
- DataType
- Values
- Min
- Max
- Default
- Testing
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ComponentName | String | 0 | unbounded | back reference | ||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ComponentName | ||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CompilerVersion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Currently this is just a string but it should evolve to specific testing methods and procedures |
The schema is in cca-gui/src/xsd/componentStaticInformation.xsd
How to regenerate the Castor Java files when the schema changes?
1. cd to cca-gui/src/castor
2. To save the old files do mv schema to schema-backup
3. Then run setenv CLASSPATH ../../lib/castor/castor-0.9.2.jar:../../lib/castor/xerces_2_0.jar
4. Then run java org.exolab.castor.builder.SourceGenerator -i ../../src/xsd/componentStaticInformation.xsd
-package schema.component
5. Then javac schema/component/*.java
[ If compiled with jdk1.4 it gives warning about deprecation. Hopefully
with new castor jar this problem should be resolved]
6. jar cf component-schema.jar schema/component/*.class to create
new jar.
7. mv component-schema.jar ../../lib/schema/component/ to replace
the old jar
8. rm schema/component/*.class to remove the unwanted class files
Implementation Details: Parsing the XML information
The files ComponentInformationParser.java and ComponentInfo.java hide the details of the parsing from the rest of the GUI. The ComponentInformationParser.java parses the xml file and sets all the information in variables in ComponentInfo.java. The ComponentInfo.java has all the component information in a flat structure to facilitate the data transfer from palette to arena. The values of the fields are obtained by simple get methods.
The ComponentInformationParser has the ability to read from both a url and a file path.
This parser may not have all the various combinations of get methods that are available from the castor generated files. It just has methods to get all the information as required to display it as a tree.
If the schema has changed then changes need to be made to these two
files.
Other files
Some files are likely to get affected by the changes to
the schema. They are
cca-gui/src/gov/anl/gui/InfoPanel.java
cca-gui/src/gov/anl/gui/SearchFrame.java
cca-gui/src/gov/anl/gui/ComponentParserSample.java
The full xml example of the schema is in
cca-gui/src/gov/xml/example.xml
NOTE: The field descriptors in the xml schema are case-sensistive so providesPort will not work in the place of ProvidesPort.
How to run the ComponentParserSample?
1. do make.sh parser samples at top level
2. cd build/classes
3. setenv CLASSPATH ../../lib/castor/castor-0.9.3.19.jar:../../lib/castor/xerces_2_0.jar:../../lib/schema/component/component-schema.jar:.
4. java gov.anl.samples.ComponentParserSample ../../src/xml/example.xml
Castor Website
1. Website: www.castor.org