1
2
3
4
5
6
7 package org.astrogrid.dataservice.service.cea;
8
9 import java.io.IOException;
10 import org.apache.commons.logging.Log;
11 import org.apache.commons.logging.LogFactory;
12 import org.astrogrid.cfg.ConfigFactory;
13 import org.astrogrid.dataservice.metadata.VoDescriptionServer;
14 import org.astrogrid.dataservice.metadata.VoResourcePlugin;
15 import org.astrogrid.dataservice.metadata.v0_10.VoResourceSupport;
16
17 /***
18 * Serves the CEA resources. Bit of a mangled fudge at the moment to get
19 * the right stuff from the right bit into the right bit.
20 * <p>
21 * @author M Hill
22 */
23
24 public class CeaResources extends VoResourceSupport implements VoResourcePlugin {
25
26 protected static Log log = LogFactory.getLog(VoDescriptionServer.class);
27
28 /***
29 * Returns a CeaServiceType resource element
30 */
31 public String getVoResource() throws IOException {
32
33 String ceaService =
34 makeVoResourceElement("cea:CeaServiceType",
35 "xmlns:cea='http://www.ivoa.net/xml/CEAService/v0.2' ")+
36 makeCore("ceaService")+
37 "<interface xsi:type='vs:WebService'>"+
38 "<accessURL use='full'>"+
39 ConfigFactory.getCommonConfig().getString("datacenter.url")+"services/CommonExecutionConnectorService"+
40 "</accessURL>"+
41 "</interface>"+
42
43 "<cea:ManagedApplications>"+
44 "<cea:ApplicationReference>"+
45 makeId("ceaApplication")+
46 "</cea:ApplicationReference>"+
47 "</cea:ManagedApplications>"+
48 "</"+VORESOURCE_ELEMENT+">";
49
50
51 String ceaApplication =
52 makeVoResourceElement("cea:CeaApplicationType",
53 "xmlns:cea='http://www.ivoa.net/xml/CEAService/v0.2' "+
54 "xmlns:ceapd='http://www.astrogrid.org/schema/AGParameterDefinition/v1' "+
55 "xmlns:ceab='http://www.astrogrid.org/schema/CommonExecutionArchitectureBase/v1' ")+
56 makeCore("ceaApplication")+
57 "<cea:ApplicationDefinition>"+
58 "<cea:Parameters>"+
59 "<cea:ParameterDefinition name='Query' type='ADQL'>"+
60 "<ceapd:UI_Name>Query</ceapd:UI_Name>"+
61 "<ceapd:UI_Description>Astronomy Data Query Language that defines the search criteria</ceapd:UI_Description>"+
62
63
64
65 "</cea:ParameterDefinition>"+
66 "<cea:ParameterDefinition name='Result' type='text'>"+
67 "<ceapd:UI_Name>Result</ceapd:UI_Name>"+
68 "<ceapd:UI_Description>Query results</ceapd:UI_Description>"+
69 "</cea:ParameterDefinition>"+
70 "<cea:ParameterDefinition name='Format' type='text'>"+
71 "<ceapd:UI_Name>Format</ceapd:UI_Name>"+
72 "<ceapd:UI_Description>How the results are to be returned. VOTABLE or CSV for now</ceapd:UI_Description>"+
73 "<ceapd:DefaultValue>VOTABLE</ceapd:DefaultValue>"+
74 "</cea:ParameterDefinition>"+
75 "<cea:ParameterDefinition name='RA' type='double'>"+
76 "<ceapd:UI_Name>RA</ceapd:UI_Name>"+
77 "<ceapd:UI_Description>Right-Ascension of cone</ceapd:UI_Description>"+
78 "<ceapd:UCD>POS_RA_MAIN</ceapd:UCD>"+
79 "<ceapd:Units>deg</ceapd:Units>"+
80 "</cea:ParameterDefinition>"+
81 "<cea:ParameterDefinition name='Radius' type='double'>"+
82 "<ceapd:UI_Name>Radius</ceapd:UI_Name>"+
83 "<ceapd:UI_Description>Radius of cone</ceapd:UI_Description>"+
84 "<ceapd:Units>deg</ceapd:Units>"+
85 "</cea:ParameterDefinition>"+
86 "</cea:Parameters>"+
87
88 "<cea:Interfaces>"+
89 "<ceab:Interface name='adql'>"+
90 "<ceab:input>"+
91 "<ceab:pref maxoccurs='1' minoccurs='1' ref='Query'/>"+
92 "<ceab:pref maxoccurs='1' minoccurs='1' ref='Format'/>"+
93 "</ceab:input>"+
94 "<ceab:output>"+
95 "<ceab:pref maxoccurs='1' minoccurs='1' ref='Result'/>"+
96 "</ceab:output>"+
97 "</ceab:Interface>"+
98 "</cea:Interfaces>"+
99 "</cea:ApplicationDefinition>"+
100 "</"+VORESOURCE_ELEMENT+">";
101
102
103 return ceaService+ceaApplication;
104 }
105
106 }
107
108
109
110
111
112
113