Revision 26512

View differences:

tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/.settings/org.eclipse.wst.common.project.facet.core.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<faceted-project>
3
  <fixed facet="jst.java"/>
4
  <fixed facet="jst.utility"/>
5
  <installed facet="jst.utility" version="1.0"/>
6
  <installed facet="jst.java" version="5.0"/>
7
</faceted-project>
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/.settings/org.eclipse.wst.common.component
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project-modules id="moduleCoreId" project-version="1.5.0">
3
<wb-module deploy-name="wps-plugin-0.4.0-operation-StreetsMap">
4
<wb-resource deploy-path="/" source-path="/src"/>
5
</wb-module>
6
</project-modules>
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/.settings/org.eclipse.jdt.core.prefs
1
#Thu Feb 21 12:16:56 GMT+01:00 2008
2
eclipse.preferences.version=1
3
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
4
org.eclipse.jdt.core.compiler.compliance=1.5
5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7
org.eclipse.jdt.core.compiler.source=1.5
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/.classpath
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4
	<classpathentry excluding="**/.svn/" kind="src" path="src"/>
5
	<classpathentry kind="var" path="FROGS_PATH/activation-2002.jar"/>
6
	<classpathentry kind="var" path="FROGS_PATH/commons-logging-1.0.4.jar"/>
7
	<classpathentry kind="var" path="FROGS_PATH/jaxb-api.jar"/>
8
	<classpathentry kind="var" path="FROGS_PATH/jaxb-impl.jar"/>
9
	<classpathentry kind="var" path="FROGS_PATH/xalan.jar"/>
10
	<classpathentry kind="var" path="FROGS_PATH/serializer.jar"/>
11
	<classpathentry kind="var" path="FROGS_PATH/xercesImpl.jar"/>
12
	<classpathentry kind="var" path="FROGS_PATH/xml-apis.jar"/>
13
	<classpathentry kind="var" path="FROGS_PATH/commons-frogs-SNAPSHOT.jar"/>
14
	<classpathentry kind="var" path="FROGS_PLUGINS_PATH/wps0_4_0/lib/wps-parser-0.4.0-SNAPSHOT.jar"/>
15
	<classpathentry kind="var" path="FROGS_PLUGINS_PATH/wps0_4_0/lib/wps-plugin-0.4.0-SNAPSHOT.jar"/>
16
	<classpathentry combineaccessrules="false" kind="src" path="/Callejero"/>
17
	<classpathentry kind="output" path="bin"/>
18
</classpath>
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>wps-plugin-0.4.0-operation-StreetsMap</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.wst.common.project.facet.core.builder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>org.eclipse.jdt.core.javabuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.wst.validation.validationbuilder</name>
20
			<arguments>
21
			</arguments>
22
		</buildCommand>
23
	</buildSpec>
24
	<natures>
25
		<nature>org.eclipse.jdt.core.javanature</nature>
26
		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
27
		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
28
		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
29
	</natures>
30
</projectDescription>
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/.fatjar
1
#Fat Jar Configuration File
2
#Mon Mar 24 17:55:13 GMT+01:00 2008
3
onejar.license.required=true
4
manifest.classpath=
5
manifest.removesigners=true
6
onejar.checkbox=false
7
jarname=wps-plugin-0.4.0-operation-StreetsMapjar
8
manifest.mergeall=true
9
manifest.mainclass=
10
manifest.file=<createnew>
11
jarname.isextern=false
12
onejar.expand=
13
excludes=<po|Callejero>
14
includes=
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/META-INF/MANIFEST.MF
1
Manifest-Version: 1.0
2
Class-Path: 
3

  
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/org/tigris/frogs/plugin/wpsint/impl_0_4_0/operation/streetsmap/resource/LocalizationBundle.properties
1
#Localization File
2
main=Properties
3
test=This is a test %0% %1% %2%
4

  
5
#WPS 0.4.0 GetCapabilties Information
6
WPS.0.4.0.Operation.GetCapabilities.None=None
7
WPS.0.4.0.Operation.GetCapabilities.WebSite=www.logex.es
8
WPS.0.4.0.Operation.GetCapabilities.NoDefinition=
9
WPS.0.4.0.Operation.GetCapabilities.Server=
10
WPS.0.4.0.Operation.GetCapabilities.Internet=
11
WPS.0.4.0.Operation.GetCapabilities.ProviderName=Lógica Extrema s.l.
12
WPS.0.4.0.Operation.GetCapabilities.AdministrativeArea=
13
WPS.0.4.0.Operation.GetCapabilities.City=Valencia
14
WPS.0.4.0.Operation.GetCapabilities.Country=Spain
15
WPS.0.4.0.Operation.GetCapabilities.DeliveryPoint=
16
WPS.0.4.0.Operation.GetCapabilities.ElectronicMailAddress=info@logex.es
17
WPS.0.4.0.Operation.GetCapabilities.PostalCode=46025
18
WPS.0.4.0.Operation.GetCapabilities.HoursOfService=
19
WPS.0.4.0.Operation.GetCapabilities.OnlineResource=
20
WPS.0.4.0.Operation.GetCapabilities.Facsimiles=(+34) 96 346 23 72
21
WPS.0.4.0.Operation.GetCapabilities.Voices=(+34) 96 346 23 75
22
WPS.0.4.0.Operation.GetCapabilities.IndividualName=
23
WPS.0.4.0.Operation.GetCapabilities.PositionName=
24
WPS.0.4.0.Operation.GetCapabilities.Role=
25

  
26
#WPS 0.4.0 Operation StreetsMap Process
27
WPS.0.4.0.Operation.StreetsMap.General.Abstract=Servidor de callejeros vectorial
28
WPS.0.4.0.Operation.StreetsMap.General.Title=Sirve ficheros gml con el callejero de la Comunidad Valencia.
29

  
30

  
31
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.Abstract=The output is a xml file with the uris of the generated gml documents.
32
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.Title=Get gml map
33
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.detailLevel.Abstract=Depending in this detailLevel, the server filters the output with its criteria(area, resolution, ...)
34

  
35
If no detailLevel specified(null), the output will be the max detailLevel
36
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.detailLevel.Title=The deatil level the user wants
37
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.layerName.Abstract=The name of the layer we want. If no layer specified(null), the process returns all the layers available in the server.
38
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.layerName.Title=The name of the layer
39
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.bBox.Abstract=The extent(bounding box) we want. Inside this extent, will be the crs.
40
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.bBox.Title=Extent of the layer
41
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.UrisOut.Abstract=Xml file whit the uris of the generated gml files.
42
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.UrisOut.Title=The uris of the gml files
43

  
44

  
45
#Some useful Error Handling Messages
46
WPS.0.4.0.Operation.StreetsMap.Error.UnKnown=An unattend error occured:'%0%'
47
WPS.0.4.0.Operation.StreetsMap.Error.NOPARAMETER=SERVER ERROR:Parameter '%0%' has been not initialized
48
WPS.0.4.0.Operation.StreetsMap.Error.NOPARAMETERS=SERVER ERROR:No parameters has been not initialized
49
WPS.0.4.0.Operation.StreetsMap.Error.XML=Problem to get the document '%0%'
50
WPS.0.4.0.Operation.StreetsMap.Error.General=General Error. Here is the detail:'%0%'
51
WPS.0.4.0.Operation.StreetsMap.Error.TEMPFILE=SERVER SIDE ERROR:Cannot delete temporary file
52
WPS.0.4.0.Operation.StreetsMap.Error.NotAccessibleUrl=The resource is either not accessible or not a valid URL
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/org/tigris/frogs/plugin/wpsint/impl_0_4_0/operation/streetsmap/resource/LocalizationBundle.java
1
/*
2
 * ============================================================================
3
 * Copyright 2006 Government of Canada
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 * ============================================================================
17
*/
18
/*
19
 $Id: 
20
 $HeadURL: 
21
*/
22

  
23
/*
24
   **    **  *******   *****       *****    **   **     *****  
25
   **    **        ** **   **     **   **   **   **    **   ** 
26
   ** ** **  **    ** **          **  ***   **   **    **  *** 
27
   ** ** **  *******   *****      ** * **   **   **    ** * ** 
28
   ** ** **  **            **     ***  **   *******    ***  ** 
29
   ** ** **  **       **   **     **   ** **     ** ** **   ** 
30
    *******  **        *****       *****  **     ** **  *****  
31
 Generated from WPS 0.4.0 Code Generator Tool version 0.9.0 at Thu Feb 21 12:05:11 GMT+01:00 2008 By PS, RC, MC
32
*/
33

  
34
package org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap.resource;
35

  
36
 /**
37
  * To be documented
38
  *
39
  */
