Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / extensions / extPublish / src / com / iver / cit / gvsig / publish / servers / PublishControler.java @ 10874

History | View | Annotate | Download (3.96 KB)

1
package com.iver.cit.gvsig.publish.servers;
2

    
3
import com.iver.andami.PluginServices;
4
import com.iver.cit.gvsig.fmap.MapControl;
5
import com.iver.cit.gvsig.fmap.layers.FLayers;
6
import com.iver.cit.gvsig.project.documents.view.gui.View;
7
import com.iver.cit.gvsig.publish.Servers;
8
import com.iver.cit.gvsig.publish.servers.geoserver.GeoserverPublishControler;
9
import com.iver.cit.gvsig.publish.servers.mapserver.MapServerPublishControler;
10
import com.iver.utiles.swing.jcomboServer.ServerData;
11

    
12
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
13
 *
14
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
15
 *
16
 * This program is free software; you can redistribute it and/or
17
 * modify it under the terms of the GNU General Public License
18
 * as published by the Free Software Foundation; either version 2
19
 * of the License, or (at your option) any later version.
20
 *
21
 * This program is distributed in the hope that it will be useful,
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 * GNU General Public License for more details.
25
 *
26
 * You should have received a copy of the GNU General Public License
27
 * along with this program; if not, write to the Free Software
28
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
29
 *
30
 * For more information, contact:
31
 *
32
 *  Generalitat Valenciana
33
 *   Conselleria d'Infraestructures i Transport
34
 *   Av. Blasco Ib??ez, 50
35
 *   46010 VALENCIA
36
 *   SPAIN
37
 *
38
 *      +34 963862235
39
 *   gvsig@gva.es
40
 *      www.gvsig.gva.es
41
 *
42
 *    or
43
 *
44
 *   IVER T.I. S.A
45
 *   Salamanca 50
46
 *   46005 Valencia
47
 *   Spain
48
 *
49
 *   +34 963163400
50
 *   dac@iver.es
51
 */
52
/* CVS MESSAGES:
53
 *
54
 * $Id: PublishControler.java 10874 2007-03-23 08:52:35Z dagilgon $
55
 * $Log$
56
 * Revision 1.5.2.2  2007-03-23 08:52:34  dagilgon
57
 * *** empty log message ***
58
 *
59
 * Revision 1.5.2.1  2006/11/15 04:11:02  jjdelcerro
60
 * *** empty log message ***
61
 *
62
 * Revision 1.5  2006/10/05 12:13:43  jorpiell
63
 * A?adida una factor?a en la clase publishControler
64
 *
65
 * Revision 1.4  2006/10/03 10:30:14  dagilgon
66
 * adaptation to branch v10
67
 *
68
 * Revision 1.3  2006/09/28 15:04:02  fjp
69
 * Usar siempre que se pueda ISymbol en lugar de FSymbol
70
 *
71
 * Revision 1.2  2006/09/08 15:39:49  jorpiell
72
 * A?adida la capacidad de publicar con WFS
73
 *
74
 * Revision 1.1  2006/09/08 08:58:53  jorpiell
75
 * Se han renombrado y modificado algunas clases
76
 *
77
 *
78
 */
79
/**
80
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
81
 */
82
public abstract class PublishControler {
83
        private View view = null;
84
        private MapControl mapCtrl = null;
85
        private FLayers layers = null;
86
        private String service = null;
87

    
88
        /**
89
         * Returs a publish controler
90
         * @param brand
91
         * @param type
92
         * @return
93
         */
94
        public static PublishControler getPublishControler(String brand,String type){
95
                if (brand.compareTo(Servers.SERVER_BRAND_MAPSERVER) == 0){
96
                        return new MapServerPublishControler(type);
97
                }else if (brand.compareTo(Servers.SERVER_BRAND_GEOSERVER) == 0){
98
                        return new GeoserverPublishControler(type);
99
                }
100
                return null;
101
        }
102
        
103
        /**
104
         * Constructor
105
         * 
106
         */
107
        public PublishControler(String service) {
108
                view = (View) PluginServices.getMDIManager().getActiveWindow();
109
                mapCtrl = view.getMapControl();
110
                layers = mapCtrl.getMapContext().getLayers();
111
                this.service = service;
112
        }
113
        
114
        public abstract Object publish(ServerData serverData);
115

    
116
        /**
117
         * @return Returns the layers.
118
         */
119
        public FLayers getLayers() {
120
                return layers;
121
        }
122

    
123
        /**
124
         * @param layers The layers to set.
125
         */
126
        public void setLayers(FLayers layers) {
127
                this.layers = layers;
128
        }
129

    
130
        /**
131
         * @return Returns the mapCtrl.
132
         */
133
        public MapControl getMapCtrl() {
134
                return mapCtrl;
135
        }
136

    
137
        /**
138
         * @param mapCtrl The mapCtrl to set.
139
         */
140
        public void setMapCtrl(MapControl mapCtrl) {
141
                this.mapCtrl = mapCtrl;
142
        }
143

    
144
        /**
145
         * @return Returns the view.
146
         */
147
        public View getView() {
148
                return view;
149
        }
150

    
151
        /**
152
         * @param view The view to set.
153
         */
154
        public void setView(View view) {
155
                this.view = view;
156
        }
157

    
158
        /**
159
         * @return Returns the service.
160
         */
161
        public String getService() {
162
                return service;
163
        }
164
}