Changeset 611


Ignore:
Timestamp:
11/14/12 09:28:10 (12 years ago)
Author:
gosiaw
Message:

Packages moved

Location:
DCWoRMS/trunk/src/test/DEBBTranslator
Files:
22 added
2 deleted
2 edited
2 copied
1 moved

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/test/DEBBTranslator/src/test/DEBBTranslator/src/DEBB2DCWoRMSTranslator.java

    r607 r611  
     1package test.DEBBTranslator.src; 
     2 
    13import java.io.File; 
    24import java.io.IOException; 
     
    810import javax.xml.parsers.DocumentBuilderFactory; 
    911import javax.xml.parsers.ParserConfigurationException; 
     12import javax.xml.transform.OutputKeys; 
    1013import javax.xml.transform.Source; 
    1114import javax.xml.transform.Transformer; 
     
    5255        private static final String DEFAULT_SCHEMA_NAME = "DCWormsResSchema.xsd"; 
    5356        private static final String DEFAULT_DEBB_COMPONENT_TRANSFORMATION_FILE_NAME = "xml/DEBBComponentTranslator.xsl"; 
     57        private static final String DEFAULT_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance"; 
    5458        private static DocumentBuilder xmlDocumentBuilder; 
    5559        private static DocumentBuilderFactory domFactory; 
     
    111115                        Element rootElement = dcwormsDocument.createElement("environment"); 
    112116 
    113                         // Attr namespaceAttribute = dcwormsDocument 
    114                         // .createAttribute("xsi:noNamespaceSchemaLocation"); 
    115                         // namespaceAttribute.setValue(DEFAULT_SCHEMA_NAME); 
    116                         // rootElement.setAttributeNode(namespaceAttribute); 
     117                        //      Information about namespaces and schema validating output xml 
     118                        //      Should be: 
     119                        //      <environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     120                //           xsi:noNamespaceSchemaLocation="DCWormsResSchema.xsd"> 
     121                         
     122                        Attr schemaAttribute = dcwormsDocument 
     123                        .createAttribute("xsi:noNamespaceSchemaLocation"); 
     124                        schemaAttribute.setValue(DEFAULT_SCHEMA_NAME); 
     125                        Attr namespaceAttribute = dcwormsDocument 
     126                        .createAttribute("xmlns:xsi"); 
     127                        namespaceAttribute.setValue(DEFAULT_NAMESPACE); 
     128                        rootElement.setAttributeNode(schemaAttribute); 
     129                        rootElement.setAttributeNode(namespaceAttribute); 
     130                         
     131                         
    117132                        dcwormsDocument.appendChild(rootElement); 
    118133                        Comment comment = dcwormsDocument 
     
    233248 
    234249                        transformer = transformerFactory.newTransformer(); 
     250                        transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 
    235251 
    236252                        DOMSource source = new DOMSource(dcwormsDocument); 
  • DCWoRMS/trunk/src/test/DEBBTranslator/src/test/DEBBTranslator/src/DEBBComponentTranslator.java

    r578 r611  
     1package test.DEBBTranslator.src; 
     2 
    13import java.io.FileOutputStream; 
    24 
     
    4850                try { 
    4951                        TransformerFactory tFactory = TransformerFactory.newInstance(); 
    50  
     52                         
     53                         
    5154                         
    5255                        Transformer transformer = tFactory 
  • DCWoRMS/trunk/src/test/DEBBTranslator/xml/DCWormsResSchema.xsd

    r557 r611  
    299299                <xs:sequence> 
    300300                        <xs:element name="airThroughputEstimationPlugin" type="airThroughputEstimationPluginType" minOccurs="0"></xs:element> 
    301                         <xs:element name="airThroughputStates" type="airThroughputStatesType" minOccurs="0"></xs:element> 
     301                        <xs:element name="airThroughputStates" type="airThroughputStatesType" minOccurs="0" maxOccurs="unbounded"></xs:element> 
    302302                        <xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element> 
    303303                </xs:sequence> 
     
    311311                        <xs:element name="airThroughputState" type="airThroughputStateType" minOccurs="1" maxOccurs="unbounded"></xs:element> 
    312312                </xs:sequence> 
     313                <xs:attribute name="name" type="xs:string" use="optional"/> 
    313314        </xs:complexType> 
    314315         
  • DCWoRMS/trunk/src/test/DEBBTranslator/xml/DEBBComponents.xml

    r557 r611  
    1414                        <Class>CRAH</Class> 
    1515                </CoolingDevice> 
     16                <CoolingDevice> 
     17                        <Manufacturer>Manufacturer</Manufacturer> 
     18                        <Product>Product</Product> 
     19                        <MaxPower>0.0</MaxPower> 
     20                        <Class>CRAH</Class> 
     21                        <MaxCoolingCapacity>60000000</MaxCoolingCapacity> 
     22                        <MaxAirThroughput>0.0</MaxAirThroughput> 
     23                        <MaxWaterThroughput>0.0</MaxWaterThroughput> 
     24                        <ThroughputProfile> 
     25                                <FlowState> 
     26                                        <State>StateONE</State> 
     27                                        <Flow>1.5</Flow> 
     28                                        <PowerUsage>2</PowerUsage> 
     29                                        <Transition> 
     30                                                <ToState>StateTWO</ToState> 
     31                                                <PowerUsage>5</PowerUsage> 
     32                                                <Time>2</Time> 
     33                                        </Transition> 
     34                                </FlowState> 
     35                                <FlowState> 
     36                                        <State>StateTWO</State> 
     37                                        <Flow>2.5</Flow> 
     38                                        <PowerUsage>3</PowerUsage> 
     39                                        <Transition> 
     40                                                <ToState>StateONE</ToState> 
     41                                                <PowerUsage>4</PowerUsage> 
     42                                                <Time>6</Time> 
     43                                        </Transition> 
     44                                </FlowState> 
     45                        </ThroughputProfile> 
     46                </CoolingDevice> 
    1647                <Sensor> 
    1748                        <Class>Temperature</Class> 
     
    6394                <Product>RECS</Product> 
    6495                <MaxPower>0.0</MaxPower> 
    65                  
     96 
    6697                <!-- Repeating 18 times for all fans omitted --> 
    6798                <PowerSupply> 
Note: See TracChangeset for help on using the changeset viewer.