You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hise-commits@incubator.apache.org by ut...@apache.org on 2010/09/09 15:03:59 UTC
svn commit: r995452 [1/5] - in /incubator/hise/trunk: ./ hise-fe/
hise-fe/src/ hise-fe/src/main/ hise-fe/src/main/java/
hise-fe/src/main/java/org/ hise-fe/src/main/java/org/apache/
hise-fe/src/main/java/org/apache/hise/ hise-fe/src/main/java/org/apache...
Author: utr
Date: Thu Sep 9 15:03:55 2010
New Revision: 995452
URL: http://svn.apache.org/viewvc?rev=995452&view=rev
Log:
HISE-88: GWT Frontend for displaying user tasks and performing basic task operations
Added:
incubator/hise/trunk/hise-fe/
incubator/hise/trunk/hise-fe/gwt.properties.template
incubator/hise/trunk/hise-fe/pom.xml
incubator/hise/trunk/hise-fe/src/
incubator/hise/trunk/hise-fe/src/main/
incubator/hise/trunk/hise-fe/src/main/java/
incubator/hise/trunk/hise-fe/src/main/java/org/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/HiseModule.gwt.xml
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/HiseModule.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/ErrorHandler.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/HiseAsyncCallback.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacade.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacadeAsync.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskColumnsConfigurator.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskInfoConfigurator.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortCriteria.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortDirection.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedByDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedOnDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskDataDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskIdDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskInitiatorDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskNameDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskOwnerDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskPriorityDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskStatusDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskSubjectDisplayer.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/views/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/views/MainView.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/FilterPanel.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/PagingPanel.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskInfoPanel.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskListPanel.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/util/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/util/FacadeRegistry.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/HiseInfrastructure.gwt.xml
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/FilterCriteriaDto.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/TaskDto.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/enums/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/enums/Action.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/enums/HumanRole.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/enums/Status.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/exceptions/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/dtos/exceptions/HiseApplicationException.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/facades/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/facades/TaskFacade.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/facades/impl/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/facades/impl/TaskFacade.java
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/utils/
incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/utils/SecurityUtil.java
incubator/hise/trunk/hise-fe/src/main/resources/
incubator/hise/trunk/hise-fe/src/main/resources/backendConfiguration.xml
incubator/hise/trunk/hise-fe/src/main/resources/gwtRpcConfiguration.xml
incubator/hise/trunk/hise-fe/src/main/resources/hisefe.properties
incubator/hise/trunk/hise-fe/src/main/resources/security.xml
incubator/hise/trunk/hise-fe/src/main/webapp/
incubator/hise/trunk/hise-fe/src/main/webapp/WEB-INF/
incubator/hise/trunk/hise-fe/src/main/webapp/WEB-INF/web.xml
incubator/hise/trunk/hise-fe/src/main/webapp/css/
incubator/hise/trunk/hise-fe/src/main/webapp/css/hise.css
incubator/hise/trunk/hise-fe/src/main/webapp/index.jsp
incubator/hise/trunk/hise-fe/src/main/webapp/login.jsp
incubator/hise/trunk/hise-fe/src/test/
incubator/hise/trunk/hise-fe/src/test/java/
incubator/hise/trunk/hise-fe/src/test/java/org/
incubator/hise/trunk/hise-fe/src/test/java/org/apache/
incubator/hise/trunk/hise-fe/src/test/java/org/apache/hise/
incubator/hise/trunk/hise-fe/src/test/java/org/apache/hise/fe/
incubator/hise/trunk/hise-fe/src/test/java/org/apache/hise/fe/SpringConfigurationIntegrationTest.java
incubator/hise/trunk/hise-fe/src/test/java/org/apache/hise/fe/server/
incubator/hise/trunk/hise-fe/src/test/java/org/apache/hise/fe/server/dtos/
incubator/hise/trunk/hise-fe/src/test/java/org/apache/hise/fe/server/dtos/FilterCriteriaDtoUnitTest.java
incubator/hise/trunk/hise-ws-client/
incubator/hise/trunk/hise-ws-client/pom.xml
incubator/hise/trunk/hise-ws-client/src/
incubator/hise/trunk/hise-ws-client/src/main/
incubator/hise/trunk/hise-ws-client/src/main/binding/
incubator/hise/trunk/hise-ws-client/src/main/binding/bindings-jaxws.xml
incubator/hise/trunk/hise-ws-client/src/main/binding/bindings.xml
incubator/hise/trunk/hise-ws-client/src/main/java/
incubator/hise/trunk/hise-ws-client/src/main/java/org/
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/facade/
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/facade/FilterCriteria.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/facade/HiseApiFacade.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/facade/HiseApiFacadeImpl.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/facade/HiseException.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/infrastructure/
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/infrastructure/ClientPasswordCallback.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/infrastructure/CommentConverter.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/infrastructure/OrganizationalEntityConverter.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/infrastructure/TaskConverter.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/infrastructure/Tasks.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/infrastructure/WSSecurityInterceptor.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/model/
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/model/Comment.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/model/OrganizationalEntity.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/model/Task.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/model/enums/
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/model/enums/Action.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/model/enums/HumanRole.java
incubator/hise/trunk/hise-ws-client/src/main/java/org/apache/hise/wsclient/model/enums/Status.java
incubator/hise/trunk/hise-ws-client/src/main/resources/
incubator/hise/trunk/hise-ws-client/src/main/resources/cxf.xml
incubator/hise/trunk/hise-ws-client/src/main/resources/hiseWsClientBaseContext.xml
incubator/hise/trunk/hise-ws-client/src/main/resources/hiseWsClientContext.xml
incubator/hise/trunk/hise-ws-client/src/main/resources/hisefe.properties
incubator/hise/trunk/hise-ws-client/src/main/resources/wsdls/
incubator/hise/trunk/hise-ws-client/src/main/resources/wsdls/ws-humantask-api-wsdl.xsd
incubator/hise/trunk/hise-ws-client/src/main/resources/wsdls/ws-humantask-api.xsd
incubator/hise/trunk/hise-ws-client/src/main/resources/wsdls/ws-humantask.wsdl
incubator/hise/trunk/hise-ws-client/src/main/resources/wsdls/ws-humantask.xsd
incubator/hise/trunk/hise-ws-client/src/main/resources/wsdls/xml.xsd
incubator/hise/trunk/hise-ws-client/src/test/
incubator/hise/trunk/hise-ws-client/src/test/java/
incubator/hise/trunk/hise-ws-client/src/test/java/org/
incubator/hise/trunk/hise-ws-client/src/test/java/org/apache/
incubator/hise/trunk/hise-ws-client/src/test/java/org/apache/hise/
incubator/hise/trunk/hise-ws-client/src/test/java/org/apache/hise/api/
incubator/hise/trunk/hise-ws-client/src/test/java/org/apache/hise/api/client/
incubator/hise/trunk/hise-ws-client/src/test/java/org/apache/hise/api/client/facade/
incubator/hise/trunk/hise-ws-client/src/test/java/org/apache/hise/api/client/facade/HiseApiFacadeUnitTest.java
incubator/hise/trunk/hise-ws-client/src/test/java/org/apache/hise/api/client/infrastucture/
incubator/hise/trunk/hise-ws-client/src/test/java/org/apache/hise/api/client/infrastucture/TaskConverterUnitTest.java
Modified:
incubator/hise/trunk/pom.xml
Added: incubator/hise/trunk/hise-fe/gwt.properties.template
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/gwt.properties.template?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/gwt.properties.template (added)
+++ incubator/hise/trunk/hise-fe/gwt.properties.template Thu Sep 9 15:03:55 2010
@@ -0,0 +1,4 @@
+java.executable=/usr/lib/jvm/java-6-sun/bin/java
+gwt.home.dir=/home/hexchen/Programming/gwt-2.0.0
+gwt.dev.jar=${gwt.home.dir}/gwt-dev.jar
+app.url=http://localhost:8080/hise-fe/
Added: incubator/hise/trunk/hise-fe/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/pom.xml?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/pom.xml (added)
+++ incubator/hise/trunk/hise-fe/pom.xml Thu Sep 9 15:03:55 2010
@@ -0,0 +1,428 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.apache.hise</groupId>
+ <artifactId>hise</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.hise</groupId>
+ <artifactId>hise-fe</artifactId>
+ <packaging>war</packaging>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>Frontend for HISE web services (web application)</name>
+
+ <properties>
+ <gwt.version>2.0.1</gwt.version>
+ <gwt.maven.plugin.version>1.2</gwt.maven.plugin.version>
+ <gwt.class.name>org.apache.hise.fe.gwt.HiseModule</gwt.class.name>
+ <spring.security.version>2.0.4</spring.security.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.hise</groupId>
+ <artifactId>hise-ws-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- GWT deps -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.gwt-widget</groupId>
+ <artifactId>gwt-sl</artifactId>
+ <version>0.1.5</version>
+ <scope>runtime</scope>
+ <type>jar</type>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- SPRING -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core</artifactId>
+ <version>${spring.security.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core-tiger</artifactId>
+ <version>${spring.security.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.dozer</groupId>
+ <artifactId>dozer</artifactId>
+ <version>5.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <!-- Others -->
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+
+ <!-- Test -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>4.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ <version>1.8.0</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>hise-fe</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <version>1.0-beta-2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>validate</goal>
+ </goals>
+ <configuration>
+ <validationSets>
+ <validationSet>
+ <dir>${basedir}/src/main/resources</dir>
+ <includes>
+ <include>*.xml</include>
+ </includes>
+ <excludes>
+ <exclude>*.properties</exclude>
+ <exclude>log4j.xml</exclude>
+ </excludes>
+ </validationSet>
+ </validationSets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>build</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <property>
+ <name>GWTCompilation</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <version>${gwt.maven.plugin.version}</version>
+ <configuration>
+ <className>${gwt.class.name}</className>
+ <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
+ <logLevel>TRACE</logLevel>
+ <treeLogger />
+ <style>PRETTY</style>
+ <!--
+ TODO for production <style>OBF</style>
+ -->
+ <source>5</source>
+ <jvmOptions>-Xss1024k -Xmx1200m -Xms256m -Djava.awt.headless=true</jvmOptions>
+ <fork>true</fork>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1-beta-1</version>
+ <configuration>
+ <archiveClasses>false</archiveClasses>
+ <packagingExcludes>WEB-INF/lib/log4j*.jar
+ </packagingExcludes>
+ <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
+ <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
+ <webResources>
+ <resource>
+ <directory>${project.build.directory}/${project.build.finalName}/${gwt.class.name}
+ </directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>skip</id>
+ <activation>
+ <property>
+ <name>skipGWTCompilation</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <version>${gwt.maven.plugin.version}</version>
+ <executions>
+ <execution>
+ <phase>install</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1-beta-1</version>
+ <configuration>
+ <archiveClasses>false</archiveClasses>
+ <packagingExcludes>WEB-INF/lib/log4j*.jar
+ </packagingExcludes>
+ <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
+ <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
+ <webResources>
+ <resource>
+ <directory>${project.build.directory}/${project.build.finalName}/${gwt.class.name}
+ </directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <excludeDefaultDirectories>true</excludeDefaultDirectories>
+ <filesets>
+ <fileset>
+ <directory>target</directory>
+ <excludes>
+ <exclude>${project.build.finalName}/**/*</exclude>
+ </excludes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <!--<profile>
+ <id>devel</id>
+ <activation>
+ <property>
+ <name>devel</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <configuration>
+ <tasks description="Display message about gwt.properties file">
+ <condition property="gwt.properties.message" value="File: gwt.properties found!" else="File: gwt.properties not found! Use gwt.properties.template to create it.">
+ <available file="gwt.properties" />
+ </condition>
+ <echo>${gwt.properties.message}</echo>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>properties-maven-plugin</artifactId>
+ <version>1.0.2-touk</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <goals>
+ <goal>read-project-properties</goal>
+ </goals>
+ <configuration>
+ <files>
+ <file>gwt.properties</file>
+ </files>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1-touk</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <executable>${java.executable}</executable>
+ <includePluginDependencies>true</includePluginDependencies>
+ <includeProjectDependencies>true</includeProjectDependencies>
+ <environmentVariables>
+ <gwt.devjar>${gwt.dev.jar}</gwt.devjar>
+ </environmentVariables>
+ <arguments>
+ <argument>-Xmx1024m</argument>
+ <argument>-Xms128m</argument>
+ <argument>-XX:CompileThreshold=8000</argument>
+ <argument>-XX:PermSize=64m</argument>
+ <argument>-XX:MaxPermSize=256m</argument>
+
+ <argument>-Xdebug</argument>
+ <argument>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8002</argument>
+
+ <argument>-classpath</argument>
+ <classpath>
+ <path>${gwt.home.dir}</path>
+ <path>${gwt.dev.jar}</path>
+ <path>${project.basedir}/src/main/java</path>
+ </classpath>
+ <argument>com.google.gwt.dev.DevMode</argument>
+ <commandLineArgs>-noserver</commandLineArgs>
+ <commandLineArgs>-gen</commandLineArgs>
+ <commandLineArgs>${project.build.directory}/review</commandLineArgs>
+ <commandLineArgs>-startupUrl</commandLineArgs>
+ <commandLineArgs>${app.url}</commandLineArgs>
+ <commandLineArgs>-war</commandLineArgs>
+ <commandLineArgs>${project.build.directory}/${project.build.finalName}</commandLineArgs>
+ <commandLineArgs>-extra</commandLineArgs>
+ <commandLineArgs>${project.build.directory}/extra</commandLineArgs>
+ <commandLineArgs>${gwt.class.name}</commandLineArgs>
+ </arguments>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.15</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>-->
+ </profiles>
+</project>
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/HiseModule.gwt.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/HiseModule.gwt.xml?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/HiseModule.gwt.xml (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/HiseModule.gwt.xml Thu Sep 9 15:03:55 2010
@@ -0,0 +1,15 @@
+<module>
+
+ <!-- Get access to server classes -->
+ <inherits name='org.apache.hise.fe.server.HiseInfrastructure'/>
+
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User'/>
+
+ <!-- inherit css based theme -->
+ <inherits name='com.google.gwt.user.theme.standard.Standard'/>
+
+ <!-- Specify the app entry point class. -->
+ <entry-point class='org.apache.hise.fe.gwt.client.HiseModule'/>
+
+</module>
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/HiseModule.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/HiseModule.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/HiseModule.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/HiseModule.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,21 @@
+package org.apache.hise.fe.gwt.client;
+
+import org.apache.hise.fe.gwt.client.ui.views.MainView;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.RootPanel;
+
+/**
+ * Entry point classes define <code>onModuleLoad()</code>.
+ */
+public class HiseModule implements EntryPoint {
+
+ /**
+ * This is the entry point method.
+ */
+ public void onModuleLoad() {
+
+ MainView mainView = MainView.getInstance();
+ RootPanel.get().add(mainView);
+ }
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/ErrorHandler.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/ErrorHandler.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/ErrorHandler.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/ErrorHandler.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,50 @@
+package org.apache.hise.fe.gwt.client.rpc;
+
+import org.apache.hise.fe.server.dtos.exceptions.HiseApplicationException;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestException;
+import com.google.gwt.user.client.Window;
+
+
+/**
+ * {@inheritDoc}
+ * <p>Recognize registered domain exceptions and displays proper user message.<br/>
+ * This function is provided by convenient statis method.</p>
+ *
+ * @author rpietra
+ */
+public class ErrorHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ public void handleError(RequestException requestException) {
+ handleError(requestException);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void handleError(Request request, Throwable throwable) {
+ handleError(throwable);
+ }
+
+ /**
+ * Handles error in generic way, which means log and display proper user message.
+ *
+ * @param throwable exception being handled
+ * @returns true if error was handled.
+ */
+ static public boolean handleError(Throwable throwable) {
+
+ if (throwable instanceof HiseApplicationException) {
+ Window.alert("BÅÄ
d webserwisu : "+ throwable.getMessage());
+ return true;
+ }
+
+ Window.alert("BÅÄ
d aplikacji: "+ throwable.getMessage());
+ return false;
+ }
+}
+
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/HiseAsyncCallback.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/HiseAsyncCallback.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/HiseAsyncCallback.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/HiseAsyncCallback.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,53 @@
+package org.apache.hise.fe.gwt.client.rpc;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+
+/**
+ * Custom <code>HiseAsyncCallback</code> class for keeping common operations in one place,
+ * like error handling for example.
+ * <br/>
+ * <b>Please use this class instead of {@link AsyncCallback}
+ *
+ * @authorrpietra
+ * @param <T> {@inheritDoc}
+ * @see AsyncCallback
+ */
+public abstract class HiseAsyncCallback<T> implements AsyncCallback<T> {
+
+ /**
+ * Please call {@link #doSuccess(java.lang.Object)} instead of this method.
+ *
+ * @param result the return value of the remote produced call
+ */
+ public void onSuccess(T result) {
+ doSuccess(result);
+ }
+
+ /**
+ * Please call {@link #doFailure(java.lang.Object)} instead of this method.
+ *
+ * @param caught failure encountered while executing a remote procedure call
+ */
+ public void onFailure(Throwable caught) {
+ if (!ErrorHandler.handleError(caught)) {
+ doFailure(caught);
+ }
+ }
+
+ /**
+ * Implement this method instead of {@link HiseAsyncCallback#doSuccess(java.lang.Object)}
+ *
+ * @param result the return value of the remote produced call
+ */
+ public abstract void doSuccess(T result);
+
+ /**
+ * Implement this method instead of {@link HiseAsyncCallback#doSuccess(java.lang.Object)}
+ *
+ * @param caught failure encountered while executing a remote procedure call
+ */
+ public abstract void doFailure(Throwable caught);
+
+}
+
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacade.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacade.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacade.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacade.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,7 @@
+package org.apache.hise.fe.gwt.client.rpc;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+public interface TaskFacade extends RemoteService, org.apache.hise.fe.server.facades.TaskFacade {
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacadeAsync.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacadeAsync.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacadeAsync.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/rpc/TaskFacadeAsync.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,20 @@
+package org.apache.hise.fe.gwt.client.rpc;
+
+import java.util.List;
+
+import org.apache.hise.fe.server.dtos.FilterCriteriaDto;
+import org.apache.hise.fe.server.dtos.TaskDto;
+import org.apache.hise.fe.server.dtos.exceptions.HiseApplicationException;
+
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public interface TaskFacadeAsync {
+
+ void getMyTasks(FilterCriteriaDto filter, AsyncCallback<List<TaskDto>> callback) throws HiseApplicationException;
+ void claim(String taskId, AsyncCallback<Void> callback) throws HiseApplicationException;
+ void start(String taskId, AsyncCallback<Void> callback) throws HiseApplicationException;
+ void complete(String taskId, AsyncCallback<Void> callback) throws HiseApplicationException;
+ void fail(String taskId, AsyncCallback<Void> callback) throws HiseApplicationException;
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskColumnsConfigurator.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskColumnsConfigurator.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskColumnsConfigurator.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskColumnsConfigurator.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,88 @@
+package org.apache.hise.fe.gwt.client.ui.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.gwt.client.ui.helpers.*;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+
+public class TaskColumnsConfigurator {
+
+ private List<TaskDataDisplayer> visibleColumns = new ArrayList<TaskDataDisplayer>();
+ private List<TaskDataDisplayer> nonVisibleColumns = new ArrayList<TaskDataDisplayer>();
+
+
+ public TaskColumnsConfigurator() {
+ addColumn(new TaskIdDisplayer(), true);
+ addColumn(new TaskNameDisplayer(), true);
+ addColumn(new TaskStatusDisplayer(), true);
+ addColumn(new TaskCreatedOnDisplayer(), true);
+ addColumn(new TaskOwnerDisplayer(), true);
+
+ addColumn(new TaskCreatedByDisplayer(), false);
+ addColumn(new TaskPriorityDisplayer(), false);
+ addColumn(new TaskSubjectDisplayer(), false);
+ addColumn(new TaskInitiatorDisplayer(), false);
+ }
+
+ private void addColumn(TaskDataDisplayer column, boolean visible) {
+ if (visible) {
+ visibleColumns.add(column);
+ } else {
+ nonVisibleColumns.add(column);
+ }
+ }
+
+ public int getColumnsCount() {
+ return visibleColumns.size();
+ }
+
+ public List<String> getColumnHeaders() {
+ List<String> headers = new ArrayList<String>();
+ for (TaskDataDisplayer column : visibleColumns) {
+ headers.add(column.getColumnLabel());
+ }
+ return headers;
+ }
+
+ public List<Widget> getColumnValues(TaskDto task) {
+ List<Widget> widgets = new ArrayList<Widget>();
+ for (TaskDataDisplayer column : visibleColumns) {
+ widgets.add(new Label(column.getDataForColumn(task)));
+ }
+ return widgets;
+ }
+
+ public TaskDataDisplayer getColumn(int index) {
+ if (index >= 0 && index < visibleColumns.size()) {
+ return visibleColumns.get(index);
+ } else {
+ return null;
+ }
+ }
+
+ public SortCriteria getSortCriteriaForColumn(int index) {
+ if (index >= 0 && index < visibleColumns.size()) {
+ return visibleColumns.get(index).getSortCriteria();
+ } else {
+ return SortCriteria.defaultValue();
+ }
+ }
+
+ public int getColumnWithSortCriteria(SortCriteria sort) {
+ int index = 0;
+ for (int i = 0; i < visibleColumns.size(); i++) {
+ if (sort.equals(visibleColumns.get(i).getSortCriteria())) {
+ index = i;
+ break;
+ }
+ }
+ return index;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskInfoConfigurator.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskInfoConfigurator.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskInfoConfigurator.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/config/TaskInfoConfigurator.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,69 @@
+package org.apache.hise.fe.gwt.client.ui.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskCreatedByDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskCreatedOnDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskDataDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskIdDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskInitiatorDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskNameDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskOwnerDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskPriorityDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskStatusDisplayer;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskSubjectDisplayer;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+public class TaskInfoConfigurator {
+
+ private List<TaskDataDisplayer> visibleData = new ArrayList<TaskDataDisplayer>();
+ private List<TaskDataDisplayer> nonVisibleData = new ArrayList<TaskDataDisplayer>();
+
+
+ public TaskInfoConfigurator() {
+ addData(new TaskIdDisplayer(), false);
+ addData(new TaskOwnerDisplayer(), true);
+ addData(new TaskNameDisplayer(), true);
+ addData(new TaskSubjectDisplayer(), true);
+ addData(new TaskStatusDisplayer(), true);
+ addData(new TaskCreatedOnDisplayer(), true);
+ addData(new TaskCreatedByDisplayer(), true);
+
+ addData(new TaskInitiatorDisplayer(), false);
+ addData(new TaskPriorityDisplayer(), false);
+ }
+
+ public int getDataCount() {
+ return visibleData.size();
+ }
+
+ private void addData(TaskDataDisplayer info, boolean visible) {
+ if (visible) {
+ visibleData.add(info);
+ } else {
+ nonVisibleData.add(info);
+ }
+ }
+
+ public List<String> getDataLabels() {
+ List<String> headers = new ArrayList<String>();
+ for (TaskDataDisplayer column : visibleData) {
+ headers.add(column.getInfoLabel());
+ }
+ return headers;
+ }
+
+ public List<Widget> getDataValues(TaskDto task) {
+ List<Widget> widgets = new ArrayList<Widget>();
+ for (TaskDataDisplayer column : visibleData) {
+ widgets.add(new Label(column.getDataForInfo(task)));
+ }
+ return widgets;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortCriteria.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortCriteria.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortCriteria.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortCriteria.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,19 @@
+package org.apache.hise.fe.gwt.client.ui.enums;
+
+
+public enum SortCriteria {
+
+ ID,
+ STATUS,
+ PRIORITY,
+ ACTUAL_OWNER,
+ CREATED_BY,
+ CREATED_DATE,
+ INITIATOR,
+ NAME,
+ SUBJECT;
+
+ static public SortCriteria defaultValue() {
+ return ID;
+ }
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortDirection.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortDirection.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortDirection.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/enums/SortDirection.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,33 @@
+package org.apache.hise.fe.gwt.client.ui.enums;
+
+public enum SortDirection {
+
+ ASCENDING {
+ @Override
+ public int intValue() {
+ return 1;
+ }
+ @Override
+ public SortDirection next() {
+ return DESCENDING;
+ }
+ },
+ DESCENDING {
+ @Override
+ public int intValue() {
+ return -1;
+ }
+ @Override
+ public SortDirection next() {
+ return ASCENDING;
+ }
+ };
+
+ abstract public int intValue();
+ abstract public SortDirection next();
+
+ static public SortDirection defaultValue() {
+ return ASCENDING;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedByDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedByDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedByDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedByDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,18 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskCreatedByDisplayer extends TaskDataDisplayer {
+
+ public TaskCreatedByDisplayer() {
+ setLabel("Utworzone przez");
+ sortCriteria = SortCriteria.CREATED_BY;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ return defaultString(task.getCreatedBy());
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedOnDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedOnDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedOnDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskCreatedOnDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,22 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskCreatedOnDisplayer extends TaskDataDisplayer {
+
+ public TaskCreatedOnDisplayer() {
+ setLabel("Data utworzenia");
+ sortCriteria = SortCriteria.CREATED_DATE;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ String date = "-";
+ if (task.getCreatedOn() != null) {
+ date = DATE_FORMAT.format(task.getCreatedOn());
+ }
+ return date;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskDataDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskDataDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskDataDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskDataDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,99 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+
+
+public abstract class TaskDataDisplayer {
+
+ static protected DateTimeFormat DATE_FORMAT = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
+
+ protected String columnLabel;
+ protected String infoLabel;
+
+ protected boolean isVisibleAsColumn;
+ protected boolean isVisibleAsInfo;
+
+ protected int columnIndex;
+ protected int infoIndex;
+
+ protected SortCriteria sortCriteria;
+
+ abstract public String getDataForInfo(TaskDto task);
+
+ public String getDataForColumn(TaskDto task) {
+ return getDataForInfo(task);
+ }
+
+ protected void setLabel(String label) {
+ columnLabel = label;
+ infoLabel = label;
+ }
+
+ protected String defaultString(String string) {
+ if (string == null) {
+ string = "";
+ }
+ return string;
+ }
+
+ public String getColumnLabel() {
+ return columnLabel;
+ }
+
+ public void setColumnLabel(String columnLabel) {
+ this.columnLabel = columnLabel;
+ }
+
+ public String getInfoLabel() {
+ return infoLabel;
+ }
+
+ public void setInfoLabel(String infoLabel) {
+ this.infoLabel = infoLabel;
+ }
+
+ public boolean isVisibleAsColumn() {
+ return isVisibleAsColumn;
+ }
+
+ public void setVisibleAsColumn(boolean isVisibleAsColumn) {
+ this.isVisibleAsColumn = isVisibleAsColumn;
+ }
+
+ public boolean isVisibleAsInfo() {
+ return isVisibleAsInfo;
+ }
+
+ public void setVisibleAsInfo(boolean isVisibleAsInfo) {
+ this.isVisibleAsInfo = isVisibleAsInfo;
+ }
+
+ public int getColumnIndex() {
+ return columnIndex;
+ }
+
+ public void setColumnIndex(int columnIndex) {
+ this.columnIndex = columnIndex;
+ }
+
+ public int getInfoIndex() {
+ return infoIndex;
+ }
+
+ public void setInfoIndex(int infoIndex) {
+ this.infoIndex = infoIndex;
+ }
+
+ public SortCriteria getSortCriteria() {
+ return sortCriteria;
+ }
+
+ public void setSortCriteria(SortCriteria sortCriteria) {
+ this.sortCriteria = sortCriteria;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskIdDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskIdDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskIdDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskIdDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,18 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskIdDisplayer extends TaskDataDisplayer {
+
+ public TaskIdDisplayer() {
+ setLabel("Id");
+ sortCriteria = SortCriteria.ID;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ return defaultString(task.getId());
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskInitiatorDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskInitiatorDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskInitiatorDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskInitiatorDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,18 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskInitiatorDisplayer extends TaskDataDisplayer {
+
+ public TaskInitiatorDisplayer() {
+ setLabel("Inicjalizator");
+ sortCriteria = SortCriteria.INITIATOR;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ return defaultString(task.getTaskInitiator());
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskNameDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskNameDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskNameDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskNameDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,18 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskNameDisplayer extends TaskDataDisplayer {
+
+ public TaskNameDisplayer() {
+ setLabel("Temat");
+ sortCriteria = SortCriteria.NAME;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ return defaultString(task.getPresentationName());
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskOwnerDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskOwnerDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskOwnerDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskOwnerDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,18 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskOwnerDisplayer extends TaskDataDisplayer {
+
+ public TaskOwnerDisplayer() {
+ setLabel("Przypisany");
+ sortCriteria = SortCriteria.ACTUAL_OWNER;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ return defaultString(task.getActualOwner());
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskPriorityDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskPriorityDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskPriorityDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskPriorityDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,22 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskPriorityDisplayer extends TaskDataDisplayer{
+
+ public TaskPriorityDisplayer() {
+ setLabel("Priorytet");
+ sortCriteria = SortCriteria.PRIORITY;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ String priority = "-";
+ if (task.getPriority() != null) {
+ priority = task.getPriority().toString();
+ }
+ return priority;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskStatusDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskStatusDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskStatusDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskStatusDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,22 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskStatusDisplayer extends TaskDataDisplayer {
+
+ public TaskStatusDisplayer() {
+ setLabel("Status");
+ sortCriteria = SortCriteria.STATUS;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ String status = "";
+ if (task.getStatus() != null) {
+ status = task.getStatus().toString();
+ }
+ return status;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskSubjectDisplayer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskSubjectDisplayer.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskSubjectDisplayer.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/helpers/TaskSubjectDisplayer.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,18 @@
+package org.apache.hise.fe.gwt.client.ui.helpers;
+
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+public class TaskSubjectDisplayer extends TaskDataDisplayer {
+
+ public TaskSubjectDisplayer() {
+ setLabel("Opis");
+ sortCriteria = SortCriteria.SUBJECT;
+ }
+
+ @Override
+ public String getDataForInfo(TaskDto task) {
+ return defaultString(task.getPresentationSubject());
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/views/MainView.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/views/MainView.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/views/MainView.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/views/MainView.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,43 @@
+package org.apache.hise.fe.gwt.client.ui.views;
+
+import org.apache.hise.fe.gwt.client.ui.widgets.FilterPanel;
+import org.apache.hise.fe.gwt.client.ui.widgets.TaskInfoPanel;
+import org.apache.hise.fe.gwt.client.ui.widgets.TaskListPanel;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class MainView extends Composite {
+
+ static private MainView instance;
+
+ static private final String STYLE_MAIN_VIEW = "mainView";
+
+ private VerticalPanel mainPanel;
+ private FilterPanel filterPanel;
+ private TaskListPanel taskList;
+ private TaskInfoPanel taskInfo;
+
+
+ static public MainView getInstance() {
+ if (instance == null) {
+ instance = new MainView();
+ }
+ return instance;
+ }
+
+ private MainView() {
+ mainPanel = new VerticalPanel();
+ filterPanel = FilterPanel.getInstance();
+ taskList = TaskListPanel.getInstance();
+ taskInfo = TaskInfoPanel.getInstance();
+ mainPanel.setStyleName(STYLE_MAIN_VIEW);
+
+ mainPanel.add(filterPanel);
+ mainPanel.add(taskList);
+ mainPanel.add(taskInfo);
+ filterPanel.setFiltersVisible(false);
+
+ initWidget(mainPanel);
+ }
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/FilterPanel.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/FilterPanel.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/FilterPanel.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/FilterPanel.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,178 @@
+package org.apache.hise.fe.gwt.client.ui.widgets;
+
+import org.apache.hise.fe.server.dtos.FilterCriteriaDto;
+import org.apache.hise.fe.server.dtos.enums.HumanRole;
+import org.apache.hise.fe.server.dtos.enums.Status;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ChangeEvent;
+import com.google.gwt.event.dom.client.ChangeHandler;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.ListBox;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class FilterPanel extends Composite {
+
+ static private FilterPanel instance;
+
+ static private String STYLE_FILTER_PANEL = "filterPanel";
+ static private String STYLE_FILTER_PANEL_HEADER = "filterPanelHeader";
+ static private String STYLE_FILTER_PANEL_BODY = "filterPanelBody";
+
+
+ private Panel panel;
+ private Panel filters;
+ private ListBox userRoles;
+ private ListBox statuses;
+ private Label hideButton;
+
+ private FilterCriteriaDto filterCriteria = new FilterCriteriaDto();
+
+ static public FilterPanel getInstance() {
+ if (instance == null) {
+ instance = new FilterPanel();
+ }
+ return instance;
+ }
+
+ public void clearFilterCriteria() {
+ filterCriteria = new FilterCriteriaDto();
+
+ for (int i = 0; i < userRoles.getItemCount(); i++) {
+ userRoles.setItemSelected(i, false);
+ }
+ for (int i = 0; i < statuses.getItemCount(); i++) {
+ statuses.setItemSelected(i, false);
+ }
+ }
+
+ public void setFiltersVisible(boolean visible) {
+ if (visible) {
+ hideButton.setText("[-]");
+ } else {
+ hideButton.setText("[+]");
+ }
+ filters.setVisible(visible);
+ }
+
+ private FilterPanel() {
+ panel = new VerticalPanel();
+ panel.setStyleName(STYLE_FILTER_PANEL);
+
+ panel.add(createHeader());
+ filters = createFilters();
+ panel.add(filters);
+ initWidget(panel);
+ }
+
+ private Panel createHeader() {
+ Panel header = new HorizontalPanel();
+ header.setStyleName(STYLE_FILTER_PANEL_HEADER);
+ header.add(new Label("Filtr zadaÅ"));
+ hideButton = createHideButton();
+ header.add(hideButton);
+ return header;
+ }
+
+ private Label createHideButton() {
+ Label hideButton = new Label("[-]");
+ hideButton.setStyleName("filterHide");
+ hideButton.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent arg0) {
+ setFiltersVisible(!filters.isVisible());
+ }
+ });
+ return hideButton;
+ }
+
+ private Panel createFilters() {
+ FlexTable filters = new FlexTable();
+ filters.setStyleName(STYLE_FILTER_PANEL_BODY);
+
+ userRoles = createListBox(HumanRole.values(), false, 1);
+ statuses = createListBox(Status.values(), true, 6);
+
+ filters = addNamedWiget(0, "Rodzaj zadaÅ", userRoles, filters);
+ filters = addNamedWiget(1, "Status zadaÅ", statuses, filters);
+ return filters;
+ }
+
+ private ListBox createListBox(Enum<?>[] enums, boolean multiselect, int visibleCount) {
+ ListBox listBox = new ListBox(multiselect);
+ if (visibleCount > 1) {
+ listBox.setVisibleItemCount(visibleCount);
+ }
+ for (Enum<?> value : enums) {
+ listBox.addItem(value.toString(), value.name());
+ }
+
+ listBox.addChangeHandler(new ChangeHandler() {
+ @Override
+ public void onChange(ChangeEvent arg0) {
+ filterIfCriteriaChanged();
+ }
+ });
+
+ return listBox;
+ }
+
+ private FlexTable addNamedWiget(int row, String name, Widget wiget, FlexTable table) {
+
+ table.setText(row, 0, name);
+ table.setWidget(row, 1, wiget);
+ table.getCellFormatter().setStyleName(row, 0, "filterLabel");
+ table.getCellFormatter().setStyleName(row, 1, "filterWiget");
+
+ return table;
+ }
+
+ private void filterIfCriteriaChanged() {
+ GWT.log("filterIfCriteriaChanged");
+ FilterCriteriaDto newCriteria = getCurrentFilterCriteria();
+ if (!newCriteria.equals(filterCriteria)) {
+ GWT.log("filterIfCriteriaChanged CHANGED");
+ filterCriteria = newCriteria;
+ TaskListPanel.getInstance().filterTasks();
+ } else {
+ GWT.log("filterIfCriteriaChanged NOT CHANGED");
+ }
+ }
+
+ private FilterCriteriaDto getCurrentFilterCriteria() {
+ FilterCriteriaDto filterCriteria = new FilterCriteriaDto();
+ if (!filters.isVisible()) return filterCriteria;
+
+ if (userRoles.getSelectedIndex() >= 0) {
+ String value = userRoles.getValue(userRoles.getSelectedIndex());
+ if (HumanRole.valueOf(value) != null) {
+ filterCriteria.setGenericHumanRole(HumanRole.valueOf(value));
+ }
+ }
+
+ if (statuses.getSelectedIndex() >= 0) {
+ for (int i = 0; i < statuses.getItemCount(); i++) {
+ if (statuses.isItemSelected(i)) {
+ String value = statuses.getValue(i);
+ if (Status.valueOf(value) != null) {
+ filterCriteria.getStatuses().add(Status.valueOf(value));
+ }
+ }
+ }
+ }
+
+ return filterCriteria;
+ }
+
+ public FilterCriteriaDto getFilterCriteria() {
+ return filterCriteria;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/PagingPanel.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/PagingPanel.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/PagingPanel.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/PagingPanel.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,129 @@
+package org.apache.hise.fe.gwt.client.ui.widgets;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Panel;
+
+public class PagingPanel extends Composite {
+
+ static private PagingPanel instance;
+
+ private static final String STYLE_PAGING_PANEL = "taskListPagingPanel";
+ private static final String STYLE_PAGING_BAR = "taskListPagingBar";
+ private static final String STYLE_REFRESH_TASKS_LINK = "refreshTasksButton";
+ private static final String STYLE_PAGE_NUMBER = "taskListPageNumber";
+ private static final String STYLE_SELECTED_PAGE_NUMBER = "taskListSelectedPageNumber";
+
+ private Panel pagingBar;
+
+
+ static public PagingPanel getInstance() {
+ if (instance == null) {
+ instance = new PagingPanel();
+ }
+ return instance;
+ }
+
+ public void updatePagingPanel(int chosenPage, int totalTasks, int tasksPerPage) {
+ pagingBar.clear();
+
+ if (totalTasks > 0) {
+ displayLinksInPagingBar(chosenPage, totalTasks, tasksPerPage);
+ }
+ }
+
+ private PagingPanel() {
+ pagingBar = createPagingBar();
+
+ HorizontalPanel panel = new HorizontalPanel();
+ panel.setStyleName(STYLE_PAGING_PANEL);
+ panel.add(createRefreshButton());
+ panel.add(pagingBar);
+
+ initWidget(panel);
+ }
+
+ private Panel createPagingBar() {
+ HorizontalPanel pagingPanel = new HorizontalPanel();
+ pagingPanel.setStyleName(STYLE_PAGING_BAR);
+ return pagingPanel;
+ }
+
+
+ private Panel createRefreshButton() {
+ Panel refreshPanel = new FlowPanel();
+ Label refreshLink = new Label("[OdÅwież]");
+ refreshLink.addClickHandler(getRefreshClickHandler());
+ refreshLink.setStyleName(STYLE_REFRESH_TASKS_LINK);
+ refreshPanel.add(refreshLink);
+ refreshPanel.setStyleName("refreshTasksPanel");
+ return refreshPanel;
+ }
+
+ private void displayLinksInPagingBar(int chosenPage, int totalTasks, int tasksPerPage) {
+ if (totalTasks == 0) return;
+
+ int totalPages = (int) Math.ceil((double)totalTasks / (double) tasksPerPage);
+ boolean morePages = totalPages > 5;
+
+ for (int page = 0; page < totalPages; page++) {
+ if (!morePages || page >= chosenPage - 1 && page <= chosenPage + 1) {
+ displayPageLink(page, chosenPage);
+ } else if (page == 0 || page == totalPages - 1) {
+ displayPageLink(page, chosenPage, morePages);
+ }
+ }
+ }
+
+ private void displayPageLink(int pageNumber, int chosenPage, boolean showMore) {
+ String labelTxt = (pageNumber + 1) + " | ";
+ if (pageNumber == 0) {
+ labelTxt = " | " + labelTxt;
+ }
+ if (showMore) {
+ if (pageNumber == 0) {
+ labelTxt = labelTxt + "... | ";
+ } else {
+ labelTxt = " ... | " + labelTxt;
+ }
+ }
+ Label label = new Label(labelTxt);
+ label.addClickHandler(getDisplayTasksPageClickHandler(pageNumber));
+ if (pageNumber == chosenPage) label.setStyleName(STYLE_SELECTED_PAGE_NUMBER);
+ else label.setStyleName(STYLE_PAGE_NUMBER);
+
+ pagingBar.add(label);
+ }
+
+ private void displayPageLink(int pageNumber, int chosenPage) {
+ displayPageLink(pageNumber, chosenPage, false);
+ }
+
+ private ClickHandler getDisplayTasksPageClickHandler(final int page) {
+ return new ClickHandler() {
+
+ @Override
+ public void onClick(ClickEvent event) {
+ GWT.log("[PAGE CLICKED] page=" + page);
+ TaskListPanel.getInstance().displayTasksPage(page);
+ }
+ };
+ }
+
+ private ClickHandler getRefreshClickHandler() {
+ return new ClickHandler() {
+
+ @Override
+ public void onClick(ClickEvent event) {
+ GWT.log("[REFRESH]");
+ TaskListPanel.getInstance().reloadTasks();
+ }
+ };
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskInfoPanel.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskInfoPanel.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskInfoPanel.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskInfoPanel.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,252 @@
+package org.apache.hise.fe.gwt.client.ui.widgets;
+
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.hise.fe.gwt.client.rpc.HiseAsyncCallback;
+import org.apache.hise.fe.gwt.client.ui.config.TaskInfoConfigurator;
+import org.apache.hise.fe.gwt.client.util.FacadeRegistry;
+import org.apache.hise.fe.server.dtos.TaskDto;
+import org.apache.hise.fe.server.dtos.enums.Action;
+import org.apache.hise.fe.server.dtos.enums.Status;
+
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.*;
+
+public class TaskInfoPanel extends Composite {
+
+ static private final String STYLE_TASK_INFO_PANEL = "taskInfoPanel";
+ static private final String STYLE_TASK_INFO_HEADER = "taskInfoHeader";
+ static private final String STYLE_TASK_INFO_BODY = "taskInfoBody";
+ static private final String STYLE_TASK_INFO_LABEL = "taskInfoLabel";
+ static private final String STYLE_TASK_INFO_DATA = "taskInfoData";
+
+ static private TaskInfoPanel instance;
+
+ private TaskInfoConfigurator infoConfig;
+
+ private VerticalPanel panel;
+ private FlowPanel header;
+ private Label headerText;
+ private FlexTable infoPanel;
+
+ private EnumMap<Action, Button> buttonsMap = new EnumMap<Action, Button>(Action.class);
+
+ private String displayedTask;
+
+
+ static public TaskInfoPanel getInstance() {
+ if (instance == null) {
+ instance = new TaskInfoPanel();
+ }
+ return instance;
+ }
+
+ private TaskInfoPanel() {
+ infoConfig = new TaskInfoConfigurator();
+
+ panel = createMainPanel();
+ panel.setVisible(false);
+
+ initWidget(panel);
+ }
+
+ private VerticalPanel createMainPanel() {
+ VerticalPanel panel = new VerticalPanel();
+ panel.setStyleName(STYLE_TASK_INFO_PANEL);
+
+ header = new FlowPanel();
+ header.setStyleName(STYLE_TASK_INFO_HEADER);
+ headerText = new Label("");
+ header.add(headerText);
+
+ infoPanel = createTaskInfoPanel();
+
+ panel.add(header);
+ panel.add(infoPanel);
+ return panel;
+ }
+
+ private FlexTable createTaskInfoPanel() {
+ FlexTable infoPanel = new FlexTable();
+
+ int row = 0;
+ for (String label : infoConfig.getDataLabels()) {
+ infoPanel.setText(row, 0, label);
+ infoPanel.getCellFormatter().setStyleName(row, 0, STYLE_TASK_INFO_LABEL);
+ infoPanel.getCellFormatter().setStyleName(row, 1, STYLE_TASK_INFO_DATA);
+ row++;
+ }
+
+ infoPanel.setWidget(infoConfig.getDataCount(), 1, createButtonsPanel());
+ infoPanel.setStyleName(STYLE_TASK_INFO_BODY);
+ return infoPanel;
+ }
+
+ private HorizontalPanel createButtonsPanel() {
+ HorizontalPanel buttons = new HorizontalPanel();
+
+ for (Action action : Action.values()) {
+ Button button = new Button(action.toString(), getHandlerForButtonClick(action));
+ buttons.add(button);
+ buttonsMap.put(action, button);
+ }
+ return buttons;
+ }
+
+ private ClickHandler getHandlerForButtonClick(final Action action) {
+ return new ClickHandler() {
+
+ @Override
+ public void onClick(ClickEvent event) {
+ final String displayedTask = TaskInfoPanel.this.displayedTask;
+ GWT.log("Task no " + displayedTask + " " + action.name() + " TO BE DONE.");
+
+ if (displayedTask != null) {
+ HiseAsyncCallback<Void> callback = new HiseAsyncCallback<Void>() {
+
+ @Override
+ public void doFailure(Throwable e) {
+ Window.alert("Operation " + action.name() + " not performed, error occurred: " + e.getMessage());
+ }
+
+ @Override
+ public void doSuccess(Void none) {
+ GWT.log("Task no " + displayedTask + " " + action.name() + " done.");
+ TaskListPanel.getInstance().reloadTask(displayedTask);
+ }
+ };
+
+ if (action == Action.CLAIM) FacadeRegistry.getTaskFacade().claim(displayedTask, callback);
+ else if (action == Action.START) FacadeRegistry.getTaskFacade().start(displayedTask, callback);
+ else if (action == Action.COMPLETE) FacadeRegistry.getTaskFacade().complete(displayedTask, callback);
+ else if (action == Action.FAIL) FacadeRegistry.getTaskFacade().fail(displayedTask, callback);
+ else {
+ Window.alert("Operation " + action.name() + " is not implemented!");
+ }
+ }
+ }
+ };
+ }
+
+// private Button createStartButton() {
+// Button button = new Button("Rozpocznij zadanie", new ClickHandler() {
+//
+// @Override
+// public void onClick(ClickEvent arg0) {
+// if (displayedTask != null) {
+// HiseAsyncCallback<Void> callback = new HiseAsyncCallback<Void>() {
+//
+// @Override
+// public void doFailure(Throwable e) {
+// Window.alert("Task not started, error occurred: " + e.getMessage());
+// }
+//
+// @Override
+// public void doSuccess(Void none) {
+// GWT.log("Task no " + displayedTask + " START done.");
+// }
+// };
+//
+// FacadeRegistry.getTaskFacade().start(displayedTask, callback);
+// }
+// }
+// });
+// return button;
+// }
+//
+// private Button createCompleteButton() {
+// Button button = new Button("UkoÅczone", new ClickHandler() {
+//
+// @Override
+// public void onClick(ClickEvent arg0) {
+// if (displayedTask != null) {
+// HiseAsyncCallback<Void> callback = new HiseAsyncCallback<Void>() {
+//
+// @Override
+// public void doFailure(Throwable e) {
+// Window.alert("Task not completed, error occurred: " + e.getMessage());
+// }
+//
+// @Override
+// public void doSuccess(Void none) {
+// GWT.log("Task no " + displayedTask + " COMPLETE done.");
+// }
+// };
+//
+// FacadeRegistry.getTaskFacade().complete(displayedTask, callback);
+// }
+// }
+// });
+// return button;
+// }
+//
+// private Button createFailButton() {
+// Button button = new Button("Nieudane", new ClickHandler() {
+//
+// @Override
+// public void onClick(ClickEvent arg0) {
+// if (displayedTask != null) {
+// HiseAsyncCallback<Void> callback = new HiseAsyncCallback<Void>() {
+//
+// @Override
+// public void doFailure(Throwable e) {
+// Window.alert("Task not failed, error occurred: " + e.getMessage());
+// }
+//
+// @Override
+// public void doSuccess(Void none) {
+// GWT.log("Task no " + displayedTask + " FAIL done.");
+// }
+// };
+//
+// FacadeRegistry.getTaskFacade().fail(displayedTask, callback);
+// }
+// }
+// });
+// return button;
+// }
+
+
+ public void hidePanel() {
+ panel.setVisible(false);
+ displayedTask = null;
+ }
+
+ public void displayTask(TaskDto task) {
+ if (task == null) {
+ GWT.log("Task to display is null");
+ return;
+ }
+
+ GWT.log("Displaying task no " + task.getId());
+ panel.setVisible(true);
+ displayedTask = task.getId();
+ headerText.setText("Zadanie nr " + task.getId());
+
+ displayTaskData(task);
+ updateButtons(task.getStatus());
+ }
+
+ private void displayTaskData(TaskDto task) {
+ int row = 0;
+ for (Widget value : infoConfig.getDataValues(task)) {
+ infoPanel.setWidget(row, 1, value);
+ row++;
+ }
+ }
+
+ private void updateButtons(Status taskStatus) {
+ List<Action> availableActions = taskStatus.getAvailableActions();
+ for (Map.Entry<Action, Button> entry : buttonsMap.entrySet()) {
+ boolean buttonVisible = availableActions.contains(entry.getKey());
+ entry.getValue().setVisible(buttonVisible);
+ }
+
+ }
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskListPanel.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskListPanel.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskListPanel.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/ui/widgets/TaskListPanel.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,286 @@
+package org.apache.hise.fe.gwt.client.ui.widgets;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.apache.hise.fe.gwt.client.rpc.HiseAsyncCallback;
+import org.apache.hise.fe.gwt.client.ui.config.TaskColumnsConfigurator;
+import org.apache.hise.fe.gwt.client.ui.enums.SortCriteria;
+import org.apache.hise.fe.gwt.client.ui.enums.SortDirection;
+import org.apache.hise.fe.gwt.client.ui.helpers.TaskDataDisplayer;
+import org.apache.hise.fe.gwt.client.util.FacadeRegistry;
+import org.apache.hise.fe.server.dtos.TaskDto;
+
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HTMLTable.Cell;
+
+public class TaskListPanel extends Composite {
+
+ static private final String STYLE_TASK_LIST = "taskList";
+ static private final String STYLE_TASK_LIST_ROW_SELECTED = "taskListRowSelected";
+ static private final String STYLE_TASK_LIST_TITLE = "taskListTitle";
+ static private final String STYLE_TASK_LIST_HEADER = "taskListHeader";
+ static private final String STYLE_PREFIX_TASK_LIST_ROW = "taskListRow";
+ static private final String STYLE_TASK_LIST_PANEL = "taskListPanel";
+ static private final String STYLE_SORT_COLUMN = "sortColumn";
+
+ static public final int TASKS_PER_PAGE = 10;
+ static private final int HEADER_ROW = 1;
+ static private final int FIRST_TASK_ROW = 2;
+
+ static private TaskListPanel instance;
+ private VerticalPanel panel;
+ private FlexTable taskTable;
+
+ private TaskColumnsConfigurator columnConfig;
+ private List<TaskDto> tasks;
+
+ private int chosenTaskRow = -1;
+ private int displayedPage = 0;
+
+ private SortDirection sortDirection = SortDirection.ASCENDING;
+ private SortCriteria sortCriteria;
+
+ static public TaskListPanel getInstance() {
+ if (instance == null) {
+ instance = new TaskListPanel();
+ }
+ return instance;
+ }
+
+ private TaskListPanel() {
+ panel = new VerticalPanel();
+ panel.setStyleName(STYLE_TASK_LIST_PANEL);
+
+ columnConfig = new TaskColumnsConfigurator();
+ sortCriteria = columnConfig.getSortCriteriaForColumn(0);
+ taskTable = createTaskTable();
+ addChooseTaskHandler();
+
+ panel.add(taskTable);
+ panel.add(PagingPanel.getInstance());
+ initWidget(panel);
+ }
+
+ @Override
+ protected void onLoad() {
+ super.onLoad();
+ reloadTasks();
+ }
+
+ public void filterTasks() {
+ GWT.log("[FILTER TASKS]");
+ loadTasks(null);
+ }
+
+ public void reloadTasks() {
+ GWT.log("[LOAD ALL TASKS]");
+ FilterPanel.getInstance().clearFilterCriteria();
+ loadTasks(null);
+ }
+
+ public void displayTasksPage(int page) {
+ GWT.log("[DISPLAY TASK PAGE] page=" + page + ", tasksCount=" + tasks.size());
+ displayTasksPage(page, tasks);
+ }
+
+ public void reloadTask(String taskToBeDisplayed) {
+ GWT.log("[RELOAD] task=" + taskToBeDisplayed);
+ FilterPanel.getInstance().clearFilterCriteria();
+ loadTasks(taskToBeDisplayed);
+ }
+
+ private void loadTasks(final String taskToBeDisplayed) {
+ GWT.log("[LOAD TASKS] taskToBeDisplayed=" + taskToBeDisplayed);
+ HiseAsyncCallback<List<TaskDto>> callback = new HiseAsyncCallback<List<TaskDto>>() {
+
+ @Override
+ public void doFailure(Throwable e) {
+ Window.alert("Tasks not loaded, error occurred: " + e.getMessage());
+ }
+
+ @Override
+ public void doSuccess(List<TaskDto> tasks) {
+ GWT.log("tasks count=" + tasks.size());
+ sort(tasks, sortCriteria, sortDirection);
+ displayTasks(taskToBeDisplayed, tasks);
+ }
+ };
+
+ FacadeRegistry.getTaskFacade().getMyTasks(FilterPanel.getInstance().getFilterCriteria(), callback);
+ }
+
+ private void displayTasks(String taskToBeDisplayed, List<TaskDto> tasks) {
+ this.tasks = tasks;
+ int taskIndex = -1;
+ int page = 0;
+ if (taskToBeDisplayed != null) {
+ for (int i = 0; i < tasks.size() && taskIndex < 0; i++) {
+ if (taskToBeDisplayed.equals(tasks.get(i).getId())) {
+ taskIndex = i;
+ }
+ }
+ }
+ if (taskIndex >= 0) {
+ page = (int) Math.floor(taskIndex / TASKS_PER_PAGE);
+ }
+ displayTasksPage(page, tasks);
+
+ if (taskIndex >= 0) {
+ selectRow(FIRST_TASK_ROW + taskIndex % TASKS_PER_PAGE);
+ TaskInfoPanel.getInstance().displayTask(tasks.get(taskIndex));
+ }
+ }
+
+ private void displayTasksPage(int page, List<TaskDto> allTasks) {
+ if (page < 0 || page * TASKS_PER_PAGE >= allTasks.size()) {
+ page = 0;
+ }
+ displayedPage = page;
+
+ int fromIndex = page * TASKS_PER_PAGE;
+ int toIndex = fromIndex + TASKS_PER_PAGE;
+ if (toIndex > allTasks.size()) toIndex = allTasks.size();
+
+ unselectRow();
+ TaskInfoPanel.getInstance().hidePanel();
+ displayTasks(allTasks.subList(fromIndex, toIndex));
+ PagingPanel.getInstance().updatePagingPanel(page, allTasks.size(), TASKS_PER_PAGE);
+ }
+
+ private FlexTable createTaskTable() {
+ FlexTable tasks = new FlexTable();
+ tasks.setStyleName(STYLE_TASK_LIST);
+ tasks.getRowFormatter().setStyleName(0, STYLE_TASK_LIST_TITLE);
+ tasks.setText(0, 0, "Twoje zadania");
+ tasks.getFlexCellFormatter().setColSpan(0, 0, columnConfig.getColumnsCount());
+
+ int column = 0;
+ for (String header : columnConfig.getColumnHeaders()) {
+ tasks.setText(1, column, header);
+ column++;
+ }
+ tasks.getRowFormatter().setStyleName(1, STYLE_TASK_LIST_HEADER);
+ return tasks;
+ }
+
+
+ private void addChooseTaskHandler() {
+ taskTable.addClickHandler(new ClickHandler() {
+
+ @Override
+ public void onClick(ClickEvent event) {
+ Cell clickedCell = taskTable.getCellForEvent(event);
+ int clickedRow = clickedCell.getRowIndex();
+ if (clickedRow >= FIRST_TASK_ROW) {
+ selectRow(clickedRow);
+ TaskInfoPanel.getInstance().displayTask(getTaskForRow(clickedRow));
+ } else if (clickedRow == 1) {
+ changeSorting(clickedCell.getCellIndex());
+ }
+ }
+ });
+ }
+
+ private void changeSorting(int newSortColumn) {
+ SortCriteria newSort = columnConfig.getSortCriteriaForColumn(newSortColumn);
+ if (newSort != null) {
+ if (newSort.equals(sortCriteria)) {
+ sortDirection = sortDirection.next();
+ } else {
+ unselectSortColumn();
+ sortDirection = SortDirection.defaultValue();
+ }
+ sortCriteria = newSort;
+ sort(tasks, newSortColumn, sortDirection);
+ displayTasksPage(0);
+ }
+ }
+
+ private void selectSortColumn(int columnIndex) {
+ taskTable.getCellFormatter().addStyleName(HEADER_ROW, columnIndex, STYLE_SORT_COLUMN);
+ }
+
+ private void unselectSortColumn() {
+ if (sortCriteria != null) {
+ taskTable.getCellFormatter().removeStyleName(HEADER_ROW, columnConfig.getColumnWithSortCriteria(sortCriteria), STYLE_SORT_COLUMN);
+ }
+ }
+
+ private void selectRow(int row) {
+ unselectRow();
+ GWT.log("Selected row: " + row);
+ taskTable.getRowFormatter().addStyleName(row, STYLE_TASK_LIST_ROW_SELECTED);
+ chosenTaskRow = row;
+ }
+
+ private void unselectRow() {
+ if (chosenTaskRow >= 0) {
+ GWT.log("Removing style from previously selected row: " + chosenTaskRow);
+ taskTable.getRowFormatter().removeStyleName(chosenTaskRow, STYLE_TASK_LIST_ROW_SELECTED);
+ chosenTaskRow = -1;
+ }
+ }
+
+ private TaskDto getTaskForRow(int rowIndex) {
+ int taskIndex = rowIndex - FIRST_TASK_ROW;
+ taskIndex += displayedPage * TASKS_PER_PAGE;
+
+ if (tasks != null && (taskIndex < tasks.size())) {
+ return tasks.get(taskIndex); //given row index includes header
+ } else {
+ return null;
+ }
+ }
+
+ private void displayTasks(List<TaskDto> tasks) {
+ chosenTaskRow = -1;
+ while (taskTable.getRowCount() > FIRST_TASK_ROW) {
+ taskTable.removeRow(FIRST_TASK_ROW);
+ }
+
+ int row = FIRST_TASK_ROW;
+ for (TaskDto task : tasks) {
+ int column = 0;
+ for (Widget data : columnConfig.getColumnValues(task)) {
+ taskTable.setWidget(row, column, data);
+ column++;
+ }
+ taskTable.getRowFormatter().setStyleName(row, STYLE_PREFIX_TASK_LIST_ROW + row%2);
+ row++;
+ }
+ }
+
+ private List<TaskDto> sort(List<TaskDto> tasks, SortCriteria criteria, final SortDirection direction) {
+ return sort(tasks, columnConfig.getColumnWithSortCriteria(criteria), direction);
+ }
+
+ private List<TaskDto> sort(List<TaskDto> tasks, int columnIndex, final SortDirection direction) {
+ selectSortColumn(columnIndex);
+ final TaskDataDisplayer criteria = columnConfig.getColumn(columnIndex);
+ if (criteria != null) {
+ Collections.sort(tasks, new Comparator<TaskDto>() {
+ @Override
+ public int compare(TaskDto task1, TaskDto task2) {
+ String data1 = criteria.getDataForColumn(task1);
+ String data2 = criteria.getDataForColumn(task2);
+ if (data1 == null && data2 == null) return 0;
+ if (data1 != null && data2 == null) return 1 * direction.intValue();
+ if (data1 == null && data2 != null) return -1 * direction.intValue();
+ return data1.compareToIgnoreCase(data2) * direction.intValue();
+ }
+ });
+ }
+ return tasks;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/util/FacadeRegistry.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/util/FacadeRegistry.java?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/util/FacadeRegistry.java (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/gwt/client/util/FacadeRegistry.java Thu Sep 9 15:03:55 2010
@@ -0,0 +1,37 @@
+package org.apache.hise.fe.gwt.client.util;
+
+import org.apache.hise.fe.gwt.client.rpc.TaskFacade;
+import org.apache.hise.fe.gwt.client.rpc.TaskFacadeAsync;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+
+
+public class FacadeRegistry {
+
+ private static FacadeRegistry instance;
+
+ private final TaskFacadeAsync taskFacade;
+
+ public static FacadeRegistry getInstance() {
+ if(instance == null) {
+ instance = new FacadeRegistry();
+ }
+ return instance;
+ }
+
+ private FacadeRegistry() {
+ taskFacade = (TaskFacadeAsync) GWT.create(TaskFacade.class);
+ ServiceDefTarget taskEndpoint = (ServiceDefTarget) taskFacade;
+ taskEndpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "rpc/TaskFacade.do");
+ }
+
+ public TaskFacadeAsync getTaskFacadeInstance() {
+ return taskFacade;
+ }
+
+ public static TaskFacadeAsync getTaskFacade() {
+ return getInstance().taskFacade;
+ }
+
+}
Added: incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/HiseInfrastructure.gwt.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/HiseInfrastructure.gwt.xml?rev=995452&view=auto
==============================================================================
--- incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/HiseInfrastructure.gwt.xml (added)
+++ incubator/hise/trunk/hise-fe/src/main/java/org/apache/hise/fe/server/HiseInfrastructure.gwt.xml Thu Sep 9 15:03:55 2010
@@ -0,0 +1,11 @@
+<module>
+
+ <source path="dtos" />
+
+ <source path="facades">
+ <exclude name="**/impl/**"/>
+ </source>
+
+ <source path="exceptions" />
+
+</module>