40
public class LocalizationBundle extends org.tigris.frogs.resource.LocalizationBundle {
41

  
42
	private static String _HEADER = "org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap.resource.LocalizationBundle";
43

  
44
	 /**
45
	  * To be documented
46
	  *
47
	  * @return String
48
	  *
49
	  */
50
	public String getHeaderClass() {
51
		return (_HEADER);
52
	}
53

  
54
}
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/org/tigris/frogs/plugin/wpsint/impl_0_4_0/operation/streetsmap/resource/LocalizationBundle_fr.properties
1
#Localization File
2
main=Properties
3
test=This is a test %0% %1% %2%
4

  
5
#WPS 0.4.0 GetCapabilties Information
6
WPS.0.4.0.Operation.GetCapabilities.None=None
7
WPS.0.4.0.Operation.GetCapabilities.WebSite=www.logex.es
8
WPS.0.4.0.Operation.GetCapabilities.NoDefinition=
9
WPS.0.4.0.Operation.GetCapabilities.Server=
10
WPS.0.4.0.Operation.GetCapabilities.Internet=
11
WPS.0.4.0.Operation.GetCapabilities.ProviderName=Lógica Extrema s.l.
12
WPS.0.4.0.Operation.GetCapabilities.AdministrativeArea=
13
WPS.0.4.0.Operation.GetCapabilities.City=Valencia
14
WPS.0.4.0.Operation.GetCapabilities.Country=Spain
15
WPS.0.4.0.Operation.GetCapabilities.DeliveryPoint=
16
WPS.0.4.0.Operation.GetCapabilities.ElectronicMailAddress=info@logex.es
17
WPS.0.4.0.Operation.GetCapabilities.PostalCode=46025
18
WPS.0.4.0.Operation.GetCapabilities.HoursOfService=
19
WPS.0.4.0.Operation.GetCapabilities.OnlineResource=
20
WPS.0.4.0.Operation.GetCapabilities.Facsimiles=(+34) 96 346 23 72
21
WPS.0.4.0.Operation.GetCapabilities.Voices=(+34) 96 346 23 75
22
WPS.0.4.0.Operation.GetCapabilities.IndividualName=
23
WPS.0.4.0.Operation.GetCapabilities.PositionName=
24
WPS.0.4.0.Operation.GetCapabilities.Role=
25

  
26
#WPS 0.4.0 Operation StreetsMap Process
27
WPS.0.4.0.Operation.StreetsMap.General.Abstract=Servidor de callejeros vectorial
28
WPS.0.4.0.Operation.StreetsMap.General.Title=Sirve ficheros gml con el callejero de la Comunidad Valencia.
29

  
30

  
31
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.Abstract=The output is a xml file with the uris of the generated gml documents.
32
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.Title=Get gml map
33
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.detailLevel.Abstract=Depending in this detailLevel, the server filters the output with its criteria(area, resolution, ...)
34

  
35
If no detailLevel specified(null), the output will be the max detailLevel
36
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.detailLevel.Title=The deatil level the user wants
37
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.layerName.Abstract=The name of the layer we want. If no layer specified(null), the process returns all the layers available in the server.
38
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.layerName.Title=The name of the layer
39
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.bBox.Abstract=The extent(bounding box) we want. Inside this extent, will be the crs.
40
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.bBox.Title=Extent of the layer
41
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.UrisOut.Abstract=Xml file whit the uris of the generated gml files.
42
WPS.0.4.0.Operation.StreetsMap.Process.GetMap.UrisOut.Title=The uris of the gml files
43

  
44

  
45
#Some useful Error Handling Messages
46
WPS.0.4.0.Operation.StreetsMap.Error.UnKnown=An unattend error occured:'%0%'
47
WPS.0.4.0.Operation.StreetsMap.Error.NOPARAMETER=SERVER ERROR:Parameter '%0%' has been not initialized
48
WPS.0.4.0.Operation.StreetsMap.Error.NOPARAMETERS=SERVER ERROR:No parameters has been not initialized
49
WPS.0.4.0.Operation.StreetsMap.Error.XML=Problem to get the document '%0%'
50
WPS.0.4.0.Operation.StreetsMap.Error.General=General Error. Here is the detail:'%0%'
51
WPS.0.4.0.Operation.StreetsMap.Error.TEMPFILE=SERVER SIDE ERROR:Cannot delete temporary file
52
WPS.0.4.0.Operation.StreetsMap.Error.NotAccessibleUrl=The resource is either not accessible or not a valid URL
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/org/tigris/frogs/plugin/wpsint/impl_0_4_0/operation/streetsmap/GetCapabilitiesResponse.java
1
/*
2
 * ============================================================================
3
 * Copyright 2006 Government of Canada
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 * ============================================================================
17
*/
18
/*
19
 $Id: 
20
 $HeadURL: 
21
*/
22

  
23
/*
24
   **    **  *******   *****       *****    **   **     *****  
25
   **    **        ** **   **     **   **   **   **    **   ** 
26
   ** ** **  **    ** **          **  ***   **   **    **  *** 
27
   ** ** **  *******   *****      ** * **   **   **    ** * ** 
28
   ** ** **  **            **     ***  **   *******    ***  ** 
29
   ** ** **  **       **   **     **   ** **     ** ** **   ** 
30
    *******  **        *****       *****  **     ** **  *****  
31
 Generated from WPS 0.4.0 Code Generator Tool version 0.9.0 at Thu Feb 21 12:05:11 GMT+01:00 2008 By PS, RC, MC
32
*/
33

  
34
package org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap;
35

  
36
import org.apache.commons.logging.Log;
37
import org.apache.commons.logging.LogFactory;
38

  
39
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.*;
40
import org.tigris.frogs.StandardSessionDataRequestedType;
41

  
42
 /**
43
  * To be documented
44
  *
45
  */
