svn-gvsig-desktop / trunk / extensions / extPublish / src / com / iver / cit / gvsig / publish / servers / PublishControler.java @ 8877
History | View | Annotate | Download (4.16 KB)
1 |
package com.iver.cit.gvsig.publish.servers; |
---|---|
2 |
|
3 |
import com.iver.andami.PluginServices; |
4 |
import com.iver.andami.ui.mdiManager.IWindow; |
5 |
import com.iver.cit.gvsig.fmap.MapControl; |
6 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
7 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
8 |
import com.iver.cit.gvsig.publish.Servers; |
9 |
import com.iver.cit.gvsig.publish.servers.geoserver.GeoserverPublishControler; |
10 |
import com.iver.cit.gvsig.publish.servers.mapserver.MapServerPublishControler; |
11 |
import com.iver.utiles.swing.jcomboServer.ServerData; |
12 |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
14 |
*
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
16 |
*
|
17 |
* This program is free software; you can redistribute it and/or
|
18 |
* modify it under the terms of the GNU General Public License
|
19 |
* as published by the Free Software Foundation; either version 2
|
20 |
* of the License, or (at your option) any later version.
|
21 |
*
|
22 |
* This program is distributed in the hope that it will be useful,
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
25 |
* GNU General Public License for more details.
|
26 |
*
|
27 |
* You should have received a copy of the GNU General Public License
|
28 |
* along with this program; if not, write to the Free Software
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
30 |
*
|
31 |
* For more information, contact:
|
32 |
*
|
33 |
* Generalitat Valenciana
|
34 |
* Conselleria d'Infraestructures i Transport
|
35 |
* Av. Blasco Ib??ez, 50
|
36 |
* 46010 VALENCIA
|
37 |
* SPAIN
|
38 |
*
|
39 |
* +34 963862235
|
40 |
* gvsig@gva.es
|
41 |
* www.gvsig.gva.es
|
42 |
*
|
43 |
* or
|
44 |
*
|
45 |
* IVER T.I. S.A
|
46 |
* Salamanca 50
|
47 |
* 46005 Valencia
|
48 |
* Spain
|
49 |
*
|
50 |
* +34 963163400
|
51 |
* dac@iver.es
|
52 |
*/
|
53 |
/* CVS MESSAGES:
|
54 |
*
|
55 |
* $Id: PublishControler.java 8877 2006-11-20 14:17:47Z dagilgon $
|
56 |
* $Log$
|
57 |
* Revision 1.7 2006-11-20 14:17:47 dagilgon
|
58 |
* *** empty log message ***
|
59 |
*
|
60 |
* Revision 1.6 2006/11/17 09:17:18 jorpiell
|
61 |
* Cambios motivados por el cambio de RC2 a RC3 en el branch
|
62 |
*
|
63 |
* Revision 1.5 2006/10/05 12:13:43 jorpiell
|
64 |
* A?adida una factor?a en la clase publishControler
|
65 |
*
|
66 |
* Revision 1.4 2006/10/03 10:30:14 dagilgon
|
67 |
* adaptation to branch v10
|
68 |
*
|
69 |
* Revision 1.3 2006/09/28 15:04:02 fjp
|
70 |
* Usar siempre que se pueda ISymbol en lugar de FSymbol
|
71 |
*
|
72 |
* Revision 1.2 2006/09/08 15:39:49 jorpiell
|
73 |
* A?adida la capacidad de publicar con WFS
|
74 |
*
|
75 |
* Revision 1.1 2006/09/08 08:58:53 jorpiell
|
76 |
* Se han renombrado y modificado algunas clases
|
77 |
*
|
78 |
*
|
79 |
*/
|
80 |
/**
|
81 |
* @author Jorge Piera Llodr? (piera_jor@gva.es)
|
82 |
*/
|
83 |
public abstract class PublishControler { |
84 |
private View view = null; |
85 |
private MapControl mapCtrl = null; |
86 |
private FLayers layers = null; |
87 |
private String service = null; |
88 |
|
89 |
/**
|
90 |
* Returs a publish controler
|
91 |
* @param brand
|
92 |
* @param type
|
93 |
* @return
|
94 |
*/
|
95 |
public static PublishControler getPublishControler(String brand,String type){ |
96 |
if (brand.compareTo(Servers.SERVER_BRAND_MAPSERVER) == 0){ |
97 |
return new MapServerPublishControler(type); |
98 |
}else if (brand.compareTo(Servers.SERVER_BRAND_GEOSERVER) == 0){ |
99 |
return new GeoserverPublishControler(type); |
100 |
} |
101 |
return null; |
102 |
} |
103 |
|
104 |
/**
|
105 |
* Constructor
|
106 |
*
|
107 |
*/
|
108 |
public PublishControler(String service) { |
109 |
IWindow[] windows = PluginServices.getMDIManager().getAllWindows();
|
110 |
for (int i=0 ; i<windows.length ; i++){ |
111 |
if (windows[i] instanceof View){ |
112 |
view = (View)windows[i];
|
113 |
} |
114 |
} |
115 |
mapCtrl = view.getMapControl(); |
116 |
layers = mapCtrl.getMapContext().getLayers(); |
117 |
this.service = service;
|
118 |
} |
119 |
|
120 |
public abstract Object publish(ServerData serverData); |
121 |
|
122 |
/**
|
123 |
* @return Returns the layers.
|
124 |
*/
|
125 |
public FLayers getLayers() {
|
126 |
return layers;
|
127 |
} |
128 |
|
129 |
/**
|
130 |
* @param layers The layers to set.
|
131 |
*/
|
132 |
public void setLayers(FLayers layers) { |
133 |
this.layers = layers;
|
134 |
} |
135 |
|
136 |
/**
|
137 |
* @return Returns the mapCtrl.
|
138 |
*/
|
139 |
public MapControl getMapCtrl() {
|
140 |
return mapCtrl;
|
141 |
} |
142 |
|
143 |
/**
|
144 |
* @param mapCtrl The mapCtrl to set.
|
145 |
*/
|
146 |
public void setMapCtrl(MapControl mapCtrl) { |
147 |
this.mapCtrl = mapCtrl;
|
148 |
} |
149 |
|
150 |
/**
|
151 |
* @return Returns the view.
|
152 |
*/
|
153 |
public View getView() { |
154 |
return view;
|
155 |
} |
156 |
|
157 |
/**
|
158 |
* @param view The view to set.
|
159 |
*/
|
160 |
public void setView(View view) { |
161 |
this.view = view;
|
162 |
} |
163 |
|
164 |
/**
|
165 |
* @return Returns the service.
|
166 |
*/
|
167 |
public String getService() { |
168 |
return service;
|
169 |
} |
170 |
} |