initial commit
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@98269 82a268e6-3cf1-43bd-a215-b396298e98cf
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/databases-manager-portlet-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry including="**/*.java" kind="src" output="src/main/webapp/WEB-INF/classes" path="src/main/resources"/>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
|
||||
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/loredana/Desktop/libraries/gxt-2.2.5.zip"/>
|
||||
<classpathentry kind="var" path="GLOBUS_LOCATION"/>
|
||||
<classpathentry kind="var" path="KEYS"/>
|
||||
<classpathentry kind="output" path="target/databases-manager-portlet-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>databases-manager-portlet</name>
|
||||
<comment>databases-manager-portlet project</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.maven.ide.eclipse.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/webapp" />
|
||||
<classpathentry kind="con"
|
||||
path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER" />
|
||||
<classpathentry kind="con"
|
||||
path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||
<attributes>
|
||||
<attribute name="hide" value="true" />
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con"
|
||||
path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary" />
|
||||
<classpathentry kind="output" path="" />
|
||||
</classpath>
|
|
@ -0,0 +1,3 @@
|
|||
#Thu Jun 16 10:18:26 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
filesCopiedToWebInfLib=
|
|
@ -0,0 +1,5 @@
|
|||
eclipse.preferences.version=1
|
||||
jarsExcludedFromWebInfLib=
|
||||
lastWarOutDir=/home/loredana/workspace/databases-manager-portlet/target/databases-manager-portlet-1.0.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
|
@ -0,0 +1,5 @@
|
|||
#Thu Jun 16 11:14:17 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
entryPointModules=
|
||||
filesCopiedToWebInfLib=gwt-servlet.jar
|
||||
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBWy13YXIgc3JjL21haW4vd2ViYXBwXV0+PC9leHRyYS1hcmdzPjx2bS1hcmdzPjwhW0NEQVRBWy1YbXg1MTJtXV0+PC92bS1hcmdzPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLmNvbXBhbnkuU29tZU1vZHVsZTwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+
|
|
@ -0,0 +1,6 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
|
@ -0,0 +1,8 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -0,0 +1,4 @@
|
|||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="${module}">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||
<property name="context-root" value="databases-manager-portlet"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="jst.web" version="2.3"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="java" version="1.7"/>
|
||||
</faceted-project>
|
|
@ -0,0 +1 @@
|
|||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
|
|
@ -0,0 +1,2 @@
|
|||
disabled=06target
|
||||
eclipse.preferences.version=1
|
|
@ -0,0 +1,9 @@
|
|||
#Thu Sep 02 10:42:12 CEST 2010
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
fullBuildGoals=process-test-resources
|
||||
includeModules=false
|
||||
resolveWorkspaceProjects=true
|
||||
resourceFilterGoals=process-resources resources\:testResources
|
||||
skipCompilerPlugin=true
|
||||
version=1
|
|
@ -0,0 +1,291 @@
|
|||
<!-- <?xml version="1.0" encoding="UTF-8"?> -->
|
||||
<!-- <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"> -->
|
||||
|
||||
<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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<!-- POM file generated with GWT webAppCreator -->
|
||||
<!-- <modelVersion>4.0.0</modelVersion> -->
|
||||
|
||||
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>databases-manager-portlet</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<name>DatabasesResourceManagerPortlet</name>
|
||||
<description>Databases Resource Manager Portlet</description>
|
||||
|
||||
|
||||
|
||||
<properties>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<!-- Convenience property to set the GWT version -->
|
||||
<gwtVersion>2.5.1</gwtVersion>
|
||||
<!-- GWT needs at least java 1.5 -->
|
||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||
<!-- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> -->
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- Dependencies for the SM client library -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||
<artifactId>aslcore</artifactId>
|
||||
<!-- <version>[1.0.0-SNAPSHOT,5.0.0-SNAPSHOT)</version> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.data.analysis</groupId>
|
||||
<artifactId>statistical-manager-cl</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-fw-clients</artifactId>
|
||||
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>org.gcube.core</groupId> -->
|
||||
<!-- <artifactId>common-gcore-clients</artifactId> -->
|
||||
<!-- <version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.contentmanagement</groupId>
|
||||
<artifactId>storage-manager-wrapper</artifactId>
|
||||
<!-- <version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version> -->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.contentmanagement</groupId>
|
||||
<artifactId>storage-manager-core</artifactId>
|
||||
<!-- <version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version> -->
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- other dependencies -->
|
||||
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
<version>2.6.0</version>
|
||||
<!-- <scope>provided</scope> -->
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>regexp</groupId> -->
|
||||
<!-- <artifactId>regexp</artifactId> -->
|
||||
<!-- <version>1.3</version> -->
|
||||
<!-- </dependency> -->
|
||||
<dependency>
|
||||
<groupId>javax.portlet</groupId>
|
||||
<artifactId>portlet-api</artifactId>
|
||||
<!-- <version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>custom-portal-handler</artifactId>
|
||||
<!-- <version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-scope</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-scope-maps</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||
<scope>compile</scope>
|
||||
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>log4j</groupId> -->
|
||||
<!-- <artifactId>log4j</artifactId> -->
|
||||
<!-- <version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>org.gcube.applicationsupportlayer</groupId> -->
|
||||
<!-- <artifactId>accesslogger</artifactId> -->
|
||||
<!-- <version>[1.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version> -->
|
||||
<!-- <scope>provided</scope> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>org.slf4j</groupId> -->
|
||||
<!-- <artifactId>slf4j-log4j12</artifactId> -->
|
||||
<!-- <version>1.6.1</version> -->
|
||||
<!-- <scope>runtime</scope> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-servlet</artifactId>
|
||||
<!-- <version>${gwtVersion}</version> -->
|
||||
<!-- <scope>runtime</scope> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<!-- <version>${gwtVersion}</version> -->
|
||||
<!-- <scope>provided</scope> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.7</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>1.0.0.GA</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>1.0.0.GA</version>
|
||||
<classifier>sources</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.extjs.gxt</groupId>
|
||||
<artifactId>gxt</artifactId>
|
||||
<version>2.2.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>LATEST</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<!-- Generate compiled stuff in the folder used for developing mode -->
|
||||
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
|
||||
|
||||
<plugins>
|
||||
|
||||
<!-- GWT Maven Plugin -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>gwt-maven-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
|
||||
documentation at codehaus.org -->
|
||||
<configuration>
|
||||
<runTarget>DatabasesManager.html</runTarget>
|
||||
<hostedWebapp>${webappDirectory}</hostedWebapp>
|
||||
<!-- <i18nMessagesBundle>org.gcube.portlets.user.dbmanager.client.Messages</i18nMessagesBundle> -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Copy static web files before executing gwt:run -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>exploded</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<webappDirectory>${webappDirectory}</webappDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- <plugin> -->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId> -->
|
||||
<!-- <artifactId>maven-resources-plugin</artifactId> -->
|
||||
<!-- <version>2.5</version> -->
|
||||
<!-- <executions> -->
|
||||
<!-- <execution> -->
|
||||
<!-- <id>copy-profile</id> -->
|
||||
<!-- <phase>install</phase> -->
|
||||
<!-- <goals> -->
|
||||
<!-- <goal>copy-resources</goal> -->
|
||||
<!-- </goals> -->
|
||||
<!-- <configuration> -->
|
||||
<!-- <outputDirectory>target</outputDirectory> -->
|
||||
<!-- <resources> -->
|
||||
<!-- <resource> -->
|
||||
<!-- <directory>${distroDirectory}</directory> -->
|
||||
<!-- <filtering>true</filtering> -->
|
||||
<!-- <includes> -->
|
||||
<!-- <include>profile.xml</include> -->
|
||||
<!-- </includes> -->
|
||||
<!-- </resource> -->
|
||||
<!-- </resources> -->
|
||||
<!-- </configuration> -->
|
||||
<!-- </execution> -->
|
||||
<!-- </executions> -->
|
||||
<!-- </plugin> -->
|
||||
|
||||
<!-- <plugin> -->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId> -->
|
||||
<!-- <artifactId>maven-assembly-plugin</artifactId> -->
|
||||
<!-- <version>2.2</version> -->
|
||||
<!-- <configuration> -->
|
||||
<!-- <descriptors> -->
|
||||
<!-- <descriptor>${distroDirectory}/descriptor.xml</descriptor> -->
|
||||
<!-- </descriptors> -->
|
||||
<!-- </configuration> -->
|
||||
<!-- <executions> -->
|
||||
<!-- <execution> -->
|
||||
<!-- <id>servicearchive</id> -->
|
||||
<!-- <phase>install</phase> -->
|
||||
<!-- <goals> -->
|
||||
<!-- <goal>single</goal> -->
|
||||
<!-- </goals> -->
|
||||
<!-- </execution> -->
|
||||
<!-- </executions> -->
|
||||
<!-- </plugin> -->
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,106 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.panels.GxtBorderLayoutPanel;
|
||||
//import org.gcube.portlets.user.dbmanager.client.utils.ConstantsPortlet;
|
||||
|
||||
import com.google.gwt.core.client.EntryPoint;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.logical.shared.ResizeEvent;
|
||||
import com.google.gwt.event.logical.shared.ResizeHandler;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.ServiceDefTarget;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.panels.GxtBorderLayoutPanel;
|
||||
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
|
||||
|
||||
/**
|
||||
* Entry point classes define <code>onModuleLoad()</code>.
|
||||
*/
|
||||
public class DatabasesManager implements EntryPoint {
|
||||
|
||||
private GxtBorderLayoutPanel borderLayout;
|
||||
|
||||
/**
|
||||
* This is the entry point method.
|
||||
*/
|
||||
|
||||
public void onModuleLoad() {
|
||||
|
||||
HandlerManager eventBus = new HandlerManager(this);
|
||||
|
||||
// create the RPC service
|
||||
|
||||
GWTdbManagerServiceAsync service = (GWTdbManagerServiceAsync) GWT
|
||||
.create(GWTdbManagerService.class);
|
||||
|
||||
ServiceDefTarget serviceDef = (ServiceDefTarget) service;
|
||||
serviceDef.setServiceEntryPoint(GWT.getModuleBaseURL()
|
||||
+ "dbManagerService");
|
||||
|
||||
try {
|
||||
borderLayout = new GxtBorderLayoutPanel(eventBus, service);
|
||||
|
||||
|
||||
RootPanel.get(ConstantsPortlet.CONTENTDIV).add(borderLayout);
|
||||
|
||||
Window.addResizeHandler(new ResizeHandler() {
|
||||
// @Override
|
||||
public void onResize(ResizeEvent event) {
|
||||
System.out.println("onWindowResized width: "
|
||||
+ event.getWidth() + " height: "
|
||||
+ event.getHeight());
|
||||
updateSize();
|
||||
}
|
||||
});
|
||||
|
||||
updateSize();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update window size
|
||||
*/
|
||||
public void updateSize() {
|
||||
|
||||
RootPanel rootPanel = RootPanel.get(ConstantsPortlet.CONTENTDIV);
|
||||
|
||||
int topBorder = rootPanel.getAbsoluteTop();
|
||||
|
||||
int leftBorder = rootPanel.getAbsoluteLeft();
|
||||
|
||||
int footer = 85; // footer is bottombar + sponsor
|
||||
|
||||
// int rootHeight = (Window.getClientHeight() - topBorder - 4) ;// -
|
||||
// ((footer == null)?0:(footer.getOffsetHeight()-15));
|
||||
|
||||
// if (rootHeight > 550)
|
||||
// rootHeight = 550;
|
||||
|
||||
int rootHeight = (Window.getClientHeight() - topBorder - 4 - footer);// -
|
||||
// ((footer
|
||||
// ==
|
||||
// null)?0:(footer.getOffsetHeight()-15));
|
||||
|
||||
if (rootHeight < 550)
|
||||
rootHeight = 550;
|
||||
|
||||
int rootWidth = Window.getClientWidth() - 2 * leftBorder; // -
|
||||
// rightScrollBar;
|
||||
|
||||
System.out.println("New workspace dimension Height: " + rootHeight
|
||||
+ " Width: " + rootWidth);
|
||||
|
||||
borderLayout.setHeight(rootHeight);
|
||||
borderLayout.setWidth(rootWidth);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.FileModel;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Row;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.FileModel;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Result;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Row;
|
||||
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||
|
||||
//interface that defines RPC methods
|
||||
@RemoteServiceRelativePath("dbManagerService")
|
||||
public interface GWTdbManagerService extends RemoteService {
|
||||
|
||||
List<FileModel> getResource() throws Exception;
|
||||
|
||||
List<FileModel> getTables(LinkedHashMap<String, String> dataInput)
|
||||
throws Exception;
|
||||
|
||||
LinkedHashMap<String, FileModel> getDBInfo(String resourceName)
|
||||
throws Exception;
|
||||
|
||||
List<FileModel> getDBSchema(LinkedHashMap<String, String> dataInput)
|
||||
throws Exception;
|
||||
|
||||
List<Result> submitQuery(LinkedHashMap<String, String> dataDB,
|
||||
String query, boolean valueReadOnlyQuery,
|
||||
boolean smartCorrectionQuery, String language) throws Exception;
|
||||
|
||||
List<Row> parseCVSString(List<Result> result, List<String> attrNames)
|
||||
throws Exception;
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.FileModel;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Row;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.FileModel;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Result;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Row;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
public interface GWTdbManagerServiceAsync {
|
||||
|
||||
void getResource(AsyncCallback<List<FileModel>> asyncCallback);
|
||||
|
||||
void getDBInfo(String resourceName,
|
||||
AsyncCallback<LinkedHashMap<String, FileModel>> asyncCallback);
|
||||
|
||||
void getTables(LinkedHashMap<String, String> dataInput,
|
||||
AsyncCallback<List<FileModel>> callback);
|
||||
|
||||
void getDBSchema(LinkedHashMap<String, String> dataInput,
|
||||
AsyncCallback<List<FileModel>> callback);
|
||||
|
||||
void submitQuery(LinkedHashMap<String, String> dataDB, String query,
|
||||
boolean valueReadOnlyQuery, boolean smartCorrectionQuery,
|
||||
String language, AsyncCallback<List<Result>> callback);
|
||||
|
||||
void parseCVSString(List<Result> result, List<String> attrNames,
|
||||
AsyncCallback<List<Row>> callback);
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
//package org.gcube.portlets.user.databasesmanager.client;
|
||||
//
|
||||
//import com.google.gwt.user.client.rpc.RemoteService;
|
||||
//import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||
//
|
||||
///**
|
||||
// * The client side stub for the RPC service.
|
||||
// */
|
||||
//@RemoteServiceRelativePath("greet")
|
||||
//public interface GreetingService extends RemoteService {
|
||||
// String greetServer(String name) throws IllegalArgumentException;
|
||||
//}
|
|
@ -0,0 +1,40 @@
|
|||
//package org.gcube.portlets.user.databasesmanager.client;
|
||||
//
|
||||
//
|
||||
//
|
||||
//import com.google.gwt.core.client.GWT;
|
||||
//import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
//import com.google.gwt.user.client.rpc.ServiceDefTarget;
|
||||
//
|
||||
//public interface GreetingServiceAsync
|
||||
//{
|
||||
//
|
||||
// /**
|
||||
// * GWT-RPC service asynchronous (client-side) interface
|
||||
// * @see org.com.example.TestApp.client.GreetingService
|
||||
// */
|
||||
// void greetServer( java.lang.String name, AsyncCallback<java.lang.String> callback );
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * Utility class to get the RPC Async interface from client-side code
|
||||
// */
|
||||
// public static final class Util
|
||||
// {
|
||||
// private static GreetingServiceAsync instance;
|
||||
//
|
||||
// public static final GreetingServiceAsync getInstance()
|
||||
// {
|
||||
// if ( instance == null )
|
||||
// {
|
||||
// instance = (GreetingServiceAsync) GWT.create( GreetingService.class );
|
||||
// }
|
||||
// return instance;
|
||||
// }
|
||||
//
|
||||
// private Util()
|
||||
// {
|
||||
// // Utility class should not be instanciated
|
||||
// }
|
||||
// }
|
||||
//}
|
|
@ -0,0 +1,129 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.datamodel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.extjs.gxt.ui.client.data.BaseModelData;
|
||||
|
||||
public class FileModel extends BaseModelData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static int ID = 0;
|
||||
// private int id;
|
||||
private boolean isExpanded = true;
|
||||
// private boolean isSchema = false;
|
||||
private boolean isLoaded = false;
|
||||
// private boolean isTable = false;
|
||||
private boolean isDatabase = false;
|
||||
|
||||
|
||||
private List<Result> DBInfo = null;
|
||||
private boolean isDBInfoDisplayed = false;
|
||||
|
||||
public FileModel() {
|
||||
setId();
|
||||
// setIsExpanded(true);
|
||||
// setIsSchema(false);
|
||||
}
|
||||
|
||||
public FileModel(String name) {
|
||||
setName(name);
|
||||
setId();
|
||||
|
||||
}
|
||||
|
||||
public void setId() {
|
||||
set("ID", this.ID++);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return get("ID");
|
||||
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
set("name", name);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return get("name");
|
||||
}
|
||||
|
||||
public void setIsExpanded(boolean value) {
|
||||
|
||||
isExpanded = value;
|
||||
}
|
||||
|
||||
public boolean isExpanded() {
|
||||
|
||||
return isExpanded;
|
||||
}
|
||||
|
||||
public void setIsLoaded(boolean value) {
|
||||
|
||||
isLoaded = value;
|
||||
|
||||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
|
||||
return isLoaded;
|
||||
|
||||
}
|
||||
|
||||
public void setIsSchema(boolean value) {
|
||||
|
||||
set("isSchema", value);
|
||||
}
|
||||
|
||||
public boolean isSchema() {
|
||||
return get("isSchema");
|
||||
}
|
||||
|
||||
public void setIsTable(boolean value) {
|
||||
|
||||
set("isTable", value);
|
||||
}
|
||||
|
||||
public boolean isTable() {
|
||||
|
||||
return get("isTable");
|
||||
}
|
||||
|
||||
public void setIsDatabase(boolean value) {
|
||||
|
||||
isDatabase = value;
|
||||
}
|
||||
|
||||
public boolean isDatabase() {
|
||||
|
||||
return isDatabase;
|
||||
}
|
||||
|
||||
public void setDBInfo(List<Result> data) {
|
||||
DBInfo = data;
|
||||
}
|
||||
|
||||
public List<Result> getDBInfo() {
|
||||
return DBInfo;
|
||||
}
|
||||
|
||||
public void setIsDBInfoDisplayed(boolean value) {
|
||||
isDBInfoDisplayed = value;
|
||||
}
|
||||
|
||||
public boolean isDBInfoDisplayed() {
|
||||
return isDBInfoDisplayed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj != null && obj instanceof FileModel) {
|
||||
FileModel mobj = (FileModel) obj;
|
||||
return getName().equals(mobj.getName());
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.datamodel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Parameter implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String value;
|
||||
private String name;
|
||||
private String paramDescription;
|
||||
private String objectType;
|
||||
private String defaultValue;
|
||||
|
||||
public Parameter(String paramName, String paramDescription,
|
||||
String objectType, String defaultValue) {
|
||||
|
||||
this.setName(paramName);
|
||||
this.setParamDescription(paramDescription);
|
||||
this.setObjectType(objectType);
|
||||
this.setDefaultValue(defaultValue);
|
||||
|
||||
}
|
||||
|
||||
public Parameter() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getParamDescription() {
|
||||
return paramDescription;
|
||||
}
|
||||
|
||||
public void setParamDescription(String paramDescription) {
|
||||
this.paramDescription = paramDescription;
|
||||
}
|
||||
|
||||
public void setObjectType(String objectType){
|
||||
|
||||
this.objectType = objectType;
|
||||
}
|
||||
|
||||
public String getObjectType(){
|
||||
|
||||
return objectType;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue){
|
||||
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public String getDefaultValue(){
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.datamodel;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.extjs.gxt.ui.client.data.BaseModelData;
|
||||
|
||||
public class Result extends BaseModelData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// private String index;
|
||||
// private String value;
|
||||
|
||||
public Result() {
|
||||
}
|
||||
|
||||
public Result(String index, String value) {
|
||||
set("index", index);
|
||||
set("value", value);
|
||||
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return get("value");
|
||||
}
|
||||
|
||||
public String getIndex() {
|
||||
return get("index");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.datamodel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.extjs.gxt.ui.client.data.BaseModelData;
|
||||
|
||||
public class Row extends BaseModelData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static int ID = 0;
|
||||
|
||||
private static Logger rootLogger = Logger.getLogger("Row");
|
||||
|
||||
// String row;
|
||||
|
||||
// List<String> tokens;
|
||||
|
||||
// public Row(String [] attributes){
|
||||
//
|
||||
// for (int i=0; i<attributes.length;i++){
|
||||
//
|
||||
// set("\""+attributes[i]+"\"", attributes[i]);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
public Row() {
|
||||
|
||||
}
|
||||
|
||||
// public Row(List<String> attributes) {
|
||||
//
|
||||
// for(int i=0;i<attributes.size();i++){
|
||||
//
|
||||
// set("\""+attributes.get(i)+"\"", attributes.get(i));
|
||||
//
|
||||
// // set("value", attributes.get(i));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
public Row(List<String> attributes, List<String> values) {
|
||||
|
||||
set("index", ID++);
|
||||
|
||||
// System.out.println("setting Row value");
|
||||
|
||||
for (int i = 0; i < attributes.size(); i++) {
|
||||
|
||||
set(attributes.get(i), values.get(i));
|
||||
|
||||
// System.out.println("attribute: " + attributes.get(i) + " value: "
|
||||
// + values.get(i));
|
||||
|
||||
//print check
|
||||
// rootLogger.log(Level.INFO, "Row-> attribute: "
|
||||
// +attributes.get(i)+ "value: " + values.get(i));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getValue(String attribute) {
|
||||
return get(attribute);
|
||||
}
|
||||
|
||||
// private static List<String> parseCVSString(String row) throws Exception {
|
||||
//
|
||||
// String delimiter = ",";
|
||||
//
|
||||
// List<String> elements = new ArrayList<String>();
|
||||
// String phrase = row;
|
||||
// int idxdelim = -1;
|
||||
// boolean quot = false;
|
||||
// phrase = phrase.trim();
|
||||
// while ((idxdelim = phrase.indexOf(delimiter)) >= 0) {
|
||||
// quot = phrase.startsWith("\"");
|
||||
// if (quot) {
|
||||
// phrase = phrase.substring(1);
|
||||
// String quoted = "";
|
||||
// if (phrase.startsWith("\""))
|
||||
// phrase = phrase.substring(1);
|
||||
// else{
|
||||
// RE regexp = new RE("[^\\\\]\"");
|
||||
// boolean matching = regexp.match(phrase);
|
||||
//
|
||||
// if (matching) {
|
||||
// int i0 = regexp.getParenStart(0);
|
||||
// quoted = phrase.substring(0, i0 + 1).trim();
|
||||
// phrase = phrase.substring(i0 + 2).trim();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (phrase.startsWith(delimiter))
|
||||
// phrase = phrase.substring(1);
|
||||
//
|
||||
// elements.add(quoted);
|
||||
//
|
||||
// } else {
|
||||
// elements.add(phrase.substring(0, idxdelim));
|
||||
// phrase = phrase.substring(idxdelim + 1).trim();
|
||||
// }
|
||||
// }
|
||||
// if (phrase.startsWith("\""))
|
||||
// phrase = phrase.substring(1);
|
||||
//
|
||||
// if (phrase.endsWith("\""))
|
||||
// phrase = phrase.substring(0, phrase.length() - 1);
|
||||
//
|
||||
// elements.add(phrase);
|
||||
//
|
||||
// return elements;
|
||||
// }
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.datamodel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
|
||||
|
||||
|
||||
|
||||
import com.extjs.gxt.ui.client.data.BaseModelData;
|
||||
|
||||
public class SQLDialect extends BaseModelData {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
// private String name;
|
||||
|
||||
|
||||
public SQLDialect() {
|
||||
}
|
||||
|
||||
public SQLDialect(String name) {
|
||||
|
||||
setName(name);
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
set("name", name);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
return get("name");
|
||||
}
|
||||
|
||||
|
||||
public static List<SQLDialect> loadData(){
|
||||
|
||||
List<SQLDialect> dialects = new ArrayList<SQLDialect>();
|
||||
|
||||
SQLDialect element1 = new SQLDialect(ConstantsPortlet.NONE);
|
||||
SQLDialect element2 = new SQLDialect(ConstantsPortlet.POSTGRES);
|
||||
SQLDialect element3 = new SQLDialect(ConstantsPortlet.MYSQL);
|
||||
|
||||
dialects.add(element1);
|
||||
dialects.add(element2);
|
||||
dialects.add(element3);
|
||||
|
||||
return dialects;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//public class SQLDialect {
|
||||
//
|
||||
// public SQLDialect() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static List<Data> loadData(){
|
||||
//
|
||||
// List<Data> dialects = new ArrayList<Data>();
|
||||
//
|
||||
// Data element1 = new Data(ConstantsPortlet.NONE);
|
||||
// Data element2 = new Data(ConstantsPortlet.POSTGRES);
|
||||
// Data element3 = new Data(ConstantsPortlet.MYSQL);
|
||||
//
|
||||
// dialects.add(element1);
|
||||
// dialects.add(element2);
|
||||
// dialects.add(element3);
|
||||
//
|
||||
// return dialects;
|
||||
//
|
||||
// }
|
||||
//
|
||||
//}
|
|
@ -0,0 +1,46 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.datamodel;
|
||||
|
||||
public class SubmitQueryData {
|
||||
|
||||
private String query;
|
||||
private boolean readOnlyQuery;
|
||||
private boolean smartCorrection;
|
||||
private String language;
|
||||
|
||||
public SubmitQueryData(){
|
||||
|
||||
}
|
||||
|
||||
public void setQuery(String value) {
|
||||
this.query = value;
|
||||
}
|
||||
|
||||
public void setReadOnlyQuery(boolean value) {
|
||||
this.readOnlyQuery = value;
|
||||
}
|
||||
|
||||
public void setSmartCorrection(boolean value) {
|
||||
this.smartCorrection = value;
|
||||
}
|
||||
|
||||
public void setLanguage(String value) {
|
||||
this.language = value;
|
||||
}
|
||||
|
||||
public String getQuery() {
|
||||
return this.query;
|
||||
}
|
||||
|
||||
public boolean getReadOnlyQuery() {
|
||||
return this.readOnlyQuery;
|
||||
}
|
||||
|
||||
public boolean getSmartCorrection() {
|
||||
return this.smartCorrection;
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
return this.language;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.events;
|
||||
|
||||
public enum EventsTypeEnum {
|
||||
|
||||
SELECTED_ITEM_EVENT,
|
||||
SUBMIT_QUERY_EVENT,
|
||||
SHOW_CREATE_TABLE_EVENT;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.events;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.interfaces.SelectedItemEventHandler;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.interfaces.SelectedItemEventHandler;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
//"SelectedItemEvent" event definition
|
||||
|
||||
public class SelectedItemEvent extends GwtEvent<SelectedItemEventHandler> {
|
||||
|
||||
public static Type<SelectedItemEventHandler> TYPE = new Type<SelectedItemEventHandler>();
|
||||
|
||||
@Override
|
||||
public Type<SelectedItemEventHandler> getAssociatedType() {
|
||||
// TODO Auto-generated method stub
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(SelectedItemEventHandler handler) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
handler.onSelectedItem(this);
|
||||
|
||||
}
|
||||
|
||||
public EventsTypeEnum getKey() {
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
return EventsTypeEnum.SELECTED_ITEM_EVENT;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.events;
|
||||
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.interfaces.SubmitQueryEventHandler;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.interfaces.SubmitQueryEventHandler;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
//"SubmitQueryEvent" event definition
|
||||
|
||||
public class SubmitQueryEvent extends GwtEvent<SubmitQueryEventHandler> {
|
||||
|
||||
public static Type<SubmitQueryEventHandler> TYPE = new Type<SubmitQueryEventHandler>();
|
||||
|
||||
@Override
|
||||
public Type<SubmitQueryEventHandler> getAssociatedType() {
|
||||
// TODO Auto-generated method stub
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(SubmitQueryEventHandler handler) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
handler.onSubmitQuery(this);
|
||||
|
||||
}
|
||||
|
||||
public EventsTypeEnum getKey() {
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
return EventsTypeEnum.SUBMIT_QUERY_EVENT;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.events.interfaces;
|
||||
|
||||
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.SelectedItemEvent;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
|
||||
// Handler for "SelectedItemEvent" event
|
||||
public interface SelectedItemEventHandler extends EventHandler {
|
||||
public void onSelectedItem(SelectedItemEvent selectedItemEvent);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.events.interfaces;
|
||||
|
||||
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.SubmitQueryEvent;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
//Handler for "SubmitQueryEvent" event
|
||||
public interface SubmitQueryEventHandler extends EventHandler {
|
||||
public void onSubmitQuery(SubmitQueryEvent submitQueryEvent);
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.form;
|
||||
|
||||
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.SubmitQueryData;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.SubmitQueryData;
|
||||
|
||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||
import com.extjs.gxt.ui.client.widget.VerticalPanel;
|
||||
import com.extjs.gxt.ui.client.widget.form.CheckBox;
|
||||
import com.extjs.gxt.ui.client.widget.form.FormPanel;
|
||||
import com.extjs.gxt.ui.client.widget.form.TextField;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
||||
|
||||
public class GxtFormSubmitQuery extends LayoutContainer {
|
||||
|
||||
private VerticalPanel vp;
|
||||
FormPanel form;
|
||||
private FormData formData;
|
||||
|
||||
// private SubmitQueryData data;
|
||||
|
||||
// private boolean ReadOnlyQuery;
|
||||
// private boolean SmartCorrection;
|
||||
|
||||
private static Logger rootLogger = Logger.getLogger("GxtFormSubmitQuery");
|
||||
|
||||
|
||||
|
||||
public GxtFormSubmitQuery() {
|
||||
|
||||
formData = new FormData("-20");
|
||||
vp = new VerticalPanel();
|
||||
|
||||
vp.setSpacing(10);
|
||||
|
||||
createLayout();
|
||||
|
||||
add(vp);
|
||||
|
||||
}
|
||||
|
||||
private void createLayout() {
|
||||
|
||||
// FormPanel form = new FormPanel();
|
||||
|
||||
form = new FormPanel();
|
||||
|
||||
// form.setHeading("Submit Query");
|
||||
form.setHeaderVisible(false);
|
||||
form.setFrame(true);
|
||||
form.setWidth(250);
|
||||
// form.setWidth(350);
|
||||
// form.setHeight(250);
|
||||
|
||||
// Query field
|
||||
TextField<String> query = new TextField<String>();
|
||||
query.setFieldLabel("Query");
|
||||
|
||||
// query.setHeight(50);
|
||||
// query.setWidth(50);
|
||||
// query.setAllowBlank(false);
|
||||
query.getFocusSupport().setPreviousId(form.getButtonBar().getId());
|
||||
form.add(query, formData);
|
||||
|
||||
// Read-Only button
|
||||
// CheckBoxGroup readOnlyQuery = new CheckBoxGroup();
|
||||
// readOnlyQuery.setFieldLabel("Read Only Query");
|
||||
|
||||
// CheckBox checkRO = new CheckBox();
|
||||
// checkRO.setFieldLabel("Read Only Query");
|
||||
// checkRO.setValue(true);
|
||||
// // readOnlyQuery.add(checkRO);
|
||||
// // form.add(readOnlyQuery, formData);
|
||||
// form.add(checkRO, formData);
|
||||
|
||||
// Smart Correction button
|
||||
// CheckBoxGroup smartCorrection = new CheckBoxGroup();
|
||||
// smartCorrection.setFieldLabel("Apply Smart Correction");
|
||||
|
||||
CheckBox checkSC = new CheckBox();
|
||||
checkSC.setFieldLabel("Apply Smart Corrections");
|
||||
checkSC.setValue(true);
|
||||
// smartCorrection.add(checkSC);
|
||||
// form.add(smartCorrection, formData);
|
||||
form.add(checkSC, formData);
|
||||
|
||||
// // SQL Dialect ComboBox
|
||||
//
|
||||
// ListStore<SQLDialect> store = new ListStore<SQLDialect>();
|
||||
// List<SQLDialect> elements = new ArrayList<SQLDialect>();
|
||||
//
|
||||
// // load data to display in comboBox
|
||||
// elements = SQLDialect.loadData();
|
||||
// store.add(elements);
|
||||
//
|
||||
// ComboBox<SQLDialect> combo = new ComboBox<SQLDialect>();
|
||||
// combo.setFieldLabel("Language");
|
||||
// combo.setDisplayField("name");
|
||||
// combo.setTriggerAction(TriggerAction.ALL);
|
||||
// combo.setValue(store.getAt(0));
|
||||
// combo.setStore(store);
|
||||
// form.add(combo, formData);
|
||||
|
||||
vp.add(form);
|
||||
|
||||
}
|
||||
|
||||
private String getQuery() {
|
||||
|
||||
String query = ((TextField<String>) form.getWidget(0)).getValue();
|
||||
|
||||
// System.out.println("GxtFormSubmitQuery->query: " + query);
|
||||
|
||||
rootLogger.log(Level.SEVERE, "query: " + query);
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
// private boolean getReadOnlyQueryValue() {
|
||||
//
|
||||
// CheckBox checkRO = ((CheckBox) form.getWidget(1));
|
||||
//
|
||||
// System.out.println("GxtFormSubmitQuery->readonlyquery: "
|
||||
// + checkRO.getValue());
|
||||
// return (checkRO.getValue());
|
||||
//
|
||||
// }
|
||||
|
||||
private boolean getSmartCorrectionValue() {
|
||||
|
||||
// CheckBox checkSC = ((CheckBox) form.getWidget(2));
|
||||
CheckBox checkSC = ((CheckBox) form.getWidget(1));
|
||||
|
||||
// System.out.println("GxtFormSubmitQuery->smartcorrection: "
|
||||
// + checkSC.getValue());
|
||||
|
||||
rootLogger.log(Level.SEVERE, "smartcorrection: " + checkSC.getValue());
|
||||
|
||||
return (checkSC.getValue());
|
||||
|
||||
}
|
||||
|
||||
// private String getLanguage() {
|
||||
//
|
||||
// ComboBox<SQLDialect> combo = ((ComboBox<SQLDialect>) form.getWidget(3));
|
||||
// SQLDialect item = combo.getValue();
|
||||
//
|
||||
// System.out.println("GxtFormSubmitQuery->language: " + item.getName());
|
||||
//
|
||||
// return item.getName();
|
||||
// }
|
||||
|
||||
public SubmitQueryData getSubmitQueryData() {
|
||||
|
||||
layout(true);
|
||||
|
||||
SubmitQueryData data = new SubmitQueryData();
|
||||
|
||||
data.setQuery(this.getQuery());
|
||||
|
||||
//TO REMOVE
|
||||
// data.setReadOnlyQuery(this.getReadOnlyQueryValue());
|
||||
|
||||
data.setSmartCorrection(this.getSmartCorrectionValue());
|
||||
|
||||
//TO REMOVE
|
||||
// data.setLanguage(this.getLanguage());
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,738 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.panels;
|
||||
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.GWTdbManagerServiceAsync;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.FileModel;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Row;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.SubmitQueryData;
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.SelectedItemEvent;
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.SubmitQueryEvent;
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.interfaces.SelectedItemEventHandler;
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.interfaces.SubmitQueryEventHandler;
|
||||
import org.gcube.portlets.user.databasesmanager.client.toolbar.GxtToolbarFunctionality;
|
||||
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.GWTdbManagerServiceAsync;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.FileModel;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Result;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Row;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.SubmitQueryData;
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.SelectedItemEvent;
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.SubmitQueryEvent;
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.interfaces.SelectedItemEventHandler;
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.interfaces.SubmitQueryEventHandler;
|
||||
//import org.gcube.portlets.user.dbmanager.client.toolbar.GxtToolbarFunctionality;
|
||||
//import org.gcube.portlets.user.dbmanager.client.utils.ConstantsPortlet;
|
||||
|
||||
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||
import com.extjs.gxt.ui.client.store.ListStore;
|
||||
import com.extjs.gxt.ui.client.util.Margins;
|
||||
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
||||
import com.extjs.gxt.ui.client.widget.Dialog;
|
||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||
import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
||||
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
||||
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
||||
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
||||
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||
import com.extjs.gxt.ui.client.widget.layout.RowData;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.extjs.gxt.ui.client.event.Listener;
|
||||
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
||||
import com.extjs.gxt.ui.client.widget.button.Button;
|
||||
|
||||
public class GxtBorderLayoutPanel extends ContentPanel {
|
||||
|
||||
/* Create Root Logger */
|
||||
private static Logger rootLogger = Logger.getLogger("GxtBorderLayoutPanel");
|
||||
|
||||
private ContentPanel north;
|
||||
private ContentPanel west;
|
||||
private LayoutContainer center;
|
||||
private ContentPanel centerUpper;
|
||||
private ContentPanel centerBottom;
|
||||
private GxtTreePanel treePanel;
|
||||
private GxtToolbarFunctionality toolbar;
|
||||
private ArrayList<String> parsedList;
|
||||
|
||||
private List<String> listAttributes;
|
||||
private List<Row> rows;
|
||||
|
||||
private HandlerManager eventBus = null;
|
||||
|
||||
// RPC service
|
||||
private GWTdbManagerServiceAsync RPCservice = null;
|
||||
|
||||
public GxtBorderLayoutPanel(HandlerManager eBus,
|
||||
GWTdbManagerServiceAsync service) throws Exception {
|
||||
|
||||
eventBus = eBus;
|
||||
RPCservice = service;
|
||||
|
||||
north = new ContentPanel();
|
||||
west = new ContentPanel();
|
||||
center = new LayoutContainer();
|
||||
treePanel = new GxtTreePanel(eventBus, service);
|
||||
toolbar = new GxtToolbarFunctionality(eventBus, RPCservice);
|
||||
|
||||
initLayout();
|
||||
createLayouts();
|
||||
|
||||
addHandler();
|
||||
|
||||
}
|
||||
|
||||
private void initLayout() {
|
||||
|
||||
north.setLayout(new FitLayout());
|
||||
north.setTopComponent(toolbar.getToolBar());
|
||||
north.add(toolbar.getToolBar());
|
||||
|
||||
west.setLayout(new FitLayout());
|
||||
west.setHeading("Databases Resources");
|
||||
|
||||
west.add(treePanel);
|
||||
west.setScrollMode(Scroll.AUTO);
|
||||
|
||||
center.setLayout(new BorderLayout());
|
||||
|
||||
}
|
||||
|
||||
public void createLayouts() {
|
||||
|
||||
// Border layout for the external container
|
||||
final BorderLayout borderLayoutNordWest = new BorderLayout();
|
||||
setLayout(borderLayoutNordWest);
|
||||
|
||||
// NORD
|
||||
BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH,
|
||||
55, 55, 70);
|
||||
|
||||
northData.setSplit(false); // Split bar between regions
|
||||
// northData.setFloatable(true);
|
||||
// northData.setCollapsible(true);
|
||||
// northData.setHideCollapseTool(false);
|
||||
// northData.setSplit(true);
|
||||
northData.setMargins(new Margins(0, 0, 1, 0));
|
||||
|
||||
// WEST
|
||||
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST,
|
||||
330, 330, 400);
|
||||
westData.setSplit(true);
|
||||
westData.setCollapsible(true);
|
||||
westData.setMargins(new Margins(0, 1, 0, 0));
|
||||
|
||||
// CENTER
|
||||
|
||||
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
|
||||
centerData.setMargins(new Margins(0));
|
||||
// center.setHeading("Information");
|
||||
centerData.setSplit(true);
|
||||
centerData.setCollapsible(true);
|
||||
|
||||
// CENTER UPPER
|
||||
|
||||
centerUpper = new ContentPanel();
|
||||
centerUpper.setLayout(new FitLayout());
|
||||
centerUpper.setHeading("Database Information");
|
||||
centerUpper.setScrollMode(Scroll.NONE);
|
||||
|
||||
// CENTER BOTTOM
|
||||
|
||||
centerBottom = new ContentPanel();
|
||||
centerBottom.setLayout(new FitLayout());
|
||||
centerBottom.setHeading("Information Details");
|
||||
centerBottom.setScrollMode(Scroll.AUTO);
|
||||
|
||||
BorderLayoutData centerUpperData = new BorderLayoutData(
|
||||
LayoutRegion.NORTH, 250, 100, 250);
|
||||
|
||||
centerUpperData.setSplit(true); // Split bar between regions
|
||||
// northData.setFloatable(true);
|
||||
centerUpperData.setCollapsible(false);
|
||||
// northData.setHideCollapseTool(false);
|
||||
// northData.setSplit(true);
|
||||
centerUpperData.setMargins(new Margins(0, 0, 1, 0));
|
||||
|
||||
// BorderLayoutData centerBottomData = new
|
||||
// BorderLayoutData(LayoutRegion.CENTER,
|
||||
// 50, 30, 50);
|
||||
|
||||
BorderLayoutData centerBottomData = new BorderLayoutData(
|
||||
LayoutRegion.CENTER);
|
||||
centerBottomData.setSplit(true);
|
||||
centerBottomData.setCollapsible(false);
|
||||
centerBottomData.setMargins(new Margins(0));
|
||||
// centerBottomData.setMargins(new Margins(1, 0, 0, 0));
|
||||
|
||||
// to add the central panels to the second container
|
||||
center.add(centerUpper, centerUpperData);
|
||||
center.add(centerBottom, centerBottomData);
|
||||
|
||||
add(north, northData);
|
||||
add(west, westData);
|
||||
add(center, centerData);
|
||||
// add(east, eastData);
|
||||
|
||||
}
|
||||
|
||||
private void addHandler() {
|
||||
|
||||
eventBus.addHandler(SelectedItemEvent.TYPE,
|
||||
new SelectedItemEventHandler() {
|
||||
|
||||
public void onSelectedItem(
|
||||
SelectedItemEvent selectedItemEvent) {
|
||||
|
||||
// System.out
|
||||
// .println("GxtBorderLayoutPanel: Event received");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "Event received");
|
||||
|
||||
int DepthSelectedItem = treePanel
|
||||
.getTreeDepthSelectedItem();
|
||||
|
||||
// System.out.println("GxtBorderLayoutPanel-> Depth: "
|
||||
// + DepthSelectedItem);
|
||||
|
||||
// element name selected
|
||||
String text = treePanel.getValue();
|
||||
|
||||
// System.out
|
||||
// .println("GxtBorderLayoutPanel-> item selected: "
|
||||
// + text);
|
||||
|
||||
rootLogger.log(Level.INFO, "item selected: " + text);
|
||||
|
||||
toolbar.disableButtonOnToolbar(DepthSelectedItem,
|
||||
treePanel.getSelectedItemIsSchema());
|
||||
|
||||
if (DepthSelectedItem != 3) {
|
||||
|
||||
centerUpper.removeAll();
|
||||
|
||||
centerUpper.layout(true);
|
||||
|
||||
}
|
||||
|
||||
List<FileModel> data = treePanel.getTreePanel()
|
||||
.getSelectionModel().getSelectedItems();
|
||||
|
||||
FileModel selectedItem = data.get(0);
|
||||
|
||||
if (DepthSelectedItem == 3) { // the item selected is a
|
||||
// database.
|
||||
|
||||
// show database information in the panel
|
||||
|
||||
// List<FileModel> data = treePanel.getTreePanel()
|
||||
// .getSelectionModel().getSelectedItems();
|
||||
// FileModel selectedItem = data.get(0);
|
||||
|
||||
FileModel parent = treePanel.getTreeStore()
|
||||
.getParent(selectedItem);
|
||||
|
||||
// displayDBInfo(parent);
|
||||
|
||||
// display information about the selected database
|
||||
displayDBInfo(data.get(0));
|
||||
|
||||
}
|
||||
|
||||
//display the table name in the right panel when a table is selected
|
||||
|
||||
if (DepthSelectedItem == 5){
|
||||
|
||||
centerUpper.removeAll();
|
||||
|
||||
centerUpper.addText(data.get(0).getName());
|
||||
|
||||
centerUpper.layout(true);
|
||||
|
||||
}
|
||||
|
||||
if ((DepthSelectedItem == 4) && (data.get(0).isSchema() == false)){
|
||||
|
||||
centerUpper.removeAll();
|
||||
|
||||
centerUpper.addText(data.get(0).getName());
|
||||
|
||||
centerUpper.layout(true);
|
||||
|
||||
}
|
||||
|
||||
// System.out
|
||||
// .println("GxtBorderLayoutPanel: Event finished");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "Event finished");
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
eventBus.addHandler(SubmitQueryEvent.TYPE,
|
||||
new SubmitQueryEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onSubmitQuery(SubmitQueryEvent submitQueryEvent) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
try {
|
||||
submitQuery();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void submitQuery() throws Exception {
|
||||
|
||||
// System.out.println("Start RPC - submitQuery");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "Start RPC - submitQuery");
|
||||
|
||||
// recover input data
|
||||
|
||||
LinkedHashMap<String, String> dataDB = treePanel
|
||||
.getInfoOnSelectedItem();
|
||||
|
||||
final SubmitQueryData dataQuery = toolbar.getSubmitQueryData();
|
||||
|
||||
// RPCservice.submitQuery(dataDB, dataQuery.getQuery(),
|
||||
// dataQuery.getReadOnlyQuery(), dataQuery.getSmartCorrection(),
|
||||
// dataQuery.getLanguage(), new AsyncCallback<List<Result>>() {
|
||||
|
||||
// force the "true" value for the readonly input.
|
||||
|
||||
// determine the language
|
||||
List<FileModel> data = treePanel.getTreePanel().getSelectionModel()
|
||||
.getSelectedItems();
|
||||
FileModel selectedItem = data.get(0);
|
||||
|
||||
String dialect;
|
||||
|
||||
if (selectedItem.isDatabase()) { // the selected item is a database
|
||||
|
||||
// System.out.println("the selected item is a database");
|
||||
rootLogger.log(Level.INFO, "the selected item is a database");
|
||||
|
||||
// determine the dialect recovering the dialect
|
||||
dialect = selectedItem.getDBInfo().get(2).getValue();
|
||||
|
||||
rootLogger.log(Level.INFO, "determined Dialect for smart correction: " + dialect);
|
||||
|
||||
} else {
|
||||
FileModel parent1 = treePanel.getTreeStore()
|
||||
.getParent(selectedItem);
|
||||
|
||||
if (parent1.isDatabase()) { // the selected item is a schema
|
||||
|
||||
// System.out.println("the selected item is a schema");
|
||||
|
||||
rootLogger.log(Level.INFO, "the selected item is a schema");
|
||||
|
||||
// determine the dialect recovering the dialect
|
||||
dialect = parent1.getDBInfo().get(2).getValue();
|
||||
|
||||
rootLogger.log(Level.INFO, "determined Dialect for smart correction: " + dialect);
|
||||
|
||||
}
|
||||
|
||||
else { // the selected item is a table
|
||||
|
||||
// System.out.println("the selected item is a table");
|
||||
|
||||
rootLogger.log(Level.INFO, "the selected item is a table");
|
||||
|
||||
FileModel parent2 = treePanel.getTreeStore().getParent(parent1);
|
||||
|
||||
// determine the dialect recovering the dialect
|
||||
dialect = parent2.getDBInfo().get(2).getValue();
|
||||
|
||||
rootLogger.log(Level.INFO, "determined Dialect for smart correction: " + dialect);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String language = ConstantsPortlet.NONE;
|
||||
|
||||
if (dialect.toUpperCase().contains(ConstantsPortlet.POSTGRES)) {
|
||||
|
||||
language = ConstantsPortlet.POSTGRES;
|
||||
}
|
||||
|
||||
if (dialect.toUpperCase().contains(ConstantsPortlet.MYSQL)) {
|
||||
|
||||
language = ConstantsPortlet.MYSQL;
|
||||
}
|
||||
|
||||
rootLogger.log(Level.INFO, "Dialect used for smart correction: " + language);
|
||||
|
||||
RPCservice.submitQuery(dataDB, dataQuery.getQuery(), true,
|
||||
dataQuery.getSmartCorrection(), language,
|
||||
new AsyncCallback<List<Result>>() {
|
||||
|
||||
// // TO REMOVE data "true" and "POSTGRES"
|
||||
// RPCservice.submitQuery(dataDB, dataQuery.getQuery(),
|
||||
// true,
|
||||
// dataQuery.getSmartCorrection(), "POSTGRES",
|
||||
// new AsyncCallback<List<Result>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
// Window.alert(caught.getMessage());
|
||||
|
||||
// System.out.println("FAILURE submitQuery");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "FAILURE RPC submitQuery");
|
||||
|
||||
Listener<MessageBoxEvent> l = new Listener<MessageBoxEvent>() {
|
||||
public void handleEvent(MessageBoxEvent ce) {
|
||||
// Button btn = ce.getButtonClicked();
|
||||
// Info.display("MessageBox", "The '{0}' button was pressed", btn.getHtml());
|
||||
|
||||
// Button btn = ce.getButtonClicked();
|
||||
|
||||
Dialog form = toolbar.getDialogForm();
|
||||
|
||||
if (form.isMasked())
|
||||
form.unmask();
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// MessageBox.alert("Error "," <br/>Cause:"+caught.getCause()+"<br/>Message:"+caught.getMessage(), l);
|
||||
MessageBox.alert("Error ","<br/>Message:"+caught.getMessage(), l);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<Result> result) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// System.out.println("SUCCESS submitQuery");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SUCCESS RPC submitQuery");
|
||||
|
||||
rows = new ArrayList<Row>();
|
||||
|
||||
|
||||
// System.out.println("result size: " + result.size());
|
||||
|
||||
rootLogger.log(Level.SEVERE, "output size: " + result.size());
|
||||
|
||||
// recover query
|
||||
// Result query = result.remove(0);
|
||||
|
||||
|
||||
// recover converted query
|
||||
Result convertedQuery;
|
||||
|
||||
if (dataQuery.getSmartCorrection() == true) {
|
||||
|
||||
result.remove(0);
|
||||
// convertedQuery = result.get(1);
|
||||
|
||||
}
|
||||
|
||||
// get the attributes list for the result table
|
||||
getListAttributes(result.get(0).getValue());
|
||||
|
||||
// remove the header in order to parse only the result
|
||||
result.remove(0);
|
||||
|
||||
//parse the result in order to obtain a table
|
||||
parseResult(result);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// start the parsing of the submit result in order to obtain a table
|
||||
private void parseResult(List<Result> result) {
|
||||
|
||||
RPCservice.parseCVSString(result, listAttributes,
|
||||
new AsyncCallback<List<Row>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
Window.alert(caught.getMessage());
|
||||
// System.out.println("FAILURE StartParse");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "FAILURE RPC parseResult");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<Row> rows) {
|
||||
|
||||
// System.out.println("Success StartParse");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SUCCESS RPC parseResult");
|
||||
|
||||
if (rows != null) {
|
||||
|
||||
Dialog form = toolbar.getDialogForm();
|
||||
|
||||
if (form.isMasked())
|
||||
form.unmask();
|
||||
|
||||
|
||||
form.hide();
|
||||
|
||||
|
||||
|
||||
// Display the submit query result as a table
|
||||
Dialog submitResult = new Dialog();
|
||||
submitResult.setLayout(new FitLayout());
|
||||
submitResult.setHeading("Result");
|
||||
|
||||
submitResult.setResizable(false);
|
||||
// submitResult.setHeading("Submit Query");
|
||||
// submitResult.setWidth(290);
|
||||
// submitResult.setHeight(250);
|
||||
|
||||
submitResult.setModal(true);
|
||||
submitResult.setBlinkModal(true);
|
||||
|
||||
// submitResult.setBodyStyle("padding:9px;");
|
||||
submitResult.setSize(600, 400);
|
||||
// submitResult.setScrollMode(Scroll.AUTO);
|
||||
submitResult.setScrollMode(Scroll.NONE);
|
||||
submitResult.setHideOnButtonClick(true);
|
||||
|
||||
submitResult.setMaximizable(true);
|
||||
// submitResult.addText("Result Table");
|
||||
|
||||
ListStore<Row> store = new ListStore<Row>();
|
||||
store.add(rows);
|
||||
|
||||
Grid<Row> grid;
|
||||
|
||||
grid = new Grid<Row>(store, createColumnModel());
|
||||
|
||||
// grid.setAutoExpandColumn("value");
|
||||
grid.setBorders(true);
|
||||
|
||||
// grid.setAutoWidth(true);
|
||||
|
||||
RowData data = new RowData(.5, 1);
|
||||
data.setMargins(new Margins(6));
|
||||
|
||||
submitResult.add(grid, data);
|
||||
|
||||
submitResult.show();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// private void updateListRow(Row row){
|
||||
//
|
||||
//
|
||||
//
|
||||
// rows.add(row);
|
||||
//
|
||||
// System.out.println("CHECK size2: " + rows.size());
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
// private void returnParsedeList(List<String> result) {
|
||||
//
|
||||
// parsedList = new ArrayList<String>();
|
||||
// for (String s : result) {
|
||||
//
|
||||
// System.out.println("value: " + result);
|
||||
// parsedList.add(s);
|
||||
// }
|
||||
//
|
||||
// System.out.println("size row1: " + result.size());
|
||||
//
|
||||
// }
|
||||
|
||||
private void getListAttributes(String value) {
|
||||
|
||||
// recover attribute fields fo the result table
|
||||
String headers = value;
|
||||
|
||||
// System.out.println("headers: " + headers);
|
||||
|
||||
rootLogger.log(Level.INFO, "Headers fields table: " + headers);
|
||||
|
||||
listAttributes = parseAttributesTableResult(headers);
|
||||
|
||||
|
||||
|
||||
// System.out.println("attributes number: " + listAttributes.size());
|
||||
|
||||
rootLogger.log(Level.INFO, "attributes number: " + listAttributes.size());
|
||||
|
||||
rootLogger.log(Level.INFO, "attributes list: ");
|
||||
|
||||
for (int i = 0; i < listAttributes.size(); i++) {
|
||||
|
||||
// System.out.println(listAttributes.get(i));
|
||||
|
||||
rootLogger.log(Level.INFO, "attribute: " + listAttributes.get(i));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private ColumnModel createColumnModel() {
|
||||
|
||||
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
|
||||
ColumnConfig column;
|
||||
|
||||
column = new ColumnConfig();
|
||||
|
||||
column.setId("index");
|
||||
column.setHeader("Index");
|
||||
column.setWidth(100);
|
||||
column.setSortable(false);
|
||||
|
||||
configs.add(column);
|
||||
|
||||
for (int i = 0; i < listAttributes.size(); i++) {
|
||||
|
||||
// System.out.println("attribute: " + listAttributes.get(i));
|
||||
rootLogger.log(Level.INFO, "attribute: " + listAttributes.get(i));
|
||||
column = new ColumnConfig();
|
||||
column.setId(listAttributes.get(i));
|
||||
// column.setId("\"" + fields.get(i) + "\"");
|
||||
column.setHeader(listAttributes.get(i));
|
||||
column.setWidth(100);
|
||||
column.setSortable(false);
|
||||
|
||||
configs.add(column);
|
||||
|
||||
}
|
||||
|
||||
return new ColumnModel(configs);
|
||||
}
|
||||
|
||||
// private String[] parseAttributesTableResult(String value) {
|
||||
//
|
||||
// System.out.println("parsing attributes table");
|
||||
//
|
||||
// String todelete = "[,]";
|
||||
//
|
||||
// value = value.replaceAll(todelete, " ");
|
||||
// value = value.replaceAll("[ ]+", " ");
|
||||
//
|
||||
// String[] tokens = value.split("[ ]");
|
||||
// return tokens;
|
||||
//
|
||||
// }
|
||||
|
||||
private List<String> parseAttributesTableResult(String phrase) {
|
||||
|
||||
String delimiter = ",";
|
||||
List<String> elements = new ArrayList<String>();
|
||||
int idxdelim = -1;
|
||||
phrase = phrase.trim();
|
||||
|
||||
while ((idxdelim = phrase.indexOf(delimiter)) >= 0) {
|
||||
|
||||
elements.add(phrase.substring(0, idxdelim));
|
||||
phrase = phrase.substring(idxdelim + 1).trim();
|
||||
|
||||
}
|
||||
|
||||
elements.add(phrase);
|
||||
return elements;
|
||||
|
||||
}
|
||||
|
||||
private ColumnModel createColumnModelForDBInfo(List<Result> result) {
|
||||
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
|
||||
|
||||
ColumnConfig column = new ColumnConfig();
|
||||
column.setId("index");
|
||||
column.setHeader("Property");
|
||||
column.setWidth(100);
|
||||
column.setSortable(false);
|
||||
|
||||
configs.add(column);
|
||||
|
||||
column = new ColumnConfig();
|
||||
column.setId("value");
|
||||
column.setHeader("Value");
|
||||
column.setWidth(600);
|
||||
|
||||
column.setSortable(false);
|
||||
|
||||
configs.add(column);
|
||||
|
||||
ListStore<Result> store = new ListStore<Result>();
|
||||
store.add(result);
|
||||
|
||||
return new ColumnModel(configs);
|
||||
}
|
||||
|
||||
private void displayDBInfo(FileModel element) {
|
||||
|
||||
// System.out.println("GxtBorderLayout->displaying info");
|
||||
|
||||
rootLogger.log(Level.INFO, "displaying info");
|
||||
|
||||
// LinkedHashMap<String, FileModel> data = element.getDBInfo();
|
||||
|
||||
List<Result> dataDB = element.getDBInfo();
|
||||
|
||||
// System.out.println("GxtBorderLayout->size info: " + dataDB.size());
|
||||
|
||||
rootLogger.log(Level.INFO, "info size: " + dataDB.size());
|
||||
|
||||
ListStore<Result> store = new ListStore<Result>();
|
||||
store.add(dataDB);
|
||||
|
||||
Grid<Result> grid = new Grid<Result>(store,
|
||||
createColumnModelForDBInfo(dataDB));
|
||||
|
||||
// grid.setAutoExpandColumn("name");
|
||||
grid.setBorders(true);
|
||||
|
||||
// grid.setAutoWidth(true);
|
||||
|
||||
RowData data = new RowData(.5, 1);
|
||||
data.setMargins(new Margins(6));
|
||||
|
||||
centerUpper.removeAll();
|
||||
|
||||
centerUpper.add(grid, data);
|
||||
centerUpper.layout(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,838 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.panels;
|
||||
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.GWTdbManagerServiceAsync;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.FileModel;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.SelectedItemEvent;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.GWTdbManagerServiceAsync;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.FileModel;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Result;
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.SelectedItemEvent;
|
||||
|
||||
import com.extjs.gxt.ui.client.Style.SelectionMode;
|
||||
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
||||
import com.extjs.gxt.ui.client.event.EventType;
|
||||
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
||||
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
||||
import com.extjs.gxt.ui.client.event.TreePanelEvent;
|
||||
import com.extjs.gxt.ui.client.store.TreeStore;
|
||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FlowData;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
|
||||
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
public class GxtTreePanel extends LayoutContainer {
|
||||
|
||||
private TreeStore<FileModel> store;
|
||||
private TreePanel<FileModel> treePanel;
|
||||
|
||||
private HandlerManager eventBus = null;
|
||||
|
||||
private String value = "";
|
||||
private int treeDepthSelectedItem;
|
||||
private boolean SelectedItemIsSchema = false;
|
||||
private GWTdbManagerServiceAsync RPCservice = null;
|
||||
|
||||
private LinkedHashMap<String, FileModel> dataDBInfo = null;
|
||||
|
||||
private String ResourceNameSelected;
|
||||
private String DatabaseNameSelected;
|
||||
private String SchemaNameSelected;
|
||||
private String TableNameSelected;
|
||||
|
||||
private LinkedHashMap<String, String> infoOnSelectedItem;
|
||||
|
||||
private static Logger rootLogger = Logger.getLogger("GxtTreePanel");
|
||||
|
||||
public GxtTreePanel(HandlerManager eBus, GWTdbManagerServiceAsync service)
|
||||
throws Exception {
|
||||
|
||||
RPCservice = service;
|
||||
|
||||
eventBus = eBus;
|
||||
|
||||
store = new TreeStore<FileModel>();
|
||||
|
||||
this.initLayout();
|
||||
|
||||
}
|
||||
|
||||
private void initLayout() throws Exception {
|
||||
|
||||
setLayout(new FlowLayout(10));
|
||||
|
||||
treePanel = new TreePanel<FileModel>(store) {
|
||||
|
||||
@Override
|
||||
public boolean hasChildren(FileModel parent) {
|
||||
if (parent.isExpanded() == true) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void onComponentEvent(ComponentEvent ce) {
|
||||
super.onComponentEvent(ce);
|
||||
|
||||
TreePanelEvent<FileModel> tpe = (TreePanelEvent) ce;
|
||||
EventType typeEvent = tpe.getType();
|
||||
|
||||
int type = ce.getEventTypeInt();
|
||||
switch (type) {
|
||||
case Event.ONCLICK:
|
||||
onRightClick(tpe);
|
||||
break;
|
||||
// case Event.ONDBLCLICK:
|
||||
// onDoubleClick(tpe);
|
||||
// break;
|
||||
// case Event.ONSCROLL:
|
||||
// onScroll(tpe);
|
||||
// break;
|
||||
// case Event.ONFOCUS:
|
||||
// onFocus(ce);
|
||||
// break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
treePanel.setDisplayProperty("name");
|
||||
|
||||
// load the root
|
||||
loadRootItemTree();
|
||||
|
||||
// Single selection Mode
|
||||
treePanel.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
|
||||
|
||||
// select root item
|
||||
treePanel.getSelectionModel().select(store.getRootItems().get(0), true);
|
||||
|
||||
// expand level 1
|
||||
treePanel.setExpanded(store.getRootItems().get(0), true);
|
||||
|
||||
add(treePanel, new FlowData(10));
|
||||
|
||||
addListeners();
|
||||
|
||||
}
|
||||
|
||||
// private void createLayout() {
|
||||
//
|
||||
// // Folder model = getTreeModel();
|
||||
//
|
||||
// }
|
||||
|
||||
private void addListeners() {
|
||||
|
||||
treePanel.getSelectionModel().addSelectionChangedListener(
|
||||
new SelectionChangedListener<FileModel>() {
|
||||
|
||||
@Override
|
||||
public void selectionChanged(
|
||||
SelectionChangedEvent<FileModel> se) {
|
||||
|
||||
// System.out.println("SelectionChangedListener");
|
||||
|
||||
dataDBInfo = null;
|
||||
|
||||
ResourceNameSelected = null;
|
||||
DatabaseNameSelected = null;
|
||||
SchemaNameSelected = null;
|
||||
TableNameSelected = null;
|
||||
|
||||
infoOnSelectedItem = null;
|
||||
|
||||
SelectedItemIsSchema = false;
|
||||
|
||||
// the selected element
|
||||
List<FileModel> data = treePanel.getSelectionModel()
|
||||
.getSelectedItems();
|
||||
|
||||
treePanel.setExpanded(data.get(0), true); // expand
|
||||
// level of
|
||||
// the
|
||||
// element
|
||||
// selected
|
||||
|
||||
value = data.get(0).get("name");
|
||||
|
||||
// System.out.println("GxtTreePanel Value: "
|
||||
// + data.get(0).get("name"));
|
||||
|
||||
rootLogger.log(Level.INFO, "GxtTreePanel-> selectedItem value: " + value);
|
||||
|
||||
// System.out.println("GxtTreePanel Depth: "
|
||||
// + store.getDepth(data.get(0)));
|
||||
|
||||
treeDepthSelectedItem = store.getDepth(data.get(0));
|
||||
|
||||
// rootLogger.log(Level.INFO, "GxtTreePanel-> selectedItem level depth: " + treeDepthSelectedItem);
|
||||
|
||||
rootLogger.log(Level.INFO, "selectedItem level depth: " + treeDepthSelectedItem);
|
||||
|
||||
int numChildrenFolder = store.getChildCount(data.get(0));
|
||||
|
||||
// recover the appropriate information whenever an
|
||||
// element is selected
|
||||
|
||||
setInfoOnSelectedItem(data.get(0));
|
||||
|
||||
if ((numChildrenFolder == 0)
|
||||
&& (data.get(0).isLoaded() != true)) {
|
||||
treePanel.mask("Loading", "x-mask-loading");
|
||||
|
||||
switch (treeDepthSelectedItem) {
|
||||
// case 1:
|
||||
//
|
||||
// loadResources(data.get(0));
|
||||
// break;
|
||||
|
||||
case 2:
|
||||
loadDBInfo(data.get(0));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
loadSchema(data.get(0));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
loadTables(data.get(0));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// fire event
|
||||
eventBus.fireEvent(new SelectedItemEvent());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void loadRootItemTree() throws Exception {
|
||||
|
||||
// treePanel.mask("Loading", "x-mask-loading");
|
||||
|
||||
this.mask("Loading", "x-mask-loading");
|
||||
|
||||
|
||||
final FileModel root = new FileModel("Resources");
|
||||
store.insert(root, 0, true);
|
||||
|
||||
// store.add(root, true);
|
||||
|
||||
loadResources(root, this);
|
||||
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
public int getTreeDepthSelectedItem() {
|
||||
|
||||
return treeDepthSelectedItem;
|
||||
}
|
||||
|
||||
private void loadResources(final FileModel element, final GxtTreePanel tree) {
|
||||
|
||||
// System.out.println("Start RPC - getResources");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> Start RPC - getResource");
|
||||
rootLogger.log(Level.SEVERE, "Start RPC - getResource");
|
||||
|
||||
// call remote service
|
||||
|
||||
RPCservice.getResource(new AsyncCallback<List<FileModel>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
Window.alert(caught.getMessage());
|
||||
// System.out.println("FAILURE");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> FAILURE RPC getResource");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "FAILURE RPC getResource");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<FileModel> result) {
|
||||
|
||||
if (tree.isMasked())
|
||||
tree.unmask();
|
||||
|
||||
// if (treePanel.isMasked())
|
||||
// treePanel.unmask();
|
||||
|
||||
// System.out.println("SUCCESS");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> SUCCESS RPC getResource");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SUCCESS RPC getResource");
|
||||
|
||||
// print check
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
|
||||
// System.out.println(result.get(i).getName());
|
||||
|
||||
// rootLogger.log(Level.INFO, "GxtTreePanel-> Resource: " + result.get(i).getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "Resource: " + result.get(i).getName());
|
||||
|
||||
}
|
||||
|
||||
// int numChildrenFolder = store.getChildCount(element);
|
||||
|
||||
addChildren(element, result);
|
||||
|
||||
element.setIsLoaded(true);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// System.out.println("End RPC - getResources");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> End RPC - getResource");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "End RPC - getResource");
|
||||
}
|
||||
|
||||
private void loadDBInfo(final FileModel element) {
|
||||
|
||||
// System.out.println("Start RPC - getDBInfo");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> Start RPC - getDBInfo");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "Start RPC - getDBInfo");
|
||||
|
||||
|
||||
// call remote service
|
||||
|
||||
RPCservice.getDBInfo(element.getName(),
|
||||
new AsyncCallback<LinkedHashMap<String, FileModel>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
Window.alert(caught.getMessage());
|
||||
// System.out.println("FAILURE");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> FAILURE RPC getDBInfo");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "FAILURE RPC getDBInfo");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(
|
||||
LinkedHashMap<String, FileModel> result) {
|
||||
|
||||
if (treePanel.isMasked())
|
||||
treePanel.unmask();
|
||||
|
||||
// System.out.println("SUCCESS");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> SUCCESS RPC getDBInfo");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SUCCESS RPC getDBInfo");
|
||||
|
||||
if (result.size() != 0) {
|
||||
|
||||
// recover keys from the result
|
||||
|
||||
Set<String> keys = result.keySet();
|
||||
|
||||
Object[] array = keys.toArray();
|
||||
|
||||
// System.out.println("array size: " + array.length);
|
||||
|
||||
// recover information for each database
|
||||
|
||||
List<FileModel> children = new ArrayList<FileModel>();
|
||||
int numIterations = (result.size()) / 5;
|
||||
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
for (i = 0; i < numIterations; i++) {
|
||||
|
||||
// System.out.println("index i: " + i);
|
||||
|
||||
String DBName = null;
|
||||
List<Result> DBInfo = new ArrayList<Result>();
|
||||
|
||||
for (j = (i * 5); j < (i + 1) * 5; j++) {
|
||||
|
||||
// System.out.println("index j: " + j);
|
||||
|
||||
if (array[j].toString().contains(
|
||||
"Database Name")) {
|
||||
|
||||
// recover the database name
|
||||
DBName = result
|
||||
.get(array[j].toString())
|
||||
.getName();
|
||||
|
||||
Result row = new Result(
|
||||
"Database Name", result.get(
|
||||
array[j].toString())
|
||||
.getName());
|
||||
DBInfo.add(row);
|
||||
|
||||
}
|
||||
|
||||
if (array[j].toString().contains("URL")) {
|
||||
Result row = new Result("URL", result
|
||||
.get(array[j].toString())
|
||||
.getName());
|
||||
DBInfo.add(row);
|
||||
}
|
||||
|
||||
if (array[j].toString().contains(
|
||||
"Driver Name")) {
|
||||
|
||||
Result row = new Result("Driver Name",
|
||||
result.get(array[j].toString())
|
||||
.getName());
|
||||
DBInfo.add(row);
|
||||
|
||||
}
|
||||
|
||||
if (array[j].toString().contains(
|
||||
"Dialect Name")) {
|
||||
|
||||
Result row = new Result("Dialect Name",
|
||||
result.get(array[j].toString())
|
||||
.getName());
|
||||
DBInfo.add(row);
|
||||
|
||||
}
|
||||
|
||||
if (array[j].toString().contains(
|
||||
"Platform Name")) {
|
||||
|
||||
Result row = new Result(
|
||||
"Platform Name", result.get(
|
||||
array[j].toString())
|
||||
.getName());
|
||||
DBInfo.add(row);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FileModel child = new FileModel(DBName);
|
||||
|
||||
child.setIsDatabase(true);
|
||||
|
||||
child.setDBInfo(DBInfo);
|
||||
|
||||
children.add(child);
|
||||
|
||||
}
|
||||
|
||||
addChildren(element, children);
|
||||
|
||||
}
|
||||
|
||||
// System.out.println("children number: "
|
||||
// + store.getChildCount(element));
|
||||
|
||||
// rootLogger.log(Level.INFO, "GxtTreePanel-> children number: " + store.getChildCount(element));
|
||||
|
||||
rootLogger.log(Level.INFO, "children number: " + store.getChildCount(element));
|
||||
|
||||
element.setIsLoaded(true);
|
||||
|
||||
// // fire event
|
||||
// eventBus.fireEvent(new DisplayDBInfoEvent());
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// System.out.println("End RPC - getDBInfo");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> End RPC - getDBInfo");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "End RPC - getDBInfo");
|
||||
|
||||
}
|
||||
|
||||
private void loadSchema(final FileModel element) {
|
||||
|
||||
// System.out.println("Start RPC - getSchema");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> Start RPC - getDBSchema");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "Start RPC - getDBSchema");
|
||||
|
||||
// recover data inputs
|
||||
|
||||
LinkedHashMap<String, String> dataInput = new LinkedHashMap<String, String>();
|
||||
|
||||
FileModel parent = store.getParent(element);
|
||||
|
||||
dataInput.put("ResourceName", parent.getName());
|
||||
dataInput.put("DatabaseName", element.getName());
|
||||
|
||||
// call remote service
|
||||
|
||||
RPCservice.getDBSchema(dataInput, new AsyncCallback<List<FileModel>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Window.alert(caught.getMessage());
|
||||
// System.out.println("FAILURE");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> FAILURE RPC getDBSchema");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "FAILURE RPC getDBSchema");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<FileModel> result) {
|
||||
|
||||
if (treePanel.isMasked())
|
||||
treePanel.unmask();
|
||||
|
||||
// System.out.println("SUCCESS");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> SUCCESS RPC getDBSchema");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SUCCESS RPC getDBSchema");
|
||||
|
||||
|
||||
if (result.size() == 0) { // the database has not schema
|
||||
|
||||
loadTables(element);
|
||||
|
||||
} else {
|
||||
|
||||
// // print check
|
||||
// for (int i = 0; i < result.size(); i++) {
|
||||
// System.out.println(result.get(i).getName());
|
||||
//
|
||||
// }
|
||||
|
||||
// int numChildrenFolder = store.getChildCount(element);
|
||||
|
||||
// if (numChildrenFolder == 0) {
|
||||
|
||||
addChildren(element, result);
|
||||
|
||||
element.setIsLoaded(true);
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// System.out.println("End RPC - getSchema");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> End RPC - getDBSchema");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "End RPC - getDBSchema");
|
||||
|
||||
}
|
||||
|
||||
private void loadTables(final FileModel element) {
|
||||
|
||||
// System.out.println("Start RPC - getTables");
|
||||
|
||||
// rootLogger.log(Level.SEVERE, "GxtTreePanel-> Start RPC - getTables");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "Start RPC - getTables");
|
||||
|
||||
// recover data inputs
|
||||
|
||||
LinkedHashMap<String, String> dataInput = new LinkedHashMap<String, String>();
|
||||
|
||||
FileModel parent = store.getParent(element);
|
||||
FileModel parent1 = store.getParent(parent);
|
||||
|
||||
dataInput.put("ResourceName", parent1.getName());
|
||||
dataInput.put("DatabaseName", parent.getName());
|
||||
dataInput.put("SchemaName", element.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + parent1.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + parent.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + element.getName());
|
||||
|
||||
// System.out.println(parent1.getName());
|
||||
// System.out.println(parent.getName());
|
||||
// System.out.println(element.getName());
|
||||
|
||||
// call remote service
|
||||
|
||||
RPCservice.getTables(dataInput, new AsyncCallback<List<FileModel>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Window.alert(caught.getMessage());
|
||||
// System.out.println("FAILURE");
|
||||
rootLogger.log(Level.SEVERE, "FAILURE RPC getTables");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<FileModel> result) {
|
||||
|
||||
if (treePanel.isMasked())
|
||||
treePanel.unmask();
|
||||
|
||||
// System.out.println("SUCCESS");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SUCCESS RPC getTables");
|
||||
|
||||
if (result.size() == 0) { // the database has not tables
|
||||
|
||||
// System.out.println("the database has not tables");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "the database has not tables");
|
||||
|
||||
// loadTables(element);
|
||||
element.setIsExpanded(false);
|
||||
|
||||
treePanel.setExpanded(element, false);
|
||||
|
||||
} else {
|
||||
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
|
||||
result.get(i).setIsExpanded(false);
|
||||
result.get(i).setIsLoaded(true);
|
||||
|
||||
// System.out.println(result.get(i).getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "table: " + result.get(i).getName());
|
||||
|
||||
}
|
||||
|
||||
// int numChildrenFolder = store.getChildCount(element);
|
||||
|
||||
// if (numChildrenFolder == 0) {
|
||||
|
||||
addChildren(element, result);
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
element.setIsLoaded(true);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// System.out.println("End RPC - getTables");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "End RPC getTables");
|
||||
|
||||
}
|
||||
|
||||
public boolean getSelectedItemIsSchema() {
|
||||
|
||||
return SelectedItemIsSchema;
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, FileModel> getDataOnDB() {
|
||||
return dataDBInfo;
|
||||
}
|
||||
|
||||
// public FileModel getSelectedItem(){
|
||||
//
|
||||
//
|
||||
// return treePanel.getSelectionModel().getSelectedItem();
|
||||
//
|
||||
// }
|
||||
|
||||
private void addChildren(FileModel parent, List<FileModel> children) {
|
||||
|
||||
if (parent != null) {
|
||||
|
||||
store.add(parent, children, true);
|
||||
|
||||
// System.out.println("Added children in store");
|
||||
|
||||
rootLogger.log(Level.INFO, "Added children in store");
|
||||
}
|
||||
}
|
||||
|
||||
public String getResourceNameSelected() {
|
||||
|
||||
return ResourceNameSelected;
|
||||
|
||||
}
|
||||
|
||||
public String getDatabaseNameSelected() {
|
||||
|
||||
return DatabaseNameSelected;
|
||||
|
||||
}
|
||||
|
||||
public String getSchemaNameSelected() {
|
||||
|
||||
return SchemaNameSelected;
|
||||
|
||||
}
|
||||
|
||||
public String getTableNameSelected() {
|
||||
|
||||
return TableNameSelected;
|
||||
|
||||
}
|
||||
|
||||
private void setInfoOnSelectedItem(FileModel element) {
|
||||
|
||||
infoOnSelectedItem = new LinkedHashMap<String, String>();
|
||||
|
||||
if ((treeDepthSelectedItem == 4) && (element.isSchema() == true)) { // the
|
||||
// selected
|
||||
// element
|
||||
// is
|
||||
// a
|
||||
// schema
|
||||
|
||||
// System.out.println("is a schema");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "setInfo for selected item schema");
|
||||
|
||||
SelectedItemIsSchema = true;
|
||||
|
||||
// //recover schema name
|
||||
// SchemaNameSelected = element.getName();
|
||||
|
||||
// recover database name
|
||||
FileModel database = store.getParent(element);
|
||||
|
||||
DatabaseNameSelected = database.getName();
|
||||
|
||||
// recover resource name
|
||||
FileModel resource = store.getParent(database);
|
||||
ResourceNameSelected = resource.getName();
|
||||
|
||||
infoOnSelectedItem.put("ResourceName", ResourceNameSelected);
|
||||
infoOnSelectedItem.put("DatabaseName", DatabaseNameSelected);
|
||||
|
||||
}
|
||||
|
||||
else if ((treeDepthSelectedItem == 4) && (element.isSchema() == false)) { // the
|
||||
// selected
|
||||
// element
|
||||
// is
|
||||
// a
|
||||
// table
|
||||
// because
|
||||
// the
|
||||
// database
|
||||
// is
|
||||
// mysql
|
||||
// type
|
||||
|
||||
// System.out.println("is a table");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "setInfo for selected item table");
|
||||
|
||||
// recover table name
|
||||
TableNameSelected = element.getName();
|
||||
|
||||
// recover database name
|
||||
FileModel database = store.getParent(element);
|
||||
|
||||
DatabaseNameSelected = database.getName();
|
||||
|
||||
// recover resource name
|
||||
FileModel resource = store.getParent(database);
|
||||
ResourceNameSelected = resource.getName();
|
||||
|
||||
infoOnSelectedItem.put("ResourceName", ResourceNameSelected);
|
||||
infoOnSelectedItem.put("DatabaseName", DatabaseNameSelected);
|
||||
infoOnSelectedItem.put("TableName", TableNameSelected);
|
||||
|
||||
} else if (treeDepthSelectedItem == 5) { // the selected item is a table
|
||||
// so the database is
|
||||
// postgres type
|
||||
|
||||
// System.out.println("is a table");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "setInfo for selected item table");
|
||||
|
||||
// recover table name
|
||||
TableNameSelected = element.getName();
|
||||
|
||||
// recover schema name
|
||||
FileModel schema = store.getParent(element);
|
||||
SchemaNameSelected = schema.getName();
|
||||
|
||||
// recover database name
|
||||
FileModel database = store.getParent(schema);
|
||||
|
||||
DatabaseNameSelected = database.getName();
|
||||
|
||||
// recover resource name
|
||||
FileModel resource = store.getParent(database);
|
||||
ResourceNameSelected = resource.getName();
|
||||
|
||||
infoOnSelectedItem.put("ResourceName", ResourceNameSelected);
|
||||
infoOnSelectedItem.put("DatabaseName", DatabaseNameSelected);
|
||||
infoOnSelectedItem.put("SchemaName", SchemaNameSelected);
|
||||
infoOnSelectedItem.put("TableName", TableNameSelected);
|
||||
|
||||
} else if (treeDepthSelectedItem == 3) { // the selected item is a
|
||||
// database
|
||||
|
||||
// System.out.println("is a database");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "setInfo for selected item database");
|
||||
|
||||
// recover database name
|
||||
DatabaseNameSelected = element.getName();
|
||||
|
||||
// recover resource name
|
||||
FileModel resource = store.getParent(element);
|
||||
ResourceNameSelected = resource.getName();
|
||||
|
||||
infoOnSelectedItem.put("ResourceName", ResourceNameSelected);
|
||||
infoOnSelectedItem.put("DatabaseName", DatabaseNameSelected);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, String> getInfoOnSelectedItem() {
|
||||
|
||||
return infoOnSelectedItem;
|
||||
}
|
||||
|
||||
public TreePanel<FileModel> getTreePanel() {
|
||||
return this.treePanel;
|
||||
}
|
||||
|
||||
public TreeStore<FileModel> getTreeStore() {
|
||||
return this.store;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,413 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.toolbar;
|
||||
|
||||
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.GWTdbManagerServiceAsync;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.SubmitQueryData;
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.SubmitQueryEvent;
|
||||
import org.gcube.portlets.user.databasesmanager.client.form.GxtFormSubmitQuery;
|
||||
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.GWTdbManagerServiceAsync;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.SubmitQueryData;
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.SubmitQueryEvent;
|
||||
//import org.gcube.portlets.user.dbmanager.client.form.GxtFormSubmitQuery;
|
||||
//import org.gcube.portlets.user.dbmanager.client.utils.ConstantsPortlet;
|
||||
|
||||
import com.extjs.gxt.ui.client.Style.ButtonArrowAlign;
|
||||
import com.extjs.gxt.ui.client.Style.ButtonScale;
|
||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
||||
import com.extjs.gxt.ui.client.event.SelectionListener;
|
||||
import com.extjs.gxt.ui.client.widget.Dialog;
|
||||
import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||
import com.extjs.gxt.ui.client.widget.button.Button;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
||||
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
|
||||
|
||||
public class GxtToolbarFunctionality {
|
||||
|
||||
private HandlerManager eventBus = null;
|
||||
|
||||
private Button btnSubmitQuery;
|
||||
// private Button btnGetInfo;
|
||||
private Button btnShowCreateTable;
|
||||
private Button btnSimpleSample;
|
||||
private Button btnSmartSample;
|
||||
private Button btnRandomSample;
|
||||
|
||||
private SubmitQueryData data;
|
||||
|
||||
private ToolBar toolBar;
|
||||
|
||||
// the dialog that contains the form
|
||||
private Dialog dialog = new Dialog();
|
||||
|
||||
// RPC service
|
||||
private GWTdbManagerServiceAsync RPCservice = null;
|
||||
|
||||
private static Logger rootLogger = Logger
|
||||
.getLogger("GxtToolbarFunctionality");
|
||||
|
||||
public GxtToolbarFunctionality(HandlerManager eBus,
|
||||
GWTdbManagerServiceAsync service) {
|
||||
|
||||
eventBus = eBus;
|
||||
RPCservice = service;
|
||||
|
||||
toolBar = new ToolBar();
|
||||
initToolBar();
|
||||
addSelectionListenersOnToolBar();
|
||||
|
||||
}
|
||||
|
||||
private void initToolBar() {
|
||||
|
||||
// setLayout(new FlowLayout(10));
|
||||
|
||||
// Button for Submit Query
|
||||
btnSubmitQuery = new Button(ConstantsPortlet.SUBMITQUERY);
|
||||
// btnSubmitQuery.setIcon(Resources.ICONS.text());
|
||||
btnSubmitQuery.setScale(ButtonScale.SMALL);
|
||||
btnSubmitQuery.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
toolBar.add(btnSubmitQuery);
|
||||
|
||||
// // Button to get information about a database
|
||||
// btnGetInfo = new Button(ConstantsPortlet.GETINFO);
|
||||
// btnGetInfo.setScale(ButtonScale.SMALL);
|
||||
// btnGetInfo.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
// toolBar.add(btnGetInfo);
|
||||
|
||||
// Button to get the "show create table"
|
||||
btnShowCreateTable = new Button(ConstantsPortlet.SHOWCREATETABLE);
|
||||
btnShowCreateTable.setScale(ButtonScale.SMALL);
|
||||
btnShowCreateTable.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
toolBar.add(btnShowCreateTable);
|
||||
|
||||
toolBar.add(new SeparatorToolItem());
|
||||
|
||||
// Button for Simple Sample
|
||||
btnSimpleSample = new Button(ConstantsPortlet.SAMPLING);
|
||||
btnSimpleSample.setScale(ButtonScale.SMALL);
|
||||
btnSimpleSample.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
|
||||
toolBar.add(btnSimpleSample);
|
||||
|
||||
// Button for Smart Sample
|
||||
btnSmartSample = new Button(ConstantsPortlet.SMARTSAMPLING);
|
||||
btnSmartSample.setScale(ButtonScale.SMALL);
|
||||
btnSmartSample.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
|
||||
toolBar.add(btnSmartSample);
|
||||
|
||||
// button fro Random Sample
|
||||
btnRandomSample = new Button(ConstantsPortlet.RANDOMSAMPLING);
|
||||
btnRandomSample.setScale(ButtonScale.SMALL);
|
||||
btnRandomSample.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
|
||||
toolBar.add(btnRandomSample);
|
||||
|
||||
// add(toolBar, new FlowData(10));
|
||||
|
||||
btnSubmitQuery.disable();
|
||||
// btnGetInfo.disable();
|
||||
btnShowCreateTable.disable();
|
||||
btnSimpleSample.disable();
|
||||
btnSmartSample.disable();
|
||||
btnRandomSample.disable();
|
||||
|
||||
}
|
||||
|
||||
private void addSelectionListenersOnToolBar() {
|
||||
|
||||
btnSubmitQuery
|
||||
.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
|
||||
data = null;
|
||||
|
||||
// dialog to insert inputs in order to submit a query
|
||||
|
||||
// final Dialog dialog = new Dialog();
|
||||
dialog.setLayout(new FitLayout());
|
||||
|
||||
dialog.setModal(true);
|
||||
dialog.setBlinkModal(true);
|
||||
|
||||
dialog.setButtons(Dialog.OKCANCEL);
|
||||
|
||||
// dialog.setPlain(true);
|
||||
// dialog.setCollapsible(false);
|
||||
dialog.setResizable(false);
|
||||
dialog.setHeading("Submit Query");
|
||||
dialog.setWidth(290);
|
||||
dialog.setHeight(250);
|
||||
|
||||
final GxtFormSubmitQuery form = new GxtFormSubmitQuery();
|
||||
|
||||
dialog.add(form);
|
||||
dialog.show();
|
||||
|
||||
dialog.getButtonById(Dialog.OK).addSelectionListener(
|
||||
new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
|
||||
// System.out.println("button OK event");
|
||||
|
||||
dialog.mask("Loading", "x-mask-loading");
|
||||
|
||||
// dialog.hide();
|
||||
|
||||
// recover info from dialog
|
||||
setInfoOnSubmitQuery(form);
|
||||
|
||||
// System.out
|
||||
// .println("GxtToolbarFunctionality-> query submitted");
|
||||
|
||||
rootLogger.log(Level.SEVERE,
|
||||
"query submitted");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
dialog.getButtonById(Dialog.CANCEL)
|
||||
.addSelectionListener(
|
||||
new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(
|
||||
ButtonEvent ce) {
|
||||
|
||||
// System.out
|
||||
// .println("button Cancel event");
|
||||
|
||||
rootLogger.log(Level.INFO,
|
||||
"button Cancel event");
|
||||
|
||||
dialog.hide();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
btnSimpleSample
|
||||
.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// TODO: insert the result of the sample operation
|
||||
|
||||
// TODO: manage the exception case (returned from
|
||||
// algorithm "Simple Sample") with an alert
|
||||
|
||||
// System.out.println("simple sample event");
|
||||
|
||||
Dialog d = new Dialog();
|
||||
d.setHeading("Simple Sample");
|
||||
|
||||
// d.setBodyStyle("fontWeight:bold;padding:13px;");
|
||||
|
||||
d.setBodyStyle("padding:9px;");
|
||||
d.setSize(600, 400);
|
||||
d.setScrollMode(Scroll.AUTO);
|
||||
d.setHideOnButtonClick(true);
|
||||
d.setModal(true);
|
||||
d.setMaximizable(true);
|
||||
d.addText("Result Table 1");
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnSmartSample
|
||||
.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// TODO: insert the result of the sample operation
|
||||
|
||||
// TODO: manage the exception case (returned from
|
||||
// algorithm "Smart Sample") with an alert
|
||||
|
||||
// System.out.println("simple sample event");
|
||||
|
||||
Dialog d = new Dialog();
|
||||
d.setHeading("Smart Sample");
|
||||
|
||||
// d.setBodyStyle("fontWeight:bold;padding:13px;");
|
||||
|
||||
d.setBodyStyle("padding:9px;");
|
||||
d.setSize(600, 400);
|
||||
d.setScrollMode(Scroll.AUTO);
|
||||
d.setHideOnButtonClick(true);
|
||||
d.setModal(true);
|
||||
d.setMaximizable(true);
|
||||
d.addText("Result Table 2");
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnRandomSample
|
||||
.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// TODO: insert the result of the sample operation
|
||||
|
||||
// TODO: manage the exception case (returned from
|
||||
// algorithm "Random Sample") with an alert
|
||||
|
||||
// System.out.println("simple sample event");
|
||||
|
||||
Dialog d = new Dialog();
|
||||
d.setHeading("Random Sample");
|
||||
|
||||
// d.setBodyStyle("fontWeight:bold;padding:13px;");
|
||||
|
||||
d.setBodyStyle("padding:9px;");
|
||||
d.setSize(600, 400);
|
||||
d.setScrollMode(Scroll.AUTO);
|
||||
d.setHideOnButtonClick(true);
|
||||
d.setModal(true);
|
||||
d.setMaximizable(true);
|
||||
d.addText("Result Table 3");
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void disableButtonOnToolbar(int infoTreeDepthSelectedItem,
|
||||
boolean infoSelectedItemIsSchema) {
|
||||
|
||||
// System.out.println("GxtToolbarFunctionality-> depth: "
|
||||
// + infoTreeDepthSelectedItem);
|
||||
|
||||
rootLogger.log(Level.INFO, "selectedItem depth: "
|
||||
+ infoTreeDepthSelectedItem);
|
||||
|
||||
switch (infoTreeDepthSelectedItem) {
|
||||
|
||||
case 1:
|
||||
btnSubmitQuery.disable();
|
||||
// btnGetInfo.disable();
|
||||
btnShowCreateTable.disable();
|
||||
btnSimpleSample.disable();
|
||||
btnSmartSample.disable();
|
||||
btnRandomSample.disable();
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
btnSubmitQuery.disable();
|
||||
// btnGetInfo.enable();
|
||||
btnShowCreateTable.disable();
|
||||
btnSimpleSample.disable();
|
||||
btnSmartSample.disable();
|
||||
btnRandomSample.disable();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
||||
btnSubmitQuery.enable();
|
||||
// btnGetInfo.disable();
|
||||
btnShowCreateTable.disable();
|
||||
btnSimpleSample.disable();
|
||||
btnSmartSample.disable();
|
||||
btnRandomSample.disable();
|
||||
|
||||
break;
|
||||
|
||||
case 4: // check to verify that this level refers to schema or table
|
||||
// and
|
||||
// manage it differently
|
||||
if (infoSelectedItemIsSchema == true) {
|
||||
// this tree level is a schema
|
||||
|
||||
btnSubmitQuery.enable();
|
||||
// btnShowCreateTable.enable();
|
||||
btnShowCreateTable.disable();
|
||||
btnSimpleSample.disable();
|
||||
btnSmartSample.disable();
|
||||
btnRandomSample.disable();
|
||||
|
||||
} else {
|
||||
// this tree level is a table
|
||||
btnSubmitQuery.enable();
|
||||
btnShowCreateTable.enable();
|
||||
btnSimpleSample.enable();
|
||||
btnSmartSample.enable();
|
||||
btnRandomSample.enable();
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5: // if there is the schema this level refers to table
|
||||
|
||||
btnSubmitQuery.enable();
|
||||
btnShowCreateTable.enable();
|
||||
btnSimpleSample.enable();
|
||||
btnSmartSample.enable();
|
||||
btnRandomSample.enable();
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ToolBar getToolBar() {
|
||||
return this.toolBar;
|
||||
|
||||
}
|
||||
|
||||
private void setInfoOnSubmitQuery(GxtFormSubmitQuery form) {
|
||||
|
||||
data = form.getSubmitQueryData();
|
||||
|
||||
String query = data.getQuery();
|
||||
|
||||
if ((query == null) || (query.equals(""))) {
|
||||
MessageBox.alert("Warning", "Query field null", null);
|
||||
|
||||
} else {
|
||||
|
||||
eventBus.fireEvent(new SubmitQueryEvent());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public SubmitQueryData getSubmitQueryData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public Dialog getDialogForm() {
|
||||
|
||||
return dialog;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package org.gcube.portlets.user.databasesmanager.client.utils;
|
||||
|
||||
public class ConstantsPortlet {
|
||||
|
||||
// Div Gwt
|
||||
public static final String CONTENTDIV = "contentDiv";
|
||||
|
||||
|
||||
//Toolbar button
|
||||
public static final String SUBMITQUERY = "Submit Query";
|
||||
public static final String GETINFO = "Get Info";
|
||||
public static final String SHOWCREATETABLE = "Show Create Table";
|
||||
// public static final String SIMPLESAMPLE = "Simple Sample";
|
||||
// public static final String SMARTSAMPLE = "Smart Sample";
|
||||
// public static final String RANDOMSAMPLE = "Random Sample";
|
||||
public static final String SAMPLING = "Sampling";
|
||||
public static final String SMARTSAMPLING = "Smart Sampling";
|
||||
public static final String RANDOMSAMPLING = "Random Sampling";
|
||||
|
||||
//sql Dialects
|
||||
public static final String POSTGRES = "POSTGRES";
|
||||
public static final String MYSQL = "MYSQL";
|
||||
public static final String NONE = "NONE";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package org.gcube.portlets.user.databasesmanager.portlet;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.portlet.GenericPortlet;
|
||||
import javax.portlet.PortletException;
|
||||
import javax.portlet.PortletRequestDispatcher;
|
||||
import javax.portlet.RenderRequest;
|
||||
import javax.portlet.RenderResponse;
|
||||
|
||||
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||
|
||||
public class DatabasesManager extends GenericPortlet {
|
||||
|
||||
// protected GCUBELog logger = new GCUBELog(StatisticalManager.class);
|
||||
|
||||
|
||||
/**
|
||||
* JSP folder name
|
||||
*/
|
||||
public static final String JSP_FOLDER = "/WEB-INF/jsp/";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static final String VIEW_JSP = JSP_FOLDER + "DatabasesManager_view.jsp";
|
||||
|
||||
/**
|
||||
* @param request .0
|
||||
* @param response .
|
||||
* @throws IOException .
|
||||
* @throws PortletException .
|
||||
*/
|
||||
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
|
||||
|
||||
// logger.trace("StatisticalManager loading from JSP: "+VIEW_JSP);
|
||||
|
||||
// logger.trace("setting context using ScopeHelper");
|
||||
ScopeHelper.setContext(request);
|
||||
|
||||
// logger.trace("passing to the render");
|
||||
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(VIEW_JSP);
|
||||
rd.include(request,response);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,958 @@
|
|||
package org.gcube.portlets.user.databasesmanager.server;
|
||||
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLStreamHandler;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.regexp.RE;
|
||||
import org.apache.regexp.RESyntaxException;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.contentmanager.storageclient.model.protocol.smp.SMPURLConnection;
|
||||
import org.gcube.data.analysis.statisticalmanager.proxies.StatisticalManagerDSL;
|
||||
import org.gcube.data.analysis.statisticalmanager.proxies.StatisticalManagerFactory;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMAlgorithm;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMComputationConfig;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMComputationRequest;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMGroupedAlgorithms;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMListGroupedAlgorithms;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMOperationStatus;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMParameter;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMParameters;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMResourceType;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.SMTypeParameter;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMAbstractResource;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMComputation;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMEntries;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMFile;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMInputEntry;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMObject;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMOperationInfo;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMResource;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.SMTable;
|
||||
import org.gcube.data.analysis.statisticalmanager.stubs.types.schema.StatisticalServiceType;
|
||||
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes;
|
||||
import org.gcube.portlets.user.databasesmanager.client.GWTdbManagerService;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.FileModel;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Parameter;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Row;
|
||||
import org.gcube.portlets.user.databasesmanager.server.util.SessionUtil;
|
||||
//import org.gcube.portlets.user.dbmanager.client.GWTdbManagerService;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.FileModel;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Parameter;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Result;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Row;
|
||||
//import org.gcube.portlets.user.dbmanager.server.util.SessionUtil;
|
||||
|
||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
|
||||
public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
||||
GWTdbManagerService {
|
||||
|
||||
private LinkedHashMap<String, String> outputMap;
|
||||
private LinkedHashMap<String, String> outputKey;
|
||||
|
||||
private static Logger rootLogger = Logger
|
||||
.getLogger("GWTdbManagerServiceImpl");
|
||||
|
||||
public GWTdbManagerServiceImpl() {
|
||||
|
||||
}
|
||||
|
||||
public List<FileModel> getResource() throws Exception {
|
||||
|
||||
List<Parameter> inputParameters = new ArrayList<Parameter>();
|
||||
// List<String> outputParameters = new ArrayList<String>();
|
||||
|
||||
List<FileModel> outputParameters = new ArrayList<FileModel>();
|
||||
// Parameter data = new Parameter();
|
||||
|
||||
// get list of algorithms
|
||||
|
||||
List<String> algorithms = new ArrayList<String>();
|
||||
|
||||
algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// get algorithmId
|
||||
|
||||
String algorithmId = null;
|
||||
|
||||
for (int i = 0; i < algorithms.size(); i++) {
|
||||
|
||||
if (algorithms.get(i).equals("LISTDBNAMES")) {
|
||||
|
||||
algorithmId = algorithms.get(i);
|
||||
|
||||
// System.out.println("algorithmId: " + algorithmId);
|
||||
|
||||
rootLogger.log(Level.SEVERE, "algorithmId: " + algorithmId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// get input parameters of the algorithm
|
||||
|
||||
inputParameters = getParameters(algorithmId);
|
||||
|
||||
// System.out.println("getting input parameters");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "getting input parameters");
|
||||
|
||||
for (int i = 0; i < inputParameters.size(); i++) {
|
||||
|
||||
// System.out.println(inputParameters.get(i).getName());
|
||||
|
||||
rootLogger.log(Level.INFO, inputParameters.get(i).getName());
|
||||
|
||||
}
|
||||
|
||||
String computationId = startComputation(algorithmId, inputParameters);
|
||||
|
||||
// retrieve data
|
||||
|
||||
// System.out.println("output data retrieved");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "output data retrieved");
|
||||
|
||||
for (int i = 0; i < outputMap.size(); i++) {
|
||||
|
||||
// outputParameters.add(outputMap.get(String.valueOf(i)));
|
||||
|
||||
FileModel obj = new FileModel(outputMap.get(String.valueOf(i)));
|
||||
|
||||
// obj.setIsLoaded(true);
|
||||
|
||||
outputParameters.add(obj);
|
||||
|
||||
}
|
||||
|
||||
return outputParameters;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinkedHashMap<String, FileModel> getDBInfo(String resourceName)
|
||||
throws Exception {
|
||||
|
||||
List<Parameter> inputParameters = new ArrayList<Parameter>();
|
||||
|
||||
// List<String> outputParameters = new ArrayList<String>();
|
||||
|
||||
// List<FileModel> outputParameters = new ArrayList<FileModel>();
|
||||
|
||||
LinkedHashMap<String, FileModel> outputParameters = new LinkedHashMap<String, FileModel>();
|
||||
|
||||
// get list of algorithms
|
||||
|
||||
List<String> algorithms = new ArrayList<String>();
|
||||
|
||||
algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// get algorithmId
|
||||
|
||||
String algorithmId = null;
|
||||
|
||||
for (int i = 0; i < algorithms.size(); i++) {
|
||||
|
||||
if (algorithms.get(i).equals("LISTDBINFO")) {
|
||||
|
||||
algorithmId = algorithms.get(i);
|
||||
|
||||
// System.out.println("algorithmId: " + algorithmId);
|
||||
|
||||
rootLogger.log(Level.SEVERE, "algorithmId: " + algorithmId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// get input parameters of the algorithm
|
||||
|
||||
rootLogger.log(Level.SEVERE, "getting input parameters");
|
||||
|
||||
inputParameters = getParameters(algorithmId);
|
||||
|
||||
for (int i = 0; i < inputParameters.size(); i++) {
|
||||
|
||||
// System.out.println(inputParameters.get(i).getName());
|
||||
|
||||
inputParameters.get(i).setValue(resourceName);
|
||||
|
||||
rootLogger.log(Level.INFO, inputParameters.get(i).getName());
|
||||
|
||||
}
|
||||
|
||||
String computationId = startComputation(algorithmId, inputParameters);
|
||||
|
||||
// retrieve data
|
||||
|
||||
// System.out.println("output data retrieved");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "output data retrieved");
|
||||
|
||||
for (int i = 0; i < outputMap.size(); i++) {
|
||||
|
||||
// outputParameters.add(outputKey.get(String.valueOf(i)) + " "
|
||||
// + outputMap.get(String.valueOf(i)));
|
||||
|
||||
FileModel obj = new FileModel(outputMap.get(String.valueOf(i)));
|
||||
|
||||
// obj.setIsLoaded(true);
|
||||
|
||||
// outputParameters.add(obj);
|
||||
|
||||
// System.out.println("value: " + outputMap.get(String.valueOf(i)));
|
||||
|
||||
// System.out.println("key: " + outputKey.get(String.valueOf(i)));
|
||||
|
||||
outputParameters.put(outputKey.get(String.valueOf(i)), obj);
|
||||
|
||||
}
|
||||
|
||||
return outputParameters;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FileModel> getDBSchema(LinkedHashMap<String, String> dataInput)
|
||||
throws Exception {
|
||||
|
||||
List<Parameter> inputParameters = new ArrayList<Parameter>();
|
||||
// List<String> outputParameters = new ArrayList<String>();
|
||||
|
||||
List<FileModel> outputParameters = new ArrayList<FileModel>();
|
||||
|
||||
// get list of algorithms
|
||||
|
||||
List<String> algorithms = new ArrayList<String>();
|
||||
|
||||
algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// get algorithmId
|
||||
|
||||
String algorithmId = null;
|
||||
|
||||
for (int i = 0; i < algorithms.size(); i++) {
|
||||
|
||||
if (algorithms.get(i).equals("LISTDBSCHEMA")) {
|
||||
|
||||
algorithmId = algorithms.get(i);
|
||||
|
||||
// System.out.println("algorithmId: " + algorithmId);
|
||||
|
||||
rootLogger.log(Level.SEVERE, "algorithmId: " + algorithmId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// get input parameters of the algorithm
|
||||
rootLogger.log(Level.SEVERE, "getting input parameters");
|
||||
|
||||
inputParameters = getParameters(algorithmId);
|
||||
|
||||
for (int i = 0; i < inputParameters.size(); i++) {
|
||||
|
||||
// System.out.println(inputParameters.get(i).getName());
|
||||
|
||||
rootLogger.log(Level.INFO, inputParameters.get(i).getName());
|
||||
|
||||
}
|
||||
|
||||
inputParameters.get(0).setValue(dataInput.get("ResourceName"));
|
||||
inputParameters.get(1).setValue(dataInput.get("DatabaseName"));
|
||||
|
||||
String computationId = startComputation(algorithmId, inputParameters);
|
||||
|
||||
// retrieve data
|
||||
|
||||
// System.out.println("output data retrieved");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "output data retrieved");
|
||||
|
||||
for (int i = 0; i < outputMap.size(); i++) {
|
||||
|
||||
// outputParameters.add(outputKey.get(String.valueOf(i)) + " "
|
||||
// + outputMap.get(String.valueOf(i)));
|
||||
|
||||
FileModel obj = new FileModel(outputMap.get(String.valueOf(i)));
|
||||
|
||||
obj.setIsSchema(true);
|
||||
|
||||
// obj.setIsLoaded(true);
|
||||
|
||||
outputParameters.add(obj);
|
||||
|
||||
}
|
||||
|
||||
return outputParameters;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FileModel> getTables(LinkedHashMap<String, String> dataInput)
|
||||
throws Exception {
|
||||
|
||||
List<Parameter> inputParameters = new ArrayList<Parameter>();
|
||||
|
||||
// List<String> outputParameters = new ArrayList<String>();
|
||||
|
||||
List<FileModel> outputParameters = new ArrayList<FileModel>();
|
||||
|
||||
// get list of algorithms
|
||||
|
||||
List<String> algorithms = new ArrayList<String>();
|
||||
|
||||
algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// get algorithmId
|
||||
|
||||
String algorithmId = null;
|
||||
|
||||
for (int i = 0; i < algorithms.size(); i++) {
|
||||
|
||||
if (algorithms.get(i).equals("LISTTABLES")) {
|
||||
|
||||
algorithmId = algorithms.get(i);
|
||||
|
||||
// System.out.println("algorithmId: " + algorithmId);
|
||||
|
||||
rootLogger.log(Level.SEVERE, "algorithmId: " + algorithmId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// get input parameters of the algorithm
|
||||
|
||||
rootLogger.log(Level.SEVERE, "getting input parameters");
|
||||
|
||||
inputParameters = getParameters(algorithmId);
|
||||
|
||||
for (int i = 0; i < inputParameters.size(); i++) {
|
||||
|
||||
// System.out.println(inputParameters.get(i).getName());
|
||||
|
||||
rootLogger.log(Level.INFO, inputParameters.get(i).getName());
|
||||
|
||||
}
|
||||
|
||||
inputParameters.get(0).setValue(dataInput.get("ResourceName"));
|
||||
inputParameters.get(1).setValue(dataInput.get("DatabaseName"));
|
||||
inputParameters.get(2).setValue(dataInput.get("SchemaName"));
|
||||
|
||||
// System.out.println("size outputMap pre computation: "
|
||||
// + outputMap.size());
|
||||
|
||||
String computationId = startComputation(algorithmId, inputParameters);
|
||||
|
||||
// retrieve data
|
||||
|
||||
// System.out.println("output data retrieved");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "output data retrieved");
|
||||
|
||||
System.out.println("size outputMap: " + outputMap.size());
|
||||
|
||||
for (int i = 0; i < outputMap.size(); i++) {
|
||||
|
||||
// outputParameters.add(outputKey.get(String.valueOf(i)) + " "
|
||||
// + outputMap.get(String.valueOf(i)));
|
||||
|
||||
FileModel obj = new FileModel(outputMap.get(String.valueOf(i)));
|
||||
|
||||
// obj.setIsLoaded(true);
|
||||
|
||||
// obj.setIsTable(true);
|
||||
|
||||
outputParameters.add(obj);
|
||||
|
||||
}
|
||||
|
||||
return outputParameters;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Result> submitQuery(LinkedHashMap<String, String> dataDB,
|
||||
String query, boolean valueReadOnlyQuery,
|
||||
boolean smartCorrectionQuery, String language) throws Exception {
|
||||
|
||||
// System.out.println("language detected: " + language);
|
||||
|
||||
rootLogger.log(Level.SEVERE, "language used for query conversion: "
|
||||
+ language);
|
||||
|
||||
List<Parameter> inputParameters = new ArrayList<Parameter>();
|
||||
// LinkedHashMap<String, String> output = new LinkedHashMap<String,
|
||||
// String>();
|
||||
|
||||
List<Result> output = new ArrayList<Result>();
|
||||
|
||||
// get list of algorithms
|
||||
|
||||
List<String> algorithms = new ArrayList<String>();
|
||||
|
||||
algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// get algorithmId
|
||||
|
||||
String algorithmId = null;
|
||||
|
||||
for (int i = 0; i < algorithms.size(); i++) {
|
||||
|
||||
if (algorithms.get(i).equals("SUBMITQUERY")) {
|
||||
|
||||
algorithmId = algorithms.get(i);
|
||||
|
||||
// System.out.println("algorithmId: " + algorithmId);
|
||||
|
||||
rootLogger.log(Level.SEVERE, "algorithmId: " + algorithmId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// get input parameters of the algorithm
|
||||
|
||||
rootLogger.log(Level.SEVERE, "getting input parameters");
|
||||
|
||||
inputParameters = getParameters(algorithmId);
|
||||
|
||||
// for (int i = 0; i < inputParameters.size(); i++) {
|
||||
//
|
||||
// System.out.println(inputParameters.get(i).getName());
|
||||
// System.out.println(inputParameters.get(i).getDefaultValue());
|
||||
//
|
||||
// }
|
||||
|
||||
for (int i = 0; i < inputParameters.size(); i++) {
|
||||
|
||||
// System.out.println(inputParameters.get(i).getName());
|
||||
// System.out.println(inputParameters.get(i).getDefaultValue());
|
||||
|
||||
rootLogger.log(Level.INFO, inputParameters.get(i).getName());
|
||||
|
||||
}
|
||||
|
||||
inputParameters.get(0).setValue(dataDB.get("ResourceName"));
|
||||
inputParameters.get(1).setValue(dataDB.get("DatabaseName"));
|
||||
|
||||
inputParameters.get(2).setValue(String.valueOf(valueReadOnlyQuery));
|
||||
inputParameters.get(3).setValue(String.valueOf(smartCorrectionQuery));
|
||||
|
||||
inputParameters.get(4).setValue(language);
|
||||
inputParameters.get(5).setValue(query);
|
||||
|
||||
// System.out.println("size outputMap pre computation: "
|
||||
// + outputMap.size());
|
||||
|
||||
String computationId = startComputation(algorithmId, inputParameters);
|
||||
|
||||
// retrieve data
|
||||
|
||||
// System.out.println("output data retrieved");
|
||||
|
||||
// System.out.println("size outputMap: " + outputMap.size());
|
||||
|
||||
rootLogger.log(Level.SEVERE, "output data retrieved");
|
||||
rootLogger.log(Level.SEVERE, "output data size: " + outputMap.size());
|
||||
|
||||
for (int i = 0; i < outputMap.size(); i++) {
|
||||
|
||||
Result row = new Result(outputKey.get(String.valueOf(i)),
|
||||
outputMap.get(String.valueOf(i)));
|
||||
|
||||
output.add(row);
|
||||
|
||||
// outputParameters.add(outputKey.get(String.valueOf(i)) + " "
|
||||
// + outputMap.get(String.valueOf(i)));
|
||||
|
||||
// FileModel obj = new FileModel(outputMap.get(String.valueOf(i)));
|
||||
// outputParameters.add(obj);
|
||||
|
||||
}
|
||||
|
||||
// for (int i = 0; i < outputMap.size(); i++) {
|
||||
//
|
||||
// // outputParameters.add(outputKey.get(String.valueOf(i)) + " "
|
||||
// // + outputMap.get(String.valueOf(i)));
|
||||
//
|
||||
// FileModel obj = new FileModel(outputMap.get(String.valueOf(i)));
|
||||
// outputParameters.add(obj);
|
||||
//
|
||||
// }
|
||||
|
||||
return output;
|
||||
|
||||
}
|
||||
|
||||
public List<Row> parseCVSString(List<Result> result, List<String> attrNames)
|
||||
throws Exception {
|
||||
|
||||
List<Row> rows = new ArrayList<Row>();
|
||||
|
||||
if (result != null) {
|
||||
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
|
||||
List<String> attrValues = parse(result.get(i).getValue());
|
||||
|
||||
Row element = new Row(attrNames, attrValues);
|
||||
|
||||
rows.add(element);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return rows;
|
||||
|
||||
// code worked
|
||||
|
||||
// List<String> values = parse(row);
|
||||
//
|
||||
// for (int i = 0; i < values.size(); i++) {
|
||||
//
|
||||
// System.out.println("vaalue: " + values.get(i));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// Row element = new Row(attributes, values);
|
||||
//
|
||||
// return element;
|
||||
|
||||
// List<Row> rowElements = new ArrayList<Row>();
|
||||
//
|
||||
// for (int i=0;i<result.size();i++){
|
||||
//
|
||||
// List<String> attributes = parse(result.get(i).getValue());
|
||||
//
|
||||
// Row element=new Row(attributes);
|
||||
//
|
||||
// rowElements.add(element);
|
||||
// }
|
||||
//
|
||||
// System.out.println("server rowElement size: " + rowElements.size());
|
||||
//
|
||||
// return rowElements;
|
||||
|
||||
}
|
||||
|
||||
private List<String> parse(String row) throws Exception {
|
||||
|
||||
String delimiter = ",";
|
||||
|
||||
// System.out.println("row: " + row);
|
||||
|
||||
List<String> elements = new ArrayList<String>();
|
||||
String phrase = row;
|
||||
int idxdelim = -1;
|
||||
boolean quot = false;
|
||||
phrase = phrase.trim();
|
||||
while ((idxdelim = phrase.indexOf(delimiter)) >= 0) {
|
||||
quot = phrase.startsWith("\"");
|
||||
if (quot) {
|
||||
phrase = phrase.substring(1);
|
||||
String quoted = "";
|
||||
if (phrase.startsWith("\""))
|
||||
phrase = phrase.substring(1);
|
||||
else {
|
||||
RE regexp = new RE("[^\\\\]\"");
|
||||
boolean matching = regexp.match(phrase);
|
||||
|
||||
if (matching) {
|
||||
int i0 = regexp.getParenStart(0);
|
||||
quoted = phrase.substring(0, i0 + 1).trim();
|
||||
phrase = phrase.substring(i0 + 2).trim();
|
||||
}
|
||||
}
|
||||
|
||||
if (phrase.startsWith(delimiter))
|
||||
phrase = phrase.substring(1);
|
||||
|
||||
elements.add(quoted);
|
||||
|
||||
} else {
|
||||
elements.add(phrase.substring(0, idxdelim));
|
||||
phrase = phrase.substring(idxdelim + 1).trim();
|
||||
}
|
||||
|
||||
// System.out.println("server token: " + phrase);
|
||||
}
|
||||
if (phrase.startsWith("\""))
|
||||
phrase = phrase.substring(1);
|
||||
|
||||
if (phrase.endsWith("\""))
|
||||
phrase = phrase.substring(0, phrase.length() - 1);
|
||||
|
||||
elements.add(phrase);
|
||||
|
||||
// System.out.println("size: " + elements.size());
|
||||
|
||||
return elements;
|
||||
|
||||
}
|
||||
|
||||
private List<String> getDatabaseManagerAlgorithms() throws Exception {
|
||||
|
||||
ArrayList<String> dbAlg = new ArrayList<String>();
|
||||
StatisticalManagerFactory factory = getFactory();
|
||||
|
||||
// get and print algorithms
|
||||
SMListGroupedAlgorithms groups = factory.getAlgorithms();
|
||||
|
||||
if (groups == null)
|
||||
// System.out.println("GROUPS OF ALGORITHMS IS NULL!");
|
||||
rootLogger.log(Level.SEVERE,"GROUPS OF ALGORITHMS IS NULL!");
|
||||
else
|
||||
// System.out.println("GROUPS OF ALGORITHMS IS NOT NULL!");
|
||||
rootLogger.log(Level.SEVERE, "GROUPS OF ALGORITHMS IS NOT NULL!");
|
||||
|
||||
// get list categories
|
||||
for (SMGroupedAlgorithms group : groups.thelist()) {
|
||||
|
||||
// if (group.category().equals("DATABASES")) {
|
||||
|
||||
for (SMAlgorithm algorithm : group.thelist()) {
|
||||
|
||||
// if (algorithm.name().equals("LISTDBINFO")) {
|
||||
|
||||
// System.out.println(algorithm.name());
|
||||
|
||||
dbAlg.add(algorithm.name());
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return dbAlg;
|
||||
|
||||
}
|
||||
|
||||
private List<Parameter> getParameters(String algorithmId) {
|
||||
|
||||
// System.out.println("algorithmId: " + algorithmId);
|
||||
|
||||
StatisticalManagerFactory factory = getFactory();
|
||||
SMParameters smParams = factory.getAlgorithmParameters(algorithmId);
|
||||
|
||||
List<Parameter> params = new ArrayList<Parameter>();
|
||||
|
||||
for (SMParameter smParam : smParams.list()) {
|
||||
SMTypeParameter smType = smParam.type();
|
||||
StatisticalServiceType smTypeName = smType.name();
|
||||
|
||||
String paramName = smParam.name();
|
||||
String paramDescription = smParam.description();
|
||||
String defaultValue = smParam.defaultValue();
|
||||
String objectType = smType.values().get(0);
|
||||
|
||||
// System.out.println("GWTdbManagerServiceImpl->parameters");
|
||||
|
||||
|
||||
//CHECK
|
||||
// rootLogger.log(Level.INFO, "parameters: ");
|
||||
|
||||
// rootLogger.log(Level.INFO, paramName);
|
||||
// rootLogger.log(Level.INFO, paramDescription);
|
||||
// rootLogger.log(Level.INFO, objectType);
|
||||
// rootLogger.log(Level.INFO, defaultValue);
|
||||
|
||||
|
||||
|
||||
// System.out.println(paramName);
|
||||
// System.out.println(paramDescription);
|
||||
// System.out.println(objectType);
|
||||
// System.out.println(defaultValue);
|
||||
|
||||
Parameter objectParam = new Parameter(paramName, paramDescription,
|
||||
objectType, defaultValue);
|
||||
|
||||
params.add(objectParam);
|
||||
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
private String startComputation(String algorithmName,
|
||||
List<Parameter> parameters) throws Exception {
|
||||
|
||||
SMComputationConfig config = new SMComputationConfig();
|
||||
|
||||
SMInputEntry[] list = new SMInputEntry[parameters.size()];
|
||||
int i = 0;
|
||||
|
||||
for (Parameter p : parameters)
|
||||
list[i++] = new SMInputEntry(p.getName(), p.getValue());
|
||||
config.parameters(new SMEntries(list));
|
||||
config.algorithm(algorithmName);
|
||||
|
||||
// create a computation request
|
||||
SMComputationRequest request = new SMComputationRequest();
|
||||
request.user(getUsername());
|
||||
request.config(config);
|
||||
|
||||
try {
|
||||
StatisticalManagerFactory factory = getFactory();
|
||||
|
||||
String computationId = factory.executeComputation(request);
|
||||
|
||||
float percentage = 0;
|
||||
String scope = getScope();
|
||||
String username = getUsername();
|
||||
|
||||
while (percentage < 100) {
|
||||
percentage = checkComputationStatus(scope, computationId,
|
||||
username);
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
return computationId;
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
// e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private float checkComputationStatus(String scope, String computationId,
|
||||
String user) throws Exception {
|
||||
|
||||
ScopeProvider.instance.set(scope);
|
||||
|
||||
StatisticalManagerFactory factory = StatisticalManagerDSL
|
||||
.createStateful().build();
|
||||
|
||||
SMComputation computation = factory.getComputation(computationId);
|
||||
|
||||
SMOperationStatus status = SMOperationStatus.values()[computation
|
||||
.operationStatus()];
|
||||
|
||||
// this.outputMap=null;
|
||||
|
||||
float percentage = 0;
|
||||
|
||||
if (status == SMOperationStatus.RUNNING) {
|
||||
|
||||
// System.out.println("GWTdbManagerServiceImpl->RUNNING");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "RUNNING");
|
||||
|
||||
SMOperationInfo infos = factory.getComputationInfo(computationId,
|
||||
user);
|
||||
// percentage = Float.parseFloat(infos.percentage());
|
||||
// System.out.println("GWTdbManagerServiceImpl->Percentage:" +
|
||||
// percentage);
|
||||
// computation = factory.getComputation(computationId);
|
||||
|
||||
status = SMOperationStatus.values()[computation.operationStatus()];
|
||||
} else if ((status == SMOperationStatus.COMPLETED)
|
||||
|| (status == SMOperationStatus.FAILED)) {
|
||||
|
||||
// System.out.println("GWTdbManagerServiceImpl->COMPLETED OR FAILED");
|
||||
rootLogger.log(Level.SEVERE, "COMPLETED OR FAILED");
|
||||
|
||||
SMAbstractResource abstractResource = computation
|
||||
.abstractResource();
|
||||
SMResource smResource = abstractResource.resource();
|
||||
int resourceTypeIndex = smResource.resourceType();
|
||||
SMResourceType smResType = SMResourceType.values()[resourceTypeIndex];
|
||||
|
||||
//TODO: ECXEPTION MANAGEMENT
|
||||
// if (SMResourceType.ERROR){
|
||||
//
|
||||
//
|
||||
// }
|
||||
//throws(smResource.description());
|
||||
displayOutput(smResource, smResType);
|
||||
|
||||
// System.out.println("GWTdbManagerServiceImpl-> SM resource Name: "
|
||||
// + smResource.name());
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SM resource Name: " + smResource.name());
|
||||
|
||||
// System.out.println("GWTdbManagerServiceImpl-> SM resource ID: "
|
||||
// + smResource.resourceId());
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SM resource ID: " + smResource.resourceId());
|
||||
|
||||
// System.out
|
||||
// .println("GWTdbManagerServiceImpl-> SM resource Description: "
|
||||
// + smResource.description());
|
||||
|
||||
rootLogger.log(Level.SEVERE, "SM resource Description: " + smResource.description());
|
||||
|
||||
|
||||
|
||||
percentage = 100;
|
||||
|
||||
}
|
||||
|
||||
return percentage;
|
||||
}
|
||||
|
||||
private void displayOutput(SMResource smResource, SMResourceType smResType)
|
||||
throws Exception {
|
||||
|
||||
// System.out.println("displayOutput");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "displayOutput");
|
||||
|
||||
outputMap = new LinkedHashMap<String, String>();
|
||||
|
||||
if (smResType.equals(SMResourceType.OBJECT)) {
|
||||
|
||||
// switch (smResType) {
|
||||
// case FILE:
|
||||
// SMFile fileRes = (SMFile) smResource;
|
||||
// System.out.println("Output is a file");
|
||||
// break;
|
||||
// case OBJECT:
|
||||
SMObject objRes = (SMObject) smResource;
|
||||
if (objRes.name().contentEquals(PrimitiveTypes.MAP.toString())) {
|
||||
// System.out.println("Output is a map");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "Output is a map");
|
||||
// Map<String, String> outputMap = getMap(objRes);
|
||||
this.outputMap = (LinkedHashMap<String, String>) getMap(objRes);
|
||||
} else if (objRes.name().contentEquals(
|
||||
PrimitiveTypes.IMAGES.toString())) {
|
||||
// System.out.println("Output are images");
|
||||
rootLogger.log(Level.SEVERE, "Output are images");
|
||||
} else
|
||||
// System.out.println("Output is other");
|
||||
rootLogger.log(Level.SEVERE, "Output is other");
|
||||
}
|
||||
|
||||
//EXCEPTION MANAGEMENT
|
||||
|
||||
if(smResType.equals(SMResourceType.ERROR)) {
|
||||
throw new Exception(smResource.description());
|
||||
|
||||
}
|
||||
// break;
|
||||
// case TABULAR:
|
||||
// SMTable tableRes = (SMTable) smResource;
|
||||
// System.out.println("Output is a table");
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
private Map<String, String> getMap(SMObject objRes) throws Exception {
|
||||
|
||||
// System.out.println("getMap");
|
||||
|
||||
rootLogger.log(Level.SEVERE, "getMap");
|
||||
|
||||
outputKey = new LinkedHashMap<String, String>();
|
||||
|
||||
InputStream is = getStorageClientInputStream(objRes.url());
|
||||
// object serializer
|
||||
XStream xstream = new XStream();
|
||||
xstream.alias(
|
||||
"org.gcube_system.namespaces.data.analysis.statisticalmanager.types.SMObject",
|
||||
SMObject.class);
|
||||
xstream.alias(
|
||||
"org.gcube_system.namespaces.data.analysis.statisticalmanager.types.SMFile",
|
||||
SMFile.class);
|
||||
xstream.alias(
|
||||
"org.gcube_system.namespaces.data.analysis.statisticalmanager.types.SMResource",
|
||||
SMResource.class);
|
||||
xstream.alias(
|
||||
"org.gcube_system.namespaces.data.analysis.statisticalmanager.types.SMTable",
|
||||
SMTable.class);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, SMResource> smMap = (Map<String, SMResource>) (xstream
|
||||
.fromXML(is));
|
||||
is.close();
|
||||
|
||||
LinkedHashMap<String, String> outputmap = new LinkedHashMap<String, String>();
|
||||
|
||||
int i = 0;
|
||||
for (String key : smMap.keySet()) {
|
||||
// add key value
|
||||
|
||||
outputKey.put(String.valueOf(i), key);
|
||||
|
||||
SMResource smres = smMap.get(key);
|
||||
int resourceTypeIndex = smres.resourceType();
|
||||
SMResourceType smsubResType = SMResourceType.values()[resourceTypeIndex];
|
||||
|
||||
// System.out.println("GWTdbManagerServiceImpl-> ResourceType:"
|
||||
// + smsubResType);
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceType: " + smsubResType);
|
||||
|
||||
if (smsubResType == SMResourceType.OBJECT) {
|
||||
SMObject obje = (SMObject) smres;
|
||||
String outstring = obje.url();
|
||||
|
||||
// System.out.println("key :" + key);
|
||||
|
||||
rootLogger.log(Level.INFO, "key: " + smsubResType);
|
||||
|
||||
// System.out.println("Object:"
|
||||
// + new String(outstring.getBytes(), "UTF-8"));
|
||||
|
||||
rootLogger.log(Level.INFO, "Object: " + new String(outstring.getBytes(), "UTF-8"));
|
||||
|
||||
// outputmap.put(key, outstring);
|
||||
|
||||
outputmap.put(String.valueOf(i), outstring);
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// System.out.println("Map retrieved with size: " + smMap.size());
|
||||
|
||||
rootLogger.log(Level.SEVERE, "Map retrieved with size: " + smMap.size());
|
||||
return outputmap;
|
||||
}
|
||||
|
||||
private InputStream getStorageClientInputStream(String url)
|
||||
throws Exception {
|
||||
URL u = new URL(null, url, new URLStreamHandler() {
|
||||
@Override
|
||||
protected URLConnection openConnection(URL u) throws IOException {
|
||||
return new SMPURLConnection(u);
|
||||
}
|
||||
});
|
||||
return u.openConnection().getInputStream();
|
||||
}
|
||||
|
||||
private StatisticalManagerFactory getFactory() {
|
||||
HttpSession httpSession = this.getThreadLocalRequest().getSession();
|
||||
return SessionUtil.getFactory(httpSession);
|
||||
}
|
||||
|
||||
private String getUsername() {
|
||||
HttpSession httpSession = this.getThreadLocalRequest().getSession();
|
||||
return SessionUtil.getUsername(httpSession);
|
||||
}
|
||||
|
||||
private String getScope() {
|
||||
HttpSession httpSession = this.getThreadLocalRequest().getSession();
|
||||
return SessionUtil.getScope(httpSession);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
//package org.gcube.portlets.user.databasesmanager.server;
|
||||
//
|
||||
//import org.gcube.portlets.user.databasesmanager.client.GreetingService;
|
||||
//import org.gcube.portlets.user.databasesmanager.shared.FieldVerifier;
|
||||
//import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
//
|
||||
///**
|
||||
// * The server side implementation of the RPC service.
|
||||
// */
|
||||
//@SuppressWarnings("serial")
|
||||
//public class GreetingServiceImpl extends RemoteServiceServlet implements
|
||||
// GreetingService {
|
||||
//
|
||||
// public String greetServer(String input) throws IllegalArgumentException {
|
||||
// // Verify that the input is valid.
|
||||
// if (!FieldVerifier.isValidName(input)) {
|
||||
// // If the input is not valid, throw an IllegalArgumentException back to
|
||||
// // the client.
|
||||
// throw new IllegalArgumentException(
|
||||
// "Name must be at least 4 characters long");
|
||||
// }
|
||||
//
|
||||
// String serverInfo = getServletContext().getServerInfo();
|
||||
// String userAgent = getThreadLocalRequest().getHeader("User-Agent");
|
||||
//
|
||||
// // Escape data from the client to avoid cross-site script vulnerabilities.
|
||||
// input = escapeHtml(input);
|
||||
// userAgent = escapeHtml(userAgent);
|
||||
//
|
||||
// return "Hello, " + input + "!<br><br>I am running " + serverInfo
|
||||
// + ".<br><br>It looks like you are using:<br>" + userAgent;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Escape an html string. Escaping data received from the client helps to
|
||||
// * prevent cross-site script vulnerabilities.
|
||||
// *
|
||||
// * @param html the html string to escape
|
||||
// * @return the escaped string
|
||||
// */
|
||||
// private String escapeHtml(String html) {
|
||||
// if (html == null) {
|
||||
// return null;
|
||||
// }
|
||||
// return html.replaceAll("&", "&").replaceAll("<", "<").replaceAll(
|
||||
// ">", ">");
|
||||
// }
|
||||
//}
|
|
@ -0,0 +1,110 @@
|
|||
package org.gcube.portlets.user.databasesmanager.server.util;
|
||||
|
||||
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.gcube.application.framework.core.session.ASLSession;
|
||||
import org.gcube.application.framework.core.session.SessionManager;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.data.analysis.statisticalmanager.proxies.StatisticalManagerDSL;
|
||||
import org.gcube.data.analysis.statisticalmanager.proxies.StatisticalManagerDataSpace;
|
||||
import org.gcube.data.analysis.statisticalmanager.proxies.StatisticalManagerFactory;
|
||||
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||
|
||||
/**
|
||||
* @author "Angela Italiano angela.italiano@isti.cnr.it"
|
||||
*
|
||||
*/
|
||||
public class SessionUtil {
|
||||
|
||||
protected static Logger logger = Logger.getLogger(SessionUtil.class);
|
||||
|
||||
|
||||
|
||||
public static ASLSession getSession(HttpSession httpSession) {
|
||||
String sessionID = httpSession.getId();
|
||||
String user = (String) httpSession
|
||||
.getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
|
||||
|
||||
if (user == null) {
|
||||
|
||||
user = "loredana.liccardo";
|
||||
httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, user);
|
||||
ScopeProvider.instance.set("/gcube/devsec/devVRE");
|
||||
ASLSession session = SessionManager.getInstance().getASLSession(
|
||||
sessionID, user);
|
||||
session.setScope("/gcube/devsec/devVRE");
|
||||
|
||||
return session;
|
||||
// return null;
|
||||
|
||||
} else
|
||||
{
|
||||
logger.trace("user found in session " + user);
|
||||
}
|
||||
ASLSession session = SessionManager.getInstance().getASLSession(
|
||||
sessionID, user);
|
||||
|
||||
return session;
|
||||
}
|
||||
|
||||
|
||||
public static StatisticalManagerFactory getFactory(HttpSession httpSession) {
|
||||
ASLSession session = getSession(httpSession);
|
||||
return getFactory(session);
|
||||
}
|
||||
|
||||
public static StatisticalManagerFactory getFactory(ASLSession session) {
|
||||
ScopeProvider.instance.set(session.getScope());
|
||||
|
||||
return getFactory(session.getScope());
|
||||
}
|
||||
|
||||
public static StatisticalManagerFactory getFactory(String scope) {
|
||||
ScopeProvider.instance.set(scope.toString());
|
||||
|
||||
|
||||
return StatisticalManagerDSL.createStateful()
|
||||
.withTimeout(5, TimeUnit.MINUTES).build(); // IS
|
||||
|
||||
}
|
||||
|
||||
public static StatisticalManagerDataSpace getDataSpaceService(
|
||||
HttpSession httpSession) {
|
||||
ASLSession session = getSession(httpSession);
|
||||
return getDataSpaceService(session);
|
||||
}
|
||||
|
||||
public static StatisticalManagerDataSpace getDataSpaceService(
|
||||
ASLSession session) {
|
||||
ScopeProvider.instance.set(getScope(session));
|
||||
|
||||
return StatisticalManagerDSL.dataSpace()
|
||||
.withTimeout(5, TimeUnit.MINUTES).build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String getUsername(HttpSession httpSession) {
|
||||
ASLSession session = getSession(httpSession);
|
||||
return getUsername(session);
|
||||
}
|
||||
|
||||
private static String getUsername(ASLSession session) {
|
||||
return session.getUsername();
|
||||
}
|
||||
|
||||
public static String getScope(HttpSession httpSession) {
|
||||
ASLSession session = getSession(httpSession);
|
||||
return getScope(session);
|
||||
}
|
||||
|
||||
private static String getScope(ASLSession session) {
|
||||
return session.getScope().toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.user.databasesmanager.shared;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* FieldVerifier validates that the name the user enters is valid.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is in the <code>shared</code> packing because we use it in both
|
||||
* the client code and on the server. On the client, we verify that the name is
|
||||
* valid before sending an RPC request so the user doesn't have to wait for a
|
||||
* network round trip to get feedback. On the server, we verify that the name is
|
||||
* correct to ensure that the input is correct regardless of where the RPC
|
||||
* originates.
|
||||
* </p>
|
||||
* <p>
|
||||
* When creating a class that is used on both the client and the server, be sure
|
||||
* that all code is translatable and does not use native JavaScript. Code that
|
||||
* is note translatable (such as code that interacts with a database or the file
|
||||
* system) cannot be compiled into client side JavaScript. Code that uses native
|
||||
* JavaScript (such as Widgets) cannot be run on the server.
|
||||
* </p>
|
||||
*/
|
||||
public class FieldVerifier {
|
||||
|
||||
/**
|
||||
* Verifies that the specified name is valid for our service.
|
||||
*
|
||||
* In this example, we only require that the name is at least four
|
||||
* characters. In your application, you can use more complex checks to ensure
|
||||
* that usernames, passwords, email addresses, URLs, and other fields have the
|
||||
* proper syntax.
|
||||
*
|
||||
* @param name the name to validate
|
||||
* @return true if valid, false if invalid
|
||||
*/
|
||||
public static boolean isValidName(String name) {
|
||||
if (name == null) {
|
||||
return false;
|
||||
}
|
||||
return name.length() > 3;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module rename-to='databasesmanager'>
|
||||
<!-- Inherit the core Web Toolkit stuff. -->
|
||||
<inherits name='com.google.gwt.user.User' />
|
||||
|
||||
<inherits name='com.extjs.gxt.ui.GXT' />
|
||||
|
||||
<!-- We need the JUnit module in the main module, -->
|
||||
<!-- otherwise eclipse complains (Google plugin bug?) -->
|
||||
<inherits name='com.google.gwt.junit.JUnit' />
|
||||
|
||||
<!-- Inherit the default GWT style sheet. You can change -->
|
||||
<!-- the theme of your GWT application by uncommenting -->
|
||||
<!-- any one of the following lines. -->
|
||||
<inherits name='com.google.gwt.user.theme.standard.Standard' />
|
||||
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
|
||||
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
|
||||
|
||||
<!-- Other module inherits -->
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
<entry-point class='org.gcube.portlets.user.databasesmanager.client.DatabasesManager' />
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path='client' />
|
||||
<source path='shared' />
|
||||
|
||||
</module>
|
|
@ -0,0 +1,2 @@
|
|||
sendButton = Send
|
||||
nameField = Enter your name
|
|
@ -0,0 +1,2 @@
|
|||
sendButton = Envoyer
|
||||
nameField = Entrez votre nom
|
|
@ -0,0 +1,34 @@
|
|||
/** Add css rules here for your application. */
|
||||
|
||||
|
||||
/** Example rules used by the template application (remove for your app) */
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
color: #777777;
|
||||
margin: 40px 0px 70px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sendButton {
|
||||
display: block;
|
||||
font-size: 16pt;
|
||||
}
|
||||
|
||||
/** Most GWT widgets already have a style name defined */
|
||||
.gwt-DialogBox {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.dialogVPanel {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.serverResponseLabelError {
|
||||
color: red;
|
||||
}
|
||||
|
||||
/** Set ids using widget.getElement().setId("idOfElement") */
|
||||
#closeButton {
|
||||
margin: 15px 6px 6px;
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
<!doctype html>
|
||||
<!-- The DOCTYPE declaration above will set the -->
|
||||
<!-- browser's rendering engine into -->
|
||||
<!-- "Standards Mode". Replacing this declaration -->
|
||||
<!-- with a "Quirks Mode" doctype may lead to some -->
|
||||
<!-- differences in layout. -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
<!-- -->
|
||||
<!-- Consider inlining CSS to reduce the number of requested files -->
|
||||
<!-- -->
|
||||
<!-- <link type="text/css" rel="stylesheet" href="DatabasesManager.css"> -->
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="resources/css/gxt-all.css">
|
||||
|
||||
<!-- -->
|
||||
<!-- Any title is fine -->
|
||||
<!-- -->
|
||||
<title>Database Management Web Application</title>
|
||||
|
||||
<!-- -->
|
||||
<!-- This script loads your compiled module. -->
|
||||
<!-- If you add any GWT meta tags, they must -->
|
||||
<!-- be added before this line. -->
|
||||
<!-- -->
|
||||
<script type="text/javascript" language="javascript"
|
||||
src="databasesmanager/databasesmanager.nocache.js"></script>
|
||||
</head>
|
||||
|
||||
<!-- -->
|
||||
<!-- The body can have arbitrary html, or -->
|
||||
<!-- you can leave the body empty if you want -->
|
||||
<!-- to create a completely dynamic UI. -->
|
||||
<!-- -->
|
||||
<body>
|
||||
|
||||
<!-- OPTIONAL: include this if you want history support -->
|
||||
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1'
|
||||
style="position: absolute; width: 0; height: 0; border: 0"></iframe>
|
||||
|
||||
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
|
||||
<noscript>
|
||||
<div
|
||||
style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
|
||||
Your web browser must have JavaScript enabled in order for this
|
||||
application to display correctly.</div>
|
||||
</noscript>
|
||||
|
||||
<div id="contentDiv"></div>
|
||||
|
||||
<!-- <h1>Web Application Starter Project</h1> -->
|
||||
|
||||
<!-- <table align="center"> -->
|
||||
<!-- <tr> -->
|
||||
<!-- <td colspan="2" style="font-weight: bold;">Please enter your -->
|
||||
<!-- name:</td> -->
|
||||
<!-- </tr> -->
|
||||
<!-- <tr> -->
|
||||
<!-- <td id="nameFieldContainer"></td> -->
|
||||
<!-- <td id="sendButtonContainer"></td> -->
|
||||
<!-- </tr> -->
|
||||
<!-- <tr> -->
|
||||
<!-- <td colspan="2" style="color: red;" id="errorLabelContainer"></td> -->
|
||||
<!-- </tr> -->
|
||||
<!-- </table> -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
|
||||
<!-- -->
|
||||
<!-- The module reference below is the link -->
|
||||
<!-- between html and your Web Toolkit module -->
|
||||
|
||||
<script src='<%=request.getContextPath()%>/databasesmanager/databasesmanager.nocache.js'></script>
|
||||
|
||||
<link rel="stylesheet" href="<%= request.getContextPath()%>/DatabasesManager.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%= request.getContextPath()%>/resources/css/gxt-all.css" type="text/css">
|
||||
|
||||
<div id="contentDiv"></div>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 5.2.0//EN" "http://www.liferay.com/dtd/liferay-display_5_2_0.dtd">
|
||||
|
||||
<display>
|
||||
<category name="gCube Applications">
|
||||
<portlet id="DatabasesManager" />
|
||||
</category>
|
||||
</display>
|
|
@ -0,0 +1,9 @@
|
|||
name=DatabasesManager
|
||||
module-group-id=liferay
|
||||
module-incremental-version=1
|
||||
tags=
|
||||
short-description=
|
||||
change-log=
|
||||
page-url=http://www.d4science.eu
|
||||
author=D4Science EU
|
||||
licenses=
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 5.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_5_2_0.dtd">
|
||||
|
||||
<liferay-portlet-app>
|
||||
<portlet>
|
||||
<portlet-name>DatabasesManager</portlet-name>
|
||||
<layout-cacheable>false</layout-cacheable>
|
||||
<instanceable>false</instanceable>
|
||||
<ajaxable>false</ajaxable>
|
||||
</portlet>
|
||||
</liferay-portlet-app>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<portlet-app xmlns='http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd' version='2.0'>
|
||||
<portlet>
|
||||
<description>DatabasesManager</description>
|
||||
<portlet-name>DatabasesManager</portlet-name>
|
||||
<display-name>DatabasesManager</display-name>
|
||||
<portlet-class>org.gcube.portlets.user.databasesmanager.portlet.DatabasesManager</portlet-class>
|
||||
<expiration-cache>0</expiration-cache>
|
||||
<supports>
|
||||
<mime-type>text/html</mime-type>
|
||||
<portlet-mode>VIEW</portlet-mode>
|
||||
</supports>
|
||||
<portlet-info>
|
||||
<title>DatabasesManager</title>
|
||||
<short-title>DatabasesManager</short-title>
|
||||
</portlet-info>
|
||||
</portlet>
|
||||
</portlet-app>
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE web-app
|
||||
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/dtd/web-app_2_3.dtd">
|
||||
|
||||
<web-app>
|
||||
|
||||
<!-- Servlets -->
|
||||
|
||||
<servlet>
|
||||
<servlet-name>dbmanagerservlet</servlet-name>
|
||||
<servlet-class>org.gcube.portlets.user.databasesmanager.server.GWTdbManagerServiceImpl</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>jUnitHostImpl</servlet-name>
|
||||
<servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<!-- <servlet> -->
|
||||
<!-- <servlet-name>jUnitHostImpl</servlet-name> -->
|
||||
<!-- <servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class> -->
|
||||
<!-- </servlet> -->
|
||||
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>dbmanagerservlet</servlet-name>
|
||||
<url-pattern>/databasesmanager/dbManagerService</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>jUnitHostImpl</servlet-name>
|
||||
<url-pattern>/org.gcube.portlets.user.databasesmanager.DatabasesManagerJUnit/junithost/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>jUnitHostImpl</servlet-name>
|
||||
<url-pattern>/databasesmanager/junithost/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- Default page to serve -->
|
||||
<welcome-file-list>
|
||||
<welcome-file>DatabasesManager.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
</web-app>
|
|
@ -0,0 +1,493 @@
|
|||
.x-panel {
|
||||
border-style: solid;
|
||||
border-color: #d0d0d0;
|
||||
}
|
||||
.x-panel-header {
|
||||
color:#333;
|
||||
border:1px solid #d0d0d0;
|
||||
background-image:url(../images/gray/panel/white-top-bottom.gif);
|
||||
}
|
||||
|
||||
.x-panel-body {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
.x-panel-bbar .x-toolbar {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
.x-panel-tbar .x-toolbar {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
.x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
.x-panel-body-noheader, .x-panel-mc .x-panel-body {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
.x-panel-tl .x-panel-header {
|
||||
color:#333;
|
||||
}
|
||||
.x-panel-tc {
|
||||
background-image:url(../images/gray/panel/top-bottom.gif);
|
||||
}
|
||||
.x-panel-tl {
|
||||
background-image:url(../images/gray/panel/corners-sprite.gif);
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
.x-panel-tr {
|
||||
background-image:url(../images/gray/panel/corners-sprite.gif);
|
||||
}
|
||||
.x-panel-bc {
|
||||
background-image:url(../images/gray/panel/top-bottom.gif);
|
||||
}
|
||||
.x-panel-bl {
|
||||
background-image:url(../images/gray/panel/corners-sprite.gif);
|
||||
}
|
||||
.x-panel-br {
|
||||
background-image:url(../images/gray/panel/corners-sprite.gif);
|
||||
}
|
||||
.x-panel-mc {
|
||||
background:#f1f1f1;
|
||||
}
|
||||
.x-panel-mc .x-panel-body {
|
||||
background:transparent;
|
||||
border: 0 none;
|
||||
}
|
||||
.x-panel-ml {
|
||||
background-image:url(../images/gray/panel/left-right.gif);
|
||||
}
|
||||
.x-panel-mr {
|
||||
background-image:url(../images/gray/panel/left-right.gif);
|
||||
}
|
||||
|
||||
/* Tools */
|
||||
.x-tool {
|
||||
background-image:url(../images/gray/panel/tool-sprites.gif);
|
||||
}
|
||||
|
||||
/* Ghosting */
|
||||
.x-panel-ghost {
|
||||
background:#e0e0e0;
|
||||
}
|
||||
|
||||
.x-panel-ghost ul {
|
||||
border-color:#b0b0b0;
|
||||
}
|
||||
|
||||
.x-grid-panel .x-panel-mc .x-panel-body {
|
||||
border:1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
|
||||
.x-btn-left{
|
||||
background-image:url(../images/gray/button/btn-sprite.gif);
|
||||
}
|
||||
.x-btn-right{
|
||||
background-image:url(../images/gray/button/btn-sprite.gif);
|
||||
}
|
||||
.x-btn-center{
|
||||
background-image:url(../images/gray/button/btn-sprite.gif);
|
||||
}
|
||||
|
||||
.x-btn-group-header {
|
||||
color: #333333;
|
||||
}
|
||||
.x-btn-group-tc {
|
||||
background-image: url(../images/gray/button/group-tb.gif);
|
||||
}
|
||||
.x-btn-group-tl {
|
||||
background-image: url(../images/gray/button/group-cs.gif);
|
||||
}
|
||||
.x-btn-group-tr {
|
||||
background-image: url(../images/gray/button/group-cs.gif);
|
||||
}
|
||||
.x-btn-group-bc {
|
||||
background-image: url(../images/gray/button/group-tb.gif);
|
||||
}
|
||||
.x-btn-group-bl {
|
||||
background-image: url(../images/gray/button/group-cs.gif);
|
||||
}
|
||||
.x-btn-group-br {
|
||||
background-image: url(../images/gray/button/group-cs.gif);
|
||||
}
|
||||
.x-btn-group-ml {
|
||||
background-image: url(../images/gray/button/group-lr.gif);
|
||||
}
|
||||
.x-btn-group-mr {
|
||||
background-image: url(../images/gray/button/group-lr.gif);
|
||||
}
|
||||
.x-btn-group-notitle .x-btn-group-tc {
|
||||
background-image: url(../images/gray/button/group-tb.gif);
|
||||
}
|
||||
|
||||
/* Layout classes */
|
||||
|
||||
.x-border-layout-ct {
|
||||
background:#f0f0f0;
|
||||
}
|
||||
|
||||
.x-accordion-hd {
|
||||
background-image:url(../images/gray/panel/light-hd.gif);
|
||||
}
|
||||
|
||||
.x-layout-collapsed{
|
||||
background-color:#eee;
|
||||
border-color:#e0e0e0;
|
||||
}
|
||||
.x-layout-collapsed-over{
|
||||
background-color:#fbfbfb;
|
||||
}
|
||||
|
||||
|
||||
/* qtips */
|
||||
.x-tip .x-tip-top {
|
||||
background-image:url(../images/gray/qtip/tip-sprite.gif);
|
||||
}
|
||||
.x-tip .x-tip-top-left {
|
||||
background-image:url(../images/gray/qtip/tip-sprite.gif);
|
||||
}
|
||||
.x-tip .x-tip-top-right {
|
||||
background-image:url(../images/gray/qtip/tip-sprite.gif);
|
||||
}
|
||||
.x-tip .x-tip-ft {
|
||||
background-image:url(../images/gray/qtip/tip-sprite.gif);
|
||||
}
|
||||
.x-tip .x-tip-ft-left {
|
||||
background-image:url(../images/gray/qtip/tip-sprite.gif);
|
||||
}
|
||||
.x-tip .x-tip-ft-right {
|
||||
background-image:url(../images/gray/qtip/tip-sprite.gif);
|
||||
}
|
||||
.x-tip .x-tip-bd-left {
|
||||
background-image:url(../images/gray/qtip/tip-sprite.gif);
|
||||
}
|
||||
.x-tip .x-tip-bd-right {
|
||||
background-image:url(../images/gray/qtip/tip-sprite.gif);
|
||||
}
|
||||
|
||||
/* Toolbars */
|
||||
|
||||
.x-toolbar{
|
||||
border-color:#d0d0d0;
|
||||
background:#f0f4f5 url(../images/gray/toolbar/bg.gif) repeat-x top left;
|
||||
}
|
||||
.x-toolbar button {
|
||||
color:#444;
|
||||
}
|
||||
.x-toolbar .x-btn-menu-arrow-wrap .x-btn-center button {
|
||||
background-image:url(../images/gray/toolbar/btn-arrow.gif);
|
||||
}
|
||||
.x-toolbar .x-btn-text-icon .x-btn-menu-arrow-wrap .x-btn-center button {
|
||||
background-image:url(../images/gray/toolbar/btn-arrow.gif);
|
||||
}
|
||||
.x-toolbar .x-btn-over .x-btn-left{
|
||||
background-image:url(../images/gray/toolbar/tb-btn-sprite.gif);
|
||||
}
|
||||
.x-toolbar .x-btn-over .x-btn-right{
|
||||
background-image:url(../images/gray/toolbar/tb-btn-sprite.gif);
|
||||
}
|
||||
.x-toolbar .x-btn-over .x-btn-center{
|
||||
background-image:url(../images/gray/toolbar/tb-btn-sprite.gif);
|
||||
}
|
||||
.x-toolbar .x-btn-over button {
|
||||
color:#111;
|
||||
}
|
||||
.x-toolbar .x-btn-click .x-btn-left, .x-toolbar .x-btn-pressed .x-btn-left, .x-toolbar .x-btn-menu-active .x-btn-left{
|
||||
background-image:url(../images/gray/toolbar/tb-btn-sprite.gif);
|
||||
}
|
||||
.x-toolbar .x-btn-click .x-btn-right, .x-toolbar .x-btn-pressed .x-btn-right, .x-toolbar .x-btn-menu-active .x-btn-right{
|
||||
background-image:url(../images/gray/toolbar/tb-btn-sprite.gif);
|
||||
}
|
||||
|
||||
.x-toolbar .x-btn-click .x-btn-center, .x-toolbar .x-btn-pressed .x-btn-center, .x-toolbar .x-btn-menu-active .x-btn-center{
|
||||
background-image:url(../images/gray/toolbar/tb-btn-sprite.gif);
|
||||
}
|
||||
.x-toolbar .xtb-sep {
|
||||
background-image: url(../images/gray/grid/grid-split.gif);
|
||||
}
|
||||
|
||||
/* Tabs */
|
||||
|
||||
.x-tab-panel-header, .x-tab-panel-footer {
|
||||
background: #EAEAEA;
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
|
||||
.x-tab-panel-header {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
.x-tab-panel-footer {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
ul.x-tab-strip-top{
|
||||
background:#dbdbdb url(../images/gray/tabs/tab-strip-bg.gif) repeat-x left top;
|
||||
border-color:#d0d0d0;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
ul.x-tab-strip-bottom{
|
||||
background-image:url(../images/gray/tabs/tab-strip-btm-bg.gif);
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
.x-tab-strip span.x-tab-strip-text {
|
||||
color:#333;
|
||||
}
|
||||
.x-tab-strip-over span.x-tab-strip-text {
|
||||
color:#111;
|
||||
}
|
||||
|
||||
.x-tab-strip-active span.x-tab-strip-text {
|
||||
color:#333;
|
||||
}
|
||||
|
||||
.x-tab-strip-disabled .x-tabs-text {
|
||||
color:#aaaaaa;
|
||||
}
|
||||
|
||||
.x-tab-strip-top .x-tab-right {
|
||||
background-image:url(../images/gray/tabs/tabs-sprite.gif);
|
||||
}
|
||||
|
||||
.x-tab-strip-top .x-tab-left {
|
||||
background-image:url(../images/gray/tabs/tabs-sprite.gif);
|
||||
}
|
||||
.x-tab-strip-top .x-tab-strip-inner {
|
||||
background-image:url(../images/gray/tabs/tabs-sprite.gif);
|
||||
}
|
||||
|
||||
.x-tab-strip-bottom .x-tab-right {
|
||||
background-image:url(../images/gray/tabs/tab-btm-inactive-right-bg.gif);
|
||||
}
|
||||
|
||||
.x-tab-strip-bottom .x-tab-left {
|
||||
background-image:url(../images/gray/tabs/tab-btm-inactive-left-bg.gif);
|
||||
}
|
||||
|
||||
.x-tab-strip-bottom .x-tab-strip-active .x-tab-right {
|
||||
background-image:url(../images/gray/tabs/tab-btm-right-bg.gif);
|
||||
}
|
||||
|
||||
.x-tab-strip-bottom .x-tab-strip-active .x-tab-left {
|
||||
background-image:url(../images/gray/tabs/tab-btm-left-bg.gif);
|
||||
}
|
||||
|
||||
.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close {
|
||||
background-image:url(../images/gray/tabs/tab-close.gif);
|
||||
}
|
||||
.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{
|
||||
background-image:url(../images/gray/tabs/tab-close.gif);
|
||||
}
|
||||
|
||||
.x-tab-panel-body {
|
||||
border-color:#d0d0d0;
|
||||
background:#fff;
|
||||
}
|
||||
.x-tab-panel-bbar .x-toolbar {
|
||||
border-color: #d0d0d0;
|
||||
}
|
||||
|
||||
.x-tab-panel-tbar .x-toolbar {
|
||||
border-color: #d0d0d0;
|
||||
}
|
||||
|
||||
.x-tab-panel-header-plain .x-tab-strip-spacer {
|
||||
border-color:#d0d0d0;
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.x-tab-scroller-left {
|
||||
background-image: url(../images/gray/tabs/scroll-left.gif);
|
||||
border-color:#aeaeae;
|
||||
}
|
||||
.x-tab-scroller-right {
|
||||
background-image: url(../images/gray/tabs/scroll-right.gif);
|
||||
border-color:#aeaeae;
|
||||
}
|
||||
|
||||
/* Window */
|
||||
|
||||
.x-window-proxy {
|
||||
background:#e0e0e0;
|
||||
border-color:#b0b0b0;
|
||||
}
|
||||
|
||||
.x-window-tl .x-window-header {
|
||||
color:#555;
|
||||
}
|
||||
.x-window-tc {
|
||||
background-image:url(../images/gray/window/top-bottom.png);
|
||||
}
|
||||
.x-window-tl {
|
||||
background-image:url(../images/gray/window/left-corners.png);
|
||||
}
|
||||
.x-window-tr {
|
||||
background-image:url(../images/gray/window/right-corners.png);
|
||||
}
|
||||
.x-window-bc {
|
||||
background-image:url(../images/gray/window/top-bottom.png);
|
||||
}
|
||||
.x-window-bl {
|
||||
background-image:url(../images/gray/window/left-corners.png);
|
||||
}
|
||||
.x-window-br {
|
||||
background-image:url(../images/gray/window/right-corners.png);
|
||||
}
|
||||
.x-window-mc {
|
||||
border:1px solid #d0d0d0;
|
||||
background:#e8e8e8;
|
||||
}
|
||||
.ext-ie .x-window-plain .x-window-mc {
|
||||
background-color: #e3e3e3;
|
||||
}
|
||||
|
||||
.x-window-ml {
|
||||
background-image:url(../images/gray/window/left-right.png);
|
||||
}
|
||||
.x-window-mr {
|
||||
background-image:url(../images/gray/window/left-right.png);
|
||||
}
|
||||
.x-panel-ghost .x-window-tl {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
.x-panel-collapsed .x-window-tl {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
.x-window-plain .x-window-mc {
|
||||
background: #e8e8e8;
|
||||
border-right:1px solid #eee;
|
||||
border-bottom:1px solid #eee;
|
||||
border-top:1px solid #d0d0d0;
|
||||
border-left:1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
.x-window-plain .x-window-body {
|
||||
border-left:1px solid #eee;
|
||||
border-top:1px solid #eee;
|
||||
border-bottom:1px solid #d0d0d0;
|
||||
border-right:1px solid #d0d0d0;
|
||||
background:transparent !important;
|
||||
}
|
||||
|
||||
body.x-body-masked .x-window-mc, body.x-body-masked .x-window-plain .x-window-mc {
|
||||
background-color: #e4e4e4;
|
||||
}
|
||||
|
||||
|
||||
/* misc */
|
||||
.x-html-editor-wrap {
|
||||
border-color:#d0d0d0;
|
||||
}
|
||||
|
||||
/* Borders go last for specificity */
|
||||
.x-panel-noborder .x-panel-body-noborder {
|
||||
border-width:0;
|
||||
}
|
||||
|
||||
.x-panel-noborder .x-panel-header-noborder {
|
||||
border-width:0;
|
||||
border-bottom:1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
.x-panel-noborder .x-panel-tbar-noborder .x-toolbar {
|
||||
border-width:0;
|
||||
border-bottom:1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
.x-panel-noborder .x-panel-bbar-noborder .x-toolbar {
|
||||
border-width:0;
|
||||
border-top:1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
.x-window-noborder .x-window-mc {
|
||||
border-width:0;
|
||||
}
|
||||
.x-window-plain .x-window-body-noborder {
|
||||
border-width:0;
|
||||
}
|
||||
|
||||
.x-tab-panel-noborder .x-tab-panel-body-noborder {
|
||||
border-width:0;
|
||||
}
|
||||
|
||||
.x-tab-panel-noborder .x-tab-panel-header-noborder {
|
||||
border-top-width:0;
|
||||
border-left-width:0;
|
||||
border-right-width:0;
|
||||
}
|
||||
|
||||
.x-tab-panel-noborder .x-tab-panel-footer-noborder {
|
||||
border-bottom-width:0;
|
||||
border-left-width:0;
|
||||
border-right-width:0;
|
||||
}
|
||||
|
||||
|
||||
.x-tab-panel-bbar-noborder .x-toolbar {
|
||||
border-width:0;
|
||||
border-top:1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
.x-tab-panel-tbar-noborder .x-toolbar {
|
||||
border-width:0;
|
||||
border-bottom:1px solid #d0d0d0;
|
||||
}
|
||||
|
||||
.x-spinner-field .x-form-spinner-up {
|
||||
background-image: url('../images/gray/form/spinner.gif');
|
||||
}
|
||||
.x-spinner-field .x-form-spinner-down {
|
||||
background-image: url('../images/gray/form/spinner.gif');
|
||||
}.x-accordion-hd {
|
||||
background-color: #e5e5e5;
|
||||
}.x-border {
|
||||
border: 1px solid #D0D0D0;
|
||||
}
|
||||
|
||||
.x-layout-popup {
|
||||
background-color: #F0F0F0;
|
||||
border: 1px solid #D0D0D0;
|
||||
}
|
||||
|
||||
.my-list {
|
||||
border: 1px solid #D0D0D0;
|
||||
}
|
||||
|
||||
.x-view {
|
||||
border:1px solid #D0D0D0;
|
||||
}
|
||||
|
||||
.x-menubar {
|
||||
border-color: #D0D0D0;
|
||||
background-color: #F0F0F0;
|
||||
background-image: url(../images/gray/toolbar/bg.gif);
|
||||
}
|
||||
|
||||
.x-menubar-item-active {
|
||||
background-color: #D9E8FB;
|
||||
}
|
||||
|
||||
.x-menubar-item-active {
|
||||
background-color: #D9E8FB;
|
||||
}.x-date-right-icon {
|
||||
background-image: url(../images/default/shared/right-btn.gif);
|
||||
margin-right: 2px;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.x-date-left-icon {
|
||||
background-image: url(../images/default/shared/left-btn.gif);
|
||||
margin-right: 2px;
|
||||
text-decoration: none !important;
|
||||
}.my-tbl {
|
||||
border: 1px solid #C6C5C5;
|
||||
}.my-treetbl {
|
||||
border: 1px solid #C6C5C5;
|
||||
}
|
|
@ -0,0 +1,638 @@
|
|||
/*
|
||||
* Ext JS Library 2.1
|
||||
* Copyright(c) 2006-2008, Ext JS, LLC.
|
||||
* licensing@extjs.com
|
||||
*
|
||||
* http://extjs.com/license
|
||||
*/
|
||||
html,body {
|
||||
background: #3d71b8 url(../wallpapers/desktop.jpg) no-repeat left top;
|
||||
font: normal 12px tahoma, arial, verdana, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0 none;
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.start {
|
||||
background-image: url( ../images/taskbar/black/startbutton-icon.gif ) !important;
|
||||
}
|
||||
|
||||
.bogus {
|
||||
background-image: url( ../images/bogus.png ) !important;
|
||||
}
|
||||
|
||||
.logout {
|
||||
background-image: url( ../images/logout.gif ) !important;
|
||||
}
|
||||
|
||||
.settings {
|
||||
background-image: url( ../images/gears.gif ) !important;
|
||||
}
|
||||
|
||||
#dpanels {
|
||||
width: 250px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#dpanels .x-panel {
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
#dpanels .x-date-picker {
|
||||
border: 0 none;
|
||||
border-top: 0 none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#dpanels .x-date-picker td.x-date-active {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
#dpanels .x-date-picker {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
#x-desktop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0 none;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn {
|
||||
float: left;
|
||||
margin: 1px 0 0 1px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#ux-taskbar-start .x-btn {
|
||||
float: left;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#ux-taskbar button { /* width: 150px;
|
||||
overflow: hidden; */
|
||||
text-align: left;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#title-bar-wrapper {
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
#title-bar {
|
||||
color: #225599;
|
||||
padding: 9px 7px;
|
||||
font: bold 16px tahoma, arial, verdana, sans-serif;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#x-logout {
|
||||
float: right;
|
||||
padding: 6px 7px;
|
||||
}
|
||||
|
||||
.x-btn-text-icon .x-btn-center .logout {
|
||||
background-position: 0pt 3px;
|
||||
background-repeat: no-repeat;
|
||||
padding: 3px 0pt 3px 18px;
|
||||
}
|
||||
|
||||
#ux-taskbar {
|
||||
background: transparent none;
|
||||
height: 30px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
z-index: 12001;
|
||||
}
|
||||
|
||||
.x-btn-icon .ux-taskbutton-center .x-btn-text {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.x-btn-icon .ux-taskbutton-center {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.ux-startbutton-center .x-btn-text {
|
||||
color: #000000 !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ux-taskbutton-left,.ux-taskbutton-right {
|
||||
font-size: 1px;
|
||||
line-height: 1px;
|
||||
}
|
||||
|
||||
.ux-taskbutton-left {
|
||||
width: 4px;
|
||||
height: 28px;
|
||||
background: url( ../images/taskbar/black/taskbutton.gif ) no-repeat 0 0;
|
||||
}
|
||||
|
||||
.ux-taskbutton-right {
|
||||
width: 4px;
|
||||
height: 28px;
|
||||
background: url( ../images/taskbar/black/taskbutton.gif ) no-repeat 0 -28px;
|
||||
}
|
||||
|
||||
.ux-taskbutton-left i,.ux-taskbutton-right i {
|
||||
display: block;
|
||||
width: 4px;
|
||||
overflow: hidden;
|
||||
font-size: 1px;
|
||||
line-height: 1px;
|
||||
}
|
||||
|
||||
.ux-taskbutton-center {
|
||||
background: url( ../images/taskbar/black/taskbutton.gif ) repeat-x 0 -56px;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#ux-taskbar .ux-taskbutton-left {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
#ux-taskbar .ux-taskbutton-right {
|
||||
background-position: 0 -28px;
|
||||
}
|
||||
|
||||
#ux-taskbar .ux-taskbutton-center {
|
||||
background-position: 0 -56px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-over .ux-taskbutton-left {
|
||||
background-position: 0 -252px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-over .ux-taskbutton-right {
|
||||
background-position: 0 -280px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-over .ux-taskbutton-center {
|
||||
background-position: 0 -308px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-click .ux-taskbutton-left {
|
||||
background-position: 0 -168px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-click .ux-taskbutton-right {
|
||||
background-position: 0 -196px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-click .ux-taskbutton-center {
|
||||
background-position: 0 -224px;
|
||||
}
|
||||
|
||||
#ux-taskbar .active-win .ux-taskbutton-left {
|
||||
background-position: 0 -84px;
|
||||
}
|
||||
|
||||
#ux-taskbar .active-win .ux-taskbutton-right {
|
||||
background: url( ../images/taskbar/black/taskbutton.gif ) no-repeat 0 -112px;
|
||||
}
|
||||
|
||||
#ux-taskbar .active-win .ux-taskbutton-center {
|
||||
background: url( ../images/taskbar/black/taskbutton.gif ) repeat-x 0 -140px;
|
||||
}
|
||||
|
||||
#ux-taskbar .active-win .ux-taskbutton-center button {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#spacer {
|
||||
height: 25px;
|
||||
float: left;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.x-window-body p,.x-panel-body p {
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.x-window-maximized .x-window-bc {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.add {
|
||||
background-image: url(../images/add.gif) !important;
|
||||
}
|
||||
|
||||
.option {
|
||||
background-image: url(../images/plugin.gif) !important;
|
||||
}
|
||||
|
||||
.remove {
|
||||
background-image: url(../images/delete.gif) !important;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
background-image: url(../images/tabs.gif) !important;
|
||||
}
|
||||
|
||||
.ux-start-menu {
|
||||
background: transparent none;
|
||||
border: 0px none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ux-start-menu-tl .x-window-header {
|
||||
color: #f1f1f1;
|
||||
font: bold 11px tahoma, arial, verdana, sans-serif;
|
||||
padding: 5px 0 4px 0;
|
||||
}
|
||||
|
||||
.x-panel-tl .x-panel-icon,.ux-start-menu-tl .x-panel-icon {
|
||||
background-position: 0pt 4px;
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 20px !important;
|
||||
}
|
||||
|
||||
.ux-start-menu-tl {
|
||||
background: transparent url( ../images/taskbar/black/start-menu-left-corners.png ) no-repeat 0 0;
|
||||
padding-left: 6px;
|
||||
zoom: 1;
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ux-start-menu-tr {
|
||||
background: transparent url( ../images/taskbar/black/start-menu-right-corners.png ) no-repeat right
|
||||
0;
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
.ux-start-menu-tc {
|
||||
background: transparent url( ../images/taskbar/black/start-menu-top-bottom.png ) repeat-x 0 0;
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.ux-start-menu-ml {
|
||||
background: transparent url( ../images/taskbar/black/start-menu-left-right.png ) repeat-y 0 0;
|
||||
padding-left: 6px;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.ux-start-menu-bc {
|
||||
background: transparent url( ../images/taskbar/black/start-menu-top-bottom.png ) repeat-x 0 bottom;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.ux-start-menu-bc .x-window-footer {
|
||||
padding-bottom: 6px;
|
||||
zoom: 1;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.ux-start-menu-bl {
|
||||
background: transparent url( ../images/taskbar/black/start-menu-left-corners.png ) no-repeat 0
|
||||
bottom;
|
||||
padding-left: 6px;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.ux-start-menu-br {
|
||||
background: transparent url( ../images/taskbar/black/start-menu-right-corners.png ) no-repeat right
|
||||
bottom;
|
||||
padding-right: 6px;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.x-panel-nofooter .ux-start-menu-bc {
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.ux-start-menu-splitbar-h {
|
||||
background-color: #d0d0d0;
|
||||
}
|
||||
|
||||
.ux-start-menu-bwrap {
|
||||
background: transparent none;
|
||||
border: 0px none;
|
||||
}
|
||||
|
||||
.ux-start-menu-body {
|
||||
background: transparent none;
|
||||
border: 0px none;
|
||||
}
|
||||
|
||||
.ux-start-menu-apps-panel {
|
||||
background: #ffffff none;
|
||||
border: 1px solid #1e2124;
|
||||
}
|
||||
|
||||
.ux-start-menu-tools-panel {
|
||||
border: 0px none;
|
||||
background: transparent url( ../images/taskbar/black/start-menu-right.png ) repeat-y scroll right
|
||||
0pt;
|
||||
}
|
||||
|
||||
#ux-taskbar-start {
|
||||
background: #000000 url( ../images/taskbar/black/taskbar-start-panel-bg.gif ) repeat-x left top;
|
||||
left: 0px;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#ux-taskbar-start .x-toolbar {
|
||||
background: none;
|
||||
padding: 0px;
|
||||
border: 0px none;
|
||||
}
|
||||
|
||||
#ux-taskbuttons-panel {
|
||||
background: #000000 url( ../images/taskbar/black/taskbuttons-panel-bg.gif ) repeat-x left top;
|
||||
padding-top: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ux-taskbuttons-strip-wrap { /* overflow:hidden;
|
||||
position:relative;
|
||||
width:100%; */
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
ul.ux-taskbuttons-strip {
|
||||
display: block;
|
||||
width: 5000px;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
ul.ux-taskbuttons-strip li {
|
||||
float: left;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
ul.ux-taskbuttons-strip li.ux-taskbuttons-edge {
|
||||
float: left;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
border: 0 none !important;
|
||||
font-size: 1px !important;
|
||||
line-height: 1px !important;
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
background: transparent !important;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.x-clear {
|
||||
clear: both;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
line-height: 0;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.x-taskbuttons-scrolling {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.x-taskbuttons-scrolling .ux-taskbuttons-strip-wrap {
|
||||
margin-left: 18px;
|
||||
margin-right: 18px;
|
||||
}
|
||||
|
||||
td.ux-taskButtons-edge { /*float:left;*/
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
border: 0 none !important;
|
||||
font-size: 1px !important;
|
||||
line-height: 1px !important;
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
background: transparent !important;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.ux-taskbuttons-scroller-left {
|
||||
background: transparent url( ../images/taskbar/black/scroll-left.gif ) no-repeat -18px 0;
|
||||
width: 18px;
|
||||
position: absolute;
|
||||
left: 1px;
|
||||
top: 0px;
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ux-taskbuttons-scroller-left-over {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
.ux-taskbuttons-scroller-left-disabled {
|
||||
background-position: -18px 0;
|
||||
opacity: .5;
|
||||
-moz-opacity: .5;
|
||||
filter: alpha(opacity = 50);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ux-taskbuttons-scroller-right {
|
||||
background: transparent url( ../images/taskbar/black/scroll-right.gif ) no-repeat 0 0;
|
||||
width: 18px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0px;
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ux-taskbuttons-scroller-right-over {
|
||||
background-position: -18px 0;
|
||||
}
|
||||
|
||||
.ux-taskbuttons-scroller-right-disabled {
|
||||
background-position: 0 0;
|
||||
opacity: .5;
|
||||
-moz-opacity: .5;
|
||||
filter: alpha(opacity = 50);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ux-toolmenu-sep {
|
||||
background-color: #18191a;
|
||||
border-bottom: 1px solid #858789;
|
||||
display: block;
|
||||
font-size: 1px;
|
||||
line-height: 1px;
|
||||
margin: 2px 3px;
|
||||
}
|
||||
|
||||
.ux-start-menu-tools-panel ul.x-menu-list li.x-menu-list-item a.x-menu-item {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.ux-start-menu-tools-panel ul.x-menu-list li.x-menu-list-item .x-menu-item-active a.x-menu-item {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.ux-start-menu-tools-panel .x-menu-item-active {
|
||||
background: #525456 url( ../images/taskbar/black/item-over.gif ) repeat-x left bottom;
|
||||
border: 1px solid #000000;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-splitbar-h {
|
||||
background: #000000 url( ../images/taskbar/black/taskbar-split-h.gif ) no-repeat 0 0;
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
.x-window-header-text {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*
|
||||
* Begin Start button
|
||||
*/
|
||||
.ux-startbutton-left,.ux-startbutton-right {
|
||||
font-size: 1px;
|
||||
line-height: 1px;
|
||||
}
|
||||
|
||||
.ux-startbutton-left {
|
||||
width: 10px;
|
||||
height: 28px;
|
||||
background: url( ../images/taskbar/black/startbutton.gif ) no-repeat 0 0;
|
||||
}
|
||||
|
||||
.ux-startbutton-right {
|
||||
width: 10px;
|
||||
height: 30px;
|
||||
background: url( ../images/taskbar/black/startbutton.gif ) no-repeat 0 -28px;
|
||||
}
|
||||
|
||||
.ux-startbutton-left i,.ux-startbutton-right i {
|
||||
display: block;
|
||||
width: 10px;
|
||||
overflow: hidden;
|
||||
font-size: 1px;
|
||||
line-height: 1px;
|
||||
}
|
||||
|
||||
.ux-startbutton-center {
|
||||
background: url( ../images/taskbar/black/startbutton.gif ) repeat-x 0 -56px;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#ux-taskbar .ux-startbutton-left {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
#ux-taskbar .ux-startbutton-right {
|
||||
background-position: 0 -30px;
|
||||
}
|
||||
|
||||
#ux-taskbar .ux-startbutton-center {
|
||||
background-position: 0 -60px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-over .ux-startbutton-left {
|
||||
background-position: 0 -270px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-over .ux-startbutton-right {
|
||||
background-position: 0 -300px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-over .ux-startbutton-center {
|
||||
background-position: 0 -330px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-click .ux-startbutton-left {
|
||||
background-position: 0 -180px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-click .ux-startbutton-right {
|
||||
background-position: 0 -210px;
|
||||
}
|
||||
|
||||
#ux-taskbar .x-btn-click .ux-startbutton-center {
|
||||
background-position: 0 -240px;
|
||||
}
|
||||
|
||||
#ux-taskbar .active-win .ux-startbutton-left {
|
||||
background-position: 0 -90px;
|
||||
}
|
||||
|
||||
#ux-taskbar .active-win .ux-startbutton-right {
|
||||
background: url( ../images/taskbar/black/startbutton.gif ) no-repeat 0 -120px;
|
||||
}
|
||||
|
||||
#ux-taskbar .active-win .ux-startbutton-center {
|
||||
background: url( ../images/taskbar/black/startbutton.gif ) repeat-x 0 -150px;
|
||||
}
|
||||
|
||||
#ux-taskbar .active-win .ux-startbutton-center button {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/*
|
||||
* End Start button
|
||||
*/
|
||||
.x-resizable-proxy {
|
||||
background: #C7DFFC;
|
||||
opacity: .5;
|
||||
-moz-opacity: .5;
|
||||
filter: alpha(opacity = 50);
|
||||
border: 1px solid #3b5a82;
|
||||
}
|
||||
|
||||
/* Desktop Shortcuts */
|
||||
#x-shortcuts dt {
|
||||
float: left;
|
||||
margin: 15px 0 0 15px;
|
||||
clear: left;
|
||||
width: 64px;
|
||||
font: normal 10px tahoma, arial, verdana, sans-serif;
|
||||
text-align: center;
|
||||
zoom: 1;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#x-shortcuts dt a {
|
||||
width: 64px;
|
||||
display: block;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#x-shortcuts dt div {
|
||||
width: 100%;
|
||||
color: white;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#x-shortcuts dt a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
After Width: | Height: | Size: 994 B |
After Width: | Height: | Size: 989 B |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 155 KiB |
After Width: | Height: | Size: 996 B |
After Width: | Height: | Size: 967 B |
After Width: | Height: | Size: 513 B |
After Width: | Height: | Size: 842 B |
After Width: | Height: | Size: 992 B |
After Width: | Height: | Size: 808 B |
After Width: | Height: | Size: 400 B |
After Width: | Height: | Size: 191 B |
After Width: | Height: | Size: 944 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 920 B |
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 972 B |
After Width: | Height: | Size: 832 B |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 43 B |
After Width: | Height: | Size: 917 B |
After Width: | Height: | Size: 166 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 206 B |
After Width: | Height: | Size: 143 B |
After Width: | Height: | Size: 224 B |
After Width: | Height: | Size: 141 B |
After Width: | Height: | Size: 158 B |
After Width: | Height: | Size: 748 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 327 B |
After Width: | Height: | Size: 890 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 195 B |
After Width: | Height: | Size: 888 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 830 B |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 1010 B |
After Width: | Height: | Size: 1005 B |