46
public class GetCapabilitiesResponse extends org.tigris.frogs.plugin.wpsint.impl_0_4_0.GetCapabilitiesResponse {
47

  
48
    //	 Logger object for logging in this class
49
	protected final Log logger = LogFactory.getLog(getClass());
50

  
51
	private ProcessOfferingsType processOffering = null;
52
	private org.tigris.frogs.ows.impl_1_0_0.OperationsMetadataType operationsMetadata = null;
53
	private org.tigris.frogs.ows.ServiceIdentificationType serviceIdentification = null;
54
	private org.tigris.frogs.ows.ServiceProviderType serviceProvider = null;
55
	// No static element
56
	private ProcessDeclarationRunnable[] processes =
57
		new ProcessDeclarationRunnable[] {
58
			new Process_GetMap()
59
					};
60

  
61
   /**
62
     * Constructor
63
     */
64
   public GetCapabilitiesResponse() throws Exception {}
65

  
66
/**
67
  * Raise this event to point out the fact that the GetCapbilities
68
  * properties will be refreshed
69
  */
70
@Override
71
	public void afterPropertiesSet() {
72
	 	this.processOffering = null;
73
	 	this.operationsMetadata = null;
74
	 	this.operationsMetadata = null;
75
	 	this.serviceIdentification = null;
76
	 	this.serviceProvider = null;
77
	}
78

  
79
	 /**
80
	  * To be documented
81
	  *
82
	  * @return ProcessOfferingsType
83
	  *
84
	  */
85
	public ProcessOfferingsType getProcessOfferings() {
86
		if ( this.processOffering == null ) 
87
			this.processOffering = new ProcessOfferings();
88
		this.processOffering.setProcesses( this.processes );
89
		
90
		return this.processOffering;
91
	}
92

  
93
	 /**
94
	  * To be documented
95
	  *
96
	  * @return org.tigris.frogs.ows.impl_1_0_0.OperationsMetadataType
97
	  *
98
	  */
99
	public org.tigris.frogs.ows.impl_1_0_0.OperationsMetadataType getOperationsMetadata() throws Exception {
100
		if ( this.operationsMetadata == null )
101
			this.operationsMetadata = LocalizationTextOperation.getOperationsMetadata(getStatelessDataRequested().getServerName());
102

  
103
		return this.operationsMetadata;
104
	}
105

  
106
	 /**
107
	  * To be documented
108
	  *
109
	  * @return org.tigris.frogs.ows.ServiceIdentificationType
110
	  *
111
	  */
112
	public org.tigris.frogs.ows.ServiceIdentificationType getServiceIdentification() throws Exception  {
113
		if ( this.serviceIdentification == null )
114
			this.serviceIdentification = LocalizationTextOperation.getServiceIdentification(getStatelessDataRequested().getLanguage());
115

  
116
		return this.serviceIdentification;
117
	}
118

  
119
	 /**
120
	  * To be documented
121
	  *
122
	  * @return org.tigris.frogs.ows.ServiceProviderType
123
	  *
124
	  */
125
	public org.tigris.frogs.ows.ServiceProviderType getServiceProvider() throws Exception  {
126
		if ( this.serviceProvider == null )
127
			this.serviceProvider = LocalizationTextOperation.getServiceProvider(getStatelessDataRequested().getLanguage());
128

  
129
		return this.serviceProvider;
130
	}
131

  
132
	 /**
133
	  * To be documented
134
	  *
135
	  * @return String
136
	  *
137
	  */
138
	public String getUpdateSequenceAttribute() {
139
		return LocalizationTextOperation.getUpdateSequence();
140
	}
141

  
142
	 /**
143
	  * To be documented
144
	  *
145
	  * @return String
146
	  *
147
	  */
148
	public String getVersionAttribute() {
149
		return LocalizationTextOperation.getVersion();
150
	}
151

  
152
	 /**
153
	  * The error raised somewhere
154
	  *
155
	  * @param ex
156
	  *
157
	  */
158
	public void throwExceptionCheck(org.tigris.frogs.OWSException ex) {
159
		info( "What?" );
160
	}
161

  
162
    /**
163
     * Message to display in warnin mode 
164
     *
165
     * @param exception
166
     *
167
     */
168
   private void info(String message) {
169
		logger.info(message);
170
   }
171
   
172
}
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/org/tigris/frogs/plugin/wpsint/impl_0_4_0/operation/streetsmap/Localization.java
1
/*
2
 * ============================================================================
3
 * Copyright 2006 Government of Canada
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 * ============================================================================
17
*/
18
/*
19
 $Id: 
20
 $HeadURL: 
21
*/
22

  
23
/*
24
   **    **  *******   *****       *****    **   **     *****  
25
   **    **        ** **   **     **   **   **   **    **   ** 
26
   ** ** **  **    ** **          **  ***   **   **    **  *** 
27
   ** ** **  *******   *****      ** * **   **   **    ** * ** 
28
   ** ** **  **            **     ***  **   *******    ***  ** 
29
   ** ** **  **       **   **     **   ** **     ** ** **   ** 
30
    *******  **        *****       *****  **     ** **  *****  
31
 Generated from WPS 0.4.0 Code Generator Tool version 0.9.0 at Thu Feb 21 12:05:11 GMT+01:00 2008 By PS, RC, MC
32
*/
33

  
34
package org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap;
35

  
36
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap.resource.*;
37

  
38
 /**
39
  * To be documented
40
  *
41
  */
