Revision 3742
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisRowDeleteServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.server.lib; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import javax.servlet.http.HttpServletRequest; |
|
31 |
import javax.servlet.http.HttpServletResponse; |
|
32 |
import org.apache.commons.io.IOUtils; |
|
33 |
import org.gvsig.vcsgis.lib.server.VCSGisServerController; |
|
34 |
import org.gvsig.vcsgis.lib.server.VCSGisServerHandler; |
|
35 |
|
|
36 |
|
|
37 |
public class VCSGisRowDeleteServlet extends VCSGisServlet { |
|
38 |
|
|
39 |
@Override |
|
40 |
protected void doPost(HttpServletRequest request, |
|
41 |
HttpServletResponse response) throws IOException { |
|
42 |
try { |
|
43 |
VCSGisServerController vcsgisserver = this.createVCSGisServerController(); |
|
44 |
VCSGisServerHandler handler = vcsgisserver.createRowUpdateHandler(); |
|
45 |
|
|
46 |
InputStream response_stream = handler.handle(request.getInputStream()); |
|
47 |
|
|
48 |
IOUtils.copy(response_stream, response.getWriter()); |
|
49 |
|
|
50 |
// vcsgisserver.dispose(); |
|
51 |
|
|
52 |
response.setStatus(HttpServletResponse.SC_OK); |
|
53 |
response.setContentType("application/json"); |
|
54 |
response.setCharacterEncoding("utf-8"); |
|
55 |
} catch (Exception ex) { |
|
56 |
throw new IOException(ex); |
|
57 |
} |
|
58 |
} |
|
59 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisRowUpdateServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.server.lib; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import javax.servlet.http.HttpServletRequest; |
|
31 |
import javax.servlet.http.HttpServletResponse; |
|
32 |
import org.apache.commons.io.IOUtils; |
|
33 |
import org.gvsig.vcsgis.lib.server.VCSGisServerController; |
|
34 |
import org.gvsig.vcsgis.lib.server.VCSGisServerHandler; |
|
35 |
|
|
36 |
|
|
37 |
public class VCSGisRowUpdateServlet extends VCSGisServlet { |
|
38 |
|
|
39 |
@Override |
|
40 |
protected void doPost(HttpServletRequest request, |
|
41 |
HttpServletResponse response) throws IOException { |
|
42 |
try { |
|
43 |
VCSGisServerController vcsgisserver = this.createVCSGisServerController(); |
|
44 |
VCSGisServerHandler handler = vcsgisserver.createRowUpdateHandler(); |
|
45 |
|
|
46 |
InputStream response_stream = handler.handle(request.getInputStream()); |
|
47 |
|
|
48 |
IOUtils.copy(response_stream, response.getWriter()); |
|
49 |
|
|
50 |
// vcsgisserver.dispose(); |
|
51 |
|
|
52 |
response.setStatus(HttpServletResponse.SC_OK); |
|
53 |
response.setContentType("application/json"); |
|
54 |
response.setCharacterEncoding("utf-8"); |
|
55 |
} catch (Exception ex) { |
|
56 |
throw new IOException(ex); |
|
57 |
} |
|
58 |
} |
|
59 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisRowCreateServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.server.lib; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import javax.servlet.http.HttpServletRequest; |
|
31 |
import javax.servlet.http.HttpServletResponse; |
|
32 |
import org.apache.commons.io.IOUtils; |
|
33 |
import org.gvsig.vcsgis.lib.server.VCSGisServerController; |
|
34 |
import org.gvsig.vcsgis.lib.server.VCSGisServerHandler; |
|
35 |
|
|
36 |
|
|
37 |
public class VCSGisRowCreateServlet extends VCSGisServlet { |
|
38 |
|
|
39 |
@Override |
|
40 |
protected void doPost(HttpServletRequest request, |
|
41 |
HttpServletResponse response) throws IOException { |
|
42 |
try { |
|
43 |
VCSGisServerController vcsgisserver = this.createVCSGisServerController(); |
|
44 |
VCSGisServerHandler handler = vcsgisserver.createRowCreateHandler(); |
|
45 |
|
|
46 |
InputStream response_stream = handler.handle(request.getInputStream()); |
|
47 |
|
|
48 |
IOUtils.copy(response_stream, response.getWriter()); |
|
49 |
|
|
50 |
// vcsgisserver.dispose(); |
|
51 |
|
|
52 |
response.setStatus(HttpServletResponse.SC_OK); |
|
53 |
response.setContentType("application/json"); |
|
54 |
response.setCharacterEncoding("utf-8"); |
|
55 |
} catch (Exception ex) { |
|
56 |
throw new IOException(ex); |
|
57 |
} |
|
58 |
} |
|
59 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
|
|
23 |
package org.gvsig.vcsgis.server.lib; |
|
24 |
|
|
25 |
import javax.servlet.http.HttpServlet; |
|
26 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
|
27 |
import org.gvsig.vcsgis.lib.VCSGisLocator; |
|
28 |
import org.gvsig.vcsgis.lib.VCSGisManager; |
|
29 |
import org.gvsig.vcsgis.lib.repository.VCSGisRepository; |
|
30 |
import org.gvsig.vcsgis.lib.server.VCSGisServerController; |
|
31 |
|
|
32 |
/** |
|
33 |
* |
|
34 |
* @author gvSIG Team |
|
35 |
*/ |
|
36 |
public abstract class VCSGisServlet extends HttpServlet { |
|
37 |
|
|
38 |
protected VCSGisServerController createVCSGisServerController() { |
|
39 |
VCSGisManager manager = VCSGisLocator.getVCSGisManager(); |
|
40 |
JDBCServerExplorerParameters dbconn = (JDBCServerExplorerParameters) this.getServletContext().getAttribute(VCSGisServerUtils.VCSGIS_CONFIG_DBPARAMS); |
|
41 |
VCSGisRepository repository = manager.openRepository(dbconn); |
|
42 |
VCSGisServerController serverController = manager.createServerController(repository); |
|
43 |
return serverController; |
|
44 |
} |
|
45 |
|
|
46 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisServerUtils.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
|
|
23 |
package org.gvsig.vcsgis.server.lib; |
|
24 |
|
|
25 |
import java.io.File; |
|
26 |
import java.net.URL; |
|
27 |
import org.apache.commons.io.FileUtils; |
|
28 |
import org.apache.commons.math.stat.inference.TestUtils; |
|
29 |
import org.eclipse.jetty.server.Server; |
|
30 |
import org.eclipse.jetty.server.handler.ShutdownHandler; |
|
31 |
import org.eclipse.jetty.servlet.ServletContextHandler; |
|
32 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
33 |
import org.eclipse.jetty.server.handler.HandlerCollection; |
|
34 |
import org.gvsig.fmap.dal.DALLocator; |
|
35 |
import org.gvsig.fmap.dal.DataManager; |
|
36 |
import org.gvsig.fmap.dal.DataStore; |
|
37 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
|
38 |
import org.gvsig.tools.util.HasAFile; |
|
39 |
import org.gvsig.vcsgis.lib.VCSGisLocator; |
|
40 |
import org.gvsig.vcsgis.lib.VCSGisManager; |
|
41 |
|
|
42 |
/** |
|
43 |
* |
|
44 |
* @author gvSIG Team |
|
45 |
*/ |
|
46 |
public class VCSGisServerUtils { |
|
47 |
|
|
48 |
/* |
|
49 |
https://www.eclipse.org/jetty/documentation/current/ |
|
50 |
|
|
51 |
*/ |
|
52 |
public static final String VCSGIS_CONFIG_DBPARAMS = "org.gvsig.vcsgis.server.params"; |
|
53 |
|
|
54 |
public static final String PROVIDER_NAME = DataStore.H2SPATIAL_PROVIDER_NAME; |
|
55 |
public static final String DB_NAME = "vcsgisserver"; |
|
56 |
public static final int SERVER_PORT = 9810; |
|
57 |
|
|
58 |
public static Server createServer( |
|
59 |
JDBCServerExplorerParameters dbparams, |
|
60 |
String shutdownpass |
|
61 |
) { |
|
62 |
return createServer(SERVER_PORT, dbparams, shutdownpass); |
|
63 |
} |
|
64 |
|
|
65 |
public static Server createServer(JDBCServerExplorerParameters dbparams) { |
|
66 |
return createServer(SERVER_PORT, dbparams, null); |
|
67 |
} |
|
68 |
|
|
69 |
public static Server createServer( |
|
70 |
int port, |
|
71 |
JDBCServerExplorerParameters dbparams, |
|
72 |
String shutdownpass |
|
73 |
) { |
|
74 |
Server server = new Server(port); |
|
75 |
|
|
76 |
ServletContextHandler context = new ServletContextHandler( |
|
77 |
ServletContextHandler.NO_SECURITY | ServletContextHandler.NO_SESSIONS |
|
78 |
); |
|
79 |
|
|
80 |
context.setAttribute(VCSGIS_CONFIG_DBPARAMS, dbparams); |
|
81 |
|
|
82 |
context.addServlet(HelloServlet.class, "/hello"); |
|
83 |
|
|
84 |
context.addServlet(VCSGisEntitiesServlet.class, "/entities"); |
|
85 |
context.addServlet(VCSGisCommitServlet.class, "/commit"); |
|
86 |
context.addServlet(VCSGisCheckoutServlet.class, "/checkout"); |
|
87 |
|
|
88 |
context.addServlet(VCSGisRowCreateServlet.class, "/rowcreate"); |
|
89 |
context.addServlet(VCSGisRowUpdateServlet.class, "/rowupdate"); |
|
90 |
context.addServlet(VCSGisRowDeleteServlet.class, "/rowdelete"); |
|
91 |
|
|
92 |
HandlerCollection handlers = new HandlerCollection(); |
|
93 |
handlers.addHandler(context); |
|
94 |
if( shutdownpass!=null ) { |
|
95 |
handlers.addHandler(new ShutdownHandler(shutdownpass)); |
|
96 |
} |
|
97 |
server.setHandler(handlers); |
|
98 |
|
|
99 |
return server; |
|
100 |
} |
|
101 |
|
|
102 |
public static void main(String[] args) throws Exception |
|
103 |
{ |
|
104 |
|
|
105 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
106 |
|
|
107 |
VCSGisManager manager = VCSGisLocator.getVCSGisManager(); |
|
108 |
JDBCServerExplorerParameters dbparams = getDBParameters(DB_NAME); |
|
109 |
manager.initRepository(dbparams, null); |
|
110 |
|
|
111 |
Server server = createServer( |
|
112 |
SERVER_PORT, |
|
113 |
dbparams, |
|
114 |
"pass" |
|
115 |
); |
|
116 |
server.start(); |
|
117 |
server.join(); |
|
118 |
} |
|
119 |
|
|
120 |
private static JDBCServerExplorerParameters getDBParameters(String dbname) { |
|
121 |
try { |
|
122 |
DataManager dataManager = DALLocator.getDataManager(); |
|
123 |
JDBCServerExplorerParameters conn = (JDBCServerExplorerParameters) dataManager.createServerExplorerParameters(PROVIDER_NAME); |
|
124 |
|
|
125 |
File dbfile = getResource(String.format("test-dbs/%s",dbname)); |
|
126 |
FileUtils.forceMkdir(dbfile.getParentFile()); |
|
127 |
((HasAFile)conn).setFile(dbfile); |
|
128 |
return conn; |
|
129 |
} catch (Exception ex) { |
|
130 |
return null; |
|
131 |
} |
|
132 |
} |
|
133 |
|
|
134 |
private static File getTargetFolder() throws Exception { |
|
135 |
URL url = TestUtils.class.getResource("/"); |
|
136 |
File x = new File(url.toURI()); |
|
137 |
File target = x.getParentFile(); |
|
138 |
return target; |
|
139 |
} |
|
140 |
|
|
141 |
private static File getResource(String name) throws Exception { |
|
142 |
File x = new File(getTargetFolder(), name); |
|
143 |
return x; |
|
144 |
} |
|
145 |
|
|
146 |
|
|
147 |
|
|
148 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisUpdateServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.server.lib; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import javax.servlet.http.HttpServletRequest; |
|
31 |
import javax.servlet.http.HttpServletResponse; |
|
32 |
import org.apache.commons.io.IOUtils; |
|
33 |
import org.gvsig.vcsgis.lib.server.VCSGisServerController; |
|
34 |
import org.gvsig.vcsgis.lib.server.VCSGisServerHandler; |
|
35 |
|
|
36 |
|
|
37 |
public class VCSGisUpdateServlet extends VCSGisServlet { |
|
38 |
|
|
39 |
@Override |
|
40 |
protected void doPost(HttpServletRequest request, |
|
41 |
HttpServletResponse response) throws IOException { |
|
42 |
try { |
|
43 |
VCSGisServerController vcsgisserver = this.createVCSGisServerController(); |
|
44 |
VCSGisServerHandler handler = vcsgisserver.createUpdateHandler(); |
|
45 |
|
|
46 |
InputStream response_stream = handler.handle(request.getInputStream()); |
|
47 |
|
|
48 |
IOUtils.copy(response_stream, response.getWriter()); |
|
49 |
|
|
50 |
// vcsgisserver.dispose(); |
|
51 |
|
|
52 |
response.setStatus(HttpServletResponse.SC_OK); |
|
53 |
response.setContentType("application/json"); |
|
54 |
response.setCharacterEncoding("utf-8"); |
|
55 |
} catch (Exception ex) { |
|
56 |
throw new IOException(ex); |
|
57 |
} |
|
58 |
} |
|
59 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/HelloServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.server.lib; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
import java.io.IOException; |
|
29 |
import javax.naming.InitialContext; |
|
30 |
import javax.naming.NamingException; |
|
31 |
import javax.servlet.http.HttpServlet; |
|
32 |
import javax.servlet.http.HttpServletRequest; |
|
33 |
import javax.servlet.http.HttpServletResponse; |
|
34 |
|
|
35 |
public class HelloServlet extends HttpServlet { |
|
36 |
|
|
37 |
@Override |
|
38 |
protected void doGet(HttpServletRequest request, |
|
39 |
HttpServletResponse response) throws IOException { |
|
40 |
|
|
41 |
response.setStatus(HttpServletResponse.SC_OK); |
|
42 |
response.setContentType("text/html"); |
|
43 |
response.setCharacterEncoding("utf-8"); |
|
44 |
response.getWriter().println("<h1>Hello from HelloServlet</h1>"); |
|
45 |
response.getWriter().println(this.getServletContext().getClass().getName()+"<br>"); |
|
46 |
response.getWriter().println("VCSGisDatabaseParameters="+(this.getServletContext().getAttribute(VCSGisServerUtils.VCSGIS_CONFIG_DBPARAMS))+"<br>"); |
|
47 |
|
|
48 |
} |
|
49 |
|
|
50 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisEntitiesServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.server.lib; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import javax.servlet.http.HttpServletRequest; |
|
31 |
import javax.servlet.http.HttpServletResponse; |
|
32 |
import org.apache.commons.io.IOUtils; |
|
33 |
import org.gvsig.vcsgis.lib.server.VCSGisServerController; |
|
34 |
import org.gvsig.vcsgis.lib.server.VCSGisServerHandler; |
|
35 |
|
|
36 |
|
|
37 |
public class VCSGisEntitiesServlet extends VCSGisServlet { |
|
38 |
|
|
39 |
|
|
40 |
@Override |
|
41 |
protected void doGet(HttpServletRequest request, |
|
42 |
HttpServletResponse response) throws IOException { |
|
43 |
try { |
|
44 |
VCSGisServerController vcsgisserver = this.createVCSGisServerController(); |
|
45 |
VCSGisServerHandler handler = vcsgisserver.createEntitiesHandler(); |
|
46 |
|
|
47 |
InputStream response_stream = handler.handle(request.getInputStream()); |
|
48 |
|
|
49 |
IOUtils.copy(response_stream, response.getWriter()); |
|
50 |
|
|
51 |
// vcsgisserver.dispose(); |
|
52 |
|
|
53 |
response.setStatus(HttpServletResponse.SC_OK); |
|
54 |
response.setContentType("application/json"); |
|
55 |
response.setCharacterEncoding("utf-8"); |
|
56 |
} catch (Exception ex) { |
|
57 |
throw new IOException(ex); |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
protected void doPost(HttpServletRequest request, |
|
63 |
HttpServletResponse response) throws IOException { |
|
64 |
try { |
|
65 |
VCSGisServerController vcsgisserver = this.createVCSGisServerController(); |
|
66 |
VCSGisServerHandler handler = vcsgisserver.createEntitiesHandler(); |
|
67 |
|
|
68 |
InputStream response_stream = handler.handle(request.getInputStream()); |
|
69 |
|
|
70 |
IOUtils.copy(response_stream, response.getWriter()); |
|
71 |
|
|
72 |
// vcsgisserver.dispose(); |
|
73 |
|
|
74 |
response.setStatus(HttpServletResponse.SC_OK); |
|
75 |
response.setContentType("application/json"); |
|
76 |
response.setCharacterEncoding("utf-8"); |
|
77 |
} catch (Exception ex) { |
|
78 |
throw new IOException(ex); |
|
79 |
} |
|
80 |
} |
|
81 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisCheckoutServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.server.lib; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import javax.servlet.http.HttpServletRequest; |
|
31 |
import javax.servlet.http.HttpServletResponse; |
|
32 |
import org.apache.commons.io.IOUtils; |
|
33 |
import org.gvsig.vcsgis.lib.server.VCSGisServerController; |
|
34 |
import org.gvsig.vcsgis.lib.server.VCSGisServerHandler; |
|
35 |
|
|
36 |
|
|
37 |
public class VCSGisCheckoutServlet extends VCSGisServlet { |
|
38 |
|
|
39 |
@Override |
|
40 |
protected void doPost(HttpServletRequest request, |
|
41 |
HttpServletResponse response) throws IOException { |
|
42 |
try { |
|
43 |
VCSGisServerController vcsgisserver = this.createVCSGisServerController(); |
|
44 |
VCSGisServerHandler handler = vcsgisserver.createCheckoutHandler(); |
|
45 |
|
|
46 |
InputStream response_stream = handler.handle(request.getInputStream()); |
|
47 |
|
|
48 |
IOUtils.copy(response_stream, response.getWriter()); |
|
49 |
|
|
50 |
// vcsgisserver.dispose(); |
|
51 |
|
|
52 |
response.setStatus(HttpServletResponse.SC_OK); |
|
53 |
response.setContentType("application/json"); |
|
54 |
response.setCharacterEncoding("utf-8"); |
|
55 |
} catch (Exception ex) { |
|
56 |
throw new IOException(ex); |
|
57 |
} |
|
58 |
} |
|
59 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org/gvsig/vcsgis/server/lib/VCSGisCommitServlet.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.server.lib; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import javax.servlet.http.HttpServletRequest; |
|
31 |
import javax.servlet.http.HttpServletResponse; |
|
32 |
import org.apache.commons.io.IOUtils; |
|
33 |
import org.gvsig.vcsgis.lib.server.VCSGisServerController; |
|
34 |
import org.gvsig.vcsgis.lib.server.VCSGisServerHandler; |
|
35 |
|
|
36 |
|
|
37 |
public class VCSGisCommitServlet extends VCSGisServlet { |
|
38 |
|
|
39 |
@Override |
|
40 |
protected void doPost(HttpServletRequest request, |
|
41 |
HttpServletResponse response) throws IOException { |
|
42 |
try { |
|
43 |
VCSGisServerController vcsgisserver = this.createVCSGisServerController(); |
|
44 |
VCSGisServerHandler handler = vcsgisserver.createCommitHandler(); |
|
45 |
|
|
46 |
InputStream response_stream = handler.handle(request.getInputStream()); |
|
47 |
|
|
48 |
IOUtils.copy(response_stream, response.getWriter()); |
|
49 |
|
|
50 |
// vcsgisserver.dispose(); |
|
51 |
|
|
52 |
response.setStatus(HttpServletResponse.SC_OK); |
|
53 |
response.setContentType("application/json"); |
|
54 |
response.setCharacterEncoding("utf-8"); |
|
55 |
} catch (Exception ex) { |
|
56 |
throw new IOException(ex); |
|
57 |
} |
|
58 |
} |
|
59 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/VCSGisEntity.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib; |
|
23 |
|
|
24 |
import java.util.List; |
|
25 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
26 |
import org.gvsig.json.SupportToJson; |
|
27 |
import org.gvsig.tools.util.LabeledValue; |
|
28 |
|
|
29 |
/** |
|
30 |
* |
|
31 |
* @author gvSIG Team |
|
32 |
*/ |
|
33 |
public interface VCSGisEntity extends LabeledValue<VCSGisEntity>, SupportToJson { |
|
34 |
|
|
35 |
public String getEntityCode(); |
|
36 |
|
|
37 |
public String getRepositoryRevisionCode(); |
|
38 |
|
|
39 |
public String getEntityName(); |
|
40 |
|
|
41 |
public String getDataTableName(); |
|
42 |
|
|
43 |
public String getGeometryFieldName(); |
|
44 |
|
|
45 |
public String getFeatureIdFieldName(); |
|
46 |
|
|
47 |
public String getDescription(); |
|
48 |
|
|
49 |
public String getFieldForLabel(); |
|
50 |
|
|
51 |
public FeatureType getFeatureType(); |
|
52 |
|
|
53 |
public String getFeatureTypeAsJson(); |
|
54 |
|
|
55 |
public String getUserCode(); |
|
56 |
|
|
57 |
public String getTopologyPlanCode(); |
|
58 |
|
|
59 |
public String getCategory(); |
|
60 |
|
|
61 |
public List<String> getCategoriesAsList(); |
|
62 |
|
|
63 |
public String getAuthorizations(); |
|
64 |
|
|
65 |
public int getTopologyPlanMode(); |
|
66 |
|
|
67 |
public void copyto(VCSGisEntityEditable entity); |
|
68 |
|
|
69 |
@Override |
|
70 |
public String getLabel(); |
|
71 |
|
|
72 |
public boolean isAuthorized(VCSGisUser user, String operation); |
|
73 |
|
|
74 |
public String getResources(); |
|
75 |
|
|
76 |
public String getDataModels(); |
|
77 |
|
|
78 |
public List<String> getDataModelsAsList(); |
|
79 |
|
|
80 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/VCSGisUser.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib; |
|
23 |
|
|
24 |
import java.util.List; |
|
25 |
import org.gvsig.json.SupportJson; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author gvSIG Team |
|
30 |
*/ |
|
31 |
public interface VCSGisUser extends SupportJson { |
|
32 |
|
|
33 |
public static final String ROLE_CHECKOUT = "checkout"; |
|
34 |
public static final String ROLE_COMMIT = "commit"; |
|
35 |
public static final String ROLE_ENTITIES = "entities"; |
|
36 |
public static final String ROLE_HISTORY = "history"; |
|
37 |
public static final String ROLE_UPDATE = "update"; |
|
38 |
public static final String ROLE_USERS = "users"; |
|
39 |
public static final String ROLE_ROWCREATE = "rowcreate"; |
|
40 |
public static final String ROLE_ROWUPDATE = "rowupdate"; |
|
41 |
public static final String ROLE_ROWDELETE = "rowdelete"; |
|
42 |
|
|
43 |
public String getUserCode(); |
|
44 |
|
|
45 |
public String getDescription(); |
|
46 |
|
|
47 |
public String getIdentifier(); |
|
48 |
|
|
49 |
public String getAllowedOperations(); |
|
50 |
|
|
51 |
public List<String> getAllowedOperationsAsList(); |
|
52 |
|
|
53 |
public boolean isAllowedOperation(String operation); |
|
54 |
|
|
55 |
public String getRoles(); |
|
56 |
|
|
57 |
public List<String> getRolesAsList(); |
|
58 |
|
|
59 |
public void copyFrom(VCSGisUser other); |
|
60 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/VCSGisRepositoryChange.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository; |
|
23 |
|
|
24 |
import org.gvsig.fmap.geom.Geometry; |
|
25 |
import org.gvsig.vcsgis.lib.VCSGisChange; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author gvSIG Team |
|
30 |
*/ |
|
31 |
public interface VCSGisRepositoryChange extends VCSGisChange { |
|
32 |
|
|
33 |
public String getRequestCode(); |
|
34 |
|
|
35 |
public String getRevisionCode(); |
|
36 |
|
|
37 |
public long getRevisionNumber(); |
|
38 |
|
|
39 |
public Geometry getGeometry(); |
|
40 |
|
|
41 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/VCSGisRepositoryData.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository; |
|
23 |
|
|
24 |
import java.sql.Timestamp; |
|
25 |
import javax.json.JsonObject; |
|
26 |
import org.gvsig.json.SupportToJson; |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
*/ |
|
32 |
public interface VCSGisRepositoryData extends SupportToJson { |
|
33 |
|
|
34 |
public String getDataCode(); |
|
35 |
|
|
36 |
public String getEntityCode(); |
|
37 |
|
|
38 |
public String getFeatureRelatedCode(); |
|
39 |
|
|
40 |
public String getRevisionCode(); |
|
41 |
|
|
42 |
public int getOperation(); |
|
43 |
|
|
44 |
public int getRevisionNumber(); |
|
45 |
|
|
46 |
public Timestamp getEfectiveDate(); |
|
47 |
|
|
48 |
/** |
|
49 |
* The feature coded as JSon. |
|
50 |
* @return |
|
51 |
*/ |
|
52 |
public String getData(); |
|
53 |
|
|
54 |
public JsonObject getDataAsJson(); |
|
55 |
|
|
56 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisRowDeleteRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
|
|
23 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
24 |
|
|
25 |
import java.sql.Timestamp; |
|
26 |
import org.gvsig.vcsgis.lib.VCSGisEntityEditable; |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
*/ |
|
32 |
public interface VCSGisRowDeleteRequest extends VCSGisRequest { |
|
33 |
|
|
34 |
// in |
|
35 |
public String getEntityName(); |
|
36 |
public String getLocalRevisionCode(); |
|
37 |
|
|
38 |
public Timestamp getEfectiveDate(); |
|
39 |
public void setEfectiveDate(Timestamp efectiveDate); |
|
40 |
public void setEfectiveDate(String efectiveDate); |
|
41 |
|
|
42 |
public String getComment(); |
|
43 |
public void setComment(String comment); |
|
44 |
|
|
45 |
public String getRelatedFeatureCode(); |
|
46 |
public void setRelatedFeatureCode(String relatedFeatureCode); |
|
47 |
|
|
48 |
// out |
|
49 |
public String getEntityCode(); |
|
50 |
public String getEntityRevisionCode(); |
|
51 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisRowUpdateRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
|
|
23 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
24 |
|
|
25 |
import java.sql.Timestamp; |
|
26 |
import org.gvsig.vcsgis.lib.VCSGisEntityEditable; |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
*/ |
|
32 |
public interface VCSGisRowUpdateRequest extends VCSGisRequest { |
|
33 |
|
|
34 |
// in |
|
35 |
public String getEntityName(); |
|
36 |
public String getLocalRevisionCode(); |
|
37 |
|
|
38 |
public Timestamp getEfectiveDate(); |
|
39 |
public void setEfectiveDate(Timestamp efectiveDate); |
|
40 |
public void setEfectiveDate(String efectiveDate); |
|
41 |
|
|
42 |
public String getComment(); |
|
43 |
public void setComment(String comment); |
|
44 |
|
|
45 |
public String getData(); |
|
46 |
public void setData(String code); |
|
47 |
|
|
48 |
// out |
|
49 |
public String getEntityCode(); |
|
50 |
public String getEntityRevisionCode(); |
|
51 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisTopologyPlansRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
23 |
|
|
24 |
import java.util.List; |
|
25 |
import org.gvsig.vcsgis.lib.VCSGisTopologyPlan; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author gvSIG Team |
|
30 |
*/ |
|
31 |
public interface VCSGisTopologyPlansRequest extends VCSGisRequest { |
|
32 |
|
|
33 |
public List<VCSGisTopologyPlan> getTopologyPlans(); |
|
34 |
|
|
35 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisRowCreateRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
|
|
23 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
24 |
|
|
25 |
import java.sql.Timestamp; |
|
26 |
import org.gvsig.vcsgis.lib.VCSGisEntityEditable; |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
*/ |
|
32 |
public interface VCSGisRowCreateRequest extends VCSGisRequest { |
|
33 |
|
|
34 |
// in |
|
35 |
public String getEntityName(); |
|
36 |
public String getLocalRevisionCode(); |
|
37 |
|
|
38 |
public Timestamp getEfectiveDate(); |
|
39 |
public void setEfectiveDate(Timestamp efectiveDate); |
|
40 |
public void setEfectiveDate(String efectiveDate); |
|
41 |
|
|
42 |
public String getComment(); |
|
43 |
public void setComment(String comment); |
|
44 |
|
|
45 |
public String getData(); |
|
46 |
public void setData(String data); |
|
47 |
|
|
48 |
// out |
|
49 |
public String getEntityCode(); |
|
50 |
public String getEntityRevisionCode(); |
|
51 |
|
|
52 |
public String getRelatedFeatureCode(); |
|
53 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisAuthenticateRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
23 |
|
|
24 |
/** |
|
25 |
* |
|
26 |
* @author gvSIG Team |
|
27 |
*/ |
|
28 |
public interface VCSGisAuthenticateRequest extends VCSGisRequest { |
|
29 |
|
|
30 |
public String getUserId(); |
|
31 |
|
|
32 |
public String getPassword(); |
|
33 |
|
|
34 |
public void setUserId(String id); |
|
35 |
|
|
36 |
public void setPassword(String password); |
|
37 |
|
|
38 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
23 |
|
|
24 |
import java.util.Map; |
|
25 |
import org.gvsig.tools.dispose.Disposable; |
|
26 |
import org.gvsig.vcsgis.lib.VCSGisUser; |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
*/ |
|
32 |
public interface VCSGisRequest extends Disposable { |
|
33 |
|
|
34 |
public String getRequestName(); |
|
35 |
|
|
36 |
public String getCode(); |
|
37 |
|
|
38 |
public int execute(); |
|
39 |
|
|
40 |
public int getLastErrorCode(); |
|
41 |
|
|
42 |
public String getLastErrorMessage(); |
|
43 |
|
|
44 |
public void setEnabledStatus(boolean enable); |
|
45 |
|
|
46 |
public String getAuthenticationToken(); |
|
47 |
|
|
48 |
public void setAuthenticationToken(String token); |
|
49 |
|
|
50 |
public void setUserCode(String userCode); |
|
51 |
|
|
52 |
public String getUserCode(); |
|
53 |
|
|
54 |
public void setAuthenticationTokenAndUser(Map<String, String> params); |
|
55 |
|
|
56 |
public void cleanLastError(); |
|
57 |
|
|
58 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisHistoryRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
23 |
|
|
24 |
import java.sql.Timestamp; |
|
25 |
import java.time.LocalDateTime; |
|
26 |
import org.apache.commons.lang3.Range; |
|
27 |
import org.gvsig.tools.dispose.DisposableIterable; |
|
28 |
import org.gvsig.vcsgis.lib.VCSGisRevision; |
|
29 |
|
|
30 |
/** |
|
31 |
* |
|
32 |
* @author jjdelcerro |
|
33 |
*/ |
|
34 |
public interface VCSGisHistoryRequest extends VCSGisRequest { |
|
35 |
|
|
36 |
// in |
|
37 |
public String getEntityName(); |
|
38 |
|
|
39 |
public Timestamp getMinDate(); |
|
40 |
|
|
41 |
public Timestamp getMaxDate(); |
|
42 |
|
|
43 |
public long getMinRevisionNumber(); |
|
44 |
|
|
45 |
public long getMaxRevisionNumber(); |
|
46 |
|
|
47 |
public void setDateRange(Timestamp min, Timestamp max); |
|
48 |
|
|
49 |
public void setRevisionNumberRange(long min, long max); |
|
50 |
|
|
51 |
public void setMaxNumberOfRevisions(int maxNumberOfRevisions); |
|
52 |
|
|
53 |
// out |
|
54 |
public DisposableIterable<VCSGisRevision> getRevisions(); |
|
55 |
|
|
56 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisUsersRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
23 |
|
|
24 |
import java.util.List; |
|
25 |
import org.gvsig.vcsgis.lib.VCSGisUser; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author gvSIG Team |
|
30 |
*/ |
|
31 |
public interface VCSGisUsersRequest extends VCSGisRequest { |
|
32 |
|
|
33 |
public List<VCSGisUser> getUsers(); |
|
34 |
|
|
35 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisUpdateRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
23 |
|
|
24 |
import org.gvsig.tools.dispose.DisposableIterable; |
|
25 |
import org.gvsig.vcsgis.lib.VCSGisEntity; |
|
26 |
import org.gvsig.vcsgis.lib.repository.VCSGisRepositoryData; |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
*/ |
|
32 |
public interface VCSGisUpdateRequest extends VCSGisRequest { |
|
33 |
|
|
34 |
// in |
|
35 |
public String getEntityName(); |
|
36 |
|
|
37 |
public String getLocalRevisionCode(); |
|
38 |
public void setLocalRevisionCode(String revisionCode); |
|
39 |
|
|
40 |
// out |
|
41 |
public VCSGisEntity getEntity(); |
|
42 |
|
|
43 |
public DisposableIterable<VCSGisRepositoryData> getData(); |
|
44 |
|
|
45 |
public String getUsersHashCode(); |
|
46 |
|
|
47 |
public String getTopologyPlansHashCode(); |
|
48 |
|
|
49 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.16/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/repository/requests/VCSGisEntitiesRequest.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.lib.repository.requests; |
|
23 |
|
|
24 |
import java.util.List; |
|
25 |
import org.gvsig.vcsgis.lib.VCSGisEntity; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author gvSIG Team |
|
30 |
*/ |
|
31 |
public interface VCSGisEntitiesRequest extends VCSGisRequest { |
|
32 |
|
|
33 |
public List<VCSGisEntity> getRepositoryEntities(); |
|
34 |
|
|
35 |
} |
Also available in: Unified diff