Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / gvsig / javadocs / scripting / gvsig.java @ 775

History | View | Annotate | Download (8.07 KB)

1
package scripting;
2

    
3
import org.cresques.cts.IProjection;
4
import org.gvsig.fmap.dal.DataStore;
5
import org.gvsig.fmap.dal.feature.FeatureType;
6
import org.gvsig.fmap.mapcontext.layers.FLayer;
7
import org.gvsig.scripting.app.extension.ScriptingExtension;
8

    
9
/**
10
 * Representa al modulo python "gvsig".
11
 *
12
 * Es el modulo base que nos facilita el acceso a todos los componentes de
13
 * gvSIG.
14
 *
15
 */
16
public class gvsig {
17

    
18
    public static int LOGGER_INFO = ScriptingExtension.INFO;
19
    public static int LOGGER_WARN = ScriptingExtension.WARN;
20
    public static int LOGGER_ERROR = ScriptingExtension.ERROR;
21

    
22
    /**
23
     * Returns a new and empty attributes definition.
24
     *
25
     * @return the new FeatureType
26
     */
27
    public static FeatureType createFeatureType() {
28
        return null;
29
    }
30

    
31
    /**
32
     * Returns a new and empty attributes definition based in an existing
33
     * FeatureType.
34
     *
35
     * All attributes in the feature type pased as parameters are created in the
36
     * new definition
37
     *
38
     * @param featureType from the new attributes are copied
39
     * @return The new FeatureType
40
     */
41
    public static FeatureType createFeatureType(FeatureType featureType) {
42
        return null;
43
    }
44

    
45
    /**
46
     * Create a new layer with the specified parameters.
47
     *
48
     * The paramaters are used to connect to the server type and create the
49
     * layer. These parameters are specific of each type of layer.
50
     *
51
     * Valid values of server type are:
52
     * <ul>
53
     * <li>FilesystemExplorer</li>
54
     * <li>PostgreSQLExplorer</li>
55
     * <li>WFSServerExplorer</li>
56
     * <li>Wms Store</li>
57
     * <li>...</li>
58
     * </ul>
59
     *
60
     * Valid values of layer type are:
61
     * <ul>
62
     * <li>Shape</li>
63
     * <li>Dbf</li>
64
     * <li>DXF</li>
65
     * <li>DGN</li>
66
     * <li>DWG</li>
67
     * <li>JExcel</li>
68
     * <li>PostgreSQL</li>
69
     * <li>WFSStore</li>
70
     * <li>Gdal Store</li>
71
     * <li>...</li>
72
     * </ul>
73
     *
74
     * Excamples of use:<br>
75
     * <code>
76
     * layer = createLayer(schema=schema,
77
     *                   servertype="FilesystemExplorer",
78
     *                   layertype="Shape",
79
     *                   shpFile="/home/osc/temp/test1.shp",
80
     *                   CRS="EPSG:25830",
81
     *                   geometryType=POINT
82
     *                   )
83
     * </code>
84
     *
85
     * @param schema the schema to use to create la layer.
86
     * @param serverType The server type (filesystem, BBDD, ...)
87
     * @param layerType The layer type to create (Shape, ...)
88
     * @param parameters the specific parameters to create the new layer
89
     * @return the new created layer
90
     *
91
     */
92
    public static FLayer createLayer(FeatureType schema, String serverType, String layerType, Object... parameters) {
93
        return null;
94
    }
95

    
96
    /**
97
     * Create a new layer with the specified parameters.
98
     *
99
     * Use as default serverType the "FilesystemExplorer".
100
     *
101
     * @param schema
102
     * @param layerType
103
     * @param parameters
104
     * @return
105
     */
106
    public static FLayer createLayer(FeatureType schema, String layerType, Object... parameters) {
107
        return null;
108
    }
109

    
110
    /**
111
     * Load an existing shape file in the current view.
112
     *
113
     * @param path path to the shape file to load
114
     * @param projection to use to load the shape file
115
     * @return
116
     *
117
     */
118
    public static FLayer loadShapeFile(String path, String projection) {
119
        return null;
120
    }
121

    
122
    /**
123
     * Load an existing shape file in the current view.
124
     *
125
     * Use as default projection "CRS:84"
126
     *
127
     * @param path path to the shape file to load
128
     * @return
129
     *
130
     */
131
    public static FLayer loadShapeFile(String path) {
132
        return null;
133
    }
134

    
135
    /**
136
     * Load an existing layer and return it.
137
     *
138
     * Valid values of layer type are: 
139
     * - Shape 
140
     * - Gdal Store
141
     * - TODO
142
     *
143
     * Examples:
144
     *     loadLayer("Shape", shpFile=xfile, CRS="EPSG:25830")
145
     *     loadLayer("Gdal Store", uri=raster_uri)
146
     *
147
     * @param layerType
148
     * @param parameters
149
     * @return
150
     *
151
     */
152
    public static FLayer loadLayer(String layerType, Object... parameters) {
153
        return null;
154
    }
155

    
156
    /**
157
     * Send a message to the log system.
158
     *
159
     * The values of mode are:
160
     * <ul>
161
     * <li>LOGGER_INFO</li>
162
     * <li>LOGGER_WARN</li>
163
     * <li>LOGGER_ERROR</li>
164
     * </ul>
165
     *
166
     * @param msg to send to log
167
     * @param mode message type, is optional with defaul of LOGGER_INFO.
168
     * @param exception an exception to log, is optional.
169
     */
170
    public static void logger(String msg, int mode, Throwable exception) {
171

    
172
    }
173

    
174
    /**
175
     * Create the path to a resource.
176
     *
177
     * This function runs like the os.path.join, but if the first argument is a
178
     * full path name to a file, it only get the dirname of it.
179
     *
180
     * This is usefull to use with the variable __file__ as the first argument
181
     * to get a path name to a resource relative to the current module.
182
     *
183
     * Explample:<br>
184
     * <code>
185
     *  pathname = getResource(__file__,"data","icon.png")
186
     * </code>
187
     *
188
     * @param parameters parts of path to the resource.
189
     * @return the path name to the resource.
190
     */
191
    public String getResource(String... parameters) {
192
        return null;
193
    }
194

    
195
    /**
196
     * Open an existen data store an return it.
197
     *
198
     * The type of store depened of store to be opened. It can be:
199
     * <ul>
200
     * <li>Shape</li>
201
     * <li>Dbf</li>
202
     * <li>DXF</li>
203
     * <li>DGN</li>
204
     * <li>DWG</li>
205
     * <li>JExcel</li>
206
     * <li>PostgreSQL</li>
207
     * <li>WFSStore</li>
208
     * <li>Gdal Store</li>
209
     * </ul>
210
     *
211
     * Example with PostgreSQL connection:
212
     * <code>
213
     * from gvsig.utils import openStore
214
     *
215
     * os = openStore('PostgreSQL',_entity_='Persistence%3APostgreSQLStoreParameters',
216
     *                             port='5432',
217
     *                             JDBCDriverClass='org.postgresql.Driver',
218
     *                             UseSSL='false',
219
     *                             Schema='public',
220
     *                             Catalog='',
221
     *                             URL='jdbc%3Apostgresql%3A%2F%2Flocalhost%3A5432%2Fej1',
222
     *                             BaseOrder='',
223
     *                             Workingarea=None,
224
     *                             CRS='EPSG:23030',
225
     *                             PKFields='gid',
226
     *                             BaseFilter='',
227
     *                             DefaultGeometryField='geom',
228
     *                             Fields='gid%2Cnombre%2Cpoblacion%2Cgeom',
229
     *                             Table='ciudades',
230
     *                             SQL='',
231
     *                             password='postgres',
232
     *                             dbname='ej1',
233
     *                             host='localhost',
234
     *                             dbuser='postgres',
235
     *                             ProviderName='PostgreSQL')
236
     * </code>
237
     *
238
     * @param storeType the type of store to open.
239
     * @param parameters to open the store.
240
     * @return the opened data store
241
     */
242
    public DataStore openStore(String storeType, Object... parameters) {
243
        return null;
244
    }
245
    
246
    /**
247
     * Create a new projectionobject associated with the passed name of 
248
     * the projection.
249
     * 
250
     * Usually, the name is the abbreviation of the projection.
251
     * 
252
     * Is preferable to use this method <code>CRSFactory.getCRS(name)</code> instead.
253
     * 
254
     * @param name abbreviation of the projection
255
     * @return the projection object associated with the name
256
     */
257
    public IProjection getCRS(String name) {
258
        return null;
259
    }
260
    
261
    /**
262
     * Return the default data folder of gvSIG.
263
     * This is configured in the preferences of gvSIG.
264
     * 
265
     * @return the data folder of gvSIG
266
     */
267
    public String getDataFolder() {
268
        return null;
269
    }
270
    
271
    /**
272
     * Return the default projects folder of gvSIG.
273
     * This is configured in the preferences of gvSIG.
274
     * 
275
     * @return the projects folder of gvSIG.
276
     */
277
    public String getProjectsFolder() {
278
        return null;
279
    }
280
}