init import, maven version of workspace portlet

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@69017 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-02-08 09:56:27 +00:00
parent 2e2690cf30
commit c7e16ba74b
1033 changed files with 17801 additions and 0 deletions

35
.classpath Normal file
View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/workspace-6.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="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</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="output" path="target/workspace-6.0.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

59
.project Normal file
View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>workspace</name>
<comment>workspace 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>

15
.settings/.jsdtscope Normal file
View File

@ -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>

View File

@ -0,0 +1,3 @@
#Thu Jun 16 10:18:26 CEST 2011
eclipse.preferences.version=1
filesCopiedToWebInfLib=

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/backup-old-home/francesco-mangiacrapa/workspace/workspace/target/workspace-6.0.0-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -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+

View File

@ -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

View File

@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
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.6

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -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="/target/generated-sources/gwt"/>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="workspace"/>
</wb-module>
</project-modules>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="2.5"/>
</faceted-project>

View File

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

View File

@ -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

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gwt.eclipse.core.launch.gwtJUnit">
<stringAttribute key="com.google.gwt.eclipse.core.LOG_LEVEL" value="INFO"/>
<booleanAttribute key="com.google.gwt.eclipse.core.NOT_HEADLESS" value="false"/>
<stringAttribute key="com.google.gwt.eclipse.core.OUT_DIR" value="www-test"/>
<booleanAttribute key="com.google.gwt.eclipse.core.STANDARDS_MODE" value="false"/>
<stringAttribute key="com.google.gwt.eclipse.core.STYLE" value="OBFUSCATED"/>
<stringAttribute key="com.google.gwt.eclipse.core.WEB_MODE" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/workspace/src/test/java/org/gcube/portlets/user/workspace/client/GwtTestWorkspacePortlet.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gdt.eclipse.maven.mavenClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.gcube.portlets.user.workspace.client.GwtTestWorkspacePortlet"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="workspace"/>
</launchConfiguration>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gwt.eclipse.core.launch.gwtJUnit">
<stringAttribute key="com.google.gwt.eclipse.core.LOG_LEVEL" value="INFO"/>
<booleanAttribute key="com.google.gwt.eclipse.core.NOT_HEADLESS" value="false"/>
<stringAttribute key="com.google.gwt.eclipse.core.OUT_DIR" value="www-test"/>
<booleanAttribute key="com.google.gwt.eclipse.core.STANDARDS_MODE" value="false"/>
<stringAttribute key="com.google.gwt.eclipse.core.STYLE" value="OBFUSCATED"/>
<stringAttribute key="com.google.gwt.eclipse.core.WEB_MODE" value="true"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/workspace/src/test/java/org/gcube/portlets/user/workspace/client/GwtTestWorkspacePortlet.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gdt.eclipse.maven.mavenClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.gcube.portlets.user.workspace.client.GwtTestWorkspacePortlet"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="workspace"/>
</launchConfiguration>

279
pom.xml Normal file
View File