42
public class Localization {
43

  
44
	private static LocalizationBundle internalResource = null;
45

  
46
	 /**
47
	  * To be documented
48
	  */
49
	public static LocalizationBundle getResource() {
50
		if ( internalResource == null ) {
51
			internalResource = new LocalizationBundle();
52
			internalResource.setClassLoader( Thread.currentThread().getContextClassLoader() );
53
		}
54
		return (internalResource);
55
	}
56

  
57
	 /**
58
	  * To be documented
59
	  *
60
	  *
61
	  */
62
	public static void refreshResource() {
63
		if ( internalResource != null ) {
64
			internalResource = null;
65
		}
66
	}
67

  
68
}
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/org/tigris/frogs/plugin/wpsint/impl_0_4_0/operation/streetsmap/Process_GetMap.java
1
/*
2
 * ============================================================================
3
 * Copyright 2006 Government of Canada
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 * ============================================================================
17
*/
18
/*
19
 $Id: 
20
 $HeadURL: 
21
*/
22

  
23
/*
24
   **    **  *******   *****       *****    **   **     *****  
25
   **    **        ** **   **     **   **   **   **    **   ** 
26
   ** ** **  **    ** **          **  ***   **   **    **  *** 
27
   ** ** **  *******   *****      ** * **   **   **    ** * ** 
28
   ** ** **  **            **     ***  **   *******    ***  ** 
29
   ** ** **  **       **   **     **   ** **     ** ** **   ** 
30
    *******  **        *****       *****  **     ** **  *****  
31
 Generated from WPS 0.4.0 Code Generator Tool version 0.9.0 at Thu Feb 21 12:05:11 GMT+01:00 2008 By PS, RC, MC
32
*/
33

  
34
package org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap;
35

  
36
import java.awt.geom.Rectangle2D;
37
import java.io.*;
38
import java.math.BigInteger;
39
import java.util.Iterator;
40
import java.util.List;
41

  
42
import org.apache.commons.logging.Log;
43
import org.apache.commons.logging.LogFactory;
44

  
45
import org.tigris.frogs.InitParameters;
46
import org.tigris.frogs.OWSExceptionVersion1_0_0;
47
import org.tigris.frogs.commons.*;
48
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.*;
49
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.DataOutputsType.ValueFormChoice;
50
import org.tigris.frogs.StandardSessionDataRequested;
51
import es.logex.callejero.core.Callejero;
52
import es.logex.callejero.core.LayerFile;
53
import es.logex.callejero.modelo.BoundingBox;
54
import es.logex.utils.Manager;
55
import es.logex.utils.WPSConfiguration;
56
 /**
57
  * To be documented 
58
  *
59
  */
