The XML Schema
While developing the GUI for CCA frameworks we felt the need for specifying component information in a framework independent manner. XML was used to specify the component details.  We are trying to develop a schema that is general enough and yet encompasses the specific needs of a framework.

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
 
 
     
 
 
Type
MinOccurs
MaxOccurs
Comments
Component
 
 
 
 
Element
1
 1
Describes all the component information 
 
ComponentOverview
 
 
 
 Element
1
 1
Not vital for the running of the component.
 
 
ComponentName
 
 
String 
 0 
 
 
 
Summary
 
 
String
 
 
 
Description
 
 
String 
1
1
 
 
 
Author
 
 
String
unbounded 
 
 
 
ComponentAuthor
 
 
String 
unbounded
 
UniqueID
     
String
 0 
1
 
ComponentProperties
 
 
 
String 
 0
unbounded 
Currently just a  String,can be developed elaborately to describe properties that may be common over all frameworks 
 
Languages
 
 
 
String 
unbounded 
 This information is right now only for information but this could be used later to see which language component could be used. 
 
Ports
 
 
 
Element 
assumption is that a component will have to have atleast one port of either kind. The provides and uses thought indentical information is classified into two different elements for clarity 
 
 
ProvidesPort
 
 
Element 
unbounded 
 
 
 
 
PortName
 
String 
 1
  The name of the port
 
 
 
PortType
 
 String
 1
 The port type could be the WSDL as in XCAT or the dataType as SciRun
 
 
 
Summary
 
 String
1
 
 
 
 
Descprition
 
 String
1
 
 
 
 
MaxConnections
 
integer
 0
1
The maximum connections that this port can accept
 
 
 
MinConnections
 
integer
 1
The minimum connections that this port can accept
 
 
 
PortSIDL
 
String 
The SIDL String for this port - may become minoccurrence =1?
ComponentName String 0 unbounded back reference 
 
 
 
NameValuePair
 
Element 
 0
unbounded 
To accomodate for TypeMaps 
 
 
 
 
Name
 
 1
 
 
 
 
 
Value
 
 1
 
 
 
UsesPort
 
 
 
 
 
Same as ProvidesPort 
 
 
 
PortName
 
 
 
 
 
 
 
 
PortType
 
 
 
 
 
 
 
 
Summary
 
 
 
 
 
 
 
 
Description
 
 
 
 
 
 
 
 
MaxConnections
 
 
 
 
 
 
 
 
MinConnections
 
 
 
 
 
 
 
 
PortSIDL
 
 
 
 
 
 
 
 
NameValuePair
 
 
 
 
 
ComponentName
 
 
 
 
Name
 
 
 
 
 
 
 
 
Value
 
 
 
 
 
SIDL
 
 
 
String 
0
It is the BABEL generated XML string, may become  minimum occurence = 1 
Implementation
 
 
 
 
String 
It is currently just a string but this would become an element that has implementation specific details
ExecutionEnvironment
 
 
 
 
Element 
1
can be used to specify the environment information in which this component is instatiated. Its minimum occurrence is currently one since uri is required!
 
URI
 
 
 
String 
unbounded 
decribes the script or the path that this component uses to instantiate a component.
 
Libraries
 
 
 
String 
unbounded 
the depenedent or shared libraries
 
Creation
 
 
 
String 
unbounded
in XCAT this specifies the protocols used to instantiate components eg: ssh, gram, etc. In CCAFE this can only have a single value!
 
ExecScript
 
 
 
String 
The script to execute
 
OutputDir
 
 
 
String 
A path or URL where the output and error files are dumped
 
Architecture/
CompilerVersion
 
 
 
String 
unbounded 
The architecture-compiler combinations that will work for this implementation of the component.  This is useful Build Information.  This will evolve into probably into an element
 
EnvironmentVariable
 
 
 
Element 
unbounded 
All frameworks have a set of environment variables to be set for both build and run information. 
 
 
Variable
 
 
String 
 
 
 
Value
 
 
 String
 1
 
 
NameValuePair
 
 
 
Element 
unbounded 
This is used to accomodate all the framework specific environment  values that dont fit into any of the above categories.
 
 
Name
 
 
String 
 
 
 
Value
 
 
String 
 
GUIDescription
 
 
 
 
String 
 0
This format is currently taken from SciRun. We wish to evolve this so as to be able to specify custom GUIs including XUL or otherwise.
 
Description
 
 
 
String
 
 
Img
 
 
 
 String
 
 
Parameter
 
 
 
Element 
unbounded 
 
 
 
Widget
 
 
 String
 
 
 
Label
 
 
 String
 1
 1
 
 
 
Description
 
 
 String
 1
 
 
 
DataType
 
 
 String
 0
 
 
 
Value
 
 
Element
 0
unbounded 
 
 
 
 
Min
 
 String
 1
 
 
 
 
Max
 
String 
 1
 1
 
 
 
 
Default
 
String
1
1
 
Testing
       
String
0
1
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