View Javadoc

1   /*$Id: SchemaMap.java,v 1.3 2007/01/04 16:26:37 clq2 Exp $
2    * Created on 01-Sep-2004
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
9    *
10  **/
11  package org.astrogrid.test.schema;
12  
13  import org.apache.commons.logging.Log;
14  import org.apache.commons.logging.LogFactory;
15  
16  import java.util.HashMap;
17  import java.util.Iterator;
18  import java.util.Map;
19  
20  /*** static class that provides maps of all namespace - schema locations in this project.
21   * useful to pass to schema-validation methods in {@link org.astrogrid.test.AstrogridAssert}
22   * @author Noel Winstanley nw@jb.man.ac.uk 01-Sep-2004
23   * @author pharriso@eso.org May 27, 2005
24   *@ see org.astrogrid.test.AstrogridAssert
25   * @deprecated Use org.astrogrid.contracts.SchemaMap instead.
26   */
27  public class SchemaMap {
28     /***
29      * Logger for this class
30      */
31     private static final Log logger = LogFactory.getLog(SchemaMap.class);
32  
33      /*** Construct a new SchemaMap
34       * 
35       */
36      private SchemaMap() {
37      }
38      
39      public static final Map ALL; 
40      
41      static {
42          // populate the map.
43          ALL = new HashMap();
44          ALL.put("http://www.astrogrid.org/schema/CommonExecutionArchitectureBase/v1", SchemaMap.class.getResource("/schema/AGApplicationBase.xsd"));
45          ALL.put("http://www.astrogrid.org/schema/AGParameterDefinition/v1",SchemaMap.class.getResource("/schema/AGParameterDefinition.xsd"));
46          ALL.put("http://www.astrogrid.org/schema/CEATypes/v1",SchemaMap.class.getResource("/schema/CEATypes.xsd"));
47          ALL.put("http://www.astrogrid.org/schema/Credentials/v1",SchemaMap.class.getResource("/schema/Credentials.xsd"));
48          ALL.put("http://www.astrogrid.org/schema/ExecutionRecord/v1",SchemaMap.class.getResource("/schema/ExecutionRecord.xsd"));
49          ALL.put("http://www.ivoa.net/xml/CEAService/v0.1",SchemaMap.class.getResource("/schema/VOCEA.xsd"));
50          ALL.put("http://www.ivoa.net/xml/CEAService/v0.2",SchemaMap.class.getResource("/schema/VOCEA-v0.2.xsd"));
51          ALL.put("http://www.astrogrid.org/schema/CEAImplementation/v1", SchemaMap.class.getResource("/schema/CEAImplementation.xsd"));
52          ALL.put("http://www.astrogrid.org/schema/AGWorkflow/v1",SchemaMap.class.getResource("/schema/Workflow.xsd"));
53    //TODO these data model ones are almost certainly out of date...pah 
54          ALL.put("http://ivoa.org/Accuracy",SchemaMap.class.getResource("/schema/externalSchema/quantity/Accuracy.xsd"));
55          ALL.put("http://ivoa.org/CoordinateSystems",SchemaMap.class.getResource("/schema/externalSchema/quantity/CoordinateSystems.xsd"));
56          ALL.put("http://ivoa.org/Mappings",SchemaMap.class.getResource("/schema/externalSchema/quantity/Mappings.xsd"));
57          ALL.put("http://ivoa.org/Quantity",SchemaMap.class.getResource("/schema/externalSchema/quantity/Quantity.xsd"));
58                  
59          ALL.put("urn:nvo-coords",SchemaMap.class.getResource("/schema/externalSchema/stc/coords.xsd"));
60          ALL.put("urn:nvo-region",SchemaMap.class.getResource("/schema/externalSchema/stc/region.xsd"));
61          ALL.put("urn:nvo-stc",SchemaMap.class.getResource("/schema/externalSchema/stc/stc.xsd"));
62        //0.9 registry                       
63          ALL.put("http://www.ivoa.net/xml/ConeSearch/v0.2",SchemaMap.class.getResource("/schema/externalSchema/ConeSearch-v0.2.xsd"));
64          ALL.put("http://www.ivoa.net/xml/SIA/v0.6",SchemaMap.class.getResource("/schema/externalSchema/SIA-v0.6.xsd"));
65          ALL.put("http://www.ivoa.net/xml/VOCommunity/v0.2",SchemaMap.class.getResource("/schema/externalSchema/VOCommunity-v0.2.xsd"));
66          ALL.put("http://www.ivoa.net/xml/VODataService/v0.4",SchemaMap.class.getResource("/schema/externalSchema/VODataService-v0.4.xsd"));
67     // VODataServiceCoverage-* omitted - no target namespace declared. doesn't look valid as a stand-alone schema 
68          ALL.put("http://www.ivoa.net/xml/VORegistry/v0.2",SchemaMap.class.getResource("/schema/externalSchema/VORegistry-v0.2.xsd"));
69          ALL.put("http://www.ivoa.net/xml/VOResource/v0.9",SchemaMap.class.getResource("/schema/externalSchema/VOResource-v0.9.xsd"));
70     // likewise, omitted VOResourceRelType-* 
71          //0.10 registry
72          ALL.put("http://www.ivoa.net/xml/ConeSearch/v0.3",SchemaMap.class.getResource("/schema/externalSchema/v10/ConeSearch-v0.3.xsd"));
73          ALL.put("http://www.ivoa.net/xml/SIA/v0.7",SchemaMap.class.getResource("/schema/externalSchema/v10/SIA-v0.7.xsd"));
74          ALL.put("http://www.ivoa.net/xml/VODataService/v0.5",SchemaMap.class.getResource("/schema/externalSchema/v10/VODataService-v0.5.xsd"));
75          ALL.put("http://www.ivoa.net/xml/VORegistry/v0.3",SchemaMap.class.getResource("/schema/externalSchema/v10/VORegistry-v0.3.xsd"));
76          ALL.put("http://www.ivoa.net/xml/VOResource/v0.10",SchemaMap.class.getResource("/schema/externalSchema/v10/VOResource-v0.10.xsd"));
77       // the registry interface
78          ALL.put("http://www.ivoa.net/xml/RegistryInterface/v0.1",SchemaMap.class.getResource("/schema/externalSchema/v10/RegistryInterface-v0.1.xsd"));
79          
80          ALL.put("http://www.ivoa.net/xml/VOTable/v1.0",SchemaMap.class.getResource("/schema/externalSchema/VOTable.xsd"));
81          ALL.put("http://www.ivoa.net/xml/VOTable/v1.1",SchemaMap.class.getResource("/schema/externalSchema/VOTable-1.1.xsd"));
82          // isn't there a more recent version of votable now too?
83               
84          
85          for (Iterator iter = SchemaMap.ALL.keySet().iterator(); iter.hasNext();) {
86             String key = (String) iter.next();
87             if(SchemaMap.ALL.get(key) == null)
88             {
89                logger.error("key "+key+ " has no associated schema");
90             }
91          }
92  
93      }
94      
95  
96  }
97  
98  
99  /* 
100 $Log: SchemaMap.java,v $
101 Revision 1.3  2007/01/04 16:26:37  clq2
102 wo_gtr_1942
103 
104 Revision 1.2.48.1  2006/10/17 17:25:54  gtr
105 This class is deprecated in favour of org.astrogrid.contracts.SchemaMap.
106 
107 Revision 1.2  2005/07/05 08:27:01  clq2
108 paul's 559b and 559c for wo/apps and jes
109 
110 Revision 1.1.90.6  2005/06/09 07:28:31  pah
111 *** empty log message ***
112 
113 Revision 1.1.90.5  2005/06/01 15:07:30  pah
114 added votable 1.1
115 
116 Revision 1.1.90.4  2005/05/27 10:21:49  pah
117 add the registry interface schema
118 
119 Revision 1.1.90.3  2005/05/27 10:08:40  pah
120 fix broken mappings for jes types and v05 data service
121 
122 Revision 1.1.90.2  2005/05/25 09:01:05  pah
123 will create v10 registry objects in addition to the v9 objects (which have been left so as not to break existing components that use v9)
124 rearranged the generation so that it occurs into the gen folder - easier to see the few handwritten classes in this module
125 
126 Revision 1.1.90.1  2005/05/17 11:39:38  pah
127 moved generated source to the gen tree - src only has hand written source
128 
129 Revision 1.1.88.1  2005/05/17 09:54:35  pah
130 put in v10 schema and separated out the CEA implementation
131 
132 Revision 1.1  2004/09/02 01:31:15  nw
133 added in all external schemas to jar (for testing).
134 wrote static that lists all namesapces and system IDs for schemas.
135  
136 */