60
public class Process_GetMap extends ProcessDeclarationRunnable {
61

  
62
    //	 Logger object for logging in this class
63
	protected final Log logger = LogFactory.getLog(getClass());
64
 
65
	// ---- DESCRIBEPROCESS REQUEST/RESPONSE SECTION
66
	private final static String VERSION = "0.1.0";
67
	private final static String PROCESSNAME = "GetMap";
68
	private InputType[] inputs = null;
69
	private OutputType[] outputs = null;
70
	private org.tigris.frogs.ows.CodeType codeProcess = null;
71

  
72
	// ---- EXECUTE REQUEST/RESPONSE SECTION
73
	private org.tigris.frogs.ows.ExceptionReportType processFailedExceptionReport = null;
74
	private DataOutputsType[] responseProcessOutputs = null;
75
	private ExecuteRequestType executeProcess = null;
76
	private ByteArrayOutputStream pureOutBytes = null;
77
	private boolean sendXMLResponseBack = true;
78

  
79
	private LocalizationTextProcess textProcess = null;
80

  
81
	// INPUTS and OUTPUTS defined
82
	private InputType argInputdetailLevel = null;
83
	private InputType argInputlayerName = null;
84
	private InputType argInputbBox = null;
85
	private OutputType argOutputUrisOut = null;
86

  
87

  
88
	/* (non-Javadoc)
89
	 * @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclarationRunnable#initialize(java.lang.String)
90
	 */
91
	public void initialize() throws  OWSExceptionVersion1_0_0, Throwable {
92

  
93
		// Create Text Object to retrieve Localization Info
94
		this.textProcess = new LocalizationTextProcess(PROCESSNAME);
95
       this.textProcess.setLanguage( getOperationLanguage() );
96
		
97
		// Define the process name
98
		this.codeProcess = new org.tigris.frogs.plugin.wpsint.Code();
99
		this.codeProcess.setValue( PROCESSNAME );
100
		
101
		// Create all inputs and outputs
102
		this.argInputdetailLevel = getInputdetailLevel();
103
		this.argInputlayerName = getInputlayerName();
104
		this.argInputbBox = getInputbBox();
105
		this.argOutputUrisOut = getOutputUrisOut();
106

  
107

  
108
		// Put as many Input you want to be used for your process
109
		this.inputs = new InputType[] {
110
				this.argInputdetailLevel,
111
				this.argInputlayerName,
112
				this.argInputbBox,
113
					};		
114
	
115
		// Put as many Ouput you want to be served for output
116
		this.outputs = new OutputType[] {
117
				this.argOutputUrisOut,
118
					};
119

  
120
	}
121
	/* (non-Javadoc)
122
	 * @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclarationRunnable#test()
123
	 */
124
	public void test() throws  org.tigris.frogs.OWSExceptionVersion1_0_0, Throwable {
125
		// Put your operation unit test here
126
	}
127

  
128
     /**
129
      * To be documented
130
      *
131
      * @param newExecuteProcess
132
      * @throws  org.tigris.frogs.OWSExceptionVersion1_0_0
133
      * @throws Throwable
134
      *
135
      */
136
    public void run(ExecuteRequestType newExecuteProcess) throws OWSExceptionVersion1_0_0, Throwable {
137
    	 // Compute Elapse Time Total end-to-end
138
        long startTimeTotal = System.currentTimeMillis();
139
        String elapse;
140
        String inputLayerName = "";
141
        
142
        // Don't try exception, it will be catch by the PlugIn
143
        this.executeProcess = newExecuteProcess;
144
        
145
        // Always direct answer if a direct response to the client is asked with no possibility to store
146
        this.sendXMLResponseBack = true;
147

  
148
        try {
149

  
150
	 		Callejero callejero = null;
151
        	Rectangle2D rec2D = null;
152
	 		inputLayerName = getInputValue(this.argInputlayerName, "");
153
	 		Double[] lowersExtent = WpsUtils.getRequestInputLowerCorner(this.argInputbBox,this.executeProcess);
154
	 		Double[] uppersExtent = WpsUtils.getRequestInputUpperCorner(this.argInputbBox,this.executeProcess);
155
	 		String crsExtent = WpsUtils.getRequestInputCrs(this.argInputbBox,this.executeProcess);
156
	 		BigInteger dimensionsExtent = WpsUtils.getRequestInputDimensions(this.argInputbBox,this.executeProcess);
157
	 		String inputDetailLevel = getInputValue(this.argInputdetailLevel, "");
158
          	 		
159
	 		if ( this.executeProcess.isSimulation() ) {
160
               	// This flag indicates that you are being called from the main.
161
               	// Useful to test different scenario without any call from the Internet
162
            	
163
                //OutputComplexData ocd = new OutputComplexData();
164
                ValueFormChoice value = DataOutputs.newValueFormChoiceImpl();
165
                ExecuteComplexDataReference ecd = new ExecuteComplexDataReference();
166
                ecd.setReference("http://www.logex.es");
167
                value.setComplexValueReferenceOr(ecd);
168
                
169
                
170
                DataOutputs dataOutputs = new DataOutputs();
171
                dataOutputs.setOutputFormChoice(value);
172
                responseProcessOutputs = new DataOutputsType[] {  dataOutputs };
173
               
174
            }
175
            else {
176
		      
177
                // Send XML directly to the client. Might override your behavior asked. Just remove it
178
               //  this.sendXMLResponseBack = false;
179
                
180
                Manager mgr = Manager.getInstance();
181
                
182
	  			/* if (inputLayerName == null || inputLayerName == "") {
183
	  				 //devolvemos todas las layers.
184
	  				List list = WPSConfiguration.getInstance().getLayerList();
185
	  				 responseProcessOutputs = new DataOutputsType[list.size()];
186
	  				Iterator itr = list.iterator();
187
	  				int i = 0;
188
	  				while (itr.hasNext()) {
189
	  					String layerName = (String)itr.next();
190
	  					
191
		  				if (lowersExtent[0] == 0 && lowersExtent[1] == 0 && 
192
		 	            		 uppersExtent[0] == 0 && uppersExtent[1] == 0) {
193
		 	            	 //coger el máximo extent de la capa.
194
		 	            	 callejero = new Callejero(mgr.connect());
195
		 	            	 rec2D = callejero.getMaxExtent(layerName);
196
		 	            	 lowersExtent[0] = rec2D.getMinX();
197
		 	            	 lowersExtent[1] = rec2D.getMinY();
198
		 	            	  
199
		 	            	 uppersExtent[0] = rec2D.getMaxX();
200
		 	            	 uppersExtent[1] = rec2D.getMaxY();
201
		 	           
202
		 	            }
203
		 	  			 
204
		 	             BoundingBox box = new BoundingBox(lowersExtent, uppersExtent,crsExtent);
205
	  				    
206
	  					 LayerFile layer = new LayerFile(layerName, mgr.connect());
207
	  		  			 File file = layer.FromDbToFile(box);
208
	
209
	  		  			 ValueFormChoice value = DataOutputs.newValueFormChoiceImpl();
210
	  	                 ExecuteComplexDataReference ecd = new ExecuteComplexDataReference(WPSConfiguration.getInstance().getHost() + file.getName(),	null, "UTF-8", "");
211
	  	                
212
	  	                 value.setComplexValueReferenceOr(ecd);
213
	  	                 DataOutputs dataOutputs = new DataOutputs();
214
		                 dataOutputs.setOutputFormChoice(value);
215
		                 
216
		                 responseProcessOutputs[i] = dataOutputs;
217
		                 layer = null;
218
		                
219
		                 i++;
220
	  				}
221
	  				
222
	  				
223
	  			 } else {*/
224
	  				/*if (lowersExtent[0] == 0 && lowersExtent[1] == 0 && 
225
	 	            		 uppersExtent[0] == 0 && uppersExtent[1] == 0) {
226
	 	            	 //coger el máximo extent de la capa.
227
	 	            	 callejero = new Callejero(mgr.connect());
228
	 	            	 rec2D = callejero.getMaxExtent(inputLayerName);
229
	 	            	 lowersExtent[0] = rec2D.getMinX();
230
	 	            	 lowersExtent[1] = rec2D.getMinY();
231
	 	            	  
232
	 	            	 uppersExtent[0] = rec2D.getMaxX();
233
	 	            	 uppersExtent[1] = rec2D.getMaxY();
234
	 	           
235
	 	            } */
236
	 	  			 
237
                     BoundingBox box = new BoundingBox(lowersExtent, uppersExtent,crsExtent);
238
	 	              
239
	 	             
240
		             LayerFile layer = new LayerFile(inputLayerName, mgr.connect());
241
		  			 File file = layer.FromDbToFile(box);
242
		  			
243
		  			 ValueFormChoice value = DataOutputs.newValueFormChoiceImpl();
244
	                 ExecuteComplexDataReference ecd = new ExecuteComplexDataReference(WPSConfiguration.getInstance().getHost() + file.getName(),	null, "UTF-8", "");
245
	                 value.setComplexValueReferenceOr(ecd);
246
	                 
247
	                 DataOutputs dataOutputs = new DataOutputs();
248
	                 dataOutputs.setOutputFormChoice(value);
249
	                 responseProcessOutputs = new DataOutputsType[] {  dataOutputs };
250
	  			 }
251
	  			          
252
           
253
        }
254
        // These error must be sent as is to the client
255
        // start
256
        /*catch (OWSException ex) {
257
            throw ex;
258
        }*/
259
        // end
260

  
261
        // If we reach this point, the error can't be handled properly
262
        // You could fine tune your exception handling
263
        // start
264
        catch (Throwable ex) {
265
            warn("Throwable in running this class [" + this.getClass().getName() + "]");
266
            throw new StreetsMapException("General", getOperationLanguage(), ex);
267
        }
268
        // end
269

  
270
        finally {
271
            long endTimeTotal = System.currentTimeMillis();
272
            elapse = Long.toString( endTimeTotal - startTimeTotal );
273
            warn(this.getClass().getName() + " elapsed time total:" + elapse);
274
        }
275
 
276
    }
277
    
278
    @Override
279
    public  boolean isProcessSucceeded() { 
280
    	return true;
281
    }
282
    
283
    @Override 
284
    public boolean isProcessAccepted(){
285
    	return false;
286
    }
287
    
288
    @Override 
289
    public boolean isProcessStarted(){
290
    	return false;
291
    }
292
    
293
    /* (non-Javadoc)
294
     * @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclarationRunnable#terminate()
295
     */
296
    public void terminate() {
297
	// Clean Up: You should cleanp all your objects before leaving
298
	
299
	// Loop inputs and outputs
300
        this.argInputdetailLevel = null;
301
        this.argInputlayerName = null;
302
        this.argInputbBox = null;
303
        this.argOutputUrisOut = null;
304

  
305
        if ( this.inputs != null ) {
306
            for (int index=0; index<this.inputs.length; index++)
307
                this.inputs[index] = null;
308
            this.inputs = null;
309
        }
310
        if ( this.outputs != null ) {
311
            for (int index=0; index<this.outputs.length; index++)
312
                this.outputs[index] = null;
313
            this.outputs = null;
314
        }
315
        this.textProcess = null;
316
    }
317

  
318
    /**
319
      * To be documented
320
      *
321
      * @return org.tigris.frogs.ows.CodeType
322
      *
323
      */
324
    public org.tigris.frogs.ows.CodeType getIdentifier() {
325
        return this.codeProcess;
326
    }
327

  
328
     /* (non-Javadoc)
329
     * @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclaration#getAbstract()
330
     */
331
    public String getAbstract() {
332
        return this.textProcess.getAbstract();
333
    }
334

  
335
    /* (non-Javadoc)
336
     * @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclaration#getTitle()
337
     */
338
    public String getTitle() {
339
        return this.textProcess.getTitle();
340
    }
341

  
342
     /**
343
      * To be documented
344
      *
345
      * @return String
346
      *
347
      */
348
    public String getVersion() {
349
        return VERSION;
350
    }
351

  
352
     /**
353
      * To be documented
354
      *
355
      * @return InputType[]
356
      *
357
      */
358
    public InputType[] getInputs() {
359
        return this.inputs;
360
    }
361

  
362

  
363
     /**
364
      * To be documented
365
      *
366
      * @return OutputType[]
367
      *
368
      */
369
    public OutputType[] getOutputs() {
370
        return this.outputs;
371
    }
372

  
373

  
374
     /**
375
      * To be documented
376
      *
377
      * @return org.tigris.frogs.ows.ExceptionReportType
378
      *
379
      */
380
    public org.tigris.frogs.ows.ExceptionReportType getProcessFailedExceptionReport() {
381
        return this.processFailedExceptionReport;
382
    }
383

  
384
     /**
385
      * To be documented
386
      *
387
      * @return DataOutputsType[]
388
      *
389
      */
390
    public DataOutputsType[] getResponseDataOutputs() {
391
        return this.responseProcessOutputs;
392
    }
393

  
394
     /**
395
      * To be documented
396
      *
397
      * @return ByteArrayOutputStream
398
      *
399
      */
400
    public ByteArrayOutputStream getOut() {
401
        return this.pureOutBytes;
402
    }
403

  
404
     /**
405
      * To be documented
406
      *
407
      * @return boolean
408
      *
409
      */
410
    public boolean isSendXMLResponseBack() {
411
        return this.sendXMLResponseBack;
412
    }
413

  
414
     /**
415
      * To be documented
416
      *
417
      * @return String
418
      *
419
      */
420
    public String getOutCharset() {
421
        return "UTF-8";
422
    }
423

  
424

  
425
     /**
426
      * To be documented
427
      *
428
      * @return String
429
      *
430
      */
431
    public String getOutMimeType() {
432
        return "text/xml";
433
    }
434

  
435
    public boolean getStoreSupported() {
436
        return true;
437
    } 
438
        
439
     /**
440
      * To be documented
441
      *
442
      * @return boolean
443
      *
444
      */
445
    public boolean getStatusSupported() {
446
        return true;
447
    }
448

  
449
	 /**
450
	  * To be documented
451
	  *
452
	  * @return InputType
453
	  *
454
	  */
455
	static final String FIELD_NAME_detailLevel = "detailLevel";
456
	private InputType getInputdetailLevel() {
457

  
458
		// // Optional
459
		Input input = new Input(FIELD_NAME_detailLevel,false);
460

  
461
		input.setAbstract( textProcess.getFieldAbstract(FIELD_NAME_detailLevel) );
462
		input.setTitle( textProcess.getFieldTitle(FIELD_NAME_detailLevel) );
463

  
464
		WpsUtils.createLiteralValue(input,null,null,null,null,false);
465

  
466
		return input;
467
	}
468

  
469
	 /**
470
	  * To be documented
471
	  *
472
	  * @return InputType
473
	  *
474
	  */
475
	static final String FIELD_NAME_layerName = "layerName";
476
	private InputType getInputlayerName() {
477

  
478
		// // Optional
479
		Input input = new Input(FIELD_NAME_layerName,false);
480

  
481
		input.setAbstract( textProcess.getFieldAbstract(FIELD_NAME_layerName) );
482
		input.setTitle( textProcess.getFieldTitle(FIELD_NAME_layerName) );
483

  
484
		WpsUtils.createLiteralValue(input,null,null,null,null,false);
485

  
486
		return input;
487
	}
488

  
489
	 /**
490
	  * To be documented
491
	  *
492
	  * @return InputType
493
	  *
494
	  */
495
	static final String FIELD_NAME_bBox = "bBox";
496
	private InputType getInputbBox() {
497

  
498
		// // Mondatory
499
		Input input = new Input(FIELD_NAME_bBox,true);
500

  
501
		input.setAbstract( textProcess.getFieldAbstract(FIELD_NAME_bBox) );
502
		input.setTitle( textProcess.getFieldTitle(FIELD_NAME_bBox) );
503
		
504
		WpsUtils.createBoundingBoxValue(input,null,null);
505

  
506
		return input;
507
	}	
508

  
509
	 /**
510
	  * To be documented
511
	  *
512
	  * @return OutputType
513
	  *
514
	  */
515
	static final String FIELD_NAME_UrisOut = "UrisOut";
516
	private OutputType getOutputUrisOut() {
517

  
518
		Output output = new Output(FIELD_NAME_UrisOut);
519

  
520
		output.setAbstract( textProcess.getFieldAbstract(FIELD_NAME_UrisOut) );
521
		output.setTitle( textProcess.getFieldTitle(FIELD_NAME_UrisOut) );
522

  
523
		WpsUtils.createComplexData(output,getOutMimeType(),getOutCharset(),"");
524

  
525
		return output;
526
	}
527

  
528
	 /**
529
	  * To be documented
530
	  *
531
	  * @param inputParameter
532
	  * @param defaultValue
533
	  * @return String
534
	  *
535
	  */
536
	private String getInputValue(
537
			InputType inputParameter,
538
			String defaultValue	) {
539

  
540
		Object[] Field_Method_Values =	WpsUtils.getRequestInputValue(inputParameter, this.executeProcess);
541
		if ( ! Utils.isEmptyObject(Field_Method_Values) )
542
			return (String)Field_Method_Values[0];
543
		else
544
			return defaultValue;
545
	}
546

  
547
	 /**
548
	  * To be documented
549
	  *
550
	  * @param inputParameter
551
	  * @param defaultValue
552
	  * @return String
553
	  *
554
	  */
555
	private String getInputFormat(
556
			InputType inputParameter,
557
			String defaultValue	) {
558

  
559
		String value =	WpsUtils.getRequestInputFormat(inputParameter,this.executeProcess);
560
		if ( ! Utils.isEmptyString(value) )
561
			return value;
562
		else
563
			return defaultValue;
564
	}
565

  
566
	 /**
567
	  * To be documented
568
	  *
569
	  * @param inputParameter
570
	  * @param defaultValue
571
	  * @return String
572
	  *
573
	  */
574
	private String getInputEncoding(
575
			InputType inputParameter,
576
			String defaultValue	) {
577

  
578
		String value = WpsUtils.getRequestInputEncoding(inputParameter,this.executeProcess);
579
		if ( ! Utils.isEmptyString(value) )
580
			return value;
581
		else
582
			return defaultValue;
583
	}
584

  
585

  
586
    /**
587
     * Message to display in debug mode
588
     *
589
     * @param message
590
     *
591
     */
592
   private void log(String message) {
593
		if ( logger.isTraceEnabled() ) { logger.debug(message) ; }
594
   }
595

  
596
   /**
597
    * Message to display in warning mode with a tracable Exception
598
    *
599
    * @param message
600
    * @param exception
601
    *
602
    */
603
   private void warn(String message) {
604
	   logger.warn(message);
605
   }
606

  
607
    /**
608
     * Message to display in error mode with a tracable Exception
609
     *
610
     * @param message
611
     * @param exception
612
     *
613
     */
614
   private void error(String message, Throwable ex) {
615
		logger.error(message,ex);
616
   }
617

  
618

  
619
   /**
620
    * Main Unit Test without be invked by the FROGS Framework
621
    */
622
   public static void main(String[] args) {
623

  
624
       System.out.println("Simulating from main...");
625
       
626
       try {
627
           InitParameters inits = new InitParameters();
628
           // If needed
629
           //inits.add("name", "value", "decription");
630

  
631
           ProcessDeclarationRunnable.simulateCallProcess
632
                    (
633
						new StandardSessionDataRequested(
634
								"http://server/test123",
635
								"http://server/test123",
636
								org.tigris.frogs.plugin.wpsint.Constants.REQUEST_EXECUTE,
637
								StandardSessionDataRequested.NOT_DEFINED_YET,
638
								StandardSessionDataRequested.NOT_DEFINED_YET,
639
								StandardSessionDataRequested.NOT_DEFINED_YET,
640
								StandardSessionDataRequested.NOT_DEFINED_YET,
641
								false,false,false,
642
								Language.getDefaultCode()),
643
                       inits,
644
                       new Process_GetMap(),
645
                       new SimulateDataValueType[] {
646
                           new SimulateDataValueLiteral(FIELD_NAME_detailLevel, "test", null, null)
647
,                           new SimulateDataValueLiteral(FIELD_NAME_layerName, "test", null, null)
648
,                           new SimulateDataValueBoundingBox(FIELD_NAME_bBox, new Double[] { new Double(0), new Double(1) }, new Double[] { new Double(3), new Double(4) }, new java.math.BigInteger("2"), "EPSG" )
649
,                       }
650
                   );
651
           System.out.println("Execute done!");
652
       }
653
       // Throw Error
654
       catch (Throwable ex) {
655
           System.err.println("nop???");
656
       }
657

  
658
       System.out.println("Over!!!");
659
   }
660

  
661
}
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/org/tigris/frogs/plugin/wpsint/impl_0_4_0/operation/streetsmap/LocalizationTextProcess.java
1
/*
2
 * ============================================================================
3
 * Copyright 2006 Government of Canada
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 * ============================================================================
17
*/
18
/*
19
 $Id: 
20
 $HeadURL: 
21
*/
22

  
23
/*
24
   **    **  *******   *****       *****    **   **     *****  
25
   **    **        ** **   **     **   **   **   **    **   ** 
26
   ** ** **  **    ** **          **  ***   **   **    **  *** 
27
   ** ** **  *******   *****      ** * **   **   **    ** * ** 
28
   ** ** **  **            **     ***  **   *******    ***  ** 
29
   ** ** **  **       **   **     **   ** **     ** ** **   ** 
30
    *******  **        *****       *****  **     ** **  *****  
31
 Generated from WPS 0.4.0 Code Generator Tool version 0.9.0 at Thu Feb 21 12:05:11 GMT+01:00 2008 By PS, RC, MC
32
*/
33

  
34
package org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap;
35

  
36
import org.tigris.frogs.commons.*;
37

  
38
public class LocalizationTextProcess {
39
	
40
	private final static String PROCESS_KEY = "Process" + LocalizationTextOperation.SEPARATOR;
41
	private String processName = "";
42
	private String language = Language.getDefaultCode();
43
	
44
	public LocalizationTextProcess(String processName) {
45
		this.processName = processName;
46
	}
47
	
48
	 /**
49
	  * TO BE documented
50
	  *
51
	  * @return String
52
	  */
53
	public String getProcessName() {
54
		return this.processName;
55
	}
56

  
57
	 /**
58
	  * TO BE documented
59
	  *
60
	  * @return String
61
	  */
62
	public String getLanguage() {
63
		return this.language;
64
	}
65
	
66

  
67
	 /**
68
	  * TO BE documented
69
	  *
70
	  * @return String
71
	  */
72
	public void setLanguage(String language) {
73
		this.language = language;
74
	}	
75
	
76
	 /**
77
	  * TO BE documented
78
	  *
79
	  * @return String
80
	  */
81
	public String getAbstract() {
82
		return (Localization.getResource().getText( getLanguage(), getTextKey() + LocalizationTextOperation.ABSTRACT_KEY) );
83
	}
84
	
85
	 /**
86
	  * TO BE documented
87
	  *
88
	  * @return String
89
	  */
90
	public String getTitle() {
91
		return (Localization.getResource().getText( getLanguage(), getTextKey() + LocalizationTextOperation.TITLE_KEY) );
92
	}
93

  
94
	 /**
95
	  * Get LocalizationTextProcess for Abstract explanation
96
	  *
97
	  * @param fieldName
98
	  * @return String
99
	  *
100
	  */	
101
	public String getFieldAbstract(String fieldName) {
102
		return Localization.getResource().getText(
103
				getLanguage(), 
104
				getTextKey() + fieldName + LocalizationTextOperation.SEPARATOR + LocalizationTextOperation.ABSTRACT_KEY);
105
		
106
	}
107
	
108
	 /**
109
	  * Get LocalizationTextProcess for Title explanation
110
	  *
111
	  * @param fieldName
112
	  * @return String
113
	  *
114
	  */	
115
	public String getFieldTitle(String fieldName) {
116
		return Localization.getResource().getText(
117
				getLanguage(), 
118
				getTextKey() + fieldName + LocalizationTextOperation.SEPARATOR + LocalizationTextOperation.TITLE_KEY);
119
		
120
	}
121
	
122

  
123
	/**
124
	 * Get LocalizationTextProcess for error explanation
125
	 *
126
	 * @param code
127
	 * @return String
128
	 *
129
	 */	
130
	public String getErrorText(String code) {
131
		return getErrorText(code,getLanguage());
132
	}
133

  
134
	/**
135
	 * Get LocalizationTextProcess for error explanation
136
	 *
137
	 * @param code
138
	 * @param language
139
	 * @return String
140
	 *
141
	 */	
142
	public static String getErrorText(String code, String language) {
143
		return Localization.getResource().getText(
144
				language, 
145
				getErrorKey() + code);
146
	}	
147

  
148
	/**
149
	 * Get LocalizationTextProcess for error explanation and replace one value
150
	 *
151
	 * @param code
152
	 * @param value
153
	 * @return String
154
	 *
155
	 */	
156
	public String getErrorTextSubs(String code, String value) {
157
		return getErrorTextSubs(code,value,getLanguage()); 
158
	}	
159

  
160
	 /**
161
	 * Get LocalizationTextProcess for error explanation and replace one value
162
	  *
163
	  * @param code
164
	  * @param value
165
	  * @param language
166
	  * @return String
167
	  *
168
	  */	
169
	public static String getErrorTextSubs(String code, String value, String language) {
170
		return Localization.getResource().replaceSubs(
171
				language, 
172
				getErrorKey() + code,
173
				value);
174
	}	
175

  
176
	 /**
177
	  * Get LocalizationTextProcess for error explanation and replace one value
178
	  *
179
	  * @param code
180
	  * @param values
181
	  * @return String
182
	  *
183
	  */	
184
	public String getErrorTextSubs(String code, String[] values) {
185
		return getErrorTextSubs(code,values,getLanguage()); 
186
	}	
187

  
188
	 /**
189
	  * Get LocalizationTextProcess for error explanation and replace one value
190
	  *
191
	  * @param code
192
	  * @param values
193
	  * @param language
194
	  * @return String
195
	  *
196
	  */	
197
	public static String getErrorTextSubs(String code, String[] values, String language) {
198
		return Localization.getResource().replaceSubs(
199
				language, 
200
				getErrorKey() + code,
201
				values);
202
	}
203

  
204
	 /**
205
	  * Create Localization Key to get Process Text
206
	  *
207
	  * @return String
208
	  */		
209
	private String getTextKey() {
210
		return LocalizationTextOperation.OPERATION_BASED_KEY + 
211
		       LocalizationTextOperation.OPERATION_NAME_KEY + 
212
		       PROCESS_KEY + 
213
		       getProcessName() + 
214
		       LocalizationTextOperation.SEPARATOR;
215
	}
216
	
217
	 /**
218
	  * Create Localization Key to get Error Text
219
	  *
220
	  * @return String
221
	  */		
222
	private static String getErrorKey() {
223
		return LocalizationTextOperation.OPERATION_BASED_KEY + 
224
		       LocalizationTextOperation.OPERATION_NAME_KEY + 
225
		       LocalizationTextOperation.ERROR_KEY + 
226
		       LocalizationTextOperation.SEPARATOR;
227
	}	
228
	
229
}
tmp/trunk/servidor/WorkSpace_Servidor/wps-plugin-0.4.0-operation-StreetsMap/src/org/tigris/frogs/plugin/wpsint/impl_0_4_0/operation/streetsmap/LocalizationTextOperation.java
1
/*
2
 * ============================================================================
3
 * Copyright 2006 Government of Canada
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 * ============================================================================
17
*/
18
/*
19
 $Id: 
20
 $HeadURL: 
21
*/
22

  
23
/*
24
   **    **  *******   *****       *****    **   **     *****  
25
   **    **        ** **   **     **   **   **   **    **   ** 
26
   ** ** **  **    ** **          **  ***   **   **    **  *** 
27
   ** ** **  *******   *****      ** * **   **   **    ** * ** 
28
   ** ** **  **            **     ***  **   *******    ***  ** 
29
   ** ** **  **       **   **     **   ** **     ** ** **   ** 
30
    *******  **        *****       *****  **     ** **  *****  
31
 Generated from WPS 0.4.0 Code Generator Tool version 0.9.0 at Thu Feb 21 12:05:11 GMT+01:00 2008 By PS, RC, MC
32
*/
33

  
34
package org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap;
35

  
36
import org.tigris.frogs.*;
37
import org.tigris.frogs.ows.*;
38
import org.tigris.frogs.plugin.wpsint.Constants;
39

  
40
 /**
41
  * Describe all texts describing this operation meaning the GetCapababilities and DescribeProcess
42
  *
43
  */
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff