Project

General

Profile

« Previous | Next » 

Revision 46773

removed table logging bloatware

View differences:

modules/dnet-modular-database-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/db/DbManagerInternalController.java
47 47
	public @ResponseBody List<Map<String, Object>> listTables(@RequestParam(value = "db", required = true) String db) throws Exception {
48 48
		
49 49
		final List<Map<String, Object>> tables = new ArrayList<Map<String, Object>>();
50
		final Map<String, String> logSize = new HashMap<String, String>();
51
		
50

  
52 51
		final String sql = IOUtils.toString(getClass().getResourceAsStream("tables_info.sql"));
53 52
		
54 53
		final SqlRowSet rows = core.getDbUtils().executeSql(db, sql, SqlRowSet.class);
55 54
		while (rows.next()) {
56 55
			final String tname = rows.getString("name");
57
			if (tname.endsWith("_log")) {
58
				logSize.put(tname.substring(0, tname.length() - 4), rows.getString("total"));
59
			} else {
60
				final Map<String, Object> t = new HashMap<String, Object>();
61
				t.put("name", rows.getString("name"));
62
				t.put("view", rows.getString("kind").equalsIgnoreCase("v"));
63
				t.put("data", rows.getString("data"));
64
				t.put("indices", rows.getString("indices"));
65
				t.put("total", rows.getString("total"));
66
				t.put("managed", core.getDbUtils().isManagedTable(db, tname));
67
				t.put("logged", core.getDbUtils().isLoggedTable(db, tname));
68
				t.put("dnetIdentifier", core.getDbUtils().getDefaultDnetIdentifier(db, tname));
69
				tables.add(t);
70
			}
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);
71 66
		}
72
		for (Map<String, Object> t : tables) {
73
			if (logSize.containsKey(t.get("name"))) {
74
				t.put("logdata", logSize.get(t.get("name")));
75
			} else {
76
				t.put("logdata", "-");
77
			}
78
		}
79
		
67

  
80 68
		return tables;
81 69
	}
82 70

  
......
134 122
		return true;
135 123
	} 
136 124
	
137
	@RequestMapping("/ui/changeTableLog.do")
138
	public @ResponseBody boolean changeTableLog(@RequestParam(value = "db", required = true) final String db,
139
			@RequestParam(value = "t", required = true) final String t) throws Exception {
140

  
141
		if (core.getDbUtils().isManagedTable(db, t)) {
142
			if (core.getDbUtils().isLoggedTable(db, t)) {
143
				core.getDbUtils().removeLogTable(db, t);
144
			} else {
145
				core.getDbUtils().addLogTable(db, t);			
146
			}
147
		}
148

  
149
		return true;
150
	} 
151

  
152 125
	@RequestMapping("/ui/describeTable.do")
153 126
	public @ResponseBody List<Map<?, ?>> describeTable(@RequestParam(value = "db", required = true) final String db,
154 127
			@RequestParam(value = "t", required = true) final String t) throws Exception {
modules/dnet-modular-database-ui/trunk/src/main/resources/eu/dnetlib/web/resources/html/tables.html
6 6
			<th class="text-center">Data</th>
7 7
			<th class="text-center">Indices</th>
8 8
			<th class="text-center">Total</th>
9
			<th class="text-center">Log data</th>
10 9
			<th class="text-center">Type</th>
11 10
			<th class="text-center">is Managed</th>
12
			<th class="text-center">is Logged</th>
13 11
			<th class="text-center">Default value for Dnet-ID</th>
14 12
			<th class="text-right">Dump</th>
15 13
		</tr>
......
21 19
			<td class="text-center">{{t.data}}</td>
22 20
			<td class="text-center">{{t.indices}}</td>
23 21
			<td class="text-center">{{t.total}}</td>
24
			<td class="text-center">{{t.logdata}}</td>
25 22
			<td class="text-center">
26 23
				<span ng-show="t.view" class="label label-default">VIEW</span>
27 24
				<span ng-show="!t.view" class="label label-primary">TABLE</span>
......
37 34
				</span>
38 35
			</td>
39 36
			<td class="text-center">
40
				<span ng-show="!t.view && t.managed">
41
					<span ng-show="t.logged">
42
						<span class="label label-success">YES</span> / <a href="javascript:void(0)" ng-click="changeTableLog(db, t.name)">NO</a>
43
					</span>
44
					<span ng-show="!t.logged">
45
						<a href="javascript:void(0)" ng-click="changeTableLog(db, t.name)">YES</a> / <span class="label label-danger">NO</span>
46
					</span>
47
				</span>
48
			</td>
49
			<td class="text-center">
50 37
				<form class="form-inline" ng-show="!t.view && t.managed">
51 38
					<input class="form-control input-sm" type="text" readonly="readonly"  ng-model="t.dnetIdentifier" />
52 39
					<button class="btn btn-sm btn-primary" ng-click="changeIdentifiers(db, t.name)">fix</button>
......
58 45
			</td>
59 46
		</tr>
60 47
	</tbody>
61
</table>
48
</table>
modules/dnet-modular-database-ui/trunk/src/main/resources/eu/dnetlib/web/resources/js/db_manager_controllers.js
99 99
		    });
100 100
		}
101 101
		
102
		$scope.changeTableLog = function(db, t) {
103
			$scope.showSpinner();
104
			
105
			$http.get('changeTableLog.do?db=' + db + "&t=" + t).success(function(data) {
106
				$scope.hideSpinner();
107
				$scope.showNotification("Log Mode Updated !");
108
				$scope.listTables();
109
		    }).error(function() {
110
	            $scope.showError('Something really bad must have happened to our fellow hamster..');
111
	            $scope.hideSpinner();
112
		    });
113
		}
114
		
115 102
		$scope.changeIdentifiers = function(db, t) {
116 103
			if (confirm("Are you sure ?")) {
117 104
				$scope.showSpinner();
......
188 175
		}
189 176
        
190 177
	}
191
]);
178
]);
modules/dnet-modular-database-ui/trunk/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.1-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="library" name="Maven: eu.dnetlib:cnr-service-common:2.1.6-SNAPSHOT" level="project" />
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="library" name="Maven: eu.dnetlib:cnr-misc-utils:1.0.4-SNAPSHOT" level="project" />
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="library" name="Maven: eu.dnetlib:cnr-service-utils:1.0.2-SNAPSHOT" level="project" />
62
    <orderEntry type="library" name="Maven: apache:oro:2.0.8" level="project" />
63
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-spring-utils:1.0.1-SNAPSHOT" level="project" />
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.2.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.1-SNAPSHOT" level="project" />
93
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-rmi-api:2.6.1-SNAPSHOT" level="project" />
94
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-blackboard-common:2.2.1-SNAPSHOT" level="project" />
95
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-notifications-common:2.1.1-SNAPSHOT" level="project" />
96
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-resultset-service:2.0.3-SNAPSHOT" level="project" />
97
    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
98
    <orderEntry type="library" name="Maven: cglib:cglib-nodep:2.2" level="project" />
99
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-resultset-client:2.1.2-SNAPSHOT" level="project" />
100
    <orderEntry type="library" name="Maven: joda-time:joda-time:2.3" level="project" />
101
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
102
    <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
103
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
104
  </component>
105
</module>

Also available in: Unified diff