Revision 48117
Added by Claudio Atzori almost 7 years ago
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/deploy.info | ||
---|---|---|
1 |
{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-database-ui/trunk/", "deploy_repository": "dnet45-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-snapshots", "name": "dnet-modular-database-ui"} |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/java/eu/dnetlib/functionality/modular/ui/db/DbManagerEntryPointController.java | ||
---|---|---|
1 |
package eu.dnetlib.functionality.modular.ui.db; |
|
2 |
|
|
3 |
import javax.servlet.http.HttpServletRequest; |
|
4 |
import javax.servlet.http.HttpServletResponse; |
|
5 |
|
|
6 |
import org.springframework.ui.ModelMap; |
|
7 |
|
|
8 |
import eu.dnetlib.functionality.modular.ui.ModuleEntryPoint; |
|
9 |
|
|
10 |
public class DbManagerEntryPointController extends ModuleEntryPoint { |
|
11 |
|
|
12 |
@Override |
|
13 |
protected void initialize(final ModelMap map, final HttpServletRequest request, final HttpServletResponse response) throws Exception { |
|
14 |
|
|
15 |
} |
|
16 |
|
|
17 |
} |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/java/eu/dnetlib/functionality/modular/ui/db/DbManagerInternalController.java | ||
---|---|---|
1 |
package eu.dnetlib.functionality.modular.ui.db; |
|
2 |
|
|
3 |
import java.io.IOException; |
|
4 |
import java.io.StringReader; |
|
5 |
import java.util.ArrayList; |
|
6 |
import java.util.HashMap; |
|
7 |
import java.util.List; |
|
8 |
import java.util.Map; |
|
9 |
|
|
10 |
import javax.annotation.Resource; |
|
11 |
import javax.servlet.ServletOutputStream; |
|
12 |
import javax.servlet.ServletResponse; |
|
13 |
import javax.servlet.http.HttpServletResponse; |
|
14 |
|
|
15 |
import org.apache.commons.io.IOUtils; |
|
16 |
import org.springframework.jdbc.support.rowset.SqlRowSet; |
|
17 |
import org.springframework.stereotype.Controller; |
|
18 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
19 |
import org.springframework.web.bind.annotation.RequestParam; |
|
20 |
import org.springframework.web.bind.annotation.ResponseBody; |
|
21 |
|
|
22 |
import com.google.common.collect.Iterables; |
|
23 |
import com.google.common.collect.Lists; |
|
24 |
|
|
25 |
import eu.dnetlib.enabling.database.DatabaseServiceCore; |
|
26 |
import eu.dnetlib.enabling.database.objects.DnetDatabase; |
|
27 |
import eu.dnetlib.enabling.database.resultset.IterableRowSet; |
|
28 |
import eu.dnetlib.enabling.resultset.client.utils.EPRUtils; |
|
29 |
|
|
30 |
@Controller |
|
31 |
public class DbManagerInternalController { |
|
32 |
public static final String CTYPE_CSS = "text/css"; |
|
33 |
public static final String CTYPE_JS = "text/javascript"; |
|
34 |
public static final String CTYPE_XML = "text/xml"; |
|
35 |
public static final String CTYPE_TEXT = "text/plain"; |
|
36 |
public static final String CTYPE_HTML = "text/html"; |
|
37 |
|
|
38 |
@Resource |
|
39 |
private DatabaseServiceCore core; |
|
40 |
|
|
41 |
@RequestMapping("/ui/listDBs.do") |
|
42 |
public @ResponseBody List<DnetDatabase> listDatabases() throws Exception { |
|
43 |
return core.listDatabases(); |
|
44 |
} |
|
45 |
|
|
46 |
@RequestMapping("/ui/listTables.do") |
|
47 |
public @ResponseBody List<Map<String, Object>> listTables(@RequestParam(value = "db", required = true) String db) throws Exception { |
|
48 |
|
|
49 |
final List<Map<String, Object>> tables = new ArrayList<Map<String, Object>>(); |
|
50 |
|
|
51 |
final String sql = IOUtils.toString(getClass().getResourceAsStream("tables_info.sql")); |
|
52 |
|
|
53 |
final SqlRowSet rows = core.getDbUtils().executeSql(db, sql, SqlRowSet.class); |
|
54 |
while (rows.next()) { |
|
55 |
final String tname = rows.getString("name"); |
|
56 |
|
|
57 |
final Map<String, Object> t = new HashMap<String, Object>(); |
|
58 |
t.put("name", rows.getString("name")); |
|
59 |
t.put("view", rows.getString("kind").equalsIgnoreCase("v")); |
|
60 |
t.put("data", rows.getString("data")); |
|
61 |
t.put("indices", rows.getString("indices")); |
|
62 |
t.put("total", rows.getString("total")); |
|
63 |
t.put("managed", core.getDbUtils().isManagedTable(db, tname)); |
|
64 |
t.put("dnetIdentifier", core.getDbUtils().getDefaultDnetIdentifier(db, tname)); |
|
65 |
tables.add(t); |
|
66 |
} |
|
67 |
|
|
68 |
return tables; |
|
69 |
} |
|
70 |
|
|
71 |
@RequestMapping("/ui/manageDB.do") |
|
72 |
public @ResponseBody boolean manageDB(@RequestParam(value = "db", required = true) String db, |
|
73 |
@RequestParam(value = "manage", required = true) boolean b) throws Exception { |
|
74 |
core.changeDatabaseStatus(db, b); |
|
75 |
return true; |
|
76 |
} |
|
77 |
|
|
78 |
@RequestMapping("/ui/importEPR.do") |
|
79 |
public @ResponseBody boolean importEPR(@RequestParam(value = "db", required = true) String db, |
|
80 |
@RequestParam(value = "epr", required = true) String epr) throws Exception { |
|
81 |
|
|
82 |
core.importFromResultset(db, (new EPRUtils()).getEpr(epr)); |
|
83 |
|
|
84 |
return true; |
|
85 |
} |
|
86 |
|
|
87 |
|
|
88 |
@RequestMapping("/ui/query.do") |
|
89 |
public @ResponseBody List<String> query(@RequestParam(value = "query", required = true) final String query, |
|
90 |
@RequestParam(value = "db", required = true) final String db, |
|
91 |
@RequestParam(value = "limit", required = true) int limit) throws Exception { |
|
92 |
|
|
93 |
return Lists.newArrayList(Iterables.limit(new IterableRowSet(db, query, null, core.getDbUtils()), limit)); |
|
94 |
|
|
95 |
} |
|
96 |
|
|
97 |
@RequestMapping("/ui/changeTableManagement.do") |
|
98 |
public @ResponseBody boolean changeTableManagement(@RequestParam(value = "db", required = true) final String db, |
|
99 |
@RequestParam(value = "t", required = true) final String t) throws Exception { |
|
100 |
|
|
101 |
if (core.getDbUtils().isManagedTable(db, t)) { |
|
102 |
core.getDbUtils().removeManagementOfTable(db, t); |
|
103 |
} else { |
|
104 |
core.getDbUtils().prepareManagementOfTable(db, t); |
|
105 |
} |
|
106 |
|
|
107 |
return true; |
|
108 |
} |
|
109 |
|
|
110 |
|
|
111 |
@RequestMapping("/ui/changeIdentifiers.do") |
|
112 |
public @ResponseBody boolean changeId(HttpServletResponse res, |
|
113 |
@RequestParam(value = "db", required = true) final String db, |
|
114 |
@RequestParam(value = "t", required = false) final String t) throws Exception { |
|
115 |
|
|
116 |
if (t == null || t.isEmpty()) { |
|
117 |
core.getDbUtils().reassignDefaultDnetIdentifiers(db); |
|
118 |
} else { |
|
119 |
core.getDbUtils().reassignDefaultDnetIdentifiers(db, t); |
|
120 |
} |
|
121 |
|
|
122 |
return true; |
|
123 |
} |
|
124 |
|
|
125 |
@RequestMapping("/ui/describeTable.do") |
|
126 |
public @ResponseBody List<Map<?, ?>> describeTable(@RequestParam(value = "db", required = true) final String db, |
|
127 |
@RequestParam(value = "t", required = true) final String t) throws Exception { |
|
128 |
return core.getDbUtils().describeTable(db, t); |
|
129 |
} |
|
130 |
|
|
131 |
@RequestMapping("/ui/dumpTable.do") |
|
132 |
public void dumpTable(final ServletResponse response, @RequestParam(value = "db", required = true) final String db, |
|
133 |
@RequestParam(value = "t", required = true) final String t) throws Exception { |
|
134 |
sendXML(response, core.getDbUtils().dumpTableAsXML(db,t)); |
|
135 |
} |
|
136 |
|
|
137 |
@RequestMapping("/ui/dumpTableEPR.do") |
|
138 |
public void dumpTableEPR(final ServletResponse response, |
|
139 |
@RequestParam(value = "db", required = true) final String db, |
|
140 |
@RequestParam(value = "t", required = true) final String t) throws Exception { |
|
141 |
|
|
142 |
sendXML(response, core.generateResultSet(db, t, null).toString()); |
|
143 |
} |
|
144 |
|
|
145 |
|
|
146 |
public void sendXML(final ServletResponse response, final String xml) throws IOException { |
|
147 |
response.setContentType("text/xml"); |
|
148 |
|
|
149 |
final ServletOutputStream out = response.getOutputStream(); |
|
150 |
IOUtils.copy(new StringReader(xml), out); |
|
151 |
|
|
152 |
out.flush(); |
|
153 |
out.close(); |
|
154 |
} |
|
155 |
} |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/functionality/modular/ui/webContext-modular-ui-database.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beans xmlns="http://www.springframework.org/schema/beans" |
|
3 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" |
|
4 |
xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:wsa="http://cxf.apache.org/ws/addressing" |
|
5 |
xmlns:p="http://www.springframework.org/schema/p" xmlns:http="http://cxf.apache.org/transports/http/configuration" |
|
6 |
xmlns:t="http://dnetlib.eu/springbeans/t" xmlns:template="http://dnetlib.eu/springbeans/template" |
|
7 |
xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context" |
|
8 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
|
9 |
http://cxf.apache.org/ws/addressing http://cxf.apache.org/schemas/ws-addr-conf.xsd |
|
10 |
http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd |
|
11 |
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd |
|
12 |
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd |
|
13 |
http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd |
|
14 |
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd |
|
15 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> |
|
16 |
|
|
17 |
|
|
18 |
<bean name="/ui/dbManager.do" |
|
19 |
class="eu.dnetlib.functionality.modular.ui.db.DbManagerEntryPointController" |
|
20 |
p:menu="Database Manager" |
|
21 |
p:title="Database Manager" |
|
22 |
p:description="Manager for the Database Service" |
|
23 |
p:group="Tools"> |
|
24 |
<property name="permissionLevels"> |
|
25 |
<set> |
|
26 |
<value>IS_ADMIN</value> |
|
27 |
</set> |
|
28 |
</property> |
|
29 |
</bean> |
|
30 |
|
|
31 |
</beans> |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/functionality/modular/ui/db/tables_info.sql | ||
---|---|---|
1 |
SELECT c.relname AS name, |
|
2 |
c.relkind as kind, |
|
3 |
pg_size_pretty(pg_relation_size(c.relname::text)) AS data, |
|
4 |
pg_size_pretty(pg_total_relation_size(c.relname::text)-pg_relation_size(c.relname::text)) AS indices, |
|
5 |
pg_size_pretty(pg_total_relation_size(c.relname::text)) AS total |
|
6 |
FROM pg_class c |
|
7 |
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace |
|
8 |
WHERE c.relkind IN ('r','v','') |
|
9 |
AND n.nspname NOT IN ('pg_catalog', 'pg_toast') |
|
10 |
AND pg_table_is_visible(c.oid) |
|
11 |
ORDER BY c.relname; |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/dbManager.st | ||
---|---|---|
1 |
$common/master( header={ |
|
2 |
<script type="text/javascript" src="../resources/js/angular.min.js" ></script> |
|
3 |
<script type="text/javascript" src="../resources/js/angular-route.min.js"></script> |
|
4 |
<script type="text/javascript" src="../resources/js/db_manager.js"></script> |
|
5 |
<script type="text/javascript" src="../resources/js/db_manager_controllers.js"></script> |
|
6 |
}, body={ |
|
7 |
<div ng-app="dbManager"> |
|
8 |
<div ng-view></div> |
|
9 |
</div> |
|
10 |
} )$ |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/web/resources/html/tableDesc.html | ||
---|---|---|
1 |
<div class="well"> |
|
2 |
<fieldset> |
|
3 |
<legend> |
|
4 |
<b>Database: </b><i>{{db}}</i> - <b>table: </b><i>{{table}}</i> |
|
5 |
</legend> |
|
6 |
<div class="panel panel-info" ng-repeat="field in details"> |
|
7 |
<div class="panel-heading"><b>Field: </b><i>{{field.column_name}}</i></div> |
|
8 |
<table class="table table-condensed"> |
|
9 |
<tr ng-repeat="(k, v) in field" ng-show="v"> |
|
10 |
<th class="col-xs-3">{{k}}</th> |
|
11 |
<td class="col-xs-9">{{v}}</td> |
|
12 |
</tr> |
|
13 |
</table> |
|
14 |
</div> |
|
15 |
</fieldset> |
|
16 |
</div> |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/web/resources/html/databases.html | ||
---|---|---|
1 |
<table class="table table-hover"> |
|
2 |
<thead> |
|
3 |
<tr> |
|
4 |
<th>Database</th> |
|
5 |
<th class="text-center">is Managed</th> |
|
6 |
<th class="text-right">Operations</th> |
|
7 |
</tr> |
|
8 |
</thead> |
|
9 |
<tbody> |
|
10 |
<tr ng-repeat="db in databases"> |
|
11 |
<td><a href="javascript:void(0)" ng-click="go('/db/'+db.dbName)">{{db.dbName}}</a></td> |
|
12 |
<td class="text-center"> |
|
13 |
<span ng-show="db.managed"> |
|
14 |
<span class="label label-success">YES</span> / <a href="javascript:void(0)" ng-click="manageDB(db.dbName, false)">NO</a> |
|
15 |
</span> |
|
16 |
<span ng-show="!db.managed"> |
|
17 |
<a href="javascript:void(0)" ng-click="manageDB(db.dbName, true)">YES</a> / <span class="label label-danger">NO</span> |
|
18 |
</span> |
|
19 |
</td> |
|
20 |
<td class="text-right"> |
|
21 |
<button class="btn btn-sm btn-primary" ng-click="go('/q/' + db.dbName)"> |
|
22 |
SQL Query |
|
23 |
</button> |
|
24 |
<button class="btn btn-sm btn-warning" ng-click="changeIdentifiers(db.dbName)"> |
|
25 |
Fix D-Net Identifiers |
|
26 |
</button> |
|
27 |
</td> |
|
28 |
</tr> |
|
29 |
</tbody> |
|
30 |
</table> |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/web/resources/html/tables.html | ||
---|---|---|
1 |
<table class="table table-hover"> |
|
2 |
<thead> |
|
3 |
<tr> |
|
4 |
<th>Table</th> |
|
5 |
<th>Database</th> |
|
6 |
<th class="text-center">Data</th> |
|
7 |
<th class="text-center">Indices</th> |
|
8 |
<th class="text-center">Total</th> |
|
9 |
<th class="text-center">Type</th> |
|
10 |
<th class="text-center">is Managed</th> |
|
11 |
<th class="text-center">Default value for Dnet-ID</th> |
|
12 |
<th class="text-right">Dump</th> |
|
13 |
</tr> |
|
14 |
</thead> |
|
15 |
<tbody> |
|
16 |
<tr ng-repeat="t in dbtables"> |
|
17 |
<td><a href="javascript:void(0)" ng-click="go('/t/' + db + '/' + t.name)">{{t.name}}</a></td> |
|
18 |
<td>{{db}}</td> |
|
19 |
<td class="text-center">{{t.data}}</td> |
|
20 |
<td class="text-center">{{t.indices}}</td> |
|
21 |
<td class="text-center">{{t.total}}</td> |
|
22 |
<td class="text-center"> |
|
23 |
<span ng-show="t.view" class="label label-default">VIEW</span> |
|
24 |
<span ng-show="!t.view" class="label label-primary">TABLE</span> |
|
25 |
</td> |
|
26 |
<td class="text-center"> |
|
27 |
<span ng-show="!t.view"> |
|
28 |
<span ng-show="t.managed"> |
|
29 |
<span class="label label-success">YES</span> / <a href="javascript:void(0)" ng-click="changeTableManagement(db, t.name)">NO</a> |
|
30 |
</span> |
|
31 |
<span ng-show="!t.managed"> |
|
32 |
<a href="javascript:void(0)" ng-click="changeTableManagement(db, t.name)">YES</a> / <span class="label label-danger">NO</span> |
|
33 |
</span> |
|
34 |
</span> |
|
35 |
</td> |
|
36 |
<td class="text-center"> |
|
37 |
<form class="form-inline" ng-show="!t.view && t.managed"> |
|
38 |
<input class="form-control input-sm" type="text" readonly="readonly" ng-model="t.dnetIdentifier" /> |
|
39 |
<button class="btn btn-sm btn-primary" ng-click="changeIdentifiers(db, t.name)">fix</button> |
|
40 |
</form> |
|
41 |
</td> |
|
42 |
<td class="text-right"> |
|
43 |
<a href="dumpTable.do?db={{db}}&t={{t.name}}" class="btn btn-sm btn-primary">as XML</a> |
|
44 |
<a href="dumpTableEPR.do?db={{db}}&t={{t.name}}" class="btn btn-sm btn-primary">as EPR</a> |
|
45 |
</td> |
|
46 |
</tr> |
|
47 |
</tbody> |
|
48 |
</table> |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/web/resources/html/dbQuery.html | ||
---|---|---|
1 |
<form class="form-horizontal" role="form"> |
|
2 |
<div class="form-group"> |
|
3 |
<label for="dbInput" class="col-sm-2 control-label">Database</label> |
|
4 |
<div class="col-sm-4"> |
|
5 |
<input class="form-control" id="dbInput" ng-model="db" readonly="readonly" /> |
|
6 |
</div> |
|
7 |
</div> |
|
8 |
<div class="form-group"> |
|
9 |
<label for="sqlInput" class="col-sm-2 control-label">SQL Query</label> |
|
10 |
<div class="col-sm-4"> |
|
11 |
<textarea class="form-control" id="sqlInput" ng-model="sql"></textarea> |
|
12 |
</div> |
|
13 |
</div> |
|
14 |
<div class="form-group"> |
|
15 |
<label for="limitInput" class="col-sm-2 control-label">Limit</label> |
|
16 |
<div class="col-sm-1"> |
|
17 |
<input class="form-control" id="limitInput" ng-model="limit" /> |
|
18 |
</div> |
|
19 |
</div> |
|
20 |
<div class="form-group"> |
|
21 |
<div class="col-sm-offset-2 col-sm-4"> |
|
22 |
<button class="btn btn-default" ng-click="searchSQL()">Search</button> |
|
23 |
</div> |
|
24 |
</div> |
|
25 |
</form> |
|
26 |
|
|
27 |
<div class="panel panel-primary" ng-repeat="r in results"> |
|
28 |
<div class="panel-heading"><b>Result: </b><i>{{$index + 1}}</i></div> |
|
29 |
<div class="panel-body"> |
|
30 |
{{r}} |
|
31 |
</div> |
|
32 |
</div> |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/web/resources/js/db_manager_controllers.js | ||
---|---|---|
1 |
var dbManagerControllers = angular.module('dbManagerControllers', []); |
|
2 |
|
|
3 |
function common_init($scope, $http, $sce, $location) { |
|
4 |
initSpinner(); |
|
5 |
$scope.showError = function(error) { show_notification("error", error); } |
|
6 |
$scope.showNotification = function(message) { show_notification("info", message); } |
|
7 |
$scope.showSpinner = function() { showSpinner(); } |
|
8 |
$scope.hideSpinner = function() { hideSpinner(); } |
|
9 |
$scope.to_trusted = function(html) { return $sce.trustAsHtml(html); } |
|
10 |
$scope.go = function(path) { $location.path(path); } |
|
11 |
$scope.encodeValue = function(val) { return val; } |
|
12 |
} |
|
13 |
|
|
14 |
dbManagerControllers.controller('databasesCtrl', [ |
|
15 |
'$scope', '$http', '$sce', '$location', |
|
16 |
function ($scope, $http, $sce, $location) { |
|
17 |
common_init($scope, $http, $sce, $location); |
|
18 |
|
|
19 |
$scope.databases = []; |
|
20 |
|
|
21 |
$scope.listDatabases = function() { |
|
22 |
$scope.databases = []; |
|
23 |
|
|
24 |
$scope.showSpinner(); |
|
25 |
|
|
26 |
$http.get('listDBs.do').success(function(data) { |
|
27 |
$scope.hideSpinner(); |
|
28 |
$scope.databases = data; |
|
29 |
}).error(function() { |
|
30 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
31 |
$scope.hideSpinner(); |
|
32 |
}); |
|
33 |
} |
|
34 |
|
|
35 |
$scope.manageDB = function(db, b) { |
|
36 |
$scope.showSpinner(); |
|
37 |
|
|
38 |
$http.get('manageDB.do?db=' + db + "&manage=" + b).success(function(data) { |
|
39 |
$scope.hideSpinner(); |
|
40 |
$scope.showNotification("Management Mode Updated !"); |
|
41 |
$scope.listDatabases(); |
|
42 |
}).error(function() { |
|
43 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
44 |
$scope.hideSpinner(); |
|
45 |
}); |
|
46 |
} |
|
47 |
|
|
48 |
$scope.changeIdentifiers = function(db) { |
|
49 |
if (confirm("Are you sure ?")) { |
|
50 |
$scope.showSpinner(); |
|
51 |
|
|
52 |
$http.get('changeIdentifiers.do?db=' + db).success(function(data) { |
|
53 |
$scope.hideSpinner(); |
|
54 |
$scope.showNotification("Identifiers changed !"); |
|
55 |
$scope.listDatabases(); |
|
56 |
}).error(function() { |
|
57 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
58 |
$scope.hideSpinner(); |
|
59 |
}); |
|
60 |
} |
|
61 |
} |
|
62 |
|
|
63 |
$scope.listDatabases(); |
|
64 |
} |
|
65 |
]); |
|
66 |
|
|
67 |
dbManagerControllers.controller('tablesCtrl', [ |
|
68 |
'$scope', '$http', '$sce', '$location', '$routeParams', |
|
69 |
function ($scope, $http, $sce, $location, $routeParams) { |
|
70 |
common_init($scope, $http, $sce, $location); |
|
71 |
|
|
72 |
$scope.db = $routeParams.db; |
|
73 |
$scope.dbtables = []; |
|
74 |
|
|
75 |
$scope.listTables = function() { |
|
76 |
$scope.dbtables = []; |
|
77 |
|
|
78 |
$scope.showSpinner(); |
|
79 |
|
|
80 |
$http.get('listTables.do?db=' + $scope.db).success(function(data) { |
|
81 |
$scope.hideSpinner(); |
|
82 |
$scope.dbtables = data; |
|
83 |
}).error(function() { |
|
84 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
85 |
$scope.hideSpinner(); |
|
86 |
}); |
|
87 |
} |
|
88 |
|
|
89 |
$scope.changeTableManagement = function(db, t) { |
|
90 |
$scope.showSpinner(); |
|
91 |
|
|
92 |
$http.get('changeTableManagement.do?db=' + db + "&t=" + t).success(function(data) { |
|
93 |
$scope.hideSpinner(); |
|
94 |
$scope.showNotification("Management Mode Updated !"); |
|
95 |
$scope.listTables(); |
|
96 |
}).error(function() { |
|
97 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
98 |
$scope.hideSpinner(); |
|
99 |
}); |
|
100 |
} |
|
101 |
|
|
102 |
$scope.changeIdentifiers = function(db, t) { |
|
103 |
if (confirm("Are you sure ?")) { |
|
104 |
$scope.showSpinner(); |
|
105 |
|
|
106 |
$http.get('changeIdentifiers.do?db=' + db + '&t=' + t).success(function(data) { |
|
107 |
$scope.hideSpinner(); |
|
108 |
$scope.showNotification("Identifiers changed !"); |
|
109 |
$scope.listDatabases(); |
|
110 |
}).error(function() { |
|
111 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
112 |
$scope.hideSpinner(); |
|
113 |
}); |
|
114 |
} |
|
115 |
} |
|
116 |
|
|
117 |
$scope.listTables(); |
|
118 |
} |
|
119 |
]); |
|
120 |
|
|
121 |
dbManagerControllers.controller('tableDescCtrl', [ |
|
122 |
'$scope', '$http', '$sce', '$location', '$routeParams', |
|
123 |
function ($scope, $http, $sce, $location, $routeParams) { |
|
124 |
common_init($scope, $http, $sce, $location); |
|
125 |
|
|
126 |
$scope.db = $routeParams.db; |
|
127 |
$scope.table = $routeParams.t; |
|
128 |
$scope.details = []; |
|
129 |
|
|
130 |
$scope.getTableDetails = function() { |
|
131 |
$scope.details = []; |
|
132 |
|
|
133 |
$scope.showSpinner(); |
|
134 |
|
|
135 |
$http.get('describeTable.do?db=' + $scope.db + "&t=" + $scope.table).success(function(data) { |
|
136 |
$scope.hideSpinner(); |
|
137 |
$scope.details = data; |
|
138 |
}).error(function() { |
|
139 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
140 |
$scope.hideSpinner(); |
|
141 |
}); |
|
142 |
} |
|
143 |
|
|
144 |
$scope.getTableDetails(); |
|
145 |
} |
|
146 |
|
|
147 |
]); |
|
148 |
|
|
149 |
dbManagerControllers.controller('dbQueryCtrl', [ |
|
150 |
'$scope', '$http', '$sce', '$location', '$routeParams', |
|
151 |
function ($scope, $http, $sce, $location, $routeParams) { |
|
152 |
common_init($scope, $http, $sce, $location); |
|
153 |
|
|
154 |
$scope.db = $routeParams.db; |
|
155 |
$scope.sql = 'SELECT 1'; |
|
156 |
$scope.limit = 100; |
|
157 |
$scope.results = []; |
|
158 |
|
|
159 |
$scope.searchSQL = function() { |
|
160 |
$scope.results = []; |
|
161 |
|
|
162 |
$scope.showSpinner(); |
|
163 |
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; |
|
164 |
$http.post('query.do', $.param({ |
|
165 |
'db' : $scope.db, |
|
166 |
'limit' : $scope.limit, |
|
167 |
'query' : $scope.sql |
|
168 |
})).success(function(data) { |
|
169 |
$scope.hideSpinner(); |
|
170 |
$scope.results = data; |
|
171 |
}).error(function() { |
|
172 |
$scope.showError('Something really bad must have happened to our fellow hamster..'); |
|
173 |
$scope.hideSpinner(); |
|
174 |
}); |
|
175 |
} |
|
176 |
|
|
177 |
} |
|
178 |
]); |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/src/main/resources/eu/dnetlib/web/resources/js/db_manager.js | ||
---|---|---|
1 |
var module = angular.module('dbManager', ['ngRoute', 'dbManagerControllers']); |
|
2 |
|
|
3 |
module.config([ |
|
4 |
'$routeProvider', |
|
5 |
function($routeProvider) { |
|
6 |
$routeProvider |
|
7 |
.when('/dbs', { templateUrl: '../resources/html/databases.html', controller: 'databasesCtrl' }) |
|
8 |
.when('/db/:db', { templateUrl: '../resources/html/tables.html', controller: 'tablesCtrl' }) |
|
9 |
.when('/t/:db/:t', { templateUrl: '../resources/html/tableDesc.html', controller: 'tableDescCtrl' }) |
|
10 |
.when('/q/:db', { templateUrl: '../resources/html/dbQuery.html', controller: 'dbQueryCtrl' }) |
|
11 |
.otherwise({ redirectTo: '/dbs' }); |
|
12 |
} |
|
13 |
]); |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/dnet-modular-database-ui.iml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
|
3 |
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false"> |
|
4 |
<output url="file://$MODULE_DIR$/target/classes" /> |
|
5 |
<output-test url="file://$MODULE_DIR$/target/test-classes" /> |
|
6 |
<content url="file://$MODULE_DIR$"> |
|
7 |
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
|
8 |
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
|
9 |
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> |
|
10 |
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> |
|
11 |
<excludeFolder url="file://$MODULE_DIR$/target" /> |
|
12 |
</content> |
|
13 |
<orderEntry type="inheritedJdk" /> |
|
14 |
<orderEntry type="sourceFolder" forTests="false" /> |
|
15 |
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.1" level="project" /> |
|
16 |
<orderEntry type="library" name="Maven: commons-io:commons-io:2.2" level="project" /> |
|
17 |
<orderEntry type="library" name="Maven: eu.dnetlib:dnet-modular-ui:3.0.14-SNAPSHOT" level="project" /> |
|
18 |
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.2.5.RELEASE" level="project" /> |
|
19 |
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.2.5.RELEASE" level="project" /> |
|
20 |
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" /> |
|
21 |
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.2.5.RELEASE" level="project" /> |
|
22 |
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.2.5.RELEASE" level="project" /> |
|
23 |
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.2.5.RELEASE" level="project" /> |
|
24 |
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" /> |
|
25 |
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.2.5.RELEASE" level="project" /> |
|
26 |
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.2.5.RELEASE" level="project" /> |
|
27 |
<orderEntry type="library" name="Maven: eu.dnetlib:dnet-runtime:1.0.2-SNAPSHOT" level="project" /> |
|
28 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.5" level="project" /> |
|
29 |
<orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" /> |
|
30 |
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" /> |
|
31 |
<orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" /> |
|
32 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.5" level="project" /> |
|
33 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.5" level="project" /> |
|
34 |
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" /> |
|
35 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.5" level="project" /> |
|
36 |
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" /> |
|
37 |
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" /> |
|
38 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.1.5" level="project" /> |
|
39 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.5" level="project" /> |
|
40 |
<orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" /> |
|
41 |
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" /> |
|
42 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.5" level="project" /> |
|
43 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.5" level="project" /> |
|
44 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.5" level="project" /> |
|
45 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.5" level="project" /> |
|
46 |
<orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" /> |
|
47 |
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" /> |
|
48 |
<orderEntry type="module" module-name="cnr-service-common" /> |
|
49 |
<orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2" level="project" /> |
|
50 |
<orderEntry type="library" name="Maven: org.antlr:antlr:2.7.7" level="project" /> |
|
51 |
<orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.2.2" level="project" /> |
|
52 |
<orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" /> |
|
53 |
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" /> |
|
54 |
<orderEntry type="module" module-name="cnr-misc-utils" /> |
|
55 |
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" /> |
|
56 |
<orderEntry type="library" name="Maven: saxonica:saxon:9.1.0.8" level="project" /> |
|
57 |
<orderEntry type="library" name="Maven: saxonica:saxon-dom:9.1.0.8" level="project" /> |
|
58 |
<orderEntry type="library" name="Maven: jgrapht:jgrapht:0.7.2" level="project" /> |
|
59 |
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.8.0" level="project" /> |
|
60 |
<orderEntry type="library" name="Maven: org.springframework:spring-test:4.2.5.RELEASE" level="project" /> |
|
61 |
<orderEntry type="module" module-name="cnr-service-utils" /> |
|
62 |
<orderEntry type="library" name="Maven: apache:oro:2.0.8" level="project" /> |
|
63 |
<orderEntry type="module" module-name="cnr-spring-utils" /> |
|
64 |
<orderEntry type="library" name="Maven: jparsec:jparsec:2.0" level="project" /> |
|
65 |
<orderEntry type="library" name="Maven: runcc:runcc:0.7" level="project" /> |
|
66 |
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.2.2" level="project" /> |
|
67 |
<orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:3.4.2" level="project" /> |
|
68 |
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" /> |
|
69 |
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" /> |
|
70 |
<orderEntry type="library" name="Maven: org.apache.maven:maven-model:3.2.3" level="project" /> |
|
71 |
<orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-utils:3.0.17" level="project" /> |
|
72 |
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.9" level="project" /> |
|
73 |
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" /> |
|
74 |
<orderEntry type="module" module-name="cnr-enabling-database-service" /> |
|
75 |
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.2.5.RELEASE" level="project" /> |
|
76 |
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.2.5.RELEASE" level="project" /> |
|
77 |
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.2.5.RELEASE" level="project" /> |
|
78 |
<orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" /> |
|
79 |
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" /> |
|
80 |
<orderEntry type="library" name="Maven: org.postgresql:jdbc4driver:8.3" level="project" /> |
|
81 |
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.3.2.Final" level="project" /> |
|
82 |
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.3.GA" level="project" /> |
|
83 |
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1" level="project" /> |
|
84 |
<orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final" level="project" /> |
|
85 |
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" /> |
|
86 |
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" /> |
|
87 |
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.4.Final" level="project" /> |
|
88 |
<orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final" level="project" /> |
|
89 |
<orderEntry type="library" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" /> |
|
90 |
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" /> |
|
91 |
<orderEntry type="library" name="Maven: org.jboss:jandex:1.1.0.Final" level="project" /> |
|
92 |
<orderEntry type="library" name="Maven: eu.dnetlib:cnr-enabling-database-api:2.1.2-SNAPSHOT" level="project" /> |
|
93 |
<orderEntry type="module" module-name="cnr-rmi-api" /> |
|
94 |
<orderEntry type="library" name="Maven: eu.dnetlib:cnr-blackboard-common:2.2.2-SNAPSHOT" level="project" /> |
|
95 |
<orderEntry type="library" name="Maven: eu.dnetlib:cnr-notifications-common:2.1.2-SNAPSHOT" level="project" /> |
|
96 |
<orderEntry type="module" module-name="cnr-resultset-service" /> |
|
97 |
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" /> |
|
98 |
<orderEntry type="module" module-name="cnr-resultset-client" /> |
|
99 |
<orderEntry type="library" name="Maven: joda-time:joda-time:2.3" level="project" /> |
|
100 |
<orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" /> |
|
101 |
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" /> |
|
102 |
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" /> |
|
103 |
</component> |
|
104 |
</module> |
modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<parent> |
|
4 |
<groupId>eu.dnetlib</groupId> |
|
5 |
<artifactId>dnet45-parent</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
</parent> |
|
8 |
<modelVersion>4.0.0</modelVersion> |
|
9 |
<groupId>eu.dnetlib</groupId> |
|
10 |
<artifactId>dnet-modular-database-ui</artifactId> |
|
11 |
<packaging>jar</packaging> |
|
12 |
<version>2.1.1</version> |
|
13 |
<scm> |
|
14 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-database-ui/tags/dnet-modular-database-ui-2.1.1</developerConnection> |
|
15 |
</scm> |
|
16 |
<dependencies> |
|
17 |
<dependency> |
|
18 |
<groupId>commons-fileupload</groupId> |
|
19 |
<artifactId>commons-fileupload</artifactId> |
|
20 |
<version>1.3.1</version> |
|
21 |
</dependency> |
|
22 |
<dependency> |
|
23 |
<groupId>eu.dnetlib</groupId> |
|
24 |
<artifactId>dnet-modular-ui</artifactId> |
|
25 |
<version>[3.0.0,4.0.0)</version> |
|
26 |
</dependency> |
|
27 |
<dependency> |
|
28 |
<groupId>junit</groupId> |
|
29 |
<artifactId>junit</artifactId> |
|
30 |
<version>${junit.version}</version> |
|
31 |
<scope>test</scope> |
|
32 |
</dependency> |
|
33 |
<dependency> |
|
34 |
<groupId>eu.dnetlib</groupId> |
|
35 |
<artifactId>cnr-enabling-database-service</artifactId> |
|
36 |
<version>[3.0.0,4.0.0)</version> |
|
37 |
</dependency> |
|
38 |
<dependency> |
|
39 |
<groupId>javax.servlet</groupId> |
|
40 |
<artifactId>javax.servlet-api</artifactId> |
|
41 |
<version>${javax.servlet.version}</version> |
|
42 |
<scope>provided</scope> |
|
43 |
</dependency> |
|
44 |
</dependencies> |
|
45 |
</project> |
Also available in: Unified diff
[maven-release-plugin] copy for tag dnet-modular-database-ui-2.1.1