@ -0,0 +1,279 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.0.0</version>
<relativePath />
</parent>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace</artifactId>
<packaging>war</packaging>
<version>6.0.0-SNAPSHOT</version>
<name>gCube Workspace Portlet</name>
<description>
gcube Workspace Portlet is a portlet for users workspace management
</description>
<scm>
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</connection>
<developerConnection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</developerConnection>
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</url>
</scm>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.4.0</gwtVersion>
<distroDirectory>distro</distroDirectory>
<!-- GWT needs at least java 1.6 -->
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<!-- This dependency is needed and is need on TOP to use GWT UI BInder
without old Xerces version of gCore complaining -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>2.2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>gcf</artifactId>
<version>[1.4.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gcube-widgets</artifactId>
<version>[1.4.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
<version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
<version>[3.2.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace-tree-widget</artifactId>
<version>[6.0.0-SNAPSHOT, 7.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-resource-link-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>wsmail-widget</artifactId>
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>home-library</artifactId>
<version>[4.3.0-SNAPSHOT, 5.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[1.3.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
<version>[1.3.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>6.0.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
<scope>runtime</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>
</dependencies>
<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.4.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!-- <goal>test</goal> -->
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<runTarget>Messages.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
</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.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- SA 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>
<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>
</plugins>
</build>
</project>

View File

@ -0,0 +1,826 @@
package org.gcube.portlets.user.workspace.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer.ViewSwitchType;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
import org.gcube.portlets.user.workspace.client.event.ActiveGroupingView;
import org.gcube.portlets.user.workspace.client.event.ActiveGroupingViewHandler;
import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
import org.gcube.portlets.user.workspace.client.event.AddFolderEventHandler;
import org.gcube.portlets.user.workspace.client.event.AddSmartFolderEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.DeleteMessageEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteMessageEventHandler;
import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelectedEventHandler;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEventHandler;
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler;
import org.gcube.portlets.user.workspace.client.event.FilterScopeEvent;
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEventHandler;
import org.gcube.portlets.user.workspace.client.event.GridElementUnSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.GridElementUnSelectedEventHandler;
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEventHandler;
import org.gcube.portlets.user.workspace.client.event.LoadAllScopeEvent;
import org.gcube.portlets.user.workspace.client.event.LoadAllScopeEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
import org.gcube.portlets.user.workspace.client.event.OpenReportsEventHandler;
import org.gcube.portlets.user.workspace.client.event.PathElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.PathElementSelectedEventHandler;
import org.gcube.portlets.user.workspace.client.event.PreviewMessageEvent;
import org.gcube.portlets.user.workspace.client.event.PreviewMessageEventHandler;
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
import org.gcube.portlets.user.workspace.client.event.RenameItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.SaveAttachmentsEvent;
import org.gcube.portlets.user.workspace.client.event.SaveAttachmentsEventHandler;
import org.gcube.portlets.user.workspace.client.event.SaveSmartFolderEvent;
import org.gcube.portlets.user.workspace.client.event.SaveSmartFolderEventHandler;
import org.gcube.portlets.user.workspace.client.event.ScopeChangeEvent;
import org.gcube.portlets.user.workspace.client.event.ScopeChangeEventHandler;
import org.gcube.portlets.user.workspace.client.event.SearchTextEvent;
import org.gcube.portlets.user.workspace.client.event.SearchTextEventHandler;
import org.gcube.portlets.user.workspace.client.event.SendMessageEvent;
import org.gcube.portlets.user.workspace.client.event.SendMessageEventHandler;
import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent;
import org.gcube.portlets.user.workspace.client.event.WebDavUrlEventHandler;
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
import org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.model.FolderModel;
import org.gcube.portlets.user.workspace.client.model.ScopeModel;
import org.gcube.portlets.user.workspace.client.view.WorskpacePortlet;
import org.gcube.portlets.user.workspace.client.view.panels.GxtBorderLayoutPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtItemsPanel;
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
import org.gcube.portlets.user.wsmail.client.forms.MailForm;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HasWidgets;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class AppController implements SubscriberInterface {
private final static HandlerManager eventBus = new HandlerManager(null);
private WorskpacePortlet wsPortlet = null;
private AppControllerExplorer appContrExplorer = null;
private String rootIdentifier = null;
public static boolean isSearchActive = false;
public AppController(AppControllerExplorer appControllerExplorer) {
this.appContrExplorer = appControllerExplorer;
this.appContrExplorer.subscribe(this, new EventsTypeEnum[] {
EventsTypeEnum.RENAME_ITEM_EVENT,
EventsTypeEnum.SELECTED_ITEM_EVENT,
// EventsTypeEnum.EXPAND_FOLDER_EVENT,
EventsTypeEnum.ADDED_FOLDER_EVENT,
EventsTypeEnum.DELETE_ITEM_EVENT,
EventsTypeEnum.SUBTREE_LOAD_EVENT,
EventsTypeEnum.SMART_FOLDER_EVENT,
EventsTypeEnum.COMPLETED_FILE_UPLOAD_EVENT,
EventsTypeEnum.ADDED_FILE_EVENT,
EventsTypeEnum.MOVED_ITEM_EVENT,
EventsTypeEnum.LOAD_MESSAGES_EVENT,
EventsTypeEnum.SWITCH_VIEW_EVENT,
EventsTypeEnum.DELETED_MESSAGE,
EventsTypeEnum.MARK_MESSAGE_AS_READ,
EventsTypeEnum.REFRESH_FOLDER,
EventsTypeEnum.SELECTED_MESSAGE,
EventsTypeEnum.CREATE_NEW_MESSAGE,
EventsTypeEnum.REPLY_FORWARD_MESSAGE
});
bind();
}
public static HandlerManager getEventBus() {
return eventBus;
}
private void bind() {
// History.addValueChangeHandler(this);
//********EVENTS TO NOTIFY SUBSCRIBERS
eventBus.addHandler(ActiveGroupingView.TYPE, new ActiveGroupingViewHandler() {
@Override
public void onActiveGroupingView(ActiveGroupingView activeGroupingView) {
if(activeGroupingView.isActiveGrouping()){
setCookieGridViewSetting("true");
wsPortlet.getGridGroupContainer().enableGrouping();
}
else{
setCookieGridViewSetting("false");
wsPortlet.getGridGroupContainer().disableGrouping();
}
}
});
eventBus.addHandler(OpenReportsEvent.TYPE, new OpenReportsEventHandler() {
@Override
public void onClickOpenReports(OpenReportsEvent openReportsEvent) {
AppControllerExplorer.getEventBus().fireEvent(new OpenReportsEvent(openReportsEvent.getSourceFileModel()));
}
});
eventBus.addHandler(PreviewMessageEvent.TYPE, new PreviewMessageEventHandler() {
@Override
public void onPreviewMessage(PreviewMessageEvent previewMessageEvent) {
AppControllerExplorer.getEventBus().fireEvent(new PreviewMessageEvent(previewMessageEvent.getMessageIdentifier(), previewMessageEvent.getMessageType()));
}
});
eventBus.addHandler(WebDavUrlEvent.TYPE, new WebDavUrlEventHandler() {
@Override
public void onClickWebDavUrl(WebDavUrlEvent webDavUrlEvent) {
AppControllerExplorer.getEventBus().fireEvent(new WebDavUrlEvent(webDavUrlEvent.getItemIdentifier()));
}
});
eventBus.addHandler(OpenContextMenuTreeEvent.TYPE, new OpenContextMenuTreeEventHandler() {
@Override
public void onOpenContextMenuTree(OpenContextMenuTreeEvent openContextMenuTreeEvent) {
AppControllerExplorer.getEventBus().fireEvent(openContextMenuTreeEvent);
}
});
eventBus.addHandler(ImagePreviewEvent.TYPE, new ImagePreviewEventHandler() {
@Override
public void onClickPreview(ImagePreviewEvent imgPrevEvnt) {
AppControllerExplorer.getEventBus().fireEvent(new ImagePreviewEvent(imgPrevEvnt.getSourceFileModel(), imgPrevEvnt.getClientX(), imgPrevEvnt.getClientY()));
}
});
eventBus.addHandler(FileDownloadEvent.TYPE, new FileDownloadEventHandler() {
@Override
public void onFileDownloadEvent(FileDownloadEvent fileDownloadEvent) {
AppControllerExplorer.getEventBus().fireEvent(new FileDownloadEvent(fileDownloadEvent.getItemIdentifier(), fileDownloadEvent.getItemName(), fileDownloadEvent.getDownloadType()));
}
});
eventBus.addHandler(DeleteMessageEvent.TYPE, new DeleteMessageEventHandler() {
@Override
public void onDeleteMessage(DeleteMessageEvent deleteMessageEvent) {
AppControllerExplorer.getEventBus().fireEvent(new DeleteMessageEvent(deleteMessageEvent.getMessageTarget()));
}
});
eventBus.addHandler(SaveAttachmentsEvent.TYPE, new SaveAttachmentsEventHandler() {
@Override
public void onSaveAttachments(SaveAttachmentsEvent saveAttachmentsEvent) {
AppControllerExplorer.getEventBus().fireEvent(new SaveAttachmentsEvent(saveAttachmentsEvent.getMessageIdentifier(), saveAttachmentsEvent.getMessageType()));
}
});
eventBus.addHandler(GridElementSelectedEvent.TYPE, new GridElementSelectedEventHandler() {
@Override
public void onGridElementSelected(GridElementSelectedEvent event) {
doElementGridSelected(true, event.getSourceFile());
// setFileDetailsInView(event.getSourceFile().getIdentifier());
}
});
eventBus.addHandler(LoadAllScopeEvent.TYPE, new LoadAllScopeEventHandler() {
@Override
public void onLoadScopes(LoadAllScopeEvent loadAllScopeEvent) {
doLoadAllScope();
}
private void doLoadAllScope() {
appContrExplorer.getRpcWorkspaceService().getAllScope(new AsyncCallback<List<ScopeModel>>() {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting all scope." +ConstantsExplorer.TRY_AGAIN, null);
}
@Override
public void onSuccess(List<ScopeModel> result) {
// for(ScopeModel scope: result)
// System.out.println("#############Scopde id " + scope.getId() + " name " + scope.getName());
if(result!=null && result.size()>0){
wsPortlet.getSearchAndFilterContainer().setListScope(result);
wsPortlet.getSearchAndFilterContainer().selectScopeByIndex(0); //select first scope
}
else
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting all scope. No scope available. " +ConstantsExplorer.TRY_AGAIN, null);
}
});
}
});
eventBus.addHandler(ScopeChangeEvent.TYPE, new ScopeChangeEventHandler() {
@Override
public void onLoadScope(ScopeChangeEvent scopeChangeEvent) {
doLoadScope(scopeChangeEvent.getScopeId());
}
private void doLoadScope(String scopeId) {
AppControllerExplorer.getEventBus().fireEvent(new FilterScopeEvent(scopeId));
}
});
eventBus.addHandler(SaveSmartFolderEvent.TYPE, new SaveSmartFolderEventHandler() {
@Override
public void onSaveSmartFolder(SaveSmartFolderEvent saveSmartFolderEvent) {
doSaveSmartFolder(saveSmartFolderEvent);
}
private void doSaveSmartFolder(SaveSmartFolderEvent event) {
AppControllerExplorer.getEventBus().fireEvent(new AddSmartFolderEvent(event.getSearchText()));
}
});
eventBus.addHandler(DoubleClickElementSelectedEvent.TYPE, new DoubleClickElementSelectedEventHandler() {
@Override
public void onDoubleClickElementGrid(DoubleClickElementSelectedEvent doubleClickElementSelectedEvent) {
doElementDoubleClick(doubleClickElementSelectedEvent.getSourceFile());
}
private void doElementDoubleClick(final FileGridModel fileModel) {
// appContrExplorer.expandFolder(event.getIdentifier());
//COMMENTED 01-02-2013
// appContrExplorer.expandFolder(event.getIdentifier());
FolderModel folder = new FolderModel(fileModel.getIdentifier(), fileModel.getName(), fileModel.getParentFileModel(), true, fileModel.isShared());
updateStoreByRpc(folder);
}
});
eventBus.addHandler(SearchTextEvent.TYPE, new SearchTextEventHandler() {
@Override
public void onSearchText(SearchTextEvent searchTextEvent) {
if(searchTextEvent.getTextSearch()==null){
appContrExplorer.searching(false);
wsPortlet.getGridGroupContainer().setBorderAsOnSearch(false);
}
else{
wsPortlet.getSearchAndFilterContainer().setSearchActive(true); //ADDED 06-04-12
isSearchActive = true;
appContrExplorer.searching(true);
doSearchText(searchTextEvent.getTextSearch());
}
}
private void doSearchText(String textSearch) {
if(wsPortlet.getGxtCardLayoutResultPanel().getActivePanel() instanceof GxtItemsPanel){ //If active panel is panel with file items
wsPortlet.getSearchAndFilterContainer().setVisibleButtonSave(true); //ADDED 24/04/2012
// wsPortlet.getGxtCardLayoutResultPanel().getToolBarItem().activeAllButtonWithoutGroupView(false); //ADDED 06/02/2013
wsPortlet.getGridGroupContainer().setBorderAsOnSearch(true);
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
appContrExplorer.getRpcWorkspaceService().getItemsBySearchName(textSearch, new AsyncCallback<List<FileGridModel>>() {
@Override
public void onFailure(Throwable caught) {
System.out.println("Failure search RPC");
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " searching item. " +ConstantsExplorer.TRY_AGAIN, null);
wsPortlet.getGridGroupContainer().unmask();
}
@Override
public void onSuccess(List<FileGridModel> result) {
wsPortlet.getGridGroupContainer().updateStore(result);
wsPortlet.getGridGroupContainer().unmask();
}
});
}
}
});
eventBus.addHandler(PathElementSelectedEvent.TYPE, new PathElementSelectedEventHandler() {
@Override
public void onPathElementSelected(PathElementSelectedEvent event) {
wsPortlet.getSearchAndFilterContainer().searchCancel(); //cancel search
if(wsPortlet.getGxtCardLayoutResultPanel().getActivePanel() instanceof GxtItemsPanel){ //If active panel is panel with file items
AppController.getEventBus().fireEvent(new SearchTextEvent(null));
}
doPathElementSelected(event);
}
private void doPathElementSelected(PathElementSelectedEvent event) {
// appContrExplorer.selectItemInTree(event.getSourceFile().getIdentifier());
appContrExplorer.expandFolder(event.getSourceFile().getIdentifier());
}
});
eventBus.addHandler(GridElementUnSelectedEvent.TYPE, new GridElementUnSelectedEventHandler() {
@Override
public void onGridElementUnSelected(GridElementUnSelectedEvent event) {
doElementGridSelected(false, null);
}
});
eventBus.addHandler(AddFolderEvent.TYPE, new AddFolderEventHandler() {
@Override
public void onAddItem(AddFolderEvent event) {
AppControllerExplorer.getEventBus().fireEvent(new AddFolderEvent(event.getFileSourceModel(),event.getParentFileModel()));
}
});
eventBus.addHandler(SendMessageEvent.TYPE, new SendMessageEventHandler() {
@Override
public void onSendMessage(SendMessageEvent sendMessageEvent) {
doSendMessage(sendMessageEvent.getListFileModelSelected());
}
private void doSendMessage(List<FileModel> listFileModelSelected) {
AppControllerExplorer.getEventBus().fireEvent(new SendMessageEvent(null));
}
});
eventBus.addHandler(FileUploadEvent.TYPE, new FileUploadEventHandler() {
@Override
public void onFileUploadEvent(FileUploadEvent fileUploadEvent) {
AppControllerExplorer.getEventBus().fireEvent(new FileUploadEvent(null,fileUploadEvent.getUploadType()));
}
});
eventBus.addHandler(FileDownloadEvent.TYPE, new FileDownloadEventHandler() {
@Override
public void onFileDownloadEvent(FileDownloadEvent fileDownloadEvent) {
AppControllerExplorer.getEventBus().fireEvent(new FileDownloadEvent(fileDownloadEvent.getItemIdentifier(), fileDownloadEvent.getItemName(), fileDownloadEvent.getDownloadType()));
}
});
eventBus.addHandler(DeleteItemEvent.TYPE, new DeleteItemEventHandler() {
@Override
public void onDeleteItem(DeleteItemEvent event) {
doDeleteItem(event);
}
private void doDeleteItem(final DeleteItemEvent event){
AppControllerExplorer.getEventBus().fireEvent(new DeleteItemEvent(event.getFileTarget()));
}
});
eventBus.addHandler(RenameItemEvent.TYPE, new RenameItemEventHandler() {
@Override
public void onRenameItem(RenameItemEvent event) {
doRenameItem(event);
}
public void doRenameItem(final RenameItemEvent event) {
AppControllerExplorer.getEventBus().fireEvent(new RenameItemEvent(event.getFileTarget()));
}
});
}
private void doElementGridSelected(boolean isSelected, FileModel target) {
// wsPortlet.getToolbarPanelContainer().activeButtonsOnSelect(itemSelected);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItem().activeButtonsOnSelect(target, isSelected);
if(isSelected){
ArrayList<FileModel> listParents = appContrExplorer.getListParentsByIdentifier(target.getIdentifier());
setPathInView(listParents); //Set file path in tab panel on current item selected
if(isSearchActive){ //COMMENTED 30-01-12 - syncronization only if search is active
wsPortlet.getSearchAndFilterContainer().setSearchActive(true);
appContrExplorer.searching(true);
appContrExplorer.findItemAndSelectItemInTree(target.getIdentifier());
}
}
}
private void setPathInView(ArrayList<FileModel> parents){
//this.wsPortlet.getBasicTabContainer().setLabelPath(path); //Set path in tab view panel
this.wsPortlet.getToolBarPath().setPath(parents); //Set path in tab view panel
}
/**
* init method
* @param rootPanel
*/
public void go(final HasWidgets rootPanel) {
final String searchParameter = Window.Location.getParameter(ConstantsPortlet.GET_SEARCH_PARAMETER);
final boolean instanceWithGrouping = readCookieWorkspaceGridViewSetting();
System.out.println("Cookie "+ConstantsPortlet.GCUBE_COOKIE_WORKSPACE_GRID_VIEW_SETTING + " return "+instanceWithGrouping);
boolean isSearch = false;
// Log.trace("Start Workspace Portlet");
if (this.appContrExplorer == null){
this.wsPortlet = new WorskpacePortlet(instanceWithGrouping);
}
else{
if(searchParameter!=null && !searchParameter.isEmpty())
isSearch = true;
this.wsPortlet = new WorskpacePortlet(this.appContrExplorer.getPanel(true, false, !isSearch), instanceWithGrouping);
eventBus.fireEvent(new LoadAllScopeEvent()); //LOAD ALL SCOPE EVENT
}
rootPanel.add(wsPortlet.getBorderLayoutContainer());
//SET TOGGLE BUTTON GRID VIEW
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItem().toggleGridViewButton(instanceWithGrouping);
}
});
//If is SEARCH - fire event search text
if(searchParameter!=null && !searchParameter.isEmpty())
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
// wsPortlet.getGxtCardLayoutResultPanel().getToolBarItem().activeAllButtonWithoutGroupView(false);
wsPortlet.getSearchAndFilterContainer().searchText(searchParameter);
}
});
}
/**
*
* @return true if exists a cookie with msg as true value (or not exists the cookie), false otherwise
*/
private boolean readCookieWorkspaceGridViewSetting() {
//get the cookie with name GCBUEWorkspaceGridViewSetting
String msg = Cookies.getCookie(ConstantsPortlet.GCUBE_COOKIE_WORKSPACE_GRID_VIEW_SETTING);
//if null, there was no cookie
if(msg == null){
setCookieGridViewSetting("true");
return true;
}
if(msg.compareTo("true")==0)
return true;
return false;
}
public static void setCookie(String name, String value, int days) {
if (value == null) {
Cookies.removeCookie(name);
return;
}
// Now
Date expiringDate = new Date();
// Now + days
expiringDate.setTime(expiringDate.getTime() + ConstantsPortlet.MILLISECS_PER_DAY * days);
Cookies.setCookie(name, value, expiringDate);
}
public static void setCookieGridViewSetting(String value) {
setCookie(ConstantsPortlet.GCUBE_COOKIE_WORKSPACE_GRID_VIEW_SETTING, value, ConstantsPortlet.COOKIE_EXPIRE_DAYS);
}
public GxtBorderLayoutPanel getMainPanel(){
return wsPortlet.getBorderLayoutContainer();
}
// public ExplorerPanel getExplorerPanel() {
// return wsPortlet.getExplorerPanel();
// }
public void setSizeAsyncTreePanel(int width, int height) {
wsPortlet.getExplorerPanel().getAsycTreePanel().setSizeTreePanel(width-17, height-55);
}
private void updateStoreByRpc(final FileModel folder){
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
System.out.println("In client new RPC getFolderChildrenForFileGrid "+folder.getName());
appContrExplorer.getRpcWorkspaceService().getFolderChildrenForFileGrid(folder, new AsyncCallback<List<FileGridModel>>() {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting items for grid. " +ConstantsExplorer.TRY_AGAIN, null);
// System.out.println(caught);
// caught.printStackTrace();
wsPortlet.getGridGroupContainer().unmask();
}
@Override
public void onSuccess(List<FileGridModel> result) {
wsPortlet.getGridGroupContainer().setCurrentFolderView(folder); //SET folder as current view
wsPortlet.getGridGroupContainer().unmask();
wsPortlet.getGridGroupContainer().updateStore(result);
}
});
}
public FileModel getSelectedFolder(){
return this.appContrExplorer.getSelectedFolderInTree();
}
/**
* Following methods implements SubscriberInterface
*/
@Override
public void addedFolder(String itemIdentifier, FileModel parent) {
updateStoreByRpc(parent);
}
@Override
public void addedFile(String itemIdentifier, FileModel parent) {
updateStoreByRpc(parent);
}
@Override
public void selectedItem(FileModel item, ArrayList<FileModel> parents) {
FileModel currentFolder = wsPortlet.getGridGroupContainer().getCurrentFolderView();
if(currentFolder!=null){
setPathInView(parents); //set path
if(wsPortlet.getSearchAndFilterContainer().isSearchActive()){ //ADDED 12-04-12
wsPortlet.getSearchAndFilterContainer().searchCancel(); //TODO added in 05/04/2012
AppController.getEventBus().fireEvent(new SearchTextEvent(null));
wsPortlet.getSearchAndFilterContainer().setSearchActive(false);
isSearchActive = false;
if(item.isDirectory())
updateStoreByRpc(item);
else
updateStoreByRpc(item.getParentFileModel());
return;
}
if (item.isDirectory())
updateStoreByRpc(item); //View children of folder
else{
String currentIdentifier = currentFolder.getIdentifier(); //Actual id parent
if(!currentIdentifier.equals(item.getParentFileModel().getIdentifier())) {//Update store only if folder parent is differently
updateStoreByRpc(item.getParentFileModel()); //View contents of parent folder
}
}
}
else
updateStoreByRpc(item); //View children of root
}
@Override
public void expandFolderItem(FolderModel folder) {
updateStoreByRpc(folder);
}
@Override
public boolean renameItem(String itemIdentifier, String newName, String extension) {
return wsPortlet.getGridGroupContainer().renameItem(itemIdentifier, newName, extension);
}
@Override
public boolean deleteItem(String itemIdentifier) {
return wsPortlet.getGridGroupContainer().deleteItem(itemIdentifier);
}
@Override
public void rootLoaded(FileModel root) {
this.rootIdentifier = root.getIdentifier();
}
@Override
public void setParentItemSelected(ArrayList<FileModel> listParents){
setPathInView(listParents);
}
@Override
public void smartFolderSelected(final String folderId, final String category) {
System.out.println("In client folderId: " + folderId);
System.out.println("In client category: " + category);
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
wsPortlet.getGridGroupContainer().setBorderAsOnSearch(true);
if (folderId != null && !folderId.isEmpty()) {
appContrExplorer.getRpcWorkspaceService().getSmartFolderResultsById(folderId,new AsyncCallback<List<FileGridModel>>() {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting smart folders. " +ConstantsExplorer.TRY_AGAIN, null);
wsPortlet.getGridGroupContainer().unmask();
}
@Override
public void onSuccess(List<FileGridModel> result) {
wsPortlet.getSearchAndFilterContainer().setSearchActive(true);
isSearchActive = true;
wsPortlet.getGridGroupContainer().unmask();
wsPortlet.getGridGroupContainer().updateStore(result);
}
});
} else {
if (category != null && !category.isEmpty()) {
appContrExplorer.getRpcWorkspaceService().getSmartFolderResultsByCategory(category, new AsyncCallback<List<FileGridModel>>() {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting smart folder results by category. " +ConstantsExplorer.TRY_AGAIN, null);
}
@Override
public void onSuccess(List<FileGridModel> result) {
wsPortlet.getGridGroupContainer().unmask();
wsPortlet.getGridGroupContainer().updateStore(result);
}
});
}
}
}
@Override
public void movedItems(String sourceParentIdentifier, FileModel targetParent) {
updateStoreByRpc(targetParent);
}
@Override
public void switchView(ViewSwitchType type){
if(type.equals(ViewSwitchType.Tree) || type.equals(ViewSwitchType.SmartFolder)){
wsPortlet.getGxtCardLayoutResultPanel().setActivePanel(ViewSwitchTypeInResult.Group);
wsPortlet.getSearchAndFilterContainer().setEmptyText(ConstantsPortlet.SEARCHINWORSPACE);
}
else{
wsPortlet.getGxtCardLayoutResultPanel().setActivePanel(ViewSwitchTypeInResult.Messages);
wsPortlet.getSearchAndFilterContainer().setEmptyText(ConstantsPortlet.SEARCHINMESSAGE);
}
//***ADDED 24/04/2012
wsPortlet.getSearchAndFilterContainer().searchCancel();
eventBus.fireEvent(new SearchTextEvent(null));
// appContrExplorer.searching(false);
//**************
}
@Override
public void refreshFolder(FileModel folderTarget) {
updateStoreByRpc(folderTarget);
}
// @Override
// public void updatePrevieMessage(String fromLogin, String subject,
// String date, String body, List<FileModel> attachs) {
// wsPortlet.getMessagesPanelContainer().setBodyValue(subject, body);
// wsPortlet.getMessagesPanelContainer().setFromTitle(fromLogin, date);
// wsPortlet.getMessagesPanelContainer().setAttachs(attachs);
//
// }
@Override
public void createNewMessage(final HashMap<String, String> hashAttachs) {
GWT.runAsync(MailForm.class, new RunAsyncCallback() {
@Override
public void onSuccess() {
if (hashAttachs.size() == 0) { //no attachments
new MailForm();
} else {
new MailForm(hashAttachs);
}
}
public void onFailure(Throwable reason) {
Window.alert("Could not load this component: " + reason.getMessage());
}
});
}
}

View File

@ -0,0 +1,52 @@
package org.gcube.portlets.user.workspace.client;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class ConstantsPortlet {
// ToolBar button
public static final String ADDFOLDER = "Add Folder";
public static final String REMOVEITEM = "Remove Item";
public static final String RENAMEITEM = "Rename Item";
public static final String UPLOADFILE = "Upload File";
public static final String DOWNLOADITEM = "Download Item";
public static final String UPLOADARCHIVE = "Upload Archive";
public static final String GET_SEARCH_PARAMETER ="search";
// Div Gwt
public static final String WORKSPACEDIV = "workspaceDiv";
// Panels Names
public static final String WORKSPACE = "Workspace";
public static final String EXPLORER = "Explorer";
public static final String DETAILS = "Details";
public static final String RESULT = "Result";
public enum ViewSwitchTypeInResult {
List, Icons, Group, Messages
};
// Messages
public static final String FIELDVALIDATEERROR = "The field must be alphanumeric";
// Filter Panel
public static final String SEARCH = "Search";
public static final String SAVE = "Save";
public static final String CANCEL = "Cancel";
public static final String SEARCHINWORSPACE = "Search in workspace";
public static final String SEARCHINMESSAGE = "Search in messages";
public static final String VIEWSPACE = "Filter by Space";
public static final String PREVIEW = "Preview";
public static final String OPEN = "Open";
public static final String TITLEACCESSWEBDAV = "Access from Desktop";
//COOKIE SETTINGS
public static final String GCUBE_COOKIE_WORKSPACE_GRID_VIEW_SETTING = "GCUBE-Cookie-WorkspaceGridViewSetting";
public static final int COOKIE_EXPIRE_DAYS = 30;
public static final long MILLISECS_PER_DAY = 1000L * 60L * 60L * 24L;
}

View File

@ -0,0 +1,64 @@
package org.gcube.portlets.user.workspace.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class WorkspacePortlet implements EntryPoint {
/**
* This is the entry point method.
*/
AppController appController;
public void onModuleLoad() {
AppControllerExplorer appControllerExplorer = new AppControllerExplorer();
appController = new AppController(appControllerExplorer);
appController.go(RootPanel.get(ConstantsPortlet.WORKSPACEDIV));
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
System.out.println("onWindowResized width: "+event.getWidth()+" height: "+event.getHeight());
updateSize();
}
});
updateSize();
}
/**
* Update window size
*/
public void updateSize(){
RootPanel workspace = RootPanel.get(ConstantsPortlet.WORKSPACEDIV);
int topBorder = workspace.getAbsoluteTop();
int leftBorder = workspace.getAbsoluteLeft();
int rootHeight = (Window.getClientHeight() - topBorder - 4) ;// - ((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);
appController.getMainPanel().setHeight(rootHeight);
appController.getMainPanel().setWidth(rootWidth);
}
}

View File

@ -0,0 +1,32 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class ActiveGroupingView extends GwtEvent<ActiveGroupingViewHandler> {
public static Type<ActiveGroupingViewHandler> TYPE = new Type<ActiveGroupingViewHandler>();
private boolean activeGrouping;
public boolean isActiveGrouping() {
return activeGrouping;
}
public ActiveGroupingView(boolean active) {
this.activeGrouping = active;
}
@Override
public Type<ActiveGroupingViewHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(ActiveGroupingViewHandler handler) {
handler.onActiveGroupingView(this);
}
}

View File

@ -0,0 +1,7 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
public interface ActiveGroupingViewHandler extends EventHandler {
void onActiveGroupingView(ActiveGroupingView activeGroupingView);
}

View File

@ -0,0 +1,35 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.event.shared.GwtEvent;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class DoubleClickElementSelectedEvent extends GwtEvent<DoubleClickElementSelectedEventHandler> {
public static Type<DoubleClickElementSelectedEventHandler> TYPE = new Type<DoubleClickElementSelectedEventHandler>();
private FileGridModel targetFile = null;
public DoubleClickElementSelectedEvent(ModelData target) {
this.targetFile = (FileGridModel) target;
}
@Override
public Type<DoubleClickElementSelectedEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(DoubleClickElementSelectedEventHandler handler) {
handler.onDoubleClickElementGrid(this);
}
public FileGridModel getSourceFile() {
return targetFile;
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface DoubleClickElementSelectedEventHandler extends EventHandler {
void onDoubleClickElementGrid(DoubleClickElementSelectedEvent doubleClickElementSelectedEvent);
}

View File

@ -0,0 +1,37 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.event.shared.GwtEvent;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GridElementSelectedEvent extends GwtEvent<GridElementSelectedEventHandler> {
public static Type<GridElementSelectedEventHandler> TYPE = new Type<GridElementSelectedEventHandler>();
private FileGridModel targetFile = null;
public GridElementSelectedEvent(ModelData target) {
this.targetFile = (FileGridModel) target;
}
@Override
public Type<GridElementSelectedEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(GridElementSelectedEventHandler handler) {
handler.onGridElementSelected(this);
}
public FileGridModel getSourceFile() {
return targetFile;
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface GridElementSelectedEventHandler extends EventHandler {
void onGridElementSelected(GridElementSelectedEvent event);
}

View File

@ -0,0 +1,22 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GridElementUnSelectedEvent extends GwtEvent<GridElementUnSelectedEventHandler> {
public static Type<GridElementUnSelectedEventHandler> TYPE = new Type<GridElementUnSelectedEventHandler>();
@Override
public Type<GridElementUnSelectedEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(GridElementUnSelectedEventHandler handler) {
handler.onGridElementUnSelected(this);
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface GridElementUnSelectedEventHandler extends EventHandler {
void onGridElementUnSelected(GridElementUnSelectedEvent event);
}

View File

@ -0,0 +1,35 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.MessageModel;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.event.shared.GwtEvent;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GridMessageSelectedEvent extends GwtEvent<GridMessageSelectedEventHandler> {
public static Type<GridMessageSelectedEventHandler> TYPE = new Type<GridMessageSelectedEventHandler>();
private MessageModel targetMessage = null;
public GridMessageSelectedEvent(ModelData target) {
this.targetMessage = (MessageModel) target;
}
@Override
public Type<GridMessageSelectedEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(GridMessageSelectedEventHandler handler) {
handler.onGridMessageSelected(this);
}
public MessageModel getTargetMessage() {
return targetMessage;
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface GridMessageSelectedEventHandler extends EventHandler {
void onGridMessageSelected(GridMessageSelectedEvent gridMessageSelectedEvent);
}

View File

@ -0,0 +1,36 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.MessageModel;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.event.shared.GwtEvent;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GridMessageUnSelectedEvent extends GwtEvent<GridMessageUnSelectedEventHandler> {
public static Type<GridMessageUnSelectedEventHandler> TYPE = new Type<GridMessageUnSelectedEventHandler>();
private MessageModel targetMessage = null;
public GridMessageUnSelectedEvent(ModelData target) {
this.targetMessage = (MessageModel) target;
}
@Override
public Type<GridMessageUnSelectedEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(GridMessageUnSelectedEventHandler handler) {
handler.onGridMessageUnSelected(this);
}
public MessageModel getTargetMessage() {
return targetMessage;
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface GridMessageUnSelectedEventHandler extends EventHandler {
void onGridMessageUnSelected(GridMessageUnSelectedEvent gridMessageUnSelectedEvent);
}

View File

@ -0,0 +1,47 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import com.google.gwt.event.shared.GwtEvent;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GridRenameItemEvent extends GwtEvent<GridRenameItemEventHandler> {
public static Type<GridRenameItemEventHandler> TYPE = new Type<GridRenameItemEventHandler>();
private FileGridModel fileGridModel = null;
private String newName;
private String extension;
public GridRenameItemEvent(FileGridModel fileGridModel, String newName, String extension) {
this.fileGridModel = fileGridModel;
this.newName = newName;
this.extension = extension;
}
@Override
public Type<GridRenameItemEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(GridRenameItemEventHandler handler) {
handler.onGridItemRename(this);
}
public FileGridModel getFileGridModel() {
return fileGridModel;
}
public String getNewName() {
return newName;
}
public String getExtension() {
return extension;
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface GridRenameItemEventHandler extends EventHandler {
void onGridItemRename(GridRenameItemEvent event);
}

View File

@ -0,0 +1,28 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class LoadAllScopeEvent extends GwtEvent<LoadAllScopeEventHandler> {
public static Type<LoadAllScopeEventHandler> TYPE = new Type<LoadAllScopeEventHandler>();
public LoadAllScopeEvent() {
}
@Override
public Type<LoadAllScopeEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(LoadAllScopeEventHandler handler) {
handler.onLoadScopes(this);
}
}

View File

@ -0,0 +1,11 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface LoadAllScopeEventHandler extends EventHandler {
void onLoadScopes(LoadAllScopeEvent loadAllScopeEvent);
}

View File

@ -0,0 +1,35 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import com.google.gwt.event.shared.GwtEvent;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class PathElementSelectedEvent extends GwtEvent<PathElementSelectedEventHandler> {
public static Type<PathElementSelectedEventHandler> TYPE = new Type<PathElementSelectedEventHandler>();
private FileModel targetFile = null;
public PathElementSelectedEvent(FileModel target) {
this.targetFile = target;
}
@Override
public Type<PathElementSelectedEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(PathElementSelectedEventHandler handler) {
handler.onPathElementSelected(this);
}
public FileModel getSourceFile() {
return targetFile;
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface PathElementSelectedEventHandler extends EventHandler {
void onPathElementSelected(PathElementSelectedEvent event);
}

View File

@ -0,0 +1,45 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class SaveSmartFolderEvent extends GwtEvent<SaveSmartFolderEventHandler>{
public static Type<SaveSmartFolderEventHandler> TYPE = new Type<SaveSmartFolderEventHandler>();
private String smartFolderName;
private String searchText;
private String workpaceFolderId;
public SaveSmartFolderEvent(String smartFolderName, String searchText, String workpaceFolderId) {
this.smartFolderName = smartFolderName;
this.searchText = searchText;
this.workpaceFolderId = workpaceFolderId;
}
@Override
public Type<SaveSmartFolderEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(SaveSmartFolderEventHandler handler) {
handler.onSaveSmartFolder(this);
}
public String getSmartFolderName() {
return smartFolderName;
}
public String getSearchText() {
return searchText;
}
public String getWorkpaceFolderId() {
return workpaceFolderId;
}
}

View File

@ -0,0 +1,11 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface SaveSmartFolderEventHandler extends EventHandler {
void onSaveSmartFolder(SaveSmartFolderEvent saveSmartFolderEvent);
}

View File

@ -0,0 +1,35 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class ScopeChangeEvent extends GwtEvent<ScopeChangeEventHandler> {
public static Type<ScopeChangeEventHandler> TYPE = new Type<ScopeChangeEventHandler>();
private String scopeId;
public ScopeChangeEvent(String scopeId) {
this.scopeId = scopeId;
}
@Override
public Type<ScopeChangeEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(ScopeChangeEventHandler handler) {
handler.onLoadScope(this);
}
public String getScopeId() {
return scopeId;
}
}

View File

@ -0,0 +1,11 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface ScopeChangeEventHandler extends EventHandler {
void onLoadScope(ScopeChangeEvent scopeChangeEvent);
}

View File

@ -0,0 +1,34 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class SearchTextEvent extends GwtEvent<SearchTextEventHandler> {
public static Type<SearchTextEventHandler> TYPE = new Type<SearchTextEventHandler>();
private String textSearch = null;
public SearchTextEvent(String text) {
this.textSearch = text;
}
@Override
public Type<SearchTextEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(SearchTextEventHandler handler) {
handler.onSearchText(this);
}
public String getTextSearch() {
return textSearch;
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public interface SearchTextEventHandler extends EventHandler {
void onSearchText(SearchTextEvent searchTextEvent);
}

View File

@ -0,0 +1,48 @@
package org.gcube.portlets.user.workspace.client.model;
import java.util.List;
import com.extjs.gxt.ui.client.store.GroupingStore;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* This class is not used
*/
public class GroupingStoreModel implements StoreOperationsInterface{
public static GroupingStoreModel instance;
private GroupingStore<FileGridModel> store;
public static GroupingStoreModel getInstance()
{
if (instance == null)
instance = new GroupingStoreModel();
return instance;
}
public GroupingStoreModel() {
setStore(new GroupingStore<FileGridModel>());
}
private void setStore(GroupingStore<FileGridModel> store){
this.store = store;
}
public GroupingStore<FileGridModel> getStore(){
return this.store;
}
@Override
public List<FileGridModel> getListModel() {
return this.store.getModels();
}
@Override
public void setListModel(List<FileGridModel> listModel) {
this.store.removeAll();
this.store.add(listModel);
}
}

View File

@ -0,0 +1,47 @@
package org.gcube.portlets.user.workspace.client.model;
import java.util.List;
import com.extjs.gxt.ui.client.store.ListStore;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* This class is not used
*/
public class ListStoreModel implements StoreOperationsInterface{
public static ListStoreModel instance;
private ListStore<FileGridModel> store;
public static ListStoreModel getInstance()
{
if (instance == null)
instance = new ListStoreModel();
return instance;
}
public ListStoreModel() {
setStore(new ListStore<FileGridModel>());
}
private void setStore(ListStore<FileGridModel> store){
this.store = store;
}
public ListStore<FileGridModel> getStore(){
return this.store;
}
@Override
public List<FileGridModel> getListModel() {
return this.store.getModels();
}
@Override
public void setListModel(List<FileGridModel> listModel) {
this.store.removeAll();
this.store.add(listModel);
}
}

View File

@ -0,0 +1,14 @@
package org.gcube.portlets.user.workspace.client.model;
import java.util.List;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* This class is not used
*/
public interface StoreOperationsInterface {
List<FileGridModel> getListModel();
void setListModel(List<FileGridModel> listModel);
}

View File

@ -0,0 +1,106 @@
package org.gcube.portlets.user.workspace.client.view;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.workspace.client.model.ScopeModel;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtComboBox {
ListStore<StringNameFilterModel> stringNameFilterModel = null;
ListStore<ScopeModel> scopeNameModels = null;
ComboBox<StringNameFilterModel> comboStringFilter = null;
ComboBox<ScopeModel> comboViewScope = null;
public GxtComboBox() {
this.createComboBox();
}
private void createComboBox() {
scopeNameModels = new ListStore<ScopeModel>();
comboViewScope = new ComboBox<ScopeModel>();
comboViewScope.setEmptyText("Select a Scope...");
comboViewScope.setDisplayField("name");
comboViewScope.setStore(scopeNameModels);
comboViewScope.setTypeAhead(true);
comboViewScope.setEditable(false);
comboViewScope.setTriggerAction(TriggerAction.ALL);
comboStringFilter = new ComboBox<StringNameFilterModel>();
comboStringFilter.setWidth(150);
comboStringFilter.setStore(stringNameFilterModel);
comboStringFilter.setDisplayField("name");
comboStringFilter.setTypeAhead(true);
comboStringFilter.setEditable(false);
comboStringFilter.setTriggerAction(TriggerAction.ALL);
}
public ComboBox<ScopeModel> getComboViewScope(){
return comboViewScope;
}
public SimpleComboBox<String> getComboStringFilter() {
List<String> ls = new ArrayList<String>();
ls.add("is");
ls.add("contains");
ls.add("begin with");
ls.add("end with");
SimpleComboBox<String> scb = new SimpleComboBox<String>();
scb.setEmptyText("Select filter on item name");
scb.setTypeAhead(true);
scb.setEditable(false);
scb.setTriggerAction(TriggerAction.ALL); //Open list items also after the selection
scb.add(ls);
return scb;
}
public void setListScope(List<ScopeModel> listScope){
this.scopeNameModels.add(listScope);
}
// private List<StringNameFilterModel> getStringFilter() {
// List<StringNameFilterModel> stringNameFil = new ArrayList<StringNameFilterModel>();
// stringNameFil.add(new StringNameFilterModel("is"));
// stringNameFil.add(new StringNameFilterModel("contain"));
// stringNameFil.add(new StringNameFilterModel("begin"));
// stringNameFil.add(new StringNameFilterModel("end"));
// return stringNameFil;
// }
public SimpleComboBox<String> getComboNameFilter() {
List<String> ls = new ArrayList<String>();
ls.add("Common Name");
ls.add("Scientific Name");
ls.add("Common/Scientific Name");
SimpleComboBox<String> scb = new SimpleComboBox<String>();
scb.setEmptyText("Select Criteria");
scb.setTypeAhead(true);
scb.setEditable(false);
scb.setTriggerAction(TriggerAction.ALL);
scb.add(ls);
return scb;
}
}

View File

@ -0,0 +1,233 @@
package org.gcube.portlets.user.workspace.client.view;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
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.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtDetailsContainer extends Viewport{
private TextField<String> txfName = new TextField<String>();
private TextArea txtDescription = new TextArea();
private Text txtLabelOwner = new Text("Owner:");
private Text txtLabelCreationTime = new Text("Creation Time:");
private Text txtLabelDimension = new Text("Dimension:");
private Text txtOwner = new Text("Empty");
private Text txtCreationTime = new Text("Empty");
private Text txtDimension = new Text("Empty");
private ContentPanel west = new ContentPanel();
private ContentPanel center = new ContentPanel();
public GxtDetailsContainer(){
this.initBorderLayout();
this.initItemsPropertiesLayout();
this.initItemsDetailsLayout();
}
private void initItemsDetailsLayout() {
LayoutContainer itemsDetails = new LayoutContainer();
itemsDetails.setLayout(new ColumnLayout());
VerticalPanel vp = new VerticalPanel();
vp.setStyleAttribute("padding", "5px");
vp.setLayout(new FitLayout());
Text txtTitle = new Text("Items-Details");
txtTitle.setStyleAttribute("font-weight", "bold");
vp.add(txtTitle);
LayoutContainer left = new LayoutContainer();
left.setStyleAttribute("paddingRight", "20px");
HorizontalPanel hpOwner = new HorizontalPanel();
hpOwner.setSpacing(5);
txtLabelOwner.setStyleAttribute("padding-left", "5px");
hpOwner.add(txtLabelOwner);
hpOwner.add(txtOwner);
HorizontalPanel hpCreationTime = new HorizontalPanel();
hpCreationTime.setSpacing(5);
txtLabelCreationTime.setStyleAttribute("padding-left", "5px");
hpCreationTime.add(txtLabelCreationTime);
hpCreationTime.add(txtCreationTime);
HorizontalPanel hpDimension = new HorizontalPanel();
hpDimension.setSpacing(5);
txtLabelDimension.setStyleAttribute("padding-left", "5px");
hpDimension.add(txtLabelDimension);
hpDimension.add(txtDimension);
LayoutContainer right = new LayoutContainer();
right.setStyleAttribute("paddingLeft", "20px");
itemsDetails.add(left, new ColumnData(.5));
itemsDetails.add(right, new ColumnData(.5));
vp.add(hpOwner);
vp.add(hpCreationTime);
vp.add(hpDimension);
vp.add(itemsDetails);
center.add(vp);
}
private void initBorderLayout(){
BorderLayout bl = new BorderLayout();
setLayout(bl);
west.setHeaderVisible(false);
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 400);
westData.setCollapsible(false);
westData.setFloatable(false);
westData.setSplit(false);
westData.setMargins(new Margins(3, 0, 3, 3));
center.setHeaderVisible(false);
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(3));
centerData.setCollapsible(false);
centerData.setFloatable(true);
centerData.setSplit(true);
add(west, westData);
add(center, centerData);
}
private void initItemsPropertiesLayout() {
LayoutContainer itemsDetails = new LayoutContainer();
itemsDetails.setLayout(new ColumnLayout());
VerticalPanel vp = new VerticalPanel();
vp.setStyleAttribute("padding", "5px");
vp.setLayout(new FitLayout());
Text txtTitle = new Text("Items-Properties");
txtTitle.setStyleAttribute("font-weight", "bold");
vp.add(txtTitle);
FormPanel formPanel = new FormPanel();
// formPanel.setFrame(true);
formPanel.setHeaderVisible(false);
formPanel.setBodyBorder(false);
FormData formData = new FormData("100%");
LayoutContainer left = new LayoutContainer();
left.setStyleAttribute("paddingRight", "20px");
FormLayout layout = new FormLayout();
layout.setLabelAlign(LabelAlign.TOP);
// layout.setLabelWidth(40);
left.setLayout(layout);
// txtName.setEnabled(false);
txfName.setReadOnly(true);
txfName.setFieldLabel("Name");
left.add(txfName, formData);
LayoutContainer right = new LayoutContainer();
right.setStyleAttribute("paddingLeft", "20px");
layout = new FormLayout();
// layout.setLabelWidth(40);
layout.setLabelAlign(LabelAlign.TOP);
right.setLayout(layout);
// txtDescription.setEnabled(false);
txtDescription.setReadOnly(true);
txtDescription.setHeight(50);
txtDescription.setFieldLabel("Description");
right.add(txtDescription, formData);
itemsDetails.add(left, new ColumnData(.5));
itemsDetails.add(right, new ColumnData(.5));
formPanel.add(itemsDetails,new FormData("100%"));
west.add(vp);
west.add(formPanel);
}
public TextField<String> getTxtName() {
return txfName;
}
public void setTxtName(TextField<String> txtName) {
this.txfName = txtName;
}
public TextArea getTxtDescription() {
return txtDescription;
}
public void setTxtDescription(TextArea txtDescription) {
this.txtDescription = txtDescription;
}
public Text getTxtOwner() {
return txtOwner;
}
public void setTxtOwner(Text txtOwner) {
this.txtOwner = txtOwner;
}
public Text getTxtCreationTime() {
return txtCreationTime;
}
public void setTxtCreationTime(Text txtCreationTime) {
this.txtCreationTime = txtCreationTime;
}
public Text getTxtDimension() {
return txtDimension;
}
public void setTxtDimension(Text txtDimension) {
this.txtDimension = txtDimension;
}
public void resetDetails(){
this.txtDimension.setText("");
this.txtCreationTime.setText("");
this.txfName.reset();
this.txtDescription.reset();
this.txtOwner.setText("");
}
public void setDetails(String itemName, String description, String dimension, String creationTime, String owner){
this.resetDetails();
this.txtDimension.setText(dimension);
this.txtCreationTime.setText(creationTime);
this.txfName.setValue(itemName);
this.txtDescription.setValue(description);
this.txtOwner.setText(owner);
}
}

View File

@ -0,0 +1,67 @@
package org.gcube.portlets.user.workspace.client.view;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.model.ListStoreModel;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.ListView;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtListView extends LayoutContainer {
private ContentPanel cp = new ContentPanel();
// private String headerTitle = ConstantsPortlet.RESULT;
private ListStore<FileGridModel> store = ListStoreModel.getInstance().getStore();
public GxtListView() {
cp.setBodyBorder(false);
cp.setHeading(ConstantsPortlet.RESULT);
cp.setHeaderVisible(true);
ListView<FileGridModel> view = new ListView<FileGridModel>() {
@Override
protected FileGridModel prepareData(FileGridModel model) {
String s = model.get(ConstantsExplorer.NAME);
model.set("shortName", Format.ellipse(s, 15));
return model;
}
};
view.setStore(store);
view.setItemSelector("div.thumb-wrap");
view.getSelectionModel().addListener(Events.SelectionChange, new Listener<SelectionChangedEvent<FileModel>>() {
public void handleEvent(SelectionChangedEvent<FileModel> be) {
cp.setHeading("Simple ListView (" + be.getSelection().size()
+ " items selected)");
}
});
cp.add(view);
add(cp);
}
private native String getTemplate() /*-{
return [ '<tpl for=".">', '<div class="thumb-wrap" id="{Name}">',
'<div class="thumb"><img src="{path}" title="{Name}"></div>',
'<span class="x-editable">{shortName}</span></div>', '</tpl>',
'<div class="x-clear"></div>' ].join("");
}-*/;
}

View File

@ -0,0 +1,32 @@
package org.gcube.portlets.user.workspace.client.view;
import com.extjs.gxt.ui.client.data.BaseModelData;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class StringNameFilterModel extends BaseModelData {
/**
*
*/
private static final long serialVersionUID = 1L;
public StringNameFilterModel() {
}
public StringNameFilterModel(String name) {
setName(name);
}
public String getName() {
return get("name");
}
public void setName(String name) {
set("name", name);
}
}

View File

@ -0,0 +1,97 @@
package org.gcube.portlets.user.workspace.client.view;
import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtBasicTabPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtBorderLayoutPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtCardLayoutResultPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtSeachAndFilterPanel;
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtPathPanel;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class WorskpacePortlet {
private GxtBorderLayoutPanel borderLayoutContainer = null;
private GxtBasicTabPanel basicTabContainer = null;
// private GxtToolBarFunctionsPanel toolbarPanelContainer = null;
private ExplorerPanel explorerPanel = null;
private GxtDetailsContainer detailsContainer;
private GxtListView listViewContainer;
private GxtPathPanel toolBarPathPanel;
private GxtGridFilterGroupPanel gridFilterGroupContainer;
private GxtSeachAndFilterPanel searchAndFilterContainer;
private GxtGridFilterGroupPanel gridFilterContainer;
private GxtCardLayoutResultPanel gxtCardLayoutResultPanel;
public WorskpacePortlet(boolean activeGroup) {
// Log.trace("Initializing WorskpacePortlet");
this.basicTabContainer = new GxtBasicTabPanel();
this.toolBarPathPanel = new GxtPathPanel();
this.searchAndFilterContainer = new GxtSeachAndFilterPanel(this.toolBarPathPanel.getToolBarPathPanel());
this.gridFilterContainer = new GxtGridFilterGroupPanel(false);
this.gridFilterGroupContainer = new GxtGridFilterGroupPanel(activeGroup);
this.listViewContainer = new GxtListView();
this.detailsContainer = new GxtDetailsContainer();
this.gxtCardLayoutResultPanel = new GxtCardLayoutResultPanel(gridFilterContainer, gridFilterGroupContainer, listViewContainer, detailsContainer);
}
public WorskpacePortlet(ExplorerPanel expPanel, boolean activeGroup) {
this(activeGroup);
this.explorerPanel = expPanel;
this.borderLayoutContainer = new GxtBorderLayoutPanel(this.searchAndFilterContainer, this.explorerPanel, this.gxtCardLayoutResultPanel, this.detailsContainer);
}
public GxtBorderLayoutPanel getBorderLayoutContainer() {
return borderLayoutContainer;
}
public GxtBasicTabPanel getBasicTabContainer() {
return basicTabContainer;
}
public GxtDetailsContainer getDetailsContainer() {
return detailsContainer;
}
public GxtSeachAndFilterPanel getSearchAndFilterContainer() {
return searchAndFilterContainer;
}
public GxtPathPanel getToolBarPath() {
return toolBarPathPanel;
}
public GxtGridFilterGroupPanel getGridGroupContainer() {
return gridFilterGroupContainer;
}
public ExplorerPanel getExplorerPanel() {
return explorerPanel;
}
public GxtGridFilterGroupPanel getGridFilterContainer() {
return gridFilterContainer;
}
public void setGridFilterContainer(GxtGridFilterGroupPanel gridFilterContainer) {
this.gridFilterContainer = gridFilterContainer;
}
public GxtCardLayoutResultPanel getGxtCardLayoutResultPanel() {
return gxtCardLayoutResultPanel;
}
}

View File

@ -0,0 +1,450 @@
package org.gcube.portlets.user.workspace.client.view.grids;
import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.workspace.client.AppController;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.GridElementUnSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.model.GroupingStoreModel;
import com.extjs.gxt.ui.client.Style.SelectionMode;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.GridEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.store.GroupingStore;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Record;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
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.grid.GridCellRenderer;
import com.extjs.gxt.ui.client.widget.grid.GroupingView;
import com.extjs.gxt.ui.client.widget.grid.filters.DateFilter;
import com.extjs.gxt.ui.client.widget.grid.filters.GridFilters;
import com.extjs.gxt.ui.client.widget.grid.filters.NumericFilter;
import com.extjs.gxt.ui.client.widget.grid.filters.StringFilter;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.i18n.client.NumberFormat;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtGridFilterGroupPanel extends LayoutContainer {
private ContentPanel cp = new ContentPanel();
// private ListStore<FileModel> store = ListStoreModel.getInstance().getStore();
private GroupingStore<FileGridModel> store = GroupingStoreModel.getInstance().getStore();
private FileGridModel currenItemSelected = null;
private FileModel currentFolderView = null;
private final NumberFormat number = NumberFormat.getFormat("#,##0 KB;(#,##0 KB)");
private GroupingView view = new GroupingView();
private boolean groupingEnabled = false;
public GxtGridFilterGroupPanel(boolean group) {
setLayout(new FitLayout());
ColumnConfig icon = new ColumnConfig(ConstantsExplorer.ICON, "", 25);
ColumnConfig name = new ColumnConfig(ConstantsExplorer.NAME, ConstantsExplorer.NAME, 300);
ColumnConfig type = new ColumnConfig(ConstantsExplorer.TYPE, ConstantsExplorer.TYPE, 100);
ColumnConfig creationDate = new ColumnConfig(ConstantsExplorer.GRIDCOLUMNCREATIONDATE, ConstantsExplorer.GRIDCOLUMNCREATIONDATE, 100);
ColumnConfig category = new ColumnConfig(ConstantsExplorer.SHORTCUTCATEGORY, ConstantsExplorer.SHORTCUTCATEGORY, 100);
ColumnConfig size = new ColumnConfig(ConstantsExplorer.SIZE, ConstantsExplorer.SIZE, 50);
size.setEditor(new CellEditor(new NumberField()));
ColumnModel cm = null;
if(group)
cm = new ColumnModel(Arrays.asList(icon, name, type, creationDate, size, category));
else
cm = new ColumnModel(Arrays.asList(icon, name, type, creationDate, size));
final ColumnModel columnModel = cm;
cp.setBodyBorder(true);
// cp.setHeading(ConstantsPortlet.RESULT);
cp.setHeaderVisible(false);
cp.setLayout(new FitLayout());
final Grid<FileGridModel> grid = new Grid<FileGridModel>(store, columnModel);
grid.getView().setAutoFill(true);
grid.setBorders(true);
view.setShowGroupedColumn(false);
view.setForceFit(true);
grid.setView(view);
view.setEmptyText(ConstantsExplorer.EMPTY);
// view.setGroupRenderer(new GridGroupRenderer() {
// public String render(GroupColumnData data) {
// String f = columnModel.getColumnById(data.field).getHeader();
// String l = data.models.size() == 1 ? "Item" : "Items";
// return f + ": " + data.group + " (" + data.models.size() + " " + l + ")";
// }
// });
if(group){
store.groupBy(ConstantsExplorer.SHORTCUTCATEGORY);
groupingEnabled = true;
}
GridCellRenderer<FileGridModel> folderRender = new GridCellRenderer<FileGridModel>() {
@Override
public String render(FileGridModel model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<FileGridModel> store, Grid<FileGridModel> grid) {
String val = model.get(property);
String color = "black";
if(val != null && val.equals(GXTFolderItemTypeEnum.FOLDER.toString())){
// color = "#EEC900";
return "<span qtitle='" + columnModel.getColumnById(property).getHeader() + "' qtip='" + val + "' style='font-weight: bold;color:" + color + "'>" + val + "</span>";
}else{
if(val==null)
val = "";
return "<span qtitle='" + columnModel.getColumnById(property).getHeader() + "' qtip='" + val + "' style='color:" + color + "'>" + val + "</span>";
}
}
};
GridCellRenderer<FileGridModel> kbRender = new GridCellRenderer<FileGridModel>() {
@Override
public String render(FileGridModel model, String property, ColumnData config,
int rowIndex, int colIndex, ListStore<FileGridModel> store, Grid<FileGridModel> grid) {
long value = (Long) model.get(property);
if(value!=-1){
String color = "black";
// int val = Integer.parseInt(value);
// String style = (val/1024) < 2000000 ? "red" : "green";
double kb = value/1024;
if(kb<1)
kb=1;
return "<span style='color:"+color+"'>" + number.format(kb) + "</span>";
}
return "";
}
};
size.setRenderer(kbRender);
type.setRenderer(folderRender);
//setAlphanumericStoreSorter(grid);
GridFilters filters = new GridFilters();
filters.setLocal(true);
StringFilter nameFilter = new StringFilter(ConstantsExplorer.NAME);
StringFilter authorFilter = new StringFilter(ConstantsExplorer.TYPE);
DateFilter dateFilter = new DateFilter(ConstantsExplorer.GRIDCOLUMNCREATIONDATE);
NumericFilter sizeFilter = new NumericFilter(ConstantsExplorer.SIZE);
filters.addFilter(nameFilter);
filters.addFilter(authorFilter);
filters.addFilter(dateFilter);
filters.addFilter(sizeFilter);
// grid.setStyleAttribute("borderTop", "none");
grid.setAutoExpandColumn(ConstantsExplorer.NAME);
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
grid.getView().setShowDirtyCells(false);
// grid.setSize(500, 500);
grid.addPlugin(filters);
grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
grid.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<FileGridModel>() {
@Override
public void selectionChanged(SelectionChangedEvent<FileGridModel> se) {
System.out.println("selection grid change");
ModelData target = se.getSelectedItem();
if(target!=null){
currenItemSelected = (FileGridModel) target;
AppController.getEventBus().fireEvent(new GridElementSelectedEvent(target));
}
else{
currenItemSelected = null;
AppController.getEventBus().fireEvent(new GridElementUnSelectedEvent());
}
}
});
grid.addListener(Events.RowDoubleClick, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
FileGridModel fileModel = grid.getSelectionModel().getSelectedItem();
if(fileModel!=null)
fireEventByFileModelType(fileModel);
// if(fileModel.isDirectory())
// AppController.getEventBus().fireEvent(new DoubleClickElementSelectedEvent(fileModel));
}
});
grid.setContextMenu(null); //add context menu null - ignore browse event right click
grid.addListener(Events.OnContextMenu, new Listener<GridEvent<FileGridModel>>(){
@Override
public void handleEvent(GridEvent<FileGridModel> be)
{
if(be.isRightClick())
{
if(grid.getSelectionModel().getSelectedItem()!=null){
FileGridModel fileGridModel = grid.getSelectionModel().getSelectedItem();
AppController.getEventBus().fireEvent(new OpenContextMenuTreeEvent(fileGridModel, be.getClientX(), be.getClientY()));
}
}
}
});
cp.add(grid);
add(cp);
}
public void disableGrouping() {
GroupingStore<FileGridModel> groupingStore = null;
if (this.getStore() instanceof GroupingStore) {
groupingStore = (GroupingStore<FileGridModel>) this.getStore();
if (groupingStore != null) {
groupingStore.clearGrouping();
}
this.groupingEnabled = false;
}
}
public void enableGrouping() {
GroupingStore<FileGridModel> groupingStore = null;
if (this.getStore() instanceof GroupingStore) {
groupingStore = (GroupingStore<FileGridModel>) this.getStore();
if (groupingStore != null) {
groupingStore.groupBy(ConstantsExplorer.SHORTCUTCATEGORY);
}
this.groupingEnabled = true;
}
}
private void fireEventByFileModelType(FileModel target){
if(target.isDirectory()){
AppController.getEventBus().fireEvent(new DoubleClickElementSelectedEvent(target));
return;
}
switch(target.getGXTFolderItemType()){
case EXTERNAL_IMAGE:
AppController.getEventBus().fireEvent(new ImagePreviewEvent(target, 0, 0));
break;
case EXTERNAL_FILE:
AppController.getEventBus().fireEvent(new FileDownloadEvent(target.getIdentifier(), target.getName(), DownloadType.SHOW));
break;
case EXTERNAL_PDF_FILE:
AppController.getEventBus().fireEvent(new FileDownloadEvent(target.getIdentifier(), target.getName(), DownloadType.SHOW));
break;
case EXTERNAL_URL:
AppController.getEventBus().fireEvent(new FileDownloadEvent(target.getIdentifier(), target.getName(), DownloadType.SHOW));
break;
case REPORT_TEMPLATE:
AppController.getEventBus().fireEvent(new OpenReportsEvent(target));
break;
case REPORT:
AppController.getEventBus().fireEvent(new OpenReportsEvent(target));
break;
case QUERY:
break;
case TIME_SERIES:
break;
case PDF_DOCUMENT:
AppController.getEventBus().fireEvent(new FileDownloadEvent(target.getIdentifier(), target.getName(), DownloadType.SHOW));
break;
case IMAGE_DOCUMENT:
AppController.getEventBus().fireEvent(new ImagePreviewEvent(target,0, 0));
break;
case DOCUMENT:
AppController.getEventBus().fireEvent(new FileDownloadEvent(target.getIdentifier(), target.getName(), DownloadType.SHOW));
break;
case URL_DOCUMENT:
AppController.getEventBus().fireEvent(new FileDownloadEvent(target.getIdentifier(), target.getName(), DownloadType.SHOW));
break;
case METADATA:
break;
case WORKFLOW_REPORT:
break;
case WORKFLOW_TEMPLATE:
break;
case EXTERNAL_RESOURCE_LINK:
AppController.getEventBus().fireEvent(new FileDownloadEvent(target.getIdentifier(), target.getName(), DownloadType.SHOW));
break;
default:
}
}
private void resetStore(){
store.removeAll();
}
public boolean updateStore(List<FileGridModel> result){
resetStore();
if(result!= null){
for(FileGridModel file: result)
file.setIcon();
store.add(result);
return true;
}
return false;
}
public FileGridModel getSelectedItem(){
return currenItemSelected;
}
/**
*
* @param identifier (MANDATORY)
* @return
*/
public boolean deleteItem(String identifier) {
FileGridModel fileTarget = getFileGridModelByIdentifier(identifier);
if(fileTarget!=null){
Record record = store.getRecord(fileTarget);
store.remove((FileGridModel) record.getModel());
return true;
}
else
System.out.println("Delete Error: file target with " + identifier + " identifier not exist in store" );
return false;
}
/**
*
* @param fileTarget (MANDATORY)
* @param newName (MANDATORY)
* @param extension OPTIONAL - string or null
*/
private boolean renameItem(FileGridModel fileTarget, String newName, String extension) {
if(fileTarget!=null){
Record record = store.getRecord(fileTarget);
if(record!=null){
if(extension!= null)
record.set(ConstantsExplorer.NAME, newName+extension);
else
record.set(ConstantsExplorer.NAME, newName);
return true;
}
else
System.out.println("Record Error: file target with " + fileTarget.getIdentifier() + " identifier not exist in store" );
}
else
System.out.println("Rename Error: file target with is null" );
return false;
}
public FileModel getCurrentFolderView() {
return currentFolderView;
}
public void setCurrentFolderView(FileModel currentFolderView) {
this.currentFolderView = currentFolderView;
}
public boolean renameItem(String itemIdentifier, String newName, String extension) {
if(itemIdentifier!=null){
FileGridModel fileTarget = getFileGridModelByIdentifier(itemIdentifier);
if(fileTarget!=null){
Record record = store.getRecord(fileTarget);
if(record!=null){
if(extension!= null)
record.set(ConstantsExplorer.NAME, newName+extension);
else
record.set(ConstantsExplorer.NAME, newName);
return true;
}
}
else
System.out.println("Record Error: file target not exist in store" );
}
else
System.out.println("Rename Error: file target is null" );
return false;
}
public FileGridModel getFileGridModelByIdentifier(String id){
return (FileGridModel) store.findModel(ConstantsExplorer.IDENTIFIER, id);
}
public GroupingStore<FileGridModel> getStore(){
return store;
}
public void setBorderAsOnSearch(boolean bool){
if(this.cp.getElement("body")!=null){
if(bool){
this.cp.getElement("body").getStyle().setBorderColor("#32CD32");
}
else
this.cp.getElement("body").getStyle().setBorderColor("#99BBE8");
}
}
}

View File

@ -0,0 +1,227 @@
package org.gcube.portlets.user.workspace.client.view.grids;
import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.workspace.client.AppController;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.GridElementUnSelectedEvent;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.model.ListStoreModel;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Record;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreSorter;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
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.grid.filters.GridFilters;
import com.extjs.gxt.ui.client.widget.grid.filters.StringFilter;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
/**
* This class is not used
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtGridFilterPanel extends LayoutContainer {
private ContentPanel cp = new ContentPanel();
private ListStore<FileGridModel> store = ListStoreModel.getInstance().getStore();
private FileGridModel currenItemSelected = null;
private FileModel currentFolderView = null;
public GxtGridFilterPanel() {
setLayout(new FitLayout());
ColumnConfig name = new ColumnConfig(ConstantsExplorer.NAME, ConstantsExplorer.NAME, 400);
ColumnConfig type = new ColumnConfig(ConstantsExplorer.TYPE, ConstantsExplorer.TYPE, 100);
ColumnConfig creationDate = new ColumnConfig(ConstantsExplorer.GRIDCOLUMNCREATIONDATE, ConstantsExplorer.GRIDCOLUMNCREATIONDATE, 100);
ColumnConfig size = new ColumnConfig(ConstantsExplorer.SIZE, ConstantsExplorer.SIZE, 50);
ColumnModel cm = new ColumnModel(Arrays.asList(name, type, creationDate, size));
cp.setBodyBorder(false);
cp.setHeading(ConstantsPortlet.RESULT);
cp.setHeaderVisible(true);
cp.setLayout(new FitLayout());
GridFilters filters = new GridFilters();
filters.setLocal(true);
StringFilter nameFilter = new StringFilter(ConstantsExplorer.NAME);
StringFilter authorFilter = new StringFilter(ConstantsExplorer.TYPE);
StringFilter sizeFilter = new StringFilter(ConstantsExplorer.SIZE);
filters.addFilter(nameFilter);
filters.addFilter(authorFilter);
filters.addFilter(sizeFilter);
final Grid<FileGridModel> grid = new Grid<FileGridModel>(store, cm);
grid.getView().setAutoFill(true);
setAlphanumericStoreSorter(grid);
grid.setAutoExpandColumn(ConstantsExplorer.NAME);
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
grid.addPlugin(filters);
grid.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<FileGridModel>() {
@Override
public void selectionChanged(SelectionChangedEvent<FileGridModel> se) {
System.out.println("selection grid change");
ModelData target = se.getSelectedItem();
if(target!=null){
currenItemSelected = (FileGridModel) target;
AppController.getEventBus().fireEvent(new GridElementSelectedEvent(target));
}
else{
currenItemSelected = null;
AppController.getEventBus().fireEvent(new GridElementUnSelectedEvent());
}
}
});
grid.addListener(Events.RowDoubleClick, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
// FileGridModel fileModel = (FileGridModel) be.getSource();
// if(fileModel.isDirectory())
}
});
cp.add(grid);
add(cp);
}
private void resetStore(){
store.removeAll();
}
public boolean updateStore(List<FileGridModel> result){
resetStore();
if(result!= null){
store.add(result);
return true;
}
return false;
}
public FileGridModel getSelectedItem(){
return currenItemSelected;
}
/**
*
* @param identifier (MANDATORY)
* @return
*/
public boolean deleteItem(String identifier) {
// FileGridModel fileTarget = (FileGridModel) store.findModel("identifier", identifier);
FileGridModel fileTarget = getFileGridModelByIdentifier(identifier);
if(fileTarget!=null){
Record record = store.getRecord(fileTarget);
store.remove((FileGridModel) record.getModel());
return true;
}
else
System.out.println("Delete Error: file target with " + identifier + " identifier not exist in store" );
return false;
}
public FileModel getCurrentFolderView() {
return currentFolderView;
}
public void setCurrentFolderView(FileModel currentFolderView) {
this.currentFolderView = currentFolderView;
}
public boolean renameItem(String itemIdentifier, String newName, String extension) {
if(itemIdentifier!=null){
// FileGridModel fileTarget = (FileGridModel) store.findModel(ConstantsExplorer.IDENTIFIER, itemIdentifier);
FileGridModel fileTarget = getFileGridModelByIdentifier(itemIdentifier);
if(fileTarget!=null){
Record record = store.getRecord(fileTarget);
if(record!=null){
if(extension!= null)
record.set(ConstantsExplorer.NAME, newName+extension);
else
record.set(ConstantsExplorer.NAME, newName);
return true;
}
}
else
System.out.println("Record Error: file target not exist in store" );
}
else
System.out.println("Rename Error: file target with is null" );
return false;
}
private void setAlphanumericStoreSorter(Grid<FileGridModel> grid){
// Sorting files
grid.getStore().setStoreSorter(new StoreSorter<FileGridModel>() {
@Override
public int compare(Store<FileGridModel> store, FileGridModel m1, FileGridModel m2, String property) {
boolean m1Folder = m1.isDirectory();
boolean m2Folder = m2.isDirectory();
if (m1Folder && !m2Folder) {
return -1;
} else if (!m1Folder && m2Folder) {
return 1;
}
return m1.getName().compareTo(m2.getName());
}
});
}
public FileGridModel getFileGridModelByIdentifier(String id){
return (FileGridModel) store.findModel(ConstantsExplorer.IDENTIFIER, id);
}
public ListStore<FileGridModel> getStore(){
return store;
}
}

View File

@ -0,0 +1,290 @@
package org.gcube.portlets.user.workspace.client.view.panels;
import org.gcube.portlets.user.workspace.client.model.ScopeModel;
import org.gcube.portlets.user.workspace.client.view.GxtComboBox;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.util.Padding;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.FormButtonBinding;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.extjs.gxt.ui.client.widget.layout.VBoxLayout;
import com.extjs.gxt.ui.client.widget.layout.VBoxLayout.VBoxLayoutAlign;
import com.extjs.gxt.ui.client.widget.layout.VBoxLayoutData;
import com.google.gwt.user.client.Window;
/**
* This class is not used
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtBasicTabPanel extends LayoutContainer {
//Tab View
private TabItem tabView = null;
private TabItem tabSearch = null;
private TabPanel tabPanel = null;
private Text txtPath = new Text("PATH:");
private Label labelPath = new Label("");
private GxtComboBox comboBoxGxt = null;
private ComboBox<ScopeModel> cbViewScope = null;
// private Text txtSwitch = new Text("Explorer View:");
private Text txtViewScope = new Text("View Scope:");
public enum viewSwitchType {TREE,SHORTCUT};
private final String EMPTY = "EMPTY";
//Tab Search
private final TextField<String> textSearch = new TextField<String>();
private Button bSearch = new Button("Search");
private Button bCancel = new Button("Cancel");
private TextField<String> textFull = new TextField<String>();
private DateField fromDate = new DateField();
private DateField toDate = new DateField();
private final String FIELDVALIDATEERROR = "The field must be alphanumeric";
private SimpleComboBox<String> cbNameFilter = null;
// TableData tdContentView = null;
public GxtBasicTabPanel() {
// Log.trace("Initializing GxtBasicTabPanel");
setLayout(new FitLayout());
setBorders(true);
setId("ContentPanelTab");
this.tabPanel = new TabPanel();
this.tabView = new TabItem("View");
this.tabSearch = new TabItem("Search");
this.comboBoxGxt = new GxtComboBox();
this.cbViewScope = this.comboBoxGxt.getComboViewScope();
this.cbNameFilter = this.comboBoxGxt.getComboStringFilter();
this.initTabView();
this.initTabSearch();
}
private void initTabView() {
ContentPanel cp = new ContentPanel();
cp.setHeaderVisible(false);
cp.setLayout(new RowLayout());
cp.setBorders(false);
cp.setBodyBorder(false);
// cp.setStyleAttribute("margin-top", "20px");
tabPanel.setBorders(false);
tabPanel.setBodyBorder(false);
tabPanel.setStyleAttribute("margin-top", "10px");
tabPanel.setTabMargin(10);
tabPanel.setTabWidth(250);
tabPanel.setBorderStyle(false);
tabPanel.setPlain(true);
VBoxLayout vBoxLayout = new VBoxLayout();
vBoxLayout.setPadding(new Padding(5));
vBoxLayout.setVBoxLayoutAlign(VBoxLayoutAlign.LEFT);
VBoxLayoutData flex = new VBoxLayoutData(new Margins(30, 10, 10, 10));
txtPath.addStyleName("pad-text");
txtPath.setStyleAttribute("backgroundColor", "white");
txtPath.setAutoWidth(true);
// Radio radioTree = new Radio();
// radioTree.setBoxLabel("Tree");
// radioTree.setValue(true);
// radioTree.setValueAttribute(viewSwitchType.TREE.toString());
// Radio radioShortcut = new Radio();
// radioShortcut.setBoxLabel("Shortcut");
// radioShortcut.setValueAttribute(viewSwitchType.SHORTCUT.toString());
// RadioGroup radioGroup = new RadioGroup();
// radioGroup.setFieldLabel("Afecto");
// radioGroup.add(radioTree);
// radioGroup.add(radioShortcut);
// radioGroup.setStyleAttribute("margin-left", "20px");
HorizontalPanel hpPath = new HorizontalPanel();
hpPath.setLayout(new FitLayout());
hpPath.setBorders(true);
hpPath.add(txtPath);
this.labelPath.setEnabled(false);
this.setLabelPath("");
this.labelPath.setStyleAttribute("margin-left", "20px");
hpPath.add(this.labelPath);
HorizontalPanel hpScope = new HorizontalPanel();
hpScope.setLayout(new FitLayout());
hpScope.add(txtViewScope);
//Select in combo the first element of store
this.cbViewScope.addListener(Events.Attach, new Listener<BaseEvent>(){
public void handleEvent(BaseEvent be) {
cbViewScope.setValue(cbViewScope.getStore().getAt(0));
}
});
this.cbViewScope.addSelectionChangedListener(new SelectionChangedListener<ScopeModel>() {
@Override
public void selectionChanged(SelectionChangedEvent<ScopeModel> se) {
// Window.alert("selected scope" + se.getSelectedItem().get("name"));
//TODO
}
});
this.cbViewScope.setStyleAttribute("margin-left", "20px");
hpScope.add(this.cbViewScope);
// HorizontalPanel hpRadio = new HorizontalPanel();
// hpRadio.setLayout(new FitLayout());
// hpRadio.add(txtSwitch);
// hpRadio.add(radioGroup);
cp.add(hpPath,flex);
cp.add(hpScope,flex);
// cp.add(hpRadio, flex);
this.tabView.add(cp);
tabPanel.add(tabView);
add(tabPanel);
}
private void initTabSearch() {
ContentPanel cp = new ContentPanel();
cp.setHeaderVisible(false);
cp.setLayout(new RowLayout());
cp.setBorders(false);
cp.setBodyBorder(false);
FormPanel formPanel = new FormPanel();
formPanel.setHeaderVisible(false);
formPanel.setBodyBorder(false);
// formPanel.setFrame(true);
formPanel.setWidth(350);
FormData formData = new FormData("-20");
cbNameFilter.setFieldLabel("Name Filter");
// combo.setDisplayField("name");
formPanel.add(cbNameFilter, formData);
textSearch.setFieldLabel("Item Name");
textSearch.setAllowBlank(false);
textSearch.setRegex("^[ a-zA-Z0-9_-]*$");
// textSearch.getMessages().setRegexText(FIELDVALIDATEERROR);
formPanel.add(textSearch, formData);
fromDate.setName("date");
fromDate.setFieldLabel("From");
formPanel.add(fromDate);
toDate.setName("date");
toDate.setFieldLabel("To");
formPanel.add(toDate);
textFull.setFieldLabel("Full Text");
textFull.setAllowBlank(true);
formPanel.add(textFull, formData);
this.tabSearch.add(formPanel);
bSearch.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
if (textSearch.getValue() == null || textSearch.getValue() == "" || !textSearch.isValid()) {
// textSearch.fireEvent(Events.ValidateEdit);
textSearch.markInvalid(FIELDVALIDATEERROR);
// textSearch.forceInvalid("The field must be alphanumeric");
} else {
Window.alert("submit"); //TODO aysnc ws
// HistoryExample.addItem("search");
}
}
});
this.bCancel.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
resetFieldsInTabSearch();
}
});
formPanel.setButtonAlign(HorizontalAlignment.LEFT);
formPanel.addButton(this.bSearch);
formPanel.addButton(this.bCancel);
FormButtonBinding binding = new FormButtonBinding(formPanel);
binding.addButton(this.bSearch);
tabPanel.add(tabSearch);
add(tabPanel);
}
public void resetFieldsInTabSearch(){
this.textSearch.reset();
this.textFull.reset();
this.fromDate.reset();
this.toDate.reset();
this.cbNameFilter.reset();
}
public LayoutContainer getTabs() {
return this;
}
public String getValueComboNameFilter(){
return this.cbViewScope.getRawValue();
}
public void setLabelPath(String path){
if(path != null && (!path.isEmpty()))
this.labelPath.setText(path);
else
this.labelPath.setText(EMPTY);
}
}

View File

@ -0,0 +1,140 @@
package org.gcube.portlets.user.workspace.client.view.panels;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.view.ExplorerPanel;
import org.gcube.portlets.user.workspace.client.view.GxtDetailsContainer;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.BoxComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel;
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;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtBorderLayoutPanel extends ContentPanel {
private ContentPanel north = new ContentPanel();
private ContentPanel west = new ContentPanel();
private ContentPanel center = new ContentPanel();
private ContentPanel east = new ContentPanel();
private ContentPanel south = new ContentPanel();
private GxtDetailsContainer detailsContainer = null;
private ExplorerPanel expPanel = null; //TODO change position
private GxtSeachAndFilterPanel searchAndFilterContainer;
private GxtCardLayoutResultPanel gxtCardLayoutResultPanel;
public GxtBorderLayoutPanel(
GxtSeachAndFilterPanel searchAndFilterContainer2,
ExplorerPanel explorerPanel,
GxtCardLayoutResultPanel gxtCardLayoutResultPanel,
GxtDetailsContainer detailsContainer2) {
this.searchAndFilterContainer = searchAndFilterContainer2;
this.expPanel = explorerPanel;
this.gxtCardLayoutResultPanel = gxtCardLayoutResultPanel;
this.detailsContainer = detailsContainer2;
this.initLayout();
this.createLayouts();
}
private void initLayout(){
north.setId("NorthPanel");
north.setLayout(new FitLayout());
west.setId("WestPanel");
west.setLayout(new FitLayout());
center.setId("CenterPanel");
center.setLayout(new FitLayout());
center.setHeaderVisible(false);
east.setId("EastPanel");
center.setScrollMode(Scroll.AUTOX);
center.setBorders(false);
north.setHeaderVisible(false);
west.setHeading(ConstantsPortlet.EXPLORER);
south.setHeading(ConstantsPortlet.DETAILS);
south.setLayout(new FitLayout());
east.setVisible(false);
south.setVisible(false);
this.createLayouts();
}
public void createLayouts(){
final BorderLayout borderLayout = new BorderLayout();
setLayout(borderLayout);
//setStyleAttribute("padding", "10px");
setHeaderVisible(false);
// center.add(this.gridFilter);
BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 55, 55, 70);
northData.setCollapsible(true);
northData.setSplit(true); //Split bar between regions
// northData.setFloatable(true);
northData.setCollapsible(true);
// northData.setHideCollapseTool(false);
// northData.setSplit(true);
northData.setMargins(new Margins(0, 0, 1, 0));
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 330,330,400);
westData.setSplit(true);
westData.setCollapsible(true);
westData.setMargins(new Margins(0,1,0,0));
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(0));
BorderLayoutData eastData = new BorderLayoutData(LayoutRegion.EAST, 150,50,150);
eastData.setSplit(true);
eastData.setCollapsible(true);
eastData.setMargins(new Margins(0,0,0,1));
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 140,140,140);
southData.setSplit(true);
southData.setCollapsible(true);
southData.setMargins(new Margins(1, 0, 0, 0));
north.add(this.searchAndFilterContainer);
west.add(this.expPanel);
// center.add(this.toolbarContainer);
center.add(this.gxtCardLayoutResultPanel);
south.add(this.detailsContainer);
west.addListener(Events.Resize, new Listener<BoxComponentEvent>(){
@Override
public void handleEvent(BoxComponentEvent be) {
expPanel.getAsycTreePanel().setSizeTreePanel(expPanel.getWidth()-13, expPanel.getHeight()-39);
if(expPanel.getSmartFolderPanel()!=null)
expPanel.getSmartFolderPanel().setSizeSmartPanel(expPanel.getWidth()-2, expPanel.getHeight()-29);
}
});
add(north, northData);
add(west, westData);
add(center, centerData);
add(east, eastData);
}
}

View File

@ -0,0 +1,100 @@
package org.gcube.portlets.user.workspace.client.view.panels;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
import org.gcube.portlets.user.workspace.client.view.GxtDetailsContainer;
import org.gcube.portlets.user.workspace.client.view.GxtListView;
import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtToolBarItem;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.CardLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.user.client.Element;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtCardLayoutResultPanel extends LayoutContainer{
private CardLayout cardLayout = new CardLayout();
private GxtItemsPanel itemPanel;
private GxtGridFilterGroupPanel gridFilterViewContainer;
private GxtListView iconsViewContainer;
private GxtGridFilterGroupPanel gridGroupViewContainer;
private ContentPanel activePanel = null;
private GxtToolBarItem toolBarItem;
public GxtCardLayoutResultPanel(
GxtGridFilterGroupPanel gridFilterContainer,
GxtGridFilterGroupPanel gridFilterGroupContainer,
GxtListView listViewContainer,
GxtDetailsContainer detailsContainer) {
this.gridFilterViewContainer = gridFilterContainer;
this.iconsViewContainer = listViewContainer;
this.gridGroupViewContainer = gridFilterGroupContainer;
instanceItemsPanel();
}
private void instanceItemsPanel(){
this.toolBarItem = new GxtToolBarItem(gridGroupViewContainer); //instance toolbar
this.itemPanel = new GxtItemsPanel(gridFilterViewContainer, iconsViewContainer, gridGroupViewContainer, toolBarItem);
}
@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);
setLayout(new FitLayout());
ContentPanel cp = new ContentPanel();
cp.setHeaderVisible(false);
cp.setLayout(cardLayout);
cp.add(itemPanel);
cardLayout.setActiveItem(itemPanel);
activePanel = itemPanel;
add(cp);
};
public void setActivePanel(ViewSwitchTypeInResult type){
if(type.equals(ViewSwitchTypeInResult.Group) ){
cardLayout.setActiveItem(itemPanel);
activePanel = itemPanel;
// toolBar.setEnabled(true);
}
}
// public GxtGridMessagesFilterPanel getMessagesPanelContainer() {
// return messagesPanelContainer;
// }
public GxtItemsPanel getItemPanel() {
return itemPanel;
}
public void setItemPanel(GxtItemsPanel itemPanel) {
this.itemPanel = itemPanel;
}
public GxtToolBarItem getToolBarItem() {
return toolBarItem;
}
public ContentPanel getActivePanel(){
return activePanel;
}
}

View File

@ -0,0 +1,38 @@
package org.gcube.portlets.user.workspace.client.view.panels;
import org.gcube.portlets.user.workspace.client.view.GxtListView;
import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtToolBarItem;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtItemsPanel extends ContentPanel{
private GxtToolBarItem toolBarItem;
private GxtGridFilterGroupPanel gridFilterViewContainer;
private GxtListView iconsViewContainer;
private GxtGridFilterGroupPanel gridGroupViewContainer;
public GxtItemsPanel(GxtGridFilterGroupPanel gridFilterViewContainer,GxtListView iconsViewContainer, GxtGridFilterGroupPanel gridGroupViewContainer, GxtToolBarItem toolBarItem) {
this.gridFilterViewContainer = gridFilterViewContainer;
this.iconsViewContainer = iconsViewContainer;
this.gridGroupViewContainer = gridGroupViewContainer;
this.toolBarItem = toolBarItem;
setBorders(false);
setBodyBorder(false);
setHeaderVisible(false);
this.setLayout(new FitLayout());
setTopComponent(this.toolBarItem.getToolBar());
add(gridGroupViewContainer);
}
}

View File

@ -0,0 +1,268 @@
package org.gcube.portlets.user.workspace.client.view.panels;
import java.util.List;
import org.gcube.portlets.user.workspace.client.AppController;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.event.SaveSmartFolderEvent;
import org.gcube.portlets.user.workspace.client.event.ScopeChangeEvent;
import org.gcube.portlets.user.workspace.client.event.SearchTextEvent;
import org.gcube.portlets.user.workspace.client.model.ScopeModel;
import org.gcube.portlets.user.workspace.client.view.GxtComboBox;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* @author Massimiliano Assante ISTI-CNR
*
* @version 1.0 May 14th 2012
*/
public class GxtSeachAndFilterPanel extends LayoutContainer {
private GxtComboBox comboBoxGxt = null;
private ComboBox<ScopeModel> cbViewScope = null;
private HTML txtViewScope = new HTML("<nobr>"+ConstantsPortlet.VIEWSPACE+":</nobr>");
private final TextField<String> textSearch = new TextField<String>();
private Button bSearch = new Button(ConstantsPortlet.SEARCH);
private Button bCancel = new Button(ConstantsPortlet.CANCEL);
private Button bSave = new Button(ConstantsPortlet.SAVE);
private TextField<String> textFull = new TextField<String>();
private DateField fromDate = new DateField();
private DateField toDate = new DateField();
private SimpleComboBox<String> cbNameFilter = null;
private HorizontalPanel toolbarPathPanel = null;
private boolean isSearchActive = false;
private VerticalPanel cp = new VerticalPanel();
HorizontalPanel hp = new HorizontalPanel();
HorizontalPanel hp2 = new HorizontalPanel();
HorizontalPanel hpMain = new HorizontalPanel();
public GxtSeachAndFilterPanel(HorizontalPanel toolbarContainer) {
txtViewScope.getElement().getStyle().setColor("#15428B");
txtViewScope.getElement().getStyle().setFontSize(12, Unit.PX);
setLayout(new FitLayout());
setBorders(true);
setId("SearchAndFilter");
this.comboBoxGxt = new GxtComboBox();
this.cbViewScope = this.comboBoxGxt.getComboViewScope();
this.cbNameFilter = this.comboBoxGxt.getComboStringFilter();
this.cbViewScope.setWidth(300);
this.cbViewScope.setAutoWidth(true);
this.toolbarPathPanel = toolbarContainer;
cp.add(this.toolbarPathPanel);
hp.setStyleAttribute("padding", "2px");
this.cbViewScope.setStyleAttribute("margin-left", "5px");
this.cbViewScope.setStyleAttribute("margin-right", "100px");
seVisibleButtonsCancelSave(false);
textSearch.setAllowBlank(true);
textSearch.setEmptyText(ConstantsPortlet.SEARCHINWORSPACE);
textSearch.setWidth(325);
textSearch.setRegex("^[a-zA-Z0-9]+[ a-zA-Z0-9_().-]*"); //alphanumeric
textSearch.getMessages().setRegexText(ConstantsExplorer.MESSAGE_SEARCH_FORCE_APHANUMERIC);
textSearch.setAutoValidate(true);
hp.add(textSearch);
bSearch.setStyleName("wizardButton");
bSearch.getElement().getStyle().setMarginLeft(3, Unit.PX);
bCancel.setStyleName("wizardButton");
bCancel.getElement().getStyle().setMarginLeft(3, Unit.PX);
bSave.setStyleName("wizardButton");
bSave.getElement().getStyle().setMarginLeft(3, Unit.PX);
hp.add(bSearch);
// hp.add(bCancel);
hp.add(bSave);
bSearch.setWidth("70px");
bSave.setWidth("70px");
hp2.setHorizontalAlign(HorizontalAlignment.RIGHT);
hp2.setVerticalAlign(VerticalAlignment.MIDDLE);
hp2.add(txtViewScope);
hp2.add(cbViewScope);
cbViewScope.setStyleAttribute("margin-top", "2px");
hpMain.add(hp);
hpMain.add(hp2);
cp.add(hpMain);
this.addListeners();
add(cp);
updateSize();
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
updateSize();
}
});
layout();
}
/**
* Update window size
*/
public void updateSize() {
RootPanel workspace = RootPanel.get(ConstantsPortlet.WORKSPACEDIV);
int leftBorder = workspace.getAbsoluteLeft();
int rootWidth = Window.getClientWidth() - 2* leftBorder; //- rightScrollBar;
hp.setWidth(rootWidth - 400);
}
public void searchText(String value){
textSearch.setValue(value);
seVisibleButtonsCancelSave(true);
AppController.getEventBus().fireEvent(new SearchTextEvent(value));
}
private void addListeners(){
bSearch.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if(textSearch.getValue()!=null && !textSearch.getValue().isEmpty() && textSearch.isValid()){
// seVisibleButtonsCancelSave(true);
// AppController.getEventBus().fireEvent(new SearchTextEvent(textSearch.getValue()));
searchText(textSearch.getValue());
}
}
});
KeyListener keyListener = new KeyListener() {
public void componentKeyUp(ComponentEvent event) {
if (event.getKeyCode() == 13) { // KEY_ENTER
// seVisibleButtonsCancelSave(true);
// AppController.getEventBus().fireEvent(new SearchTextEvent(textSearch.getValue()));
searchText(textSearch.getValue());
}
}
};
textSearch.addKeyListener(keyListener);
//
// bCancel.addClickHandler(new ClickHandler() {
// @Override
// public void onClick(ClickEvent event) {
// if(textSearch.getValue()!=null && !textSearch.getValue().isEmpty() && textSearch.isValid()){
// searchCancel();
// AppController.getEventBus().fireEvent(new SearchTextEvent(null));
// }
// }
// });
bSave.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if(textSearch.getValue()!=null && !textSearch.getValue().isEmpty() && textSearch.isValid()){
if (textSearch.getValue() != null && textSearch.getValue().length()>0) {
AppController.getEventBus().fireEvent(new SaveSmartFolderEvent(null, textSearch.getValue(), null));
}
}
}
});
this.cbViewScope.addSelectionChangedListener(new SelectionChangedListener<ScopeModel>() {
@Override
public void selectionChanged(SelectionChangedEvent<ScopeModel> se) {
ScopeModel scope = se.getSelectedItem();
AppController.getEventBus().fireEvent(new ScopeChangeEvent(scope.getId()));
}
});
}
public void resetFields(){
this.textSearch.reset();
this.textFull.reset();
this.fromDate.reset();
this.toDate.reset();
this.cbNameFilter.reset();
}
public void seVisibleButtonsCancelSave(boolean flag){
this.bCancel.setVisible(flag);
this.bSave.setVisible(flag);
}
public void searchCancel(){
resetFields();
seVisibleButtonsCancelSave(false);
// AppController.getEventBus().fireEvent(new SearchTextEvent(null));
}
public boolean isSearchActive(){
return this.isSearchActive;
}
public void setListScope(List<ScopeModel> listScope){
this.comboBoxGxt.setListScope(listScope);
}
public void selectScopeByIndex(int index){
this.cbViewScope.setValue(cbViewScope.getStore().getAt(index));
}
public void setSearchActive(boolean isSearchActive) {
System.out.println("#################SET SEARCH ACTIVE in GRID " + isSearchActive);
this.isSearchActive = isSearchActive;
}
public void setVisibleButtonSave(boolean bool){
this.bSave.setVisible(bool);
}
public void setEmptyText(String emptyText){
textSearch.setEmptyText(emptyText);
}
}

View File

@ -0,0 +1,125 @@
package org.gcube.portlets.user.workspace.client.view.toolbars;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import org.gcube.portlets.user.workspace.client.AppController;
import org.gcube.portlets.user.workspace.client.event.PathElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.resources.Resources;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.WidgetComponent;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.google.gwt.user.client.ui.Image;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtPathPanel {
private static final String ROOT_NAME = "Workspace";
private HorizontalPanel toolBar = new HorizontalPanel();
private Text txtPath = new Text("PATH ");
private LinkedHashMap<String, FileModel> hashFileModel; // Ordered-HashMap
boolean rootAdded = false;
WidgetComponent hardDiskIcon = new WidgetComponent(new Image (Resources.getImageHardDisk()));
public GxtPathPanel() {
toolBar = new HorizontalPanel();
toolBar.setHeight("25px");
initToolbar();
}
public HorizontalPanel getToolBarPathPanel() {
return toolBar;
}
public void setPath(ArrayList<FileModel> parents) {
initToolbarWithoutFakeRoot();
if (parents != null && parents.size() > 0) {
ArrayList<Button> listButtons = new ArrayList<Button>();
hashFileModel = new LinkedHashMap<String, FileModel>();
// arrayFileModel = new ArrayList<FileModel>();
for (FileModel parent : parents) {
Button butt = new Button(parent.getName());
butt.setId(parent.getIdentifier());
butt.setStyleAttribute("top", "-4px");
butt.setStyleName("button-hyperlink");
// butt.setHeight(12);
hashFileModel.put(parent.getIdentifier(), parent);
// arrayFileModel.set(parent.getIdentifier(),parent);
butt.addListener(Events.OnClick, new Listener<ButtonEvent>() {
@Override
public void handleEvent(ButtonEvent be) {
// Window.alert("Name " + be.getButton().getText() +
// " ID: "+ be.getButton().getId());
FileModel target = hashFileModel.get(be.getButton()
.getId());
AppController.getEventBus().fireEvent(
new PathElementSelectedEvent(target));
}
});
listButtons.add(butt);
}
int size = listButtons.size();
for (int i = 0; i < size - 1; i++) {
toolBar.add(listButtons.get(i));
toolBar.add(new WidgetComponent(new Image(Resources.getImagePathSeparator())));
}
toolBar.add(listButtons.get(size - 1)); // Add last element
toolBar.layout(true);
}
}
private void initToolbar() {
toolBar.removeAll();
toolBar.setStyleName("myToolbar");
toolBar.setStyleAttribute("padding-top", "5px");
txtPath.setStyleAttribute("padding-right", "10px");
toolBar.add(new WidgetComponent(new Image(Resources.getImagePathSeparator())));
toolBar.layout(true);
Button butt = new Button(ROOT_NAME);
butt.setId("");
butt.setStyleAttribute("top", "-4px");
butt.setStyleName("button-hyperlink");
toolBar.add(butt);
}
private void initToolbarWithoutFakeRoot() {
toolBar.removeAll();
toolBar.setStyleName("myToolbar");
toolBar.setStyleAttribute("padding-top", "5px");
txtPath.setStyleAttribute("padding-right", "10px");
toolBar.add(new WidgetComponent(new Image(Resources.getImagePathSeparator())));
toolBar.layout(true);
}
}

View File

@ -0,0 +1,388 @@
package org.gcube.portlets.user.workspace.client.view.toolbars;
//
//import org.gcube.portlets.user.workspace.client.AppController;
//import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
//import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
//import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
//import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
//import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
//import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
//import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
//import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType;
//import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
//import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent;
//import org.gcube.portlets.user.workspace.client.model.FileGridModel;
//import org.gcube.portlets.user.workspace.client.resources.Resources;
//import org.gcube.portlets.user.workspace.client.view.GxtListView;
//import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
//import org.gcube.portlets.user.workspace.client.view.grids.GxtGridMessagesFilterPanel;
//
//import com.extjs.gxt.ui.client.Style.ButtonArrowAlign;
//import com.extjs.gxt.ui.client.Style.ButtonScale;
//import com.extjs.gxt.ui.client.Style.IconAlign;
//import com.extjs.gxt.ui.client.event.ButtonEvent;
//import com.extjs.gxt.ui.client.event.SelectionListener;
//import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
//import com.extjs.gxt.ui.client.widget.button.Button;
//import com.extjs.gxt.ui.client.widget.button.ToggleButton;
//import com.extjs.gxt.ui.client.widget.layout.CardLayout;
//import com.extjs.gxt.ui.client.widget.layout.FitLayout;
//import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
//import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
//import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
//import com.google.gwt.user.client.Element;
//
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* THIS CLASS IS NOT USED
*/
public class GxtToolBarFunctionsPanel extends LayoutContainer {
//
//// private GxtGridFilterPanel gridFilterViewContainer = null;
// private Button btnAddFolder = null;
// private Button btnRemoveItem = null;
// private Button btnRenameItem = null;
// private Button btnUploadFile = null;
// private Button btnUploadArchive = null;
// private Button btnDownloadFile = null;
// private GxtListView iconsViewContainer = null;
// private ToggleButton toggleGroup = new ToggleButton();
// private ToggleButton toggleList = new ToggleButton();
// private ToggleButton toggleIcon = new ToggleButton();
// private GxtGridFilterGroupPanel gridGroupViewContainer;
// private GxtPathPanel toolBarPathContainer;
// private GxtGridMessagesFilterPanel messagesPanelContainer;
// private GxtGridFilterGroupPanel gridFilterViewContainer;
// private ToolBar toolBar = new ToolBar();
// private CardLayout cardLayout = new CardLayout();
// private Button btnAccessFromDesktop = null;
//
// public GxtToolBarFunctionsPanel(GxtPathPanel toolBarPath,
// GxtGridFilterGroupPanel gridFilterContainer,
// GxtGridFilterGroupPanel gridFilterGroupContainer,
// GxtListView listViewContainer,
// GxtGridMessagesFilterPanel messagesPanelContainer) {
//
// this.gridFilterViewContainer = gridFilterContainer;
// this.iconsViewContainer = listViewContainer;
// this.gridGroupViewContainer = gridFilterGroupContainer;
// this.toolBarPathContainer = toolBarPath;
// this.messagesPanelContainer = messagesPanelContainer;
// }
//
// @Override
// protected void onRender(Element parent, int pos) {
// super.onRender(parent, pos);
// setLayout(new FitLayout());
//
// ContentPanel cp = createStandardToolbarPanel(cardLayout);
// // ContentPanel cp = new ContentPanel();
//
// addSelectionListenersOnToolBar();
// cp.add(gridGroupViewContainer);
//// cp.add(gridFilterViewContainer);
//// cp.add(iconsViewContainer);
//
// cp.add(messagesPanelContainer);
//
// cardLayout.setActiveItem(gridGroupViewContainer);
//
// add(cp);
//
// };
//
//
//
// public void setActivePanel(ViewSwitchTypeInResult type){
//
//
// if(type.equals(ViewSwitchTypeInResult.Group)){
// cardLayout.setActiveItem(gridGroupViewContainer);
// toolBar.setEnabled(true);
// }
// else if(type.equals(ViewSwitchTypeInResult.Icons)){
// cardLayout.setActiveItem(iconsViewContainer);
// toolBar.setEnabled(true);
// }
// else if(type.equals(ViewSwitchTypeInResult.Messages)){
// cardLayout.setActiveItem(messagesPanelContainer);
// toolBar.setEnabled(false);
// }
//// else if(type.equals(ViewSwitchTypeInResult.List))
//// cardLayout.setActiveItem(gridFilterViewContainer);
// }
//
// private ContentPanel createStandardToolbarPanel(CardLayout cardLayout) {
// ContentPanel panel = new ContentPanel();
// panel.setLayout(cardLayout);
//// panel.setLayout(new FitLayout());
// panel.setBodyStyle("padding: 1px");
// panel.setHeaderVisible(false);
//
// btnAddFolder = new Button(ConstantsPortlet.ADDFOLDER, Resources.getIconAddFolder());
//
// btnAddFolder.setScale(ButtonScale.SMALL);
// btnAddFolder.setIconAlign(IconAlign.TOP);
// btnAddFolder.setArrowAlign(ButtonArrowAlign.BOTTOM);
//
// toolBar.add(btnAddFolder);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
//
// btnRemoveItem = new Button(ConstantsPortlet.REMOVEITEM, Resources.getIconDeleteItem());
// btnRemoveItem.setScale(ButtonScale.SMALL);
// btnRemoveItem.setIconAlign(IconAlign.TOP);
// btnRemoveItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
//
// toolBar.add(btnRemoveItem);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
//
// btnRenameItem = new Button(ConstantsPortlet.RENAMEITEM, Resources.getIconRenameItem());
// btnRenameItem.setScale(ButtonScale.SMALL);
// btnRenameItem.setIconAlign(IconAlign.TOP);
// btnRenameItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
// toolBar.add(btnRenameItem);
//
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
//
// btnUploadFile = new Button(ConstantsPortlet.UPLOADFILE, Resources.getIconFileUpload());
// btnUploadFile.setScale(ButtonScale.SMALL);
// btnUploadFile.setIconAlign(IconAlign.TOP);
// btnUploadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
//
// toolBar.add(btnUploadFile);
//
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
//
// btnUploadArchive = new Button(ConstantsPortlet.UPLOADARCHIVE, Resources.getIconArchiveUpload());
// btnUploadArchive.setScale(ButtonScale.SMALL);
// btnUploadArchive.setIconAlign(IconAlign.TOP);
// btnUploadArchive.setArrowAlign(ButtonArrowAlign.BOTTOM);
//
// toolBar.add(btnUploadArchive);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
//
// btnDownloadFile = new Button(ConstantsPortlet.DOWNLOADITEM, Resources.getIconDownload());
// btnDownloadFile.setScale(ButtonScale.SMALL);
// btnDownloadFile.setIconAlign(IconAlign.TOP);
// btnDownloadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
//
// toolBar.add(btnDownloadFile);
//
// toolBar.add(new FillToolItem());
//
// btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
// btnAccessFromDesktop.setScale(ButtonScale.SMALL);
// btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
// btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM);
//
// toolBar.add(btnAccessFromDesktop);
//
// toggleGroup = new ToggleButton();
// toggleGroup.setIcon(Resources.getIconToggleGroup());
// toggleGroup.setToggleGroup("viewgrid");
// toggleGroup.toggle(true);
//
// toggleIcon = new ToggleButton();
// toggleIcon.setIcon(Resources.getIconToggleIcon());
// toggleIcon.setToggleGroup("viewgrid");
//
// toggleList = new ToggleButton();
// toggleList.setIcon(Resources.getIconToggleList());
// toggleList.setToggleGroup("viewgrid");
//
// switchView(ViewSwitchTypeInResult.Group);
//
// this.activeButtonsOnSelect(false);
//
// panel.setTopComponent(toolBar); //Add toolBar
//
// return panel;
// }
//
// private void addSelectionListenersOnToolBar(){
//
// btnAddFolder.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//
//// final FileGridModel fileGridModel = gridFilterContainer.getSelectedItem();
//
// AppController.getEventBus().fireEvent(new AddFolderEvent(gridGroupViewContainer.getCurrentFolderView(),null));
// }
// });
//
// btnRemoveItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// AppController.getEventBus().fireEvent(new DeleteItemEvent(fileGridModel));
// }
// });
//
// btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// AppController.getEventBus().fireEvent(new RenameItemEvent(fileGridModel));
//
// }
// });
//
// btnUploadFile.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//// AppController.getEventBus().fireEvent(event)
//// new DialogUpload(ConstantsExplorer.FILEUPLOADHEADER, toolBarPathContainer.getLastParent().getName(), ConstantsExplorer.FILE);
// AppController.getEventBus().fireEvent(new FileUploadEvent(null, UploadType.FILE));
// }
// });
//
// btnUploadArchive.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//// new DialogUpload(ConstantsExplorer.ARCHIVEUPLOADHEADER, , ConstantsExplorer.ARCHIVE);
// AppController.getEventBus().fireEvent(new FileUploadEvent(null, UploadType.ARCHIVE));
// }
// });
//
// btnDownloadFile.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.DOWNLOAD));
//
//// com.google.gwt.user.client.Window.open(GWT.getModuleBaseURL()+"DownloadService?id="+contextItem.getId(), "", "");
//// break;
// }
// });
//
// btnAccessFromDesktop.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//
// AppController.getEventBus().fireEvent(new WebDavUrlEvent(null));
// }
// });
//
// toggleGroup.addSelectionListener(new SelectionListener<ButtonEvent>(){
// @Override
// public void componentSelected(ButtonEvent ce) {
// if(toggleGroup.isPressed()){
// switchView(ViewSwitchTypeInResult.Group);
//
// }
//// Window.alert("ViewSwitchTypeInResult.Group");
// }
// });
//
// toggleList.addSelectionListener(new SelectionListener<ButtonEvent>(){
// @Override
// public void componentSelected(ButtonEvent ce) {
// if(toggleList.isPressed()){
// switchView(ViewSwitchTypeInResult.List);
// }
//// Window.alert("ViewSwitchTypeInResult.List");
// }
// });
//
// toggleIcon.addSelectionListener(new SelectionListener<ButtonEvent>(){
// @Override
// public void componentSelected(ButtonEvent ce) {
// if(toggleIcon.isPressed()){
// switchView(ViewSwitchTypeInResult.Icons);
// }
// }
// });
//
// }
//
// private void switchView(ViewSwitchTypeInResult type) {
//
// if (type.compareTo(ViewSwitchTypeInResult.Icons) == 0) {
// this.gridFilterViewContainer.setVisible(false);
// this.gridGroupViewContainer.setVisible(false);
// this.iconsViewContainer.setVisible(true);
//// toggleGroup.toggle(false);
//// toggleList.toggle(false);
//// toggleIcon.toggle(true);
//
// } else{
// if (type.compareTo(ViewSwitchTypeInResult.List) == 0) {
//
// this.iconsViewContainer.setVisible(false);
// this.gridGroupViewContainer.setVisible(false);
// this.gridFilterViewContainer.setVisible(true);
//// toggleGroup.toggle(false);
//// toggleList.toggle(true);
//// toggleIcon.toggle(false);
// }
// else{
// this.iconsViewContainer.setVisible(false);
// this.gridFilterViewContainer.setVisible(false);
// this.gridGroupViewContainer.setVisible(true);
//// toggleGroup.toggle(true);
//// toggleList.toggle(false);
//// toggleIcon.toggle(false);
// }
// }
//
// }
//
// public void activeButtonsOnSelect(boolean active){
//
// if(!active){
//// this.btnAddFolder.disable();
// this.btnRemoveItem.disable();
// this.btnRenameItem.disable();
// this.btnDownloadFile.disable();
// }
// else{
//// this.btnAddFolder.enable();
// this.btnRemoveItem.enable();
// this.btnRenameItem.enable();
// this.btnDownloadFile.enable();
//
// }
// }
//
// public void activeAllButtons(boolean active){
//
// if(!active){
// this.btnAddFolder.disable();
// this.btnRemoveItem.disable();
// this.btnRenameItem.disable();
// this.btnDownloadFile.disable();
// this.btnUploadArchive.disable();
// }
// else{
// this.btnAddFolder.enable();
// this.btnRemoveItem.enable();
// this.btnRenameItem.enable();
// this.btnDownloadFile.enable();
// this.btnUploadArchive.enable();
// }
// }
//
//public GxtGridMessagesFilterPanel getMessagesPanelContainer() {
// return messagesPanelContainer;
//}
}

View File

@ -0,0 +1,462 @@
package org.gcube.portlets.user.workspace.client.view.toolbars;
import org.gcube.portlets.user.workspace.client.AppController;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
import org.gcube.portlets.user.workspace.client.event.ActiveGroupingView;
import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType;
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent;
import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.resources.Resources;
import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
import com.extjs.gxt.ui.client.Style.ButtonArrowAlign;
import com.extjs.gxt.ui.client.Style.ButtonScale;
import com.extjs.gxt.ui.client.Style.IconAlign;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ToggleButton;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class GxtToolBarItem {
private Button btnAddFolder = null;
private Button btnRemoveItem = null;
private Button btnRenameItem = null;
private Button btnUploadFile = null;
private Button btnUploadArchive = null;
private Button btnDownloadFile = null;
private Button btnOpen = null;
private Button btnAccessFromDesktop = null;
private ToggleButton toggleGroup = new ToggleButton();
private ToggleButton toggleList = new ToggleButton();
private ToggleButton toggleIcon = new ToggleButton();
private GxtGridFilterGroupPanel gridGroupViewContainer;
private ToolBar toolBar = new ToolBar();
private Button btnPreview;
private ToggleButton btnGridView;
public GxtToolBarItem() {
initToolBar();
addSelectionListenersOnToolBar();
}
public GxtToolBarItem(GxtGridFilterGroupPanel gridFilterGroupContainer) {
this();
this.gridGroupViewContainer = gridFilterGroupContainer;
}
private void initToolBar() {
btnGridView = new ToggleButton("Category View", Resources.getIconGridView());
btnGridView.setScale(ButtonScale.SMALL);
btnGridView.setIconAlign(IconAlign.TOP);
btnGridView.toggle(true);
btnGridView.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnGridView);
toolBar.add(new SeparatorToolItem());
btnAddFolder = new Button(ConstantsPortlet.ADDFOLDER,Resources.getIconAddFolder());
btnAddFolder.setScale(ButtonScale.SMALL);
btnAddFolder.setIconAlign(IconAlign.TOP);
btnAddFolder.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnAddFolder);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnRemoveItem = new Button(ConstantsPortlet.REMOVEITEM,
Resources.getIconDeleteItem());
btnRemoveItem.setScale(ButtonScale.SMALL);
btnRemoveItem.setIconAlign(IconAlign.TOP);
btnRemoveItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnRemoveItem);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnRenameItem = new Button(ConstantsPortlet.RENAMEITEM,
Resources.getIconRenameItem());
btnRenameItem.setScale(ButtonScale.SMALL);
btnRenameItem.setIconAlign(IconAlign.TOP);
btnRenameItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnRenameItem);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnDownloadFile = new Button(ConstantsPortlet.DOWNLOADITEM,Resources.getIconDownload());
btnDownloadFile.setScale(ButtonScale.SMALL);
btnDownloadFile.setIconAlign(IconAlign.TOP);
btnDownloadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnDownloadFile);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnPreview = new Button(ConstantsPortlet.PREVIEW ,Resources.getIconPreview());
btnPreview.setScale(ButtonScale.SMALL);
btnPreview.setIconAlign(IconAlign.TOP);
btnPreview.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnPreview);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnOpen = new Button(ConstantsPortlet.OPEN ,Resources.getIconShow());
btnOpen.setScale(ButtonScale.SMALL);
btnOpen.setIconAlign(IconAlign.TOP);
btnOpen.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnOpen);
// toolBar.add(new SeparatorToolItem());
toolBar.add(new SeparatorToolItem());
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM);
// btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV);
// btnAccessFromDesktop.setScale(ButtonScale.SMALL);
// btnAccessFromDesktop.addStyleName("button-hyperlink");
toolBar.add(btnAccessFromDesktop);
toolBar.add(new FillToolItem());
btnUploadFile = new Button(ConstantsPortlet.UPLOADFILE,
Resources.getIconFileUpload());
btnUploadFile.setScale(ButtonScale.SMALL);
btnUploadFile.setIconAlign(IconAlign.TOP);
btnUploadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnUploadFile);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnUploadArchive = new Button(ConstantsPortlet.UPLOADARCHIVE,
Resources.getIconArchiveUpload());
btnUploadArchive.setScale(ButtonScale.SMALL);
btnUploadArchive.setIconAlign(IconAlign.TOP);
btnUploadArchive.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnUploadArchive);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
//TODO OLD CODE
toggleGroup = new ToggleButton();
toggleGroup.setIcon(Resources.getIconToggleGroup());
toggleGroup.setToggleGroup("viewgrid");
toggleGroup.toggle(true);
toggleIcon = new ToggleButton();
toggleIcon.setIcon(Resources.getIconToggleIcon());
toggleIcon.setToggleGroup("viewgrid");
toggleList = new ToggleButton();
toggleList.setIcon(Resources.getIconToggleList());
toggleList.setToggleGroup("viewgrid");
switchView(ViewSwitchTypeInResult.Group);
// toolBar.add(new FillToolItem());
this.activeButtonsOnSelect(null, false);
}
public void toggleGridViewButton(boolean toogle){
btnGridView.toggle(toogle);
}
private void addSelectionListenersOnToolBar() {
btnAddFolder.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(
new AddFolderEvent(gridGroupViewContainer
.getCurrentFolderView(), null));
}
});
btnGridView.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new ActiveGroupingView(btnGridView.isPressed()));
}
});
btnRemoveItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
AppController.getEventBus().fireEvent(
new DeleteItemEvent(fileGridModel));
}
});
btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
AppController.getEventBus().fireEvent(
new RenameItemEvent(fileGridModel));
}
});
btnUploadFile.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(
new FileUploadEvent(null, UploadType.FILE));
}
});
btnUploadArchive.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(
new FileUploadEvent(null, UploadType.ARCHIVE));
}
});
btnDownloadFile.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
AppController.getEventBus().fireEvent(
new FileDownloadEvent(fileGridModel
.getIdentifier(), fileGridModel
.getName(), DownloadType.DOWNLOAD));
}
});
btnPreview.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
AppController.getEventBus().fireEvent(new ImagePreviewEvent(fileGridModel, ce.getClientX(), ce.getClientY()+100));
}
});
btnOpen.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null){
if(fileGridModel.isDirectory())
AppController.getEventBus().fireEvent(new DoubleClickElementSelectedEvent(fileGridModel));
else if(fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT) || fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT_TEMPLATE))
AppController.getEventBus().fireEvent(new OpenReportsEvent(fileGridModel));
else
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.SHOW));
}
}
});
btnAccessFromDesktop.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new WebDavUrlEvent(null));
}
});
toggleGroup.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
if (toggleGroup.isPressed()) {
switchView(ViewSwitchTypeInResult.Group);
}
// Window.alert("ViewSwitchTypeInResult.Group");
}
});
toggleList.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
if (toggleList.isPressed()) {
switchView(ViewSwitchTypeInResult.List);
}
// Window.alert("ViewSwitchTypeInResult.List");
}
});
toggleIcon.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
if (toggleIcon.isPressed()) {
switchView(ViewSwitchTypeInResult.Icons);
}
}
});
}
private void switchView(ViewSwitchTypeInResult type) {
// if (type.compareTo(ViewSwitchTypeInResult.Icons) == 0) {
// this.gridFilterViewContainer.setVisible(false);
// this.gridGroupViewContainer.setVisible(false);
// this.iconsViewContainer.setVisible(true);
//
// } else{
// if (type.compareTo(ViewSwitchTypeInResult.List) == 0) {
//
// this.iconsViewContainer.setVisible(false);
// this.gridGroupViewContainer.setVisible(false);
// this.gridFilterViewContainer.setVisible(true);
// }
// else{
// this.iconsViewContainer.setVisible(false);
// this.gridFilterViewContainer.setVisible(false);
// this.gridGroupViewContainer.setVisible(true);
// }
// }
}
public void activeButtonsOnSelect(FileModel target, boolean active) {
this.btnPreview.disable();
this.btnOpen.enable();
if(target!=null){
if(active & target.getGXTFolderItemType()!=null){
switch(target.getGXTFolderItemType()){
case EXTERNAL_IMAGE:
// contextMenu.getItemByItemId(ConstantsExplorer.PRW).setVisible(true);
this.btnPreview.enable();
break;
case EXTERNAL_FILE:
break;
case EXTERNAL_PDF_FILE:
break;
case EXTERNAL_URL:
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
break;
case REPORT_TEMPLATE:
// contextMenu.getItemByItemId(ConstantsExplorer.ORT).setVisible(true);
break;
case REPORT:
break;
case QUERY:
break;
case TIME_SERIES:
break;
case PDF_DOCUMENT:
break;
case IMAGE_DOCUMENT:
this.btnPreview.enable();
break;
case DOCUMENT:
break;
case URL_DOCUMENT:
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
break;
case METADATA:
break;
case WORKFLOW_REPORT:
break;
case WORKFLOW_TEMPLATE:
break;
default:
}
}
}
activeButtons(active);
}
private void activeButtons(boolean active){
if (!active) {
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
this.btnDownloadFile.disable();
this.btnOpen.disable();
} else {
this.btnRemoveItem.enable();
this.btnRenameItem.enable();
this.btnDownloadFile.enable();
this.btnOpen.enable();
}
}
public void activeAllButtonWithoutGroupView(boolean active){
btnRemoveItem.setEnabled(active);
btnRenameItem.setEnabled(active);
btnDownloadFile.setEnabled(active);
btnPreview.setEnabled(active);
btnOpen.setEnabled(active);
}
public ToolBar getToolBar() {
return this.toolBar;
}
}

View File

@ -0,0 +1,48 @@
package org.gcube.portlets.user.workspace.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;
import org.gcube.portlets.user.workspace.server.util.Util;
/**
* @author Federico De Faveri defaveri@isti.cnr.it
*
*/
public class WorkspacePortlet extends GenericPortlet{
/**
* JSP folder name
*/
public static final String JSP_FOLDER = "/WEB-INF/jsp/";
/**
*
*/
public static final String VIEW_JSP = JSP_FOLDER + "WorkspacePortlet_view.jsp";
/**
* @param request .
* @param response .
* @throws IOException .
* @throws PortletException .
*/
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
System.out.println("LOADING ********* FROM "+VIEW_JSP);
ScopeHelper.setContext(request, Util.USERNAME_ATTRIBUTE);
// Invoke the JSP to render
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(VIEW_JSP);
rd.include(request,response);
}
}

View File

@ -0,0 +1,48 @@
package org.gcube.portlets.user.workspace.shared;
/**
* <p>
* FieldVerifier validates that the name the user enters is valid.
* </p>
* <p>
* This class is in the <code>shared</code> package 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 not 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>
*/
/**
* This class is not used
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
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;
}
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='workspace'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- We need the JUnit module in the main module, -->
<!-- otherwise eclipse complains (Google plugin bug?) -->
<inherits name='com.google.gwt.junit.JUnit' />
<!-- Moduel GXT -->
<inherits name='com.extjs.gxt.ui.GXT' />
<!-- Other module inherits -->
<inherits name='org.gcube.portlets.user.workspace.WorkspaceTree' />
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits name='org.gcube.portlets.user.workspace.lighttree.WorkspacePortletLightTree' />
<inherits name='org.gcube.portlets.user.wsmail.WsMail_Widget' />
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlets.user.workspace.client.WorkspacePortlet' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>

View File

@ -0,0 +1,21 @@
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%-- Uncomment below lines to add portlet taglibs to jsp
<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<portlet:defineObjects />
--%>
<link rel="stylesheet"
href="<%=request.getContextPath()%>/resources/css/gxt-all.css"
type="text/css">
<link rel="stylesheet"
href="<%=request.getContextPath()%>/WorkspacePortlet.css"
type="text/css">
<script type="text/javascript" language="javascript"
src="<%=request.getContextPath()%>/workspace/workspace.nocache.js"></script>
<div id="workspaceDiv"></div>

View File

@ -0,0 +1,5 @@
<display>
<category name="gCube Applications">
<portlet id="WorkspacePortlet" />
</category>
</display>

View File

@ -0,0 +1,9 @@
name=WorkspacePortlet
module-group-id=liferay
module-incremental-version=2
tags=
short-description=
change-log=
page-url=http://www.gcube-system.org
author=gCube
licenses=EUPL

View File

@ -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>WorkspacePortlet</portlet-name>
<layout-cacheable>false</layout-cacheable>
<instanceable>false</instanceable>
<ajaxable>false</ajaxable>
</portlet>
</liferay-portlet-app>

View File

@ -0,0 +1,18 @@
<?xml version='1.0' encoding='UTF-8' ?>
<portlet-app>
<portlet>
<description>Workspace Portlet</description>
<portlet-name>WorkspacePortlet</portlet-name>
<display-name>WorkspacePortlet</display-name>
<portlet-class>org.gcube.portlets.user.workspace.portlet.WorkspacePortlet</portlet-class>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>WorkspacePortlet</title>
<short-title>WorkspacePortlet</short-title>
</portlet-info>
</portlet>
</portlet-app>

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>WorkspacePortlet.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>UploadService</servlet-name>
<servlet-class>org.gcube.portlets.user.workspace.server.UploadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UploadService</servlet-name>
<url-pattern>/workspace/UploadService</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>DownloadService</servlet-name>
<servlet-class>org.gcube.portlets.user.workspace.server.DownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DownloadService</servlet-name>
<url-pattern>/workspace/DownloadService</url-pattern>
</servlet-mapping>
<!-- Servlets -->
<servlet>
<servlet-name>WorkspaceService</servlet-name>
<servlet-class>org.gcube.portlets.user.workspace.server.GWTWorkspaceServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>WorkspaceService</servlet-name>
<url-pattern>/workspace/WorkspaceService</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ImageService</servlet-name>
<servlet-class>org.gcube.portlets.user.workspace.server.ImageServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImageService</servlet-name>
<url-pattern>/workspace/ImageService</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>mailWisdgetServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.wsmail.server.WsMailServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>mailWisdgetServlet</servlet-name>
<url-pattern>/workspace/mailWisdgetServlet</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>WorkspaceLightService</servlet-name>
<servlet-class>org.gcube.portlets.user.workspace.lighttree.server.WorkspaceServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>WorkspaceLightService</servlet-name>
<url-pattern>/workspace/WorkspaceLightService</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>jUnitHostImpl</servlet-name>
<servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>jUnitHostImpl</servlet-name>
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/junithost/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jUnitHostImpl</servlet-name>
<url-pattern>/workspace/junithost/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DownloadService</servlet-name>
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/DownloadService</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>WorkspaceService</servlet-name>
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/WorkspaceService</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ImageService</servlet-name>
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/ImageService</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>UploadService</servlet-name>
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/UploadService</url-pattern>
</servlet-mapping>
</web-app>

View File

@ -0,0 +1,52 @@
<!doctype html>
<!-- The DOCTYPE declaration above will set the -->
<!-- browser's rendering engine into -->
<!-- "Standards Mode". Replacing this declaration -->
<!-- with a "Quirks Mode" doctype is not supported. -->
<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="workspaceportlet.css">
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>Web Application Starter Project</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="workspace/workspace.nocache.js"></script>
<!-- GXT -->
<link rel='stylesheet' type='text/css' href='resources/css/gxt-all.css' />
<script language='javascript' src='resources/flash/swfobject.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="workspaceDiv"></div>
</body>
</html>

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -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;
}

View File

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Some files were not shown because too many files have changed in this diff Show More