diff --git a/AUTHORS b/AUTHORS index dca75fdfd..332c5d53d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,10 +1,12 @@ Authors ======= +* Cristina Alavariño Pérez * Jacobo Aragunde Pérez * Fernando Bellas Permuy * José María Casanova Crespo * Xavier Castaño García +* Ignacio Díaz Teijido * Óscar González Fernández * Susana Montes Pedreira * Francisco Javier Morán Rúa diff --git a/HACKING b/HACKING index b81ad5b0b..6caf33b26 100644 --- a/HACKING +++ b/HACKING @@ -1,7 +1,376 @@ Hacking ======= -If you want to hack on the *NavalPlan* project you should visit the wiki where -you can find all the information related with project development. +This is a guide about how to start hacking on *NavalPlan* project. If you want +more information about *NavalPlan* development you should visit the wiki +available at: http://wiki.navalplan.org/. -*NavalPlan* wiki is available at: http://wiki.navalplan.org/. +.. contents:: + + +Compilation requirements +------------------------ + +* *Git* - Version Control System + + Needed to clone source code repository + +* *Maven 2* - Java software project management and comprehension tool + + Needed to build and compile the project + +* *JDK 6* - Java Development Kit + + Project depends on Java 6 and JDK is needed in order to compile it + +* *PostgreSQL* - Object-relational SQL database + + Database server + +* *Python Docutils* - Utilities for the documentation of Python modules + + Used to generate HTMLs help files from RST files (reStructuredText) + +* *Make* - An utility for Directing compilation + + Needed to compile the help + +* *gettext* - GNU Internationalization utilities + + Used for i18n support in the project + +* *GNU FreeFont* - Freefont Serif, Sans and Mono Truetype fonts + + Font family used in reports + +* *CutyCapt* - Utility to capture WebKit's rendering of a web page + + Required for printing + + +NavalPlan compilation +--------------------- + +Debian/Ubuntu +~~~~~~~~~~~~~ + +* Install requirements:: + + # apt-get install git-core maven2 openjdk-6-jdk postgresql postgresql-client python-docutils make gettext ttf-freefont cutycapt + +* Connect to database:: + + # su postgres -c psql + +* Use SQL sentences:: + + CREATE DATABASE navaldev; + CREATE DATABASE navaldevtest; + CREATE USER naval WITH PASSWORD 'naval'; + GRANT ALL PRIVILEGES ON DATABASE navaldev TO naval; + GRANT ALL PRIVILEGES ON DATABASE navaldevtest TO naval; + +* Download source code:: + + $ git clone git://navalplan.git.sourceforge.net/gitroot/navalplan/navalplan + +* Compile project:: + + $ mvn clean install + +* Launch application:: + + $ cd navalplanner-webapp/ + $ mvn jetty:run + +* Go to http://localhost:8080/navalplanner-webapp/ + +Fedora +~~~~~~ + +* Install requirements:: + + # yum install git maven java-1.6.0-openjdk postgresql postgresql-server python-docutils make gettext gnu-free-fonts-compat + +* Start database service:: + + # service postgresql initdb + # service postgresql start + +* Connect to database:: + + # su postgres -c psql + +* Use SQL sentences:: + + CREATE DATABASE navaldev; + CREATE DATABASE navaldevtest; + CREATE USER naval WITH PASSWORD 'naval'; + GRANT ALL PRIVILEGES ON DATABASE navaldev TO naval; + GRANT ALL PRIVILEGES ON DATABASE navaldevtest TO naval; + +* Set ``postgres`` user password:: + + ALTER USER postgres WITH PASSWORD 'postgres'; + +* Edit ``/var/lib/pgsql/data/pg_hba.conf`` and replace ``ident`` by ``md5`` + +* Reload database configuration:: + + # service postgresql reload + +* Download source code:: + + $ git clone git://navalplan.git.sourceforge.net/gitroot/navalplan/navalplan + +* Compile project:: + + $ mvn clean install + +* Launch application:: + + $ cd navalplanner-webapp/ + $ mvn jetty:run + +* Go to http://localhost:8080/navalplanner-webapp/ + +openSUSE +~~~~~~~~ + +* Install requirements:: + + # zypper install git-core java-1_6_0-openjdk-devel postgresql-server postgresql docutils make gettext-tools freefont + +* Install Maven:: + + # cd /opt/ + # wget http://www.apache.org/dist//maven/binaries/apache-maven-2.2.1-bin.tar.gz + # tar -xzvf apache-maven-2.2.1-bin.tar.gz + + Edit ``/etc/bash.bashrc.local`` and add the following lines:: + + export M2_HOME=/opt/apache-maven-2.2.1 + export M2=$M2_HOME/bin + export PATH=$M2:$PATH + +* Start database service:: + + # /etc/init.d/postgresql start + +* Connect to database:: + + # su postgres -c psql + +* Use SQL sentences:: + + CREATE DATABASE navaldev; + CREATE DATABASE navaldevtest; + CREATE USER naval WITH PASSWORD 'naval'; + GRANT ALL PRIVILEGES ON DATABASE navaldev TO naval; + GRANT ALL PRIVILEGES ON DATABASE navaldevtest TO naval; + +* Set ``postgres`` user password:: + + ALTER USER postgres WITH PASSWORD 'postgres'; + +* Edit ``/var/lib/pgsql/data/pg_hba.conf`` and replace ``ident`` by ``md5`` + +* Restart database service:: + + # /etc/init.d/postgresql restart + +* Download source code:: + + $ git clone git://navalplan.git.sourceforge.net/gitroot/navalplan/navalplan + +* Compile project:: + + $ mvn clean install + +* Launch application:: + + $ cd navalplanner-webapp/ + $ mvn jetty:run + +* Go to http://localhost:8080/navalplanner-webapp/ + + +CutyCapt compilation +-------------------- + +Like *CutyCapt* is not packaged for all distributions here are the instructions. + +Ubuntu/Debian +~~~~~~~~~~~~~ + +* Install requirements:: + + # apt-get install subversion libqt4-dev libqtwebkit-dev qt4-qmake g++ make + + In Ubuntu Lucid 10.04 remove ``libqtwebkit-dev`` package. + +* Download source code:: + + $ svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt cutycapt + +* Compile:: + + $ cd CutyCapt + $ qmake CutyCapt.pro + $ make + +* Install:: + + # cp CutyCapt /user/bin/cutycapt + +Fedora +~~~~~~ + +* Install requirements:: + + # yum install subversion qt-devel qt-webkit-devel gcc-c++ make + +* Download source code:: + + $ svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt cutycapt + +* Compile:: + + $ cd cutycapt/CutyCapt + $ qmake-qt4 CutyCapt.pro + $ make + +* Install:: + + # cp CutyCapt /user/bin/cutycapt + +openSUSE +~~~~~~~~ + +* Install requirements:: + + # zypper install subversion libqt4-devel libQtWebKit-devel gcc-c++ make + +* Download source code:: + + $ svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt cutycapt + +* Compile:: + + $ cd cutycapt/CutyCapt + $ qmake-qt4 CutyCapt.pro + $ make + +* Install:: + + # cp CutyCapt /user/bin/cutycapt + + +Compilation profiles +-------------------- + +There are different compilation profiles in *NavalPlan*. Check ```` +section in root ``pom.xml`` to see the different profiles (there are also some +profiles defined in ``pom.xml`` of business and webapp modules). + +* *dev* - Development environment (default) + + It uses databases ``navaldev`` and ``navaldevtest``. + +* *prod* - Production environment + + Unlike *dev* it uses database ``navalprod`` and `navalprodtest``. + + It is needed to use it in combination with *postgresql* or *mysql* profiles. + + This is usually used while testing the stable branch in the repository. This + allows developers to easily manage 2 different databases one for last + development in master branch and another for bugfixing over stable branch. + +* *postgresql* - PostgreSQL database (default) + + It uses PostgreSQL database server getting database names from *dev* or *prod* + profiles. + +* *mysql* - MySQL database + + It uses MySQL database server getting database names from *dev* or *prod* + profiles. + +* *reports* - JasperReports (default) + + If it is active *NavalPlan* reports are compiled. + + It is useful to disable this profile to save compilation time during + development. + +* *userguide* - User documentation (default) + + If it is active *NavalPlan* help is compiled and HTML files are generated. + + User documentation is written in *reStructuredText* and it is generated + automatically thanks to this profile. + + Like for *reports*, it is useful deactivate this profile during development + to save compilation time. + +* *liquibase-update* - Liquibase update (default) + + If it is active Liquibase changes are applied in the database. + +* *liquibase-updatesql* - Liquibase update SQL + + If it is active it is generated a file with SQL sentences for Liquibase + changes needed to apply on database. + + This is used to generate upgrade files in releases. + +How to use profiles +~~~~~~~~~~~~~~~~~~~ + +Profiles active by default are used always if not deactivated. In order to +activate or deactivate a profile you should use parameter ``-P`` for Maven +command. For example: + +* Deactivate *reports* and *userguide* to save compilation time:: + + mvn -P-reports,-userguide clean install + +* Use production environment:: + + mvn -Pprod,postgresql clean install + + +Tests +----- + +*NavalPlan* has a lot of JUnit test that by default are passed when you compile +the project with Maven. You can use ``-DskipTests`` to avoid tests are passed +always. Anyway, you should check that tests are not broken before sending or +pushing a patch. + +:: + + mvn -DskipTests clean install + + +MySQL +----- + +For MySQL users here are specific instructions. + +* SQL sentences to create database:: + + CREATE DATABASE navaldev; + CREATE DATABASE navaldevtest; + GRANT ALL ON navaldev.* to 'naval'@'localhost' identified by 'naval'; + GRANT ALL ON navaldevtest.* to 'naval'@'localhost' identified by 'naval'; + +* Compile project:: + + $ mvn -Pdev,mysql clean install + +* Launch application:: + + $ cd navalplanner-webapp/ + $ mvn -Pdev,mysql jetty:run diff --git a/INSTALL b/INSTALL index fa7b7d14d..0f555b5f4 100644 --- a/INSTALL +++ b/INSTALL @@ -1,120 +1,221 @@ -Installation instructions -========================= +Install +======= -Visit the wiki for an updated version of these instructions: -http://wiki.navalplan.org/twiki/bin/view/NavalPlan/InstallNavalPlan. +This is a guide about how to install *NavalPlan* project in your system. If you +want to upgrade your *NavalPlan* version see ``UPDATE`` file. If you want to +know how to compile it manually see ``HACKING`` file. -Database creation ------------------ - -* Current databases supported: PostgreSQL (default) and MySQL. - -* For PostgreSQL and MySQL: - - - Create a database with name ``navaldev`` (for development):: - - CREATE DATABASE navaldev; - - - Create a database with name ``navaldevtest`` (for the test fase in - development):: - - CREATE DATABASE navaldevtest; - - - Create user ``naval`` with password ``naval`` with necessary privileges for - accessing (creating tables, selecting data from tables, etc.) the - previous databases: - - + PostgreSQL:: - - CREATE USER naval WITH PASSWORD 'naval'; - GRANT ALL PRIVILEGES ON DATABASE navaldev TO naval; - GRANT ALL PRIVILEGES ON DATABASE navaldevtest TO naval; - - + MySQL:: - - GRANT ALL ON navaldev.* to 'naval'@'localhost' identified by 'naval'; - GRANT ALL ON navaldevtest.* to 'naval'@'localhost' identified by 'naval'; +.. contents:: -Compilation ------------ +NavalPlan automatic installation +-------------------------------- -* Execute the following commands:: - - cd navalplan - - mvn install - - cd navalplanner-webapp - - mvn jetty:run - -* Access to http://localhost:8080/navalplanner-webapp. - -* To install the web application in a web container, use the WAR file: - ``navalplanner-webapp/target/navalplanner-webapp.war``. - -* *Notes for using other databases*: - - + MySQL: - - - Remember to start MySQL with ``--default-table-type=InnoDB`` option for - enabling support for transactions. - - - Use ``mvn -Pdev,mysql <>``:: - - e.g. mvn -Pdev,mysql install - - -Profiles --------- - -Check ```` section in the root ``pom.xml`` to see the profile-based -approach used in the project. The default profiles (the one assumed by the above -instructions) are ``dev`` and ``postgresql`` (meaning "use PostgreSQL assuming a -development environment"). - - -Print ------ - -Printing system is based on a tool that produces several output formats -rendering the specified URLs with the WebKit engine. To be able to print local -diagrams this tool and a lightweight X server must be installed. - -The capturing tool is CutyCapt [1]_, which has to be either compiled or -installed from an external package. Once compiled from the tarball the binary -CutyCapt must be located under ``/usr/bin/`` to be available to the application. - -X virtual framebuffer xvfb [2]_ package needs to be installed for the -application running on a non-desktop server is capable of launching an X -instance to create the print capture of the selected page. - -.. [1] http://cutycapt.sourceforge.net/ -.. [2] http://www.xfree86.org/4.0.1/Xvfb.1.html - - -User Documentation ------------------- - -User documentation is done in *reStructuredText*. It is necessary to have -installed the following packages: - - * ``automake`` package in order to be able to execute ``make``. - * ``python-docutils`` package version 0.4 or higher. - * ``texlive-latex-base`` package in order to have ``pdflatex`` available. - - -Compilation +Ubuntu PPAs ~~~~~~~~~~~ -The compilation is included in Maven build. If you execute ``mvn install`` -documentation is generated. +There are Ubuntu PPAs for different versions (Lucid, Maverick and Natty), you +can find more info in the following URL: +https://launchpad.net/~libreplan/+archive/ppa -* For manual compilation, inside ``doc/src/es``, ``doc/src/gl`` or - ``doc/src/es`` directories: +Instructions:: - make html - make pdf + $ sudo add-apt-repository ppa:libreplan/ppa + $ sudo apt-get update + $ sudo apt-get install navalplan -* Output is created in ``doc/src/es/html`` and ``/doc/src/es/pdf`` directories. + +Debian packages +~~~~~~~~~~~~~~~ + +There are Debian packages for Squeeze (i386 and amd64), you can download them +from: http://sourceforge.net/projects/navalplan/files/NavalPlan/ + +Instructions: + +* Download the package:: + + $ wget http://downloads.sourceforge.net/project/navalplan/NavalPlan/navalplan_1.1.1-1_amd64.deb + +* Install package:: + + # dpkg -i navalplan_1.1.1-1_amd64.deb + +* Install dependencies:: + + # apt-get install -f + + +NavalPlan manual installation +----------------------------- + +Debian/Ubuntu +~~~~~~~~~~~~~ + +* Install requirements:: + + # apt-get install openjdk-6-jre postgresql postgresql-client tomcat6 libpg-java ttf-freefont cutycapt xvfb + +* Connect to database:: + + # su postgres -c psql + +* Use SQL sentences to create database:: + + CREATE DATABASE navalplan; + CREATE USER navalplan WITH PASSWORD 'navalplan'; + GRANT ALL PRIVILEGES ON DATABASE navalplan TO naval; + +* Download database installation script:: + + $ wget -O install.sql http://downloads.sourceforge.net/project/navalplan/NavalPlan/install_1.1.1.sql + +* Create database structure:: + + $ psql -h localhost -U navalplan -W navalplan < install.sql + +* Download ``.war`` file from SourceForge.net:: + + $ wget -O navalplan.war http://downloads.sourceforge.net/project/navalplan/NavalPlan/navalplan_1.1.1.war + +* Create a new file ``/etc/tomcat6/Catalina/localhost/navalplan.xml`` (file + name has to match with ``.war`` name) with database configuration for + Tomcat 6:: + + + + + + + +* Add a new Tomcat 6 policy file ``/etc/tomcat6/policy.d/51navalplan.policy`` + with the following content:: + + grant codeBase "file:/var/lib/tomcat6/webapps/navalplanner-webapp/-" { + permission java.security.AllPermission; + }; + grant codeBase "file:/var/lib/tomcat6/webapps/navalplanner-webapp.war" { + permission java.security.AllPermission; + }; + +* Add next lines to Tomcat 6 policy file + ``/etc/tomcat6/policy.d/03catalina.policy`` file:: + + grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { + ... + // begin:navalplan + permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}navalplanner-webapp${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read"; + // end:navalplan + ... + }; + +* Add link to Java JDBC driver for PostgreSQL in Tomcat6 libraries directory:: + + # ln -s /usr/share/java/postgresql-jdbc3.jar /usr/share/tomcat6/lib/ + +* Copy war to Tomcat 6 web applications directory:: + + # cp navalplan.war /var/lib/tomcat6/webapps/ + +* Restart Tomcat 6:: + + # /etc/init.d/tomcat6 restart + +* Go to http://localhost:8080/navalplan/ + + +openSUSE +~~~~~~~~ + +* Install requirements:: + + # zypper install java-1_6_0-openjdk postgresql-server postgresql tomcat6 freefont xorg-x11-server + +* JDBC Driver manual installation:: + + # cd /usr/share/java/ + # wget http://jdbc.postgresql.org/download/postgresql-9.0-801.jdbc3.jar + # mv postgresql-9.0-801.jdbc3.jar postgresql-jdbc3.jar + +* Follow instructions at ``HACKING`` file to compile and install CutyCapt + +* Start database service:: + + # /etc/init.d/postgresql start + +* Connect to database:: + + # su postgres -c psql + +* SQL sentences to create database:: + + CREATE DATABASE navalplan; + CREATE USER navalplan WITH PASSWORD 'navalplan'; + GRANT ALL PRIVILEGES ON DATABASE navalplan TO navalplan; + +* Set ``postgres`` user password:: + + ALTER USER postgres WITH PASSWORD 'postgres'; + +* Edit ``/var/lib/pgsql/data/pg_hba.conf`` and replace ``ident`` by ``md5`` + +* Restart database service:: + + # /etc/init.d/postgresql restart + +* Download database installation script:: + + $ wget -O install.sql http://downloads.sourceforge.net/project/navalplan/NavalPlan/install_1.1.1.sql + +* Create database structure:: + + $ psql -h localhost -U navalplan -W navalplan < install.sql + +* Download ``.war`` file from SourceForge.net:: + + $ wget -O navalplan.war http://downloads.sourceforge.net/project/navalplan/NavalPlan/navalplan_1.1.1.war + +* Create a new file ``/etc/tomcat6/Catalina/localhost/navalplan.xml`` (file + name has to match with ``.war`` name) with database configuration for + Tomcat 6:: + + + + + + + +* Add link to Java JDBC driver for PostgreSQL in Tomcat6 libraries directory:: + + # ln -s /usr/share/java/postgresql-jdbc3.jar /usr/share/tomcat6/lib/ + +* Copy war to Tomcat 6 web applications directory:: + + # cp navalplan.war /srv/tomcat6/webapps/ + +* Restart Tomcat 6:: + + # /etc/init.d/tomcat6 restart + +* Go to http://localhost:8080/navalplan/ + + +Logs +---- + +Since *NavalPlan 1.1.1* log system is configured automatically creating a new +folder under ``/var/log/tomcat6/`` with ``.war`` name. For example: +``/var/log/tomcat6/navalplan.war``. + +Inside this new directory there will be two files (``navalplan.log`` and +``navalplan-error.log``) that will be rotated every day. diff --git a/NEWS b/NEWS index c29b444f5..e465db269 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,79 @@ NEWS ==== +Version 1.1.1 (07 Jun 2011) +--------------------------- + +First minor version for 1.1.x cycle with lots of bugfixes. The most important +ones: + +* Fixed several memory leaks which will make application use less memory now. +* Improved log system configuration. +* Solved a translation issue with some strings in the Gantt view. +* Resolved some bugs moving tasks due to new dependencies. + +Changes +~~~~~~~ + +* Updated TODO file with roadmap for 1.2 version. +* Changed OpenJDK dependency in Debian package for default-jdk or default-jre. +* [i18n] Fixed wrong translation of project in some reports. +* [i18n] Fixed uppercase/lowercases incoherences. +* [Bug #1084] Fix bug +* [Bug #789] Script for parsing ZUL files should look for 'ganttzk_i18n' tag too +* [Bug #789] Renamed 'i18n' prefix in ganttzk to 'ganttzk_i18n' +* Fix possible NPE +* Fix NPE if provided allocation is null +* [Bug #1083] Fix bug +* [Bug #1014] add borders in the table of the report of worked hours per each + resource. +* [Bug #1014] include the name of the assigned task to each report line, in the + report worked hours per each resource. +* [Bug #1014] return the date time at start of day to perform the grouping by + date correctly. +* Avoid NPE if editedValue is null +* [Bug #1013] increase the width in filter search box. +* [Bug #1086] Fix bug +* Changed test to avoid it fails if it's launched on Saturday. +* [i18n] Fixed typo in progress with all tasks. +* [i18n] Fixed typo in "criterions" using "criteria". +* [i18n] Updated Spanish and Galician translations. +* [i18n] Fixed issue in keys generator and updated keys.pot files. +* [i18n] Updated Spanish and Galician translations. +* [i18n] Fixed translation of "progress" to Galician and Spanish. +* [i18n] Marked "Choosing template" for translate. +* [i18n] Changed "order sequence" for "entity sequence" +* [i18n] Updated keys.pot files +* Fixed two translation issues. +* [Bug #1082] Fix bug +* Revert "Fix bug" +* [Bug #954] Fix bug +* Revert "[Bug #954] Handle concurrency support in Configuration window" +* The new support for parametrizing the clearing of handlers is used +* Now the clearing behaviour can be parametrized +* More aggresive discarding of sessions and desktops +* [Bug #1080] Fixed issue with Montecarlo method when critical path has more + than 10 tasks. +* [Bug #1079] Fixed lazy exception initializing parent calendar too. +* Improve toString message +* Fix bug +* [Bug #1074] check if exists indicators of the earned value for that date. +* [Bug #1076] Fixed NullPointerException going to Gantt view when project is + not scheduled. +* Reduce the time that request handlers are kept around in CallbackServlet +* Fix memory leak in TemplateController +* Refactor password not changed controller code +* Allow to GC the page before the desktop is discarded +* Don't let the thread local hang forever in the threads local map +* Fix leak +* Remove unnecessary timers. +* Reduce the live time of desktops +* Fix memory leak +* Determine the log directory dinamically +* Use asynchronous appender +* Move default log4j.properties to application + + Version 1.1.0 (19 May 2011) --------------------------- @@ -1416,7 +1489,6 @@ Changes * [Bug #809] Fixed marking to translate missing label. * Fixed wrong e-mail on debian/changelog. - Version 1.0.1 (14 Jan 2011) --------------------------- diff --git a/README b/README index c7c3669ca..7795b7f45 100644 --- a/README +++ b/README @@ -36,11 +36,39 @@ Features Requirements ------------ -Visit the following wiki page for a comprehensive list of requirements: -http://wiki.navalplan.org/twiki/bin/view/NavalPlan/InstallNavalPlan. +* *JRE 6* - Java Runtime Environment + + Project depends on Java 6 and JRE is needed in order to run it + +* *PostgreSQL* - Object-relational SQL database + + A database server is needed. You could use *PostgreSQL* or *MySQL* as you + prefer. + +* *Tomcat 6* - Servlet and JSP engine + + Server to deploy the application. You could use *Jetty* instead. + +* *JDBC Driver* - Java database (JDBC) driver for PostgreSQL + + To connect application with *PostgreSQL* database in *Tomcat* + +* *GNU FreeFont* - Freefont Serif, Sans and Mono Truetype fonts + + Font family used in reports + +* *CutyCapt* - Utility to capture WebKit's rendering of a web page + + Required for printing + +* *Xvfb* - Virtual Framebuffer 'fake' X server + + Used by CutyCapt for printing See ``INSTALL`` file for installation instructions. +See ``HACKING`` file for compilation requirements and instructions. + Availability ------------ diff --git a/TODO b/TODO index 4d51fb208..ef633eeb9 100644 --- a/TODO +++ b/TODO @@ -1,65 +1,57 @@ TODO ==== -Version 1.1 - 2011w14 +Version 1.2 - 2011w36 --------------------- Dates ~~~~~ -* *IRC coordination meeting*: 2011w2 -* *Feature freeze*: 2011w11 -* *Release date*: 2011w14 +* *IRC coordination meeting*: 2011w26 +* *Feature freeze*: 2011w31 +* *Release date*: 2011w36 Features ~~~~~~~~ -* Printing support improvement. -* Help improvement. -* Chromium browser complete support. -* Limiting resources. New appropriative insertion algorithm. -* Resource levelling. -* Over allocation control. -* Heuristics in general allocations. -* Allocation functions (steps, S-curve) in simple allocation pop-up and some - usability improvements. -* Support of intraday operations. Possibility to establish not integer number of - hours in allocations, task work (hours, minutes, seconds). -* Advance allocation fix. +* *Very high priority* -Small tasks -~~~~~~~~~~~ + * Start to use new name LibrePlan with a new logo + * Merge and finish migration for ZK5 version + * Fix allocation model -* Dependency violation mark in Gantt chart. -* Default login auto-completion configuration. -* Entity Identification improvement in reports (e.g. inclusion of both task and - project names in *Work report lines report*) +* *High priority* + * Help improvement (documentation) + * Fix last issues on printing + * Prevent perspective change without saving -Version 1.2 - 2011w27 ---------------------- +* *Normal priority* -Dates -~~~~~ + * Fix issues in templates when using related entities like criteria, + progresses, ... + * Translation issues (common problems and specific issues with Galician) + * LDAP integration -* *IRC coordination meeting*: 2011w15 -* *Feature freeze*: 2011w24 -* *Release date*: 2011w27 +* *Low priority* -Features -~~~~~~~~ + * New feature for simple users. Users would be related to application + resources, and would be able to specify hours, progresses, ... on their + assigned tasks + * Improve subcontractor system -* Resource load view performance improvement. -* Gantt window performance improvement. -* Dependency type ``START-TO-FINISH``. -* Dependencies with lag. -* Periodic allocation schemes. -* Earned value improvements. -* Critical chain project management critical chain paradigm in project planning. -* Interface to resolve allocation conflicts. -* Add export/import operations for different format files from other projects - like OpenProj, MicrosoftProject, ... -* Documentation attachment. +* *Minor tasks* + + * Default login auto-completion configuration + * Permissions enhancements + * Show information about current entity being edited + * Improvements on work reports: allow specify minutes, add button to copy + work report line + * Add an operation to reassign a single task + * Web services: Add method to export only one entity by code + * Report: Add a new report which allows to check progress by task in a + project (tasks could be filtered by criteria, labels, ...) + * Save language per user in user configuration Future @@ -71,8 +63,7 @@ Future * New features in Gantt window. * Complex features disabled by default. * Quick start wizard. -* Integration services scripts that don't depend on Ruby (maybe directly with - Java). +* Integration services scripts directly with Java. * ZK 5 migration. * Permission enhancements. * *Exit without saving* detection. diff --git a/UPDATE b/UPDATE new file mode 100644 index 000000000..2782779c8 --- /dev/null +++ b/UPDATE @@ -0,0 +1,112 @@ +Update +====== + +This is a guide about how to upgrade *NavalPlan* when a new version is released. +If you want to know how to install the application ``INSTALL`` file. + +.. contents:: + + +NavalPlan automatic update +-------------------------- + +Ubuntu PPAs +~~~~~~~~~~~ + +Instructions:: + + $ sudo apt-get update + $ sudo apt-get install navalplan + + +Debian packages +~~~~~~~~~~~~~~~ + +Instructions: + +* Download the new package:: + + $ wget http://downloads.sourceforge.net/project/navalplan/NavalPlan/navalplan_1.1.1-1_amd64.deb + +* Install package:: + + # dpkg -i navalplan_1.1.1-1_amd64.deb + +* Install new dependencies if needed:: + + # apt-get install -f + + +NavalPlan manual update +----------------------- + +Debian/Ubuntu +~~~~~~~~~~~~~ + +* Stop Tomcat:: + + # /etc/init.d/tomcat6 stop + +* Download database upgrade scripts from previous version. For example, if you + are upgrading from *NavalPlan 1.0.4* to *NavalPlan 1.1.1* you should download + ``upgrade_1.1.0.sql``:: + + $ wget http://downloads.sourceforge.net/project/navalplan/NavalPlan/upgrade_1.1.0.sql + +* Upgrade database:: + + $ psql -h localhost -U navalplan -W navalplan < upgrade_1.1.0.sql + +* Download ``.war`` file of new version from SourceForge.net:: + + $ wget -O navalplan.war http://downloads.sourceforge.net/project/navalplan/NavalPlan/navalplan_1.1.1.war + +* Backup current deployed application:: + + # mv /var/lib/tomcat6/webapps/navalplan/ /tmp/ + +* Copy war to Tomcat 6 web applications directory:: + + # cp navalplan.war /var/lib/tomcat6/webapps/ + +* Start Tomcat 6:: + + # /etc/init.d/tomcat6 start + +* Go to http://localhost:8080/navalplan/ + + +openSUSE +~~~~~~~~ + +* Stop Tomcat:: + + # /etc/init.d/tomcat6 stop + +* Download database upgrade scripts from previous version. For example, if you + are upgrading from *NavalPlan 1.0.4* to *NavalPlan 1.1.1* you should download + ``upgrade_1.1.0.sql``:: + + $ wget http://downloads.sourceforge.net/project/navalplan/NavalPlan/upgrade_1.1.0.sql + +* Upgrade database:: + + $ psql -h localhost -U navalplan -W navalplan < upgrade_1.1.0.sql + +* Download ``.war`` file of new version from SourceForge.net:: + + $ wget -O navalplan.war http://downloads.sourceforge.net/project/navalplan/NavalPlan/navalplan_1.1.1.war + +* Backup current deployed application:: + + # mv /srv/tomcat6/webapps/navalplan/ /tmp/ + +* Copy war to Tomcat 6 web applications directory:: + + # cp navalplan.war /srv/tomcat6/webapps/ + +* Start Tomcat 6:: + + # /etc/init.d/tomcat6 start + +* Go to http://localhost:8080/navalplan/ diff --git a/contrib/cutycapt/debian/changelog b/contrib/cutycapt/debian/changelog index 222548595..7962ec1c6 100644 --- a/contrib/cutycapt/debian/changelog +++ b/contrib/cutycapt/debian/changelog @@ -1,3 +1,9 @@ +cutycapt (20110107-2) lenny lucid maverick; urgency=low + + * Changing command to use "cutycapt" instead of "CutyCapt". + + -- Manuel Rego Casasnovas Fri, 06 Jun 2011 19:34:22 +0200 + cutycapt (20110107-1) lenny squeeze intrepid karmic lucid maverick; urgency=low * Updated to NavalPlan package naming. diff --git a/contrib/cutycapt/debian/rules b/contrib/cutycapt/debian/rules index 256dc3e94..40cafb209 100755 --- a/contrib/cutycapt/debian/rules +++ b/contrib/cutycapt/debian/rules @@ -7,4 +7,4 @@ override_dh_auto_install: install -g root -o root -m 755 -d $(CURDIR)/debian/cutycapt/usr/bin - install -g root -o root -m 755 CutyCapt $(CURDIR)/debian/cutycapt/usr/bin + install -g root -o root -m 755 CutyCapt $(CURDIR)/debian/cutycapt/usr/bin/cutycapt diff --git a/debian/changelog b/debian/changelog index 727a3114a..1e2f087da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +navalplan (1.1.1-1) maverick; urgency=low + + * Changed dependency from OpenJDK to default-jdk or default-jre. + * Added bugs fixed from stable branch. + * Released version 1.1.1. + + -- Manuel Rego Casasnovas Wed, 07 Jun 2011 09:15:00 +0200 + navalplan (1.1.0-1) maverick; urgency=low * Removed unnecessary dependency with texlive-latex-recommended and pgf diff --git a/debian/control b/debian/control index 354ab7323..8da8fd4ea 100644 --- a/debian/control +++ b/debian/control @@ -3,14 +3,14 @@ Section: web Priority: optional Maintainer: Adrian Perez Build-Depends: debhelper (>= 7.0.50), maven2, python-docutils, - gettext (>= 0.17), openjdk-6-jdk + gettext (>= 0.17), default-jdk Standards-Version: 3.8.4 Homepage: http://www.navalplan.org/en/ Package: navalplan Architecture: any Depends: cutycapt, postgresql, postgresql-client, xvfb, dbconfig-common, ucf, - tomcat6, openjdk-6-jre-headless | openjdk-6-jre, libpg-java, ttf-freefont, + tomcat6, default-jre-headless | default-jre, libpg-java, ttf-freefont, ${misc:Depends} Description: Web application for project management. NavalPlan is a planning tool for users based on some concepts: company and diff --git a/debian/control.lucid b/debian/control.lucid new file mode 100644 index 000000000..0805769c5 --- /dev/null +++ b/debian/control.lucid @@ -0,0 +1,23 @@ +Source: navalplan +Section: web +Priority: optional +Maintainer: Adrian Perez +Build-Depends: debhelper (>= 7.0.50), maven2, python-docutils, + gettext (>= 0.17), texlive-latex-recommended, pgf, openjdk-6-jdk +Standards-Version: 3.8.4 +Homepage: http://www.navalplan.org/en/ + +Package: navalplan +Architecture: any +Depends: cutycapt, postgresql, postgresql-client, xvfb, dbconfig-common, ucf, + tomcat6, openjdk-6-jre-headless | openjdk-6-jre, libpg-java, ttf-freefont, + ${misc:Depends} +Description: Web application for project management. + NavalPlan is a planning tool for users based on some concepts: company and + multi-project overview, criteria assignments, tasks tagging, resources + management, resource allocation (specific and generic), company load control, + external integration, etc. + . + Although its name is clearly related to shipbuilding, NavalPlan is a fully + useful planning tool for any type of company whose workflow requires project + and order administration and scheduling. diff --git a/debian/control.squeeze b/debian/control.squeeze new file mode 100644 index 000000000..0805769c5 --- /dev/null +++ b/debian/control.squeeze @@ -0,0 +1,23 @@ +Source: navalplan +Section: web +Priority: optional +Maintainer: Adrian Perez +Build-Depends: debhelper (>= 7.0.50), maven2, python-docutils, + gettext (>= 0.17), texlive-latex-recommended, pgf, openjdk-6-jdk +Standards-Version: 3.8.4 +Homepage: http://www.navalplan.org/en/ + +Package: navalplan +Architecture: any +Depends: cutycapt, postgresql, postgresql-client, xvfb, dbconfig-common, ucf, + tomcat6, openjdk-6-jre-headless | openjdk-6-jre, libpg-java, ttf-freefont, + ${misc:Depends} +Description: Web application for project management. + NavalPlan is a planning tool for users based on some concepts: company and + multi-project overview, criteria assignments, tasks tagging, resources + management, resource allocation (specific and generic), company load control, + external integration, etc. + . + Although its name is clearly related to shipbuilding, NavalPlan is a fully + useful planning tool for any type of company whose workflow requires project + and order administration and scheduling. diff --git a/doc/src/technical/howto-create-a-new-report-in-navalplan.rst b/doc/src/technical/howto-create-a-new-report-in-navalplan.rst index 9932756f5..5b88c3a2e 100644 --- a/doc/src/technical/howto-create-a-new-report-in-navalplan.rst +++ b/doc/src/technical/howto-create-a-new-report-in-navalplan.rst @@ -709,9 +709,6 @@ Steps: @Override protected JRDataSource getDataSource() { - return new JRBeanCollectionDataSource(resourcesListReportModel - .getResourcesListReportDTOs()); - List dtos = resourcesListReportModel .getResourcesListReportDTOs(); if (dtos.isEmpty()) { diff --git a/doc/src/technical/howto-develop-an-use-case-in-navalplan.rst b/doc/src/technical/howto-develop-a-use-case-in-navalplan.rst similarity index 98% rename from doc/src/technical/howto-develop-an-use-case-in-navalplan.rst rename to doc/src/technical/howto-develop-a-use-case-in-navalplan.rst index 3271fb347..288a5f0cd 100644 --- a/doc/src/technical/howto-develop-an-use-case-in-navalplan.rst +++ b/doc/src/technical/howto-develop-a-use-case-in-navalplan.rst @@ -1,6 +1,6 @@ ---------------------------------------- -How To Develop An Use Case In NavalPlan ---------------------------------------- +-------------------------------------- +How To Develop A Use Case In NavalPlan +-------------------------------------- .. sectnum:: @@ -12,7 +12,7 @@ How To Develop An Use Case In NavalPlan Commons Attribution-ShareAlike 3.0 licence, available in http://creativecommons.org/licenses/by-sa/3.0/. :Abstract: - This is a guide about how to develop an use case in NavalPlan_. Following the + This is a guide about how to develop a use case in NavalPlan_. Following the different sections of this document you will end up developing a complete CRUD_ (create, read, update and delete) use case in the project. @@ -415,6 +415,17 @@ Then you will have the following files: always use these interface classes. Spring framework instantiates a class for each interface type and injects it in the corresponding variable. +.. NOTE:: + + As you can see DAO class is being defined as a singleton with the following + line:: + + @Scope(BeanDefinition.SCOPE_SINGLETON) + + This is because of DAO classes are not going to store any state variable, so + methods only depends on parameters. Thus, just an instance of a DAO class is + enough for any place where it is used. + Summarizing, persistence layer encapsulates all operations related to Hibernate communication for retrieving, querying and storing entities on database. Therefore, you will not need to use Hibernate API directly in NavalPlan source @@ -1228,6 +1239,15 @@ in order to use model from controller (which is not inside Spring context). This is why ``@Autowired`` is not needed, but on the other hand you need to use a specific name for variable. +.. NOTE:: + + Model classes are defined with prototype scope:: + + @Scope(BeanDefinition.SCOPE_PROTOTYPE) + + The reason is that models are going to keep conversation state in a variable, + so in that case new instance are going to be needed every time model is used. + Developing the conversation --------------------------- @@ -2341,7 +2361,7 @@ following content:: Now you are ready to test your web service. If you go to this URL http://localhost:8080/navalplanner-webapp/ws/rest/stretchesfunctiontemplates/, -and login with an user that has permission to access web services (e.g. user +and login with a user that has permission to access web services (e.g. user ``wsreader`` with password ``wsreader``) you will get a XML with the list of ``StretchesFunctionTemplate`` stored in the application. @@ -2367,37 +2387,21 @@ created in project repository inside ``scripts/rest-clients`` directory. .. NOTE:: - Currently these scripts depends on Tidy and Ruby to be installed in your - system. You could install them in a Debian based distribution with the - following command as root:: + Currently these scripts recommends Tidy to be installed in your system + for a better output. You could install them in a Debian based distribution + with the following command as root:: - apt-get install tidy ruby + apt-get install tidy Then for this example you will create a script called ``export-stretches-function-templates.sh``, that will be very similar to the rest of export scripts just changing web service path:: - #!/bin/sh + #!/bin/sh - . ./rest-common-env.sh + . ./rest-common-env.sh - printf "Login name: " - read loginName - printf "Password: " - read password - - if [ "$1" = "--prod" ]; then - baseServiceURL=$PRODUCTION_BASE_SERVICE_URL - certificate=$PRODUCTION_CERTIFICATE - else - baseServiceURL=$DEVELOPMENT_BASE_SERVICE_URL - certificate=$DEVELOPMENT_CERTIFICATE - fi - - authorization=`./base64.sh $loginName:$password` - - curl -sv -X GET $certificate --header "Authorization: Basic $authorization" \ - $baseServiceURL/stretchesfunctiontemplates | tidy -xml -i -q -utf8 + . ./export.sh stretchesfunctiontemplates $* Script will request user and password in order to access to web service, so you could use ``wsreader`` user to check that it works properly. diff --git a/doc/src/training-exercises/es/01-ejercicios-sesion2.rst b/doc/src/training-exercises/es/01-ejercicios-sesion2.rst index 0607cd661..5b50b7ee5 100644 --- a/doc/src/training-exercises/es/01-ejercicios-sesion2.rst +++ b/doc/src/training-exercises/es/01-ejercicios-sesion2.rst @@ -142,7 +142,7 @@ consta el ejercicio para realizar la subcontratación son los siguientes: * Crear una nueva tarea en el proyecto denominada *Subcontratación pruebas*. La tarea consistirá en 100h de pruebas. - * Crear una dependencia *FIN-COMIENZO* desde la tarea de *Modulo de facturas* + * Crear una dependencia *FIN-INICIO* desde la tarea de *Modulo de facturas* como origen hacia la tarea. * Realizar la subcontratación con los siguientes datos: * Empresa a la que se subcontrata: Empresa subcontratada. @@ -193,9 +193,9 @@ Crear un nuevo proyecto de planificación con los siguientes datos: * Acceder a la planificación del proyecto: - * Establecer dependencia entre tarea 3 y tarea 4 de tipo Inicio-Fin. - * Establecer dependencia entre tarea 2 y tarea 3 de tipo Inicio-Fin. - * Establecer dependencia entre tarea 1 y tarea 2 de tipo Inicio-Fin. + * Establecer dependencia entre tarea 3 y tarea 4 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarea 2 y tarea 3 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarea 1 y tarea 2 de tipo *FIN-INICIO*. * ¿Cómo se van colocando las tareas? ___________________________________________ * Realizar las siguientes asignaciones de recursos: diff --git a/doc/src/training-exercises/gl/01-exercicios-sesion2-grupo1.rst b/doc/src/training-exercises/gl/01-exercicios-sesion2-grupo1.rst index dd6c71c69..73adf3f8a 100644 --- a/doc/src/training-exercises/gl/01-exercicios-sesion2-grupo1.rst +++ b/doc/src/training-exercises/gl/01-exercicios-sesion2-grupo1.rst @@ -120,9 +120,9 @@ Acceder ós datos xerais do pedido e modificar o modo de planificación a "Atrá Acceder á planificación do proxecto: - * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo Inicio-Fin. + * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo *FIN-INICIO*. ¿Como se van colocando as tarefas? diff --git a/doc/src/training-exercises/gl/02-exercicios-sesion2-grupo2.rst b/doc/src/training-exercises/gl/02-exercicios-sesion2-grupo2.rst index 5b66c2f6c..de82c3e28 100644 --- a/doc/src/training-exercises/gl/02-exercicios-sesion2-grupo2.rst +++ b/doc/src/training-exercises/gl/02-exercicios-sesion2-grupo2.rst @@ -120,9 +120,9 @@ Acceder ós datos xerais do pedido e modificar o modo de planificación a "Atrá Acceder á planificación do proxecto: - * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo Inicio-Fin. + * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo *FIN-INICIO*. ¿Como se van colocando as tarefas? diff --git a/doc/src/training-exercises/gl/03-exercicios-sesion2-grupo3.rst b/doc/src/training-exercises/gl/03-exercicios-sesion2-grupo3.rst index 84b25c283..507581f40 100644 --- a/doc/src/training-exercises/gl/03-exercicios-sesion2-grupo3.rst +++ b/doc/src/training-exercises/gl/03-exercicios-sesion2-grupo3.rst @@ -120,9 +120,9 @@ Acceder ós datos xerais do pedido e modificar o modo de planificación a "Atrá Acceder á planificación do proxecto: - * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo Inicio-Fin. + * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo *FIN-INICIO*. ¿Como se van colocando as tarefas? diff --git a/doc/src/training-exercises/gl/04-exercicios-sesion2-grupo4.rst b/doc/src/training-exercises/gl/04-exercicios-sesion2-grupo4.rst index 8877d8e6c..282d6d90e 100644 --- a/doc/src/training-exercises/gl/04-exercicios-sesion2-grupo4.rst +++ b/doc/src/training-exercises/gl/04-exercicios-sesion2-grupo4.rst @@ -120,9 +120,9 @@ Acceder ós datos xerais do pedido e modificar o modo de planificación a "Atrá Acceder á planificación do proxecto: - * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo Inicio-Fin. + * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo *FIN-INICIO*. ¿Como se van colocando as tarefas? diff --git a/doc/src/training-exercises/gl/05-exercicios-sesion2-grupo5.rst b/doc/src/training-exercises/gl/05-exercicios-sesion2-grupo5.rst index 68c93e15a..33eae3bd9 100644 --- a/doc/src/training-exercises/gl/05-exercicios-sesion2-grupo5.rst +++ b/doc/src/training-exercises/gl/05-exercicios-sesion2-grupo5.rst @@ -120,9 +120,9 @@ Acceder ós datos xerais do pedido e modificar o modo de planificación a "Atrá Acceder á planificación do proxecto: - * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo Inicio-Fin. - * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo Inicio-Fin. + * Establecer dependencia entre tarefa 3 e tarefa 4 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 2 e tarefa 3 de tipo *FIN-INICIO*. + * Establecer dependencia entre tarefa 1 e tarefa 2 de tipo *FIN-INICIO*. ¿Como se van colocando as tarefas? diff --git a/ganttzk/pom.xml b/ganttzk/pom.xml index 6a81507a5..f36e4098a 100644 --- a/ganttzk/pom.xml +++ b/ganttzk/pom.xml @@ -6,7 +6,7 @@ org.navalplanner navalplanner - 1.1.0 + 1.1.1 ganttzk jar @@ -31,6 +31,21 @@ + + org.apache.maven.plugins + maven-source-plugin + 2.1.2 + + + default + package + + jar-no-fork + + + + + diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/CommandContextualized.java b/ganttzk/src/main/java/org/zkoss/ganttz/CommandContextualized.java index 9ac208be6..bad415f5d 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/CommandContextualized.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/CommandContextualized.java @@ -65,7 +65,7 @@ class CommandContextualized { result.addEventListener(Events.ON_CLICK, new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { doAction(); } }); diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/DependencyComponent.java b/ganttzk/src/main/java/org/zkoss/ganttz/DependencyComponent.java index cb26f7d3d..0e17ac3f4 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/DependencyComponent.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/DependencyComponent.java @@ -24,6 +24,7 @@ package org.zkoss.ganttz; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.io.IOException; import org.apache.commons.lang.Validate; import org.zkoss.ganttz.data.Dependency; @@ -35,6 +36,7 @@ import org.zkoss.ganttz.data.constraint.Constraint.IConstraintViolationListener; import org.zkoss.ganttz.util.WeakReferencedListeners.Mode; import org.zkoss.zk.au.out.AuInvoke; import org.zkoss.zk.ui.ext.AfterCompose; +import org.zkoss.zk.ui.sys.ContentRenderer; import org.zkoss.zul.impl.XulElement; /** @@ -95,8 +97,13 @@ public class DependencyComponent extends XulElement implements AfterCompose { return violated ? "violated-dependency" : "dependency"; } + private boolean listenerAdded = false; + @Override public void afterCompose() { + if (listenerAdded) { + return; + } PropertyChangeListener listener = new PropertyChangeListener() { @Override @@ -106,6 +113,7 @@ public class DependencyComponent extends XulElement implements AfterCompose { }; this.source.getTask().addFundamentalPropertiesChangeListener(listener); this.destination.getTask().addFundamentalPropertiesChangeListener(listener); + listenerAdded = true; } /** @@ -140,7 +148,7 @@ public class DependencyComponent extends XulElement implements AfterCompose { } public void redrawDependency() { - response("zoomChanged", new AuInvoke(this, "draw")); + response("redrawDependency" + getId(), new AuInvoke(this, "draw")); } public boolean contains(Task task) { @@ -172,6 +180,14 @@ public class DependencyComponent extends XulElement implements AfterCompose { && destinationTask.equals(dependency.getDestination()); } + protected void renderProperties(ContentRenderer renderer) throws IOException{ + super.renderProperties(renderer); + + render(renderer, "_idTaskOrig", getIdTaskOrig()); + render(renderer, "_idTaskEnd", getIdTaskEnd()); + render(renderer, "_dependencyType", getDependencyType()); + } + public boolean hasLimitingTasks() { return (source.isLimiting() || destination.isLimiting()); } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java b/ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java index d8ca15e6f..025d23bd2 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java @@ -25,7 +25,6 @@ import static org.zkoss.ganttz.i18n.I18nHelper._; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.util.ArrayList; import java.util.List; import org.apache.commons.logging.Log; @@ -105,6 +104,7 @@ public class DependencyList extends XulElement implements AfterCompose { void toggleDependencyExistence(boolean visible) { if (visible) { appendChild(dependencyComponent); + dependencyComponent.afterCompose(); addContextMenu(dependencyComponent); } else { removeChild(dependencyComponent); @@ -265,24 +265,6 @@ public class DependencyList extends XulElement implements AfterCompose { return getGanttPanel().getTimeTrackerComponent(); } - public void redrawDependenciesConnectedTo(TaskComponent taskComponent) { - redrawDependencyComponents(getDependencyComponentsConnectedTo(taskComponent)); - } - - private List getDependencyComponentsConnectedTo( - TaskComponent taskComponent) { - ArrayList result = new ArrayList(); - List dependencies = getDependencyComponents(); - for (DependencyComponent dependencyComponent : dependencies) { - if (dependencyComponent.getSource().equals(taskComponent) - || dependencyComponent.getDestination().equals( - taskComponent)) { - result.add(dependencyComponent); - } - } - return result; - } - public void redrawDependencies() { redrawDependencyComponents(getDependencyComponents()); } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/FunctionalityExposedForExtensions.java b/ganttzk/src/main/java/org/zkoss/ganttz/FunctionalityExposedForExtensions.java index a49dc354e..9649c7fc6 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/FunctionalityExposedForExtensions.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/FunctionalityExposedForExtensions.java @@ -511,7 +511,7 @@ public class FunctionalityExposedForExtensions implements IContext { Button printButton = (Button) printProperties.getFellow("printButton"); printButton.addEventListener(Events.ON_CLICK, new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { printProperties.detach(); configuration.print(buildParameters(printProperties),planner); } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/GanttPanel.java b/ganttzk/src/main/java/org/zkoss/ganttz/GanttPanel.java index 75f874e03..d6534bec1 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/GanttPanel.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/GanttPanel.java @@ -28,6 +28,7 @@ import org.zkoss.ganttz.adapters.IDisabilityConfiguration; import org.zkoss.ganttz.data.GanttDiagramGraph; import org.zkoss.ganttz.timetracker.TimeTracker; import org.zkoss.ganttz.timetracker.TimeTrackerComponent; +import org.zkoss.ganttz.timetracker.zoom.IZoomLevelChangedListener; import org.zkoss.ganttz.timetracker.zoom.ZoomLevel; import org.zkoss.ganttz.util.Interval; import org.zkoss.zk.au.out.AuInvoke; @@ -46,6 +47,8 @@ public class GanttPanel extends XulElement implements AfterCompose { private final Planner planner; + private transient IZoomLevelChangedListener zoomLevelChangedListener; + private LocalDate previousStart; private Interval previousInterval; @@ -84,6 +87,7 @@ public class GanttPanel extends XulElement implements AfterCompose { moveCurrentPositionScroll(); } + // FIXME: this is quite awful, it should be simple @Override protected void moveCurrentPositionScroll() { // get the previous data. @@ -129,6 +133,7 @@ public class GanttPanel extends XulElement implements AfterCompose { planner.getPredicate().setFilterContainers(true); planner.setTaskListPredicate(planner.getPredicate()); } + registerZoomLevelChangedListener(); } public TimeTrackerComponent getTimeTrackerComponent() { @@ -163,10 +168,10 @@ public class GanttPanel extends XulElement implements AfterCompose { return timeTrackerComponent.getTimeTracker(); } - public void setZoomLevel(ZoomLevel zoomLevel) { + public void setZoomLevel(ZoomLevel zoomLevel, int scrollLeft) { savePreviousData(); getTimeTrackerComponent().updateDayScroll(); - getTimeTracker().setZoomLevel(zoomLevel); + getTimeTrackerComponent().setZoomLevel(zoomLevel, scrollLeft); } private void savePreviousData() { @@ -178,6 +183,22 @@ public class GanttPanel extends XulElement implements AfterCompose { return planner; } + private void registerZoomLevelChangedListener() { + if (zoomLevelChangedListener == null) { + zoomLevelChangedListener = new IZoomLevelChangedListener() { + @Override + public void zoomLevelChanged(ZoomLevel detailLevel) { + adjustZoomColumnsHeight(); + } + }; + getTimeTracker().addZoomListener(zoomLevelChangedListener); + } + } + + public void adjustZoomColumnsHeight() { + response("adjust_height", new AuInvoke(this, "adjust_height")); + } + public LocalDate getPreviousStart() { return previousStart; } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTree.java b/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTree.java index 3dec00f6e..b45b6cce1 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTree.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTree.java @@ -107,7 +107,7 @@ public class LeftTasksTree extends HtmlMacroComponent { Treeitem item) { item.addEventListener("onOpen", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { OpenEvent openEvent = (OpenEvent) event; taskBean.setExpanded(openEvent.isOpen()); } @@ -120,7 +120,8 @@ public class LeftTasksTree extends HtmlMacroComponent { return task.isLeaf() || task.isExpanded(); } - private final class DetailsForBeans { + private static final class DetailsForBeans { + private Map map = new HashMap(); private Set focusRequested = new HashSet(); diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTreeRow.java b/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTreeRow.java index 67957c5ad..8a051b0c4 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTreeRow.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/LeftTasksTreeRow.java @@ -316,7 +316,7 @@ public class LeftTasksTreeRow extends GenericForwardComposer { textBox.addEventListener("onCtrlKey", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { userWantsToMove(textBox, (KeyEvent) event); } }); @@ -326,7 +326,7 @@ public class LeftTasksTreeRow extends GenericForwardComposer { component.addEventListener("onChange", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { updateBean(component); } }); @@ -336,7 +336,7 @@ public class LeftTasksTreeRow extends GenericForwardComposer { textBox.addEventListener("onOK", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { userWantsDateBox(textBox); } }); @@ -346,7 +346,7 @@ public class LeftTasksTreeRow extends GenericForwardComposer { datebox.addEventListener("onOK", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { datebox.setOpen(true); } }); @@ -375,7 +375,7 @@ public class LeftTasksTreeRow extends GenericForwardComposer { datebox.addEventListener("onBlur", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { dateBoxHasLostFocus(datebox); } }); diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/Planner.java b/ganttzk/src/main/java/org/zkoss/ganttz/Planner.java index 865987c53..593deb7ac 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/Planner.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/Planner.java @@ -55,34 +55,27 @@ import org.zkoss.ganttz.util.LongOperationFeedback.ILongOperation; import org.zkoss.ganttz.util.OnZKDesktopRegistry; import org.zkoss.ganttz.util.WeakReferencedListeners; import org.zkoss.ganttz.util.WeakReferencedListeners.IListenerNotification; -import org.zkoss.ganttz.util.script.IScriptsRegister; +import org.zkoss.zk.au.AuRequest; +import org.zkoss.zk.au.AuService; +import org.zkoss.zk.mesg.MZk; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.HtmlMacroComponent; +import org.zkoss.zk.ui.UiException; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.util.Clients; -import org.zkoss.zkex.zul.api.South; import org.zkoss.zul.Button; import org.zkoss.zul.ListModel; import org.zkoss.zul.Listbox; import org.zkoss.zul.Listitem; import org.zkoss.zul.Separator; import org.zkoss.zul.SimpleListModel; +import org.zkoss.zul.South; public class Planner extends HtmlMacroComponent { - public static void registerNeededScripts() { - IScriptsRegister register = getScriptsRegister(); - register.register(ScriptsRequiredByPlanner.class); - } - - private static IScriptsRegister getScriptsRegister() { - return OnZKDesktopRegistry.getLocatorFor(IScriptsRegister.class) - .retrieve(); - } - public static boolean guessContainersExpandedByDefaultGivenPrintParameters( Map printParameters) { return guessContainersExpandedByDefault(convertToURLParameters(printParameters)); @@ -174,7 +167,6 @@ public class Planner extends HtmlMacroComponent { .create(); public Planner() { - registerNeededScripts(); } TaskList getTaskList() { @@ -265,13 +257,13 @@ public class Planner extends HtmlMacroComponent { return new SimpleListModel(selectableZoomlevels); } - public void setZoomLevel(final ZoomLevel zoomLevel) { + public void setZoomLevel(final ZoomLevel zoomLevel, int scrollLeft) { if (ganttPanel == null) { return; } this.fixedZoomByUser = true; initialZoomLevel = zoomLevel; - ganttPanel.setZoomLevel(zoomLevel); + ganttPanel.setZoomLevel(zoomLevel, scrollLeft); } public void zoomIncrease() { @@ -286,7 +278,7 @@ public class Planner extends HtmlMacroComponent { } @Override - public void doAction() throws Exception { + public void doAction() { ganttPanel.zoomIncrease(); } }); @@ -303,7 +295,7 @@ public class Planner extends HtmlMacroComponent { } @Override - public void doAction() throws Exception { + public void doAction() { ganttPanel.zoomDecrease(); } }); @@ -373,6 +365,35 @@ public class Planner extends HtmlMacroComponent { this.visibleChart = configuration.isExpandPlanningViewCharts(); ((South) getFellow("graphics")).setOpen(this.visibleChart); + + setAuService(new AuService(){ + public boolean service(AuRequest request, boolean everError){ + String command = request.getCommand(); + String[] requestData; + int zoomindex; + int scrollLeft; + + if (command.equals("onZoomLevelChange")){ + zoomindex= (Integer) retrieveData(request, "zoomindex"); + scrollLeft = (Integer) retrieveData(request, "scrollLeft"); + + setZoomLevel((ZoomLevel)((Listbox)getFellow("listZoomLevels")) + .getModel().getElementAt(zoomindex), + scrollLeft); + return true; + } + return false; + } + + private Object retrieveData(AuRequest request, String key){ + Object value = request.getData().get(key); + if ( value == null) + throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, + new Object[] { key, this }); + + return value; + } + }); } private void resettingPreviousComponentsToNull() { @@ -484,7 +505,7 @@ public class Planner extends HtmlMacroComponent { getDependencyList().taskRemoved(task); leftPane.taskRemoved(task); setHeight(getHeight());// forcing smart update - taskList.adjustZoomColumnsHeight(); + ganttPanel.adjustZoomColumnsHeight(); getDependencyList().redrawDependencies(); } @@ -497,7 +518,7 @@ public class Planner extends HtmlMacroComponent { westContainer.addEventListener(Events.ON_SIZE, new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { Clients.evalJavaScript("zkTaskContainer.legendResize();"); } @@ -605,10 +626,10 @@ public class Planner extends HtmlMacroComponent { public void showAllLabels() { Button showAllLabelsButton = (Button) getFellow("showAllLabels"); if (isShowingLabels) { - Clients.evalJavaScript("zkTasklist.hideAllTooltips();"); + Clients.evalJavaScript("ganttz.TaskList.getInstance().hideAllTaskLabels()"); showAllLabelsButton.setSclass("planner-command show-labels"); } else { - Clients.evalJavaScript("zkTasklist.showAllTooltips();"); + Clients.evalJavaScript("ganttz.TaskList.getInstance().showAllTaskLabels()"); showAllLabelsButton .setSclass("planner-command show-labels clicked"); } @@ -618,10 +639,10 @@ public class Planner extends HtmlMacroComponent { public void showAllResources() { Button showAllLabelsButton = (Button) getFellow("showAllResources"); if (isShowingResources) { - Clients.evalJavaScript("zkTasklist.hideResourceTooltips();"); + Clients.evalJavaScript("ganttz.TaskList.getInstance().hideResourceTooltips()"); showAllLabelsButton.setSclass("planner-command show-resources"); } else { - Clients.evalJavaScript("zkTasklist.showResourceTooltips();"); + Clients.evalJavaScript("ganttz.TaskList.getInstance().showResourceTooltips()"); showAllLabelsButton .setSclass("planner-command show-resources clicked"); } @@ -820,6 +841,10 @@ public class Planner extends HtmlMacroComponent { return null; } + public String getWidgetClass(){ + return getDefinition().getDefaultWidgetClass(); + } + public List getCriticalPath() { return context.getCriticalPath(); } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/ScriptsRequiredByPlanner.java b/ganttzk/src/main/java/org/zkoss/ganttz/ScriptsRequiredByPlanner.java deleted file mode 100644 index 37ecf50db..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/ScriptsRequiredByPlanner.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz; - -import org.zkoss.ganttz.util.script.ScriptsRequiredDeclaration; - -@ScriptsRequiredDeclaration(dependsOn = { YUIMin.class, ScrollSyncScript.class }) -public class ScriptsRequiredByPlanner { - - private ScriptsRequiredByPlanner() { - } - - public static final String SELECTOR = "/zkau/web/js/yui/2.7.0/selector/selector-min.js"; - public static final String YAHOO_DOM_EVENT = "/zkau/web/js/yui/2.7.0/yahoo-dom-event/yahoo-dom-event.js"; - public static final String DRAGDROPMIN = "/zkau/web/js/yui/2.7.0/dragdrop/dragdrop-min.js"; - - public static final String ELEMENT_MIN = "/zkau/web/js/yui/2.7.0/element/element-min.js"; - public static final String RESIZE_MIN = "/zkau/web/js/yui/2.7.0/resize/resize-min.js"; - public static final String LOGGER_MIN = "/zkau/web/js/yui/2.7.0/logger/logger-min.js"; - // adding manually js associated to components since they can be used by - // other files with no dependencies being present - public static final String DEPENDENCY_LIST = "/zkau/web/js/ganttz/dependencylist.js"; - public static final String DEPENDENCY = "/zkau/web/js/ganttz/dependency.js"; -} diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/ScrollSyncScript.java b/ganttzk/src/main/java/org/zkoss/ganttz/ScrollSyncScript.java deleted file mode 100644 index bda7012f8..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/ScrollSyncScript.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz; - -import org.zkoss.ganttz.util.script.ScriptsRequiredDeclaration; - -@ScriptsRequiredDeclaration(dependsOn = YUIMin.class) -public class ScrollSyncScript { - - private ScrollSyncScript() { - } - - public static final String SCROLL_SYNC = "/zkau/web/js/ganttz/scrollSync.js"; - - public static final String YAHOO_DOM_EVENT = "/zkau/web/js/yui/2.7.0/yahoo-dom-event/yahoo-dom-event.js"; - -} diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/TabsRegistry.java b/ganttzk/src/main/java/org/zkoss/ganttz/TabsRegistry.java index 3376b37a2..d20e915bf 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/TabsRegistry.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/TabsRegistry.java @@ -117,7 +117,7 @@ public class TabsRegistry { new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { if (_("Limiting resources").equals(t.getName())) { Executions.sendRedirect("/planner/index.zul;limiting_resources"); } else { diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/TaskComponent.java b/ganttzk/src/main/java/org/zkoss/ganttz/TaskComponent.java index 9af312fd4..77628a912 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/TaskComponent.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/TaskComponent.java @@ -23,10 +23,9 @@ package org.zkoss.ganttz; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.io.IOException; import java.util.Map; import java.util.UUID; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.apache.commons.lang.Validate; import org.apache.commons.logging.Log; @@ -43,10 +42,8 @@ import org.zkoss.ganttz.data.constraint.Constraint; import org.zkoss.ganttz.data.constraint.Constraint.IConstraintViolationListener; import org.zkoss.ganttz.util.WeakReferencedListeners.Mode; import org.zkoss.lang.Objects; -import org.zkoss.xml.HTMLs; import org.zkoss.zk.au.AuRequest; -import org.zkoss.zk.au.Command; -import org.zkoss.zk.au.ComponentCommand; +import org.zkoss.zk.au.AuService; import org.zkoss.zk.au.out.AuInvoke; import org.zkoss.zk.mesg.MZk; import org.zkoss.zk.ui.Component; @@ -54,6 +51,7 @@ import org.zkoss.zk.ui.UiException; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.ext.AfterCompose; +import org.zkoss.zk.ui.sys.ContentRenderer; import org.zkoss.zul.Div; /** @@ -70,94 +68,6 @@ public class TaskComponent extends Div implements AfterCompose { private static final int HALF_DEADLINE_MARK = 3; - private static Pattern pixelsSpecificationPattern = Pattern - .compile("\\s*(\\d+)px\\s*;?\\s*"); - - private static int stripPx(String pixels) { - Matcher matcher = pixelsSpecificationPattern.matcher(pixels); - if (!matcher.matches()) { - throw new IllegalArgumentException("pixels " + pixels - + " is not valid. It must be " - + pixelsSpecificationPattern.pattern()); - } - return Integer.valueOf(matcher.group(1)); - } - - private static Command _updatecmd = new ComponentCommand( - "onUpdatePosition", 0) { - - protected void process(AuRequest request) { - - final TaskComponent ta = (TaskComponent) request.getComponent(); - - if (ta == null) { - throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, - this); - } - - String[] requestData = request.getData(); - - if (requestData == null || requestData.length != 2) { - throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, - new Object[] { Objects.toString(requestData), this }); - } else { - - ta.doUpdatePosition(requestData[0], requestData[1]); - Events.postEvent(new Event(getId(), ta, request.getData())); - } - } - - }; - - private static Command _updatewidthcmd = new ComponentCommand( - "onUpdateWidth", 0) { - - protected void process(AuRequest request) { - - final TaskComponent ta = (TaskComponent) request.getComponent(); - - if (ta == null) { - throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, - this); - } - - String[] requestData = request.getData(); - - if (requestData == null || requestData.length != 1) { - throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, - new Object[] { Objects.toString(requestData), this }); - } else { - - ta.doUpdateSize(requestData[0]); - Events.postEvent(new Event(getId(), ta, request.getData())); - } - } - }; - - private static Command _adddependencycmd = new ComponentCommand( - "onAddDependency", 0) { - - protected void process(AuRequest request) { - - final TaskComponent taskComponent = (TaskComponent) request.getComponent(); - - if (taskComponent == null) { - throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, - this); - } - - String[] requestData = request.getData(); - - if (requestData == null || requestData.length != 1) { - throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, - new Object[] { Objects.toString(requestData), this }); - } else { - taskComponent.doAddDependency(requestData[0]); - Events.postEvent(new Event(getId(), taskComponent, request.getData())); - } - } - }; - protected final IDisabilityConfiguration disabilityConfiguration; private PropertyChangeListener criticalPathPropertyListener; @@ -195,7 +105,6 @@ public class TaskComponent extends Div implements AfterCompose { setContext("idContextMenuTaskAssignment"); this.task = task; setClass(calculateCSSClass()); - setId(UUID.randomUUID().toString()); this.disabilityConfiguration = disabilityConfiguration; taskViolationListener = Constraint @@ -234,6 +143,64 @@ public class TaskComponent extends Div implements AfterCompose { }; this.task.addReloadListener(reloadResourcesTextRequested); + setAuService(new AuService(){ + public boolean service(AuRequest request, boolean everError){ + String command = request.getCommand(); + final TaskComponent ta; + + if (command.equals("onUpdatePosition")){ + ta = retrieveTaskComponent(request); + + ta.doUpdatePosition( + toInteger(retrieveData(request, "left")), + toInteger(retrieveData(request, "top"))); + Events.postEvent(new Event(getId(), ta, request.getData())); + + return true; + } + if (command.equals("onUpdateWidth")){ + ta = retrieveTaskComponent(request); + + ta.doUpdateSize(toInteger(retrieveData(request, "width"))); + Events.postEvent(new Event(getId(), ta, request.getData())); + + return true; + } + if (command.equals("onAddDependency")){ + ta = retrieveTaskComponent(request); + + ta.doAddDependency((String) retrieveData(request, "dependencyId")); + Events.postEvent(new Event(getId(), ta, request.getData())); + + return true; + } + return false; + } + + private int toInteger(Object valueFromRequestData) { + return ((Number) valueFromRequestData).intValue(); + } + + private TaskComponent retrieveTaskComponent(AuRequest request){ + final TaskComponent ta = (TaskComponent) request.getComponent(); + + if (ta == null) { + throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, + this); + } + + return ta; + } + + private Object retrieveData(AuRequest request, String key){ + Object value = request.getData().get(key); + if ( value == null) + throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, + new Object[] { key, this }); + + return value; + } + }); } /* Generate CSS class attribute depending on task properties */ @@ -261,8 +228,7 @@ public class TaskComponent extends Div implements AfterCompose { } protected void updateClass() { - response(null, new AuInvoke(this, "setClass", - new Object[] { calculateCSSClass() })); + setSclass(calculateCSSClass()); } public final void afterCompose() { @@ -369,20 +335,6 @@ public class TaskComponent extends Div implements AfterCompose { return null; } - public Command getCommand(String cmdId) { - Command result = null; - if ("updatePosition".equals(cmdId) - && isMovingTasksEnabled()) { - result = _updatecmd; - } else if ("updateSize".equals(cmdId) - && isResizingTasksEnabled()) { - result = _updatewidthcmd; - } else if ("addDependency".equals(cmdId)) { - result = _adddependencycmd; - } - return result; - } - public boolean isResizingTasksEnabled() { return (disabilityConfiguration != null) && disabilityConfiguration.isResizingTasksEnabled() @@ -395,9 +347,10 @@ public class TaskComponent extends Div implements AfterCompose { && task.canBeExplicitlyMoved(); } - void doUpdatePosition(String leftX, String topY) { + + void doUpdatePosition(int leftX, int topY) { GanttDate startBeforeMoving = this.task.getBeginDate(); - LocalDate newPosition = getMapper().toDate(stripPx(leftX)); + LocalDate newPosition = getMapper().toDate(leftX); this.task.moveTo(GanttDate.createFrom(newPosition)); boolean remainsInOriginalPosition = this.task.getBeginDate().equals( startBeforeMoving); @@ -406,11 +359,10 @@ public class TaskComponent extends Div implements AfterCompose { } } - void doUpdateSize(String size) { - int pixels = stripPx(size); + void doUpdateSize(int size) { DateTime end = new DateTime(this.task.getBeginDate() .toDayRoundedDate().getTime()).plus(getMapper().toDuration( - pixels)); + size)); this.task.resizeTo(end.toLocalDate()); updateProperties(); } @@ -436,20 +388,26 @@ public class TaskComponent extends Div implements AfterCompose { } /* - * We override the method of getRealStyle to put the color property as part + * We override the method of renderProperties to put the color property as part * of the style */ + protected void renderProperties(ContentRenderer renderer) throws IOException{ + if(getColor() != null) + setStyle("background-color : " + getColor()); - protected String getRealStyle() { + setWidgetAttribute("movingTasksEnabled",((Boolean)isMovingTasksEnabled()).toString()); + setWidgetAttribute("resizingTasksEnabled", ((Boolean)isResizingTasksEnabled()).toString()); - final StringBuffer sb = new StringBuffer(super.getRealStyle()); + /*We can't use setStyle because of restrictions + * involved with UiVisualizer#getResponses and the + * smartUpdate method (when the request is asynchronous) */ + render(renderer, "style", "position : absolute"); - if (getColor() != null) { - HTMLs.appendStyle(sb, "background-color", getColor()); - } - HTMLs.appendStyle(sb, "position", "absolute"); + render(renderer, "_labelsText", getLabelsText()); + render(renderer, "_resourcesText", getResourcesText()); + render(renderer, "_tooltipText", getTooltipText()); - return sb.toString(); + super.renderProperties(renderer); } /* @@ -487,10 +445,6 @@ public class TaskComponent extends Div implements AfterCompose { setLeft(this.task.getBeginDate().toPixels(getMapper()) + "px"); updateWidth(); smartUpdate("name", this.task.getName()); - DependencyList dependencyList = getDependencyList(); - if (dependencyList != null) { - dependencyList.redrawDependenciesConnectedTo(this); - } updateDeadline(); updateCompletionIfPossible(); updateClass(); diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/TaskEditFormComposer.java b/ganttzk/src/main/java/org/zkoss/ganttz/TaskEditFormComposer.java index 9a1df4f99..e3a403a63 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/TaskEditFormComposer.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/TaskEditFormComposer.java @@ -93,7 +93,7 @@ public class TaskEditFormComposer extends GenericForwardComposer { * * @author Manuel Rego Casasnovas */ - public class TaskDTO { + public static class TaskDTO { public String name; public Date beginDate; public Date endDate; diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java b/ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java index 5ed7d2789..f801ec5a0 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java @@ -49,7 +49,6 @@ import org.zkoss.ganttz.timetracker.zoom.ZoomLevel; import org.zkoss.ganttz.util.Interval; import org.zkoss.ganttz.util.MenuBuilder; import org.zkoss.ganttz.util.MenuBuilder.ItemAction; -import org.zkoss.zk.au.out.AuInvoke; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.ext.AfterCompose; @@ -144,7 +143,7 @@ public class TaskList extends XulElement implements AfterCompose { taskComponent.afterCompose(); if (relocate) { setHeight(getHeight());// forcing smart update - adjustZoomColumnsHeight(); + getGanttPanel().adjustZoomColumnsHeight(); getGanttPanel().getDependencyList().redrawDependencies(); } } @@ -180,24 +179,14 @@ public class TaskList extends XulElement implements AfterCompose { taskComponent.addEventListener("onDoubleClick", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { doubleClickCommand.doAction(taskComponent); } }); } private void addContextMenu(final TaskComponent taskComponent) { - taskComponent.addEventListener("onRightClick", new EventListener() { - - @Override - public void onEvent(Event event) throws Exception { - try { - getContextMenuFor(taskComponent).open(taskComponent); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); + taskComponent.setContext(getContextMenuFor(taskComponent)); } @Override @@ -295,7 +284,6 @@ public class TaskList extends XulElement implements AfterCompose { for (TaskComponent taskComponent : getTaskComponents()) { taskComponent.zoomChanged(); } - adjustZoomColumnsHeight(); adjustZoomPositionScroll(); } }; @@ -344,10 +332,6 @@ public class TaskList extends XulElement implements AfterCompose { return (GanttPanel) getParent(); } - public void adjustZoomColumnsHeight() { - response("adjust_height", new AuInvoke(TaskList.this, "adjust_height")); - } - private void adjustZoomPositionScroll() { getTimeTrackerComponent().movePositionScroll(); } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/YUIMin.java b/ganttzk/src/main/java/org/zkoss/ganttz/YUIMin.java deleted file mode 100644 index d0afdec3c..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/YUIMin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz; - -import org.zkoss.ganttz.util.script.ScriptsRequiredDeclaration; - -@ScriptsRequiredDeclaration -public class YUIMin { - - private YUIMin() { - } - - public static final String YUI_MIN = "/zkau/web/js/yui/2.7.0/yahoo/yahoo-min.js"; - -} diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/data/GanttDiagramGraph.java b/ganttzk/src/main/java/org/zkoss/ganttz/data/GanttDiagramGraph.java index c4351b7f4..b44944f72 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/data/GanttDiagramGraph.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/data/GanttDiagramGraph.java @@ -360,7 +360,8 @@ public class GanttDiagramGraph> implements Collection tasks) { List result = new ArrayList(); for (V each : tasks) { - if (noVisibleDependencies(graph.incomingEdgesOf(each))) { + if (noVisibleDependencies(isScheduleForward() ? graph + .incomingEdgesOf(each) : graph.outgoingEdgesOf(each))) { result.add(each); } } @@ -469,8 +470,8 @@ public class GanttDiagramGraph> implements + o2.taskPoint); int result = o1Depth - o2Depth; if (result == 0) { - return asInt(o2.parentRecalculation) - - asInt(o1.parentRecalculation); + return asInt(o1.parentRecalculation) + - asInt(o2.parentRecalculation); } return result; } @@ -1765,7 +1766,8 @@ public class GanttDiagramGraph> implements @Override public String toString() { - return String.format("%s, parentRecalculation: %s, parents: %s", + return String.format( + "%s, parentRecalculation: %s, predecessors: %s", taskPoint, parentRecalculation, asSimpleString(recalculationsCouldAffectThis)); } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java index a5238c1e6..2faeadcc0 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java @@ -23,6 +23,7 @@ package org.zkoss.ganttz.resourceload; import static org.zkoss.ganttz.i18n.I18nHelper._; +import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -42,6 +43,7 @@ import org.zkoss.ganttz.util.MenuBuilder.ItemAction; import org.zkoss.ganttz.util.WeakReferencedListeners.IListenerNotification; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.sys.ContentRenderer; import org.zkoss.zul.Div; import org.zkoss.zul.Menupopup; import org.zkoss.zul.impl.XulElement; @@ -97,7 +99,7 @@ public class ResourceLoadComponent extends XulElement { private void addDoubleClickAction(final Div div, final LoadTimeLine loadLine) { div.addEventListener("onDoubleClick", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { schedule(loadLine); } }); @@ -105,9 +107,18 @@ public class ResourceLoadComponent extends XulElement { private void addContextMenu(final List
divs, final Div div, final LoadTimeLine loadLine) { + /* + * This EventListener could be replaced with + * div.setContext(getContextMenuFor(divs, div, loadLine)) but + * on this case this is not valid as we'll got an exception. + * As this component (ResourceLoadComponent) hasn't be added to + * a page yet, its getPage() method will return null and a + * non-null page is required by MenuBuilder or a NullPointerException + * will be raised. + * */ div.addEventListener("onRightClick", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { try { getContextMenuFor(divs, div, loadLine).open(div); } catch (Exception e) { @@ -213,4 +224,11 @@ public class ResourceLoadComponent extends XulElement { return datesMapper.toPixels(loadPeriod.getStart()); } + protected void renderProperties(ContentRenderer renderer) throws IOException{ + render(renderer, "_resourceLoadName", getResourceLoadName()); + render(renderer, "_resourceLoadType", getResourceLoadType()); + + super.renderProperties(renderer); + } + } \ No newline at end of file diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadLeftPane.java b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadLeftPane.java index 06f0a9adb..c5ac9a755 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadLeftPane.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadLeftPane.java @@ -74,7 +74,7 @@ MutableTreeModel modelForTree, return new TreeitemRenderer() { @Override public void render(Treeitem item, Object data) - throws Exception { + { LoadTimeLine line = (LoadTimeLine) data; item.setOpen(false); item.setValue(line); @@ -111,7 +111,7 @@ MutableTreeModel modelForTree, buttonPlan.setTooltiptext(_("See scheduling")); buttonPlan.addEventListener("onClick", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { schedule(taskLine); } }); @@ -134,7 +134,7 @@ MutableTreeModel modelForTree, final LoadTimeLine line) { item.addEventListener("onOpen", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { OpenEvent openEvent = (OpenEvent) event; if (openEvent.isOpen()) { List closed = calculatedClosedItems(item); diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadList.java b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadList.java index 87689ef7b..26aacb961 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadList.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadList.java @@ -35,16 +35,14 @@ import org.zkoss.ganttz.timetracker.zoom.ZoomLevel; import org.zkoss.ganttz.util.MutableTreeModel; import org.zkoss.zk.au.out.AuInvoke; import org.zkoss.zk.ui.Component; -import org.zkoss.zk.ui.HtmlMacroComponent; -import org.zkoss.zk.ui.ext.AfterCompose; import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.impl.XulElement; /** * Component to include a list of ResourceLoads inside the ResourcesLoadPanel. * @author Lorenzo Tilve Álvaro */ -public class ResourceLoadList extends HtmlMacroComponent implements - AfterCompose { +public class ResourceLoadList extends XulElement { private final IZoomLevelChangedListener zoomListener; @@ -97,8 +95,8 @@ public class ResourceLoadList extends HtmlMacroComponent implements for (LoadTimeLine l : line.getAllChildren()) { getComponentFor(l).detach(); } - Clients - .evalJavaScript("zkResourcesLoadList.recalculateTimetrackerHeight();"); + + Clients.evalJavaScript(getWidgetClass() + ".getInstance().recalculateTimeTrackerHeight();"); } private ResourceLoadComponent getComponentFor(LoadTimeLine l) { @@ -119,8 +117,8 @@ public class ResourceLoadList extends HtmlMacroComponent implements insertBefore(child, nextSibling); nextSibling = child; } - Clients - .evalJavaScript("zkResourcesLoadList.recalculateTimetrackerHeight();"); + + Clients.evalJavaScript(getWidgetClass() + ".getInstance().recalculateTimeTrackerHeight();"); } private List getChildrenReverseOrderFor(LoadTimeLine line) { @@ -129,11 +127,6 @@ public class ResourceLoadList extends HtmlMacroComponent implements return childrenOf; } - @Override - public void afterCompose() { - super.afterCompose(); - } - public void addSeeScheduledOfListener( ISeeScheduledOfListener seeScheduledOfListener) { for (Entry entry : fromTimeLineToComponent diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java index 655b14069..d58b7fce7 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java @@ -35,19 +35,16 @@ import org.zkoss.ganttz.timetracker.zoom.ZoomLevel; import org.zkoss.ganttz.util.ComponentsFinder; import org.zkoss.ganttz.util.Interval; import org.zkoss.ganttz.util.LongOperationFeedback; -import org.zkoss.ganttz.util.MutableTreeModel; -import org.zkoss.ganttz.util.OnZKDesktopRegistry; -import org.zkoss.ganttz.util.WeakReferencedListeners; import org.zkoss.ganttz.util.LongOperationFeedback.ILongOperation; +import org.zkoss.ganttz.util.MutableTreeModel; +import org.zkoss.ganttz.util.WeakReferencedListeners; import org.zkoss.ganttz.util.WeakReferencedListeners.IListenerNotification; -import org.zkoss.ganttz.util.script.IScriptsRegister; import org.zkoss.zk.au.out.AuInvoke; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.HtmlMacroComponent; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; -import org.zkoss.zkex.zul.api.South; import org.zkoss.zul.Button; import org.zkoss.zul.Comboitem; import org.zkoss.zul.ListModel; @@ -55,6 +52,7 @@ import org.zkoss.zul.Separator; import org.zkoss.zul.SimpleListModel; import org.zkoss.zul.api.Combobox; import org.zkoss.zul.api.Listbox; +import org.zkoss.zul.api.South; public class ResourcesLoadPanel extends HtmlMacroComponent { public interface IToolbarCommand { @@ -128,7 +126,6 @@ public class ResourcesLoadPanel extends HtmlMacroComponent { timeTrackerComponent = timeTrackerForResourcesLoadPanel(timeTracker); resourceLoadList = new ResourceLoadList(timeTracker, treeModel); leftPane = new ResourceLoadLeftPane(treeModel, resourceLoadList); - registerNeededScripts(); } public ListModel getFilters() { @@ -158,7 +155,7 @@ public class ResourcesLoadPanel extends HtmlMacroComponent { new ILongOperation() { @Override - public void doAction() throws Exception { + public void doAction() { applyFilter(); } @@ -252,7 +249,7 @@ public class ResourcesLoadPanel extends HtmlMacroComponent { Button result = new Button(); result.addEventListener(Events.ON_CLICK, new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { c.doAction(); } }); @@ -278,15 +275,6 @@ public class ResourcesLoadPanel extends HtmlMacroComponent { return toolbar; } - private void registerNeededScripts() { - getScriptsRegister().register(ScriptsRequiredByResourceLoadPanel.class); - } - - private IScriptsRegister getScriptsRegister() { - return OnZKDesktopRegistry.getLocatorFor(IScriptsRegister.class) - .retrieve(); - } - private MutableTreeModel createModelForTree() { MutableTreeModel result = MutableTreeModel .create(LoadTimeLine.class); @@ -444,7 +432,7 @@ public class ResourcesLoadPanel extends HtmlMacroComponent { Comboitem item = new Comboitem(); item.setLabel(firstName.substring(0, 1) + " - " + lastName.substring(0, 1)); item.setDescription(firstName + " - " + lastName); - item.setValue(new Integer(position)); + item.setValue(position); filterByNameCombo.appendChild(item); position = newPosition; } @@ -506,14 +494,13 @@ public class ResourcesLoadPanel extends HtmlMacroComponent { new ILongOperation() { @Override - public void doAction() throws Exception { + public void doAction() { if(paginationType == PaginationType.INTERNAL_PAGINATION) { //if the pagination is internal, we are in charge of repainting the graph treeModel = createModelForTree(); timeTrackerComponent = timeTrackerForResourcesLoadPanel(timeTracker); resourceLoadList = new ResourceLoadList(timeTracker, treeModel); leftPane = new ResourceLoadLeftPane(treeModel, resourceLoadList); - registerNeededScripts(); } nameFilterListener.fireEvent(new IListenerNotification() { @Override diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ScriptsRequiredByResourceLoadPanel.java b/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ScriptsRequiredByResourceLoadPanel.java deleted file mode 100644 index 9873c7de4..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ScriptsRequiredByResourceLoadPanel.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz.resourceload; - -import org.zkoss.ganttz.ScrollSyncScript; -import org.zkoss.ganttz.YUIMin; -import org.zkoss.ganttz.util.script.ScriptsRequiredDeclaration; - -@ScriptsRequiredDeclaration(dependsOn = { YUIMin.class, ScrollSyncScript.class }) -public class ScriptsRequiredByResourceLoadPanel { - - private ScriptsRequiredByResourceLoadPanel() { - } - - public static final String SELECTOR = "/zkau/web/js/yui/2.7.0/selector/selector-min.js"; - public static final String YAHOO_DOM_EVENT = "/zkau/web/js/yui/2.7.0/yahoo-dom-event/yahoo-dom-event.js"; - -} diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/servlets/CallbackServlet.java b/ganttzk/src/main/java/org/zkoss/ganttz/servlets/CallbackServlet.java index 12c44919c..9706a8145 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/servlets/CallbackServlet.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/servlets/CallbackServlet.java @@ -21,14 +21,16 @@ package org.zkoss.ganttz.servlets; import java.io.IOException; +import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; +import java.util.Map.Entry; import java.util.Random; import java.util.Timer; import java.util.TimerTask; -import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.TimeUnit; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -47,15 +49,13 @@ public class CallbackServlet extends HttpServlet { private static final String MAPPING = "/callback/"; - private static final long CLEANING_PERIOD_MILLIS = 1000 * 60 * 10; // ten + private static final long CLEANING_PERIOD_MILLIS = 1000 * 60 * 1; // one + // minute // minutes - private static final long EXPIRATION_TIME_MILLIS = 1000 * 60 * 30; // half - // hour; - private static Random random = new Random(); - private static ConcurrentMap handlersCallbacks = new ConcurrentHashMap(); + private static ConcurrentMap handlersCallbacks = new ConcurrentHashMap(); private static Timer cleaningTimer = new Timer(true); @@ -65,32 +65,105 @@ public class CallbackServlet extends HttpServlet { IOException; } - private static class HandlerWithRegisterTime { - private final IServletRequestHandler handler; - private final long creationTime; + public enum DisposalMode { + WHEN_NO_LONGER_REFERENCED { + @Override + public IHandler create(IServletRequestHandler handler) { + return new WeakReferencedHandler(handler); + } + }, + AFTER_TEN_MINUTES { + @Override + public IHandler create(IServletRequestHandler handler) { + return new BasedOnExpirationTimeHandler(handler, + tenMinutesInMillis); + } + }; - public HandlerWithRegisterTime(IServletRequestHandler handler) { + private static final long tenMinutesInMillis = TimeUnit.MILLISECONDS + .convert(10, TimeUnit.MINUTES); + + public abstract IHandler create( + IServletRequestHandler handler); + } + + private interface IHandler { + + abstract boolean hasExpired(); + + abstract IServletRequestHandler getHandler(); + } + + private static class BasedOnExpirationTimeHandler implements IHandler { + + private IServletRequestHandler handler; + + private final long creationTime; + private final long expirationTimeMilliseconds; + + public BasedOnExpirationTimeHandler(IServletRequestHandler handler, + long expirationTimeMilliseconds) { Validate.notNull(handler); this.handler = handler; this.creationTime = System.currentTimeMillis(); + this.expirationTimeMilliseconds = expirationTimeMilliseconds; } - boolean hasExpired() { - return System.currentTimeMillis() - creationTime > EXPIRATION_TIME_MILLIS; + @Override + public IServletRequestHandler getHandler() { + return handler; } + + @Override + public boolean hasExpired() { + return System.currentTimeMillis() - creationTime > expirationTimeMilliseconds; + } + } + + private static class WeakReferencedHandler implements IHandler { + + private final WeakReference handler; + + WeakReferencedHandler(IServletRequestHandler handler) { + this.handler = new WeakReference(handler); + } + + @Override + public boolean hasExpired() { + return handler.get() == null; + } + + @Override + public IServletRequestHandler getHandler() { + return handler.get(); + } + } public static String registerAndCreateURLFor(HttpServletRequest request, IServletRequestHandler handler) { - return registerAndCreateURLFor(request, handler, true); + return registerAndCreateURLFor(request, handler, + DisposalMode.AFTER_TEN_MINUTES); + } + + public static String registerAndCreateURLFor(HttpServletRequest request, + IServletRequestHandler handler, DisposalMode disposalMode) { + return registerAndCreateURLFor(request, handler, true, disposalMode); } public static String registerAndCreateURLFor(HttpServletRequest request, IServletRequestHandler handler, boolean withContextPath) { + return registerAndCreateURLFor(request, handler, withContextPath, + DisposalMode.AFTER_TEN_MINUTES); + } + + public static String registerAndCreateURLFor(HttpServletRequest request, + IServletRequestHandler handler, boolean withContextPath, + DisposalMode disposalMode) { + Validate.notNull(disposalMode); // theoretically could be an infinite loop, could be improved. String generatedKey = ""; - HandlerWithRegisterTime toBeRegistered = new HandlerWithRegisterTime( - handler); + IHandler toBeRegistered = disposalMode.create(handler); do { generatedKey = generateKey(); } while (handlersCallbacks.putIfAbsent(generatedKey, toBeRegistered) != null); @@ -126,10 +199,10 @@ public class CallbackServlet extends HttpServlet { } private static List findExpired() { - ArrayList> handlersList = new ArrayList>( + ArrayList> handlersList = new ArrayList>( handlersCallbacks.entrySet()); List expired = new ArrayList(); - for (Entry entry : handlersList) { + for (Entry entry : handlersList) { if (entry.getValue().hasExpired()) { expired.add(entry.getKey()); } @@ -170,8 +243,8 @@ public class CallbackServlet extends HttpServlet { } private IServletRequestHandler handlerFor(String callbackId) { - HandlerWithRegisterTime h = handlersCallbacks.get(callbackId); - return h != null ? h.handler : null; + IHandler h = handlersCallbacks.get(callbackId); + return h != null ? h.getHandler() : null; } } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTrackedTableWithLeftPane.java b/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTrackedTableWithLeftPane.java index 55f2350ff..ea2300f01 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTrackedTableWithLeftPane.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTrackedTableWithLeftPane.java @@ -111,7 +111,7 @@ public class TimeTrackedTableWithLeftPane { return new Callable>() { @Override - public List call() throws Exception { + public List call() { return loadPairOfListsFromCallable().getSecond(); } }; diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java b/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java index a48b1f47c..c05dd0568 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java @@ -234,7 +234,7 @@ public class TimeTracker { new ILongOperation() { @Override - public void doAction() throws Exception { + public void doAction() { invalidatingChangeHappened(); } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTrackerComponent.java b/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTrackerComponent.java index e5e0c1371..e9b1fcc56 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTrackerComponent.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTrackerComponent.java @@ -30,9 +30,6 @@ import org.zkoss.ganttz.timetracker.zoom.DetailItem; import org.zkoss.ganttz.timetracker.zoom.IZoomLevelChangedListener; import org.zkoss.ganttz.timetracker.zoom.TimeTrackerState; import org.zkoss.ganttz.timetracker.zoom.ZoomLevel; -import org.zkoss.zk.au.AuRequest; -import org.zkoss.zk.au.Command; -import org.zkoss.zk.au.ComponentCommand; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.HtmlMacroComponent; @@ -46,6 +43,7 @@ public abstract class TimeTrackerComponent extends HtmlMacroComponent { private IZoomLevelChangedListener zoomListener; private final String secondLevelZul; private String timeTrackerElementId; + private int scrollLeft; public TimeTrackerComponent(TimeTracker timeTracker) { this(timeTracker, @@ -63,6 +61,7 @@ public abstract class TimeTrackerComponent extends HtmlMacroComponent { public void zoomLevelChanged(ZoomLevel detailLevel) { if (isInPage()) { recreate(); + changeDetailLevel(getDaysFor(scrollLeft)); } } }; @@ -82,9 +81,15 @@ public abstract class TimeTrackerComponent extends HtmlMacroComponent { return timeTrackerElementId; } + /* + * fsanjurjo: I'm temporary changing the name of this method + * (from afterCompose to compose) to get it called after calling recreate(). + * To understand why, please read this: http://www.zkoss.org/forum/listComment/14905 + * Also renamed the call to its parent. + * */ @Override - public void afterCompose() { - super.afterCompose(); + public void compose() { + super.compose(); Component fellow = getFellow("firstleveldetails"); addSecondLevels(fellow.getParent()); } @@ -116,49 +121,6 @@ public abstract class TimeTrackerComponent extends HtmlMacroComponent { return getTimeTracker().getTimeTrackerState(); } - private Command _onincreasecmd = new ComponentCommand("onIncrease", 0) { - - protected void process(AuRequest request) { - String[] requestData = request.getData(); - int pixelsOffset = Integer.parseInt(requestData[0]); - onIncrease(pixelsOffset); - } - - }; - - private Command _ondecreasecmd = new ComponentCommand("onDecrease", 0) { - - protected void process(AuRequest request) { - String[] requestData = request.getData(); - int pixelsOffset = Integer.parseInt(requestData[0]); - onDecrease(pixelsOffset); - } - - }; - - private Command[] commands = { _onincreasecmd, _ondecreasecmd }; - - public Command getCommand(String cmdId) { - for (Command command : commands) { - if (command.getId().equals(cmdId)) { - return command; - } - } - return super.getCommand(cmdId); - } - - public void onIncrease(int offset) { - double daysOffset = getDaysFor(offset); - getTimeTracker().zoomIncrease(); - changeDetailLevel(daysOffset); - } - - public void onDecrease(int offset) { - double daysOffset = getDaysFor(offset); - getTimeTracker().zoomDecrease(); - changeDetailLevel(daysOffset); - } - public TimeTracker getTimeTracker() { return timeTracker; } @@ -198,4 +160,13 @@ public abstract class TimeTrackerComponent extends HtmlMacroComponent { return timeTracker.getDetailLevel() == ZoomLevel.DETAIL_FOUR; } + public void setZoomLevel(ZoomLevel zoomlevel, int scrollLeft){ + this.scrollLeft = scrollLeft; + getTimeTracker().setZoomLevel(zoomlevel); + } + + public String getWidgetClass(){ + return getDefinition().getDefaultWidgetClass(); + } + } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/GanttUtils.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/GanttUtils.java index 5f820ebbb..68de3b609 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/GanttUtils.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/util/GanttUtils.java @@ -31,12 +31,13 @@ public class GanttUtils { private GanttUtils() { } - public static int getIntFromStylePosition(String position) throws Exception { + public static int getIntFromStylePosition(String position) { String[] tokens = position.split("px"); if (tokens.length != 1) { - throw new Exception("Bad formatting for input parameter"); + throw new IllegalArgumentException( + "Bad formatting for input parameter"); } return Integer.parseInt(tokens[0]); diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/LongOperationFeedback.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/LongOperationFeedback.java index 0973393f0..57fc0b309 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/LongOperationFeedback.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/util/LongOperationFeedback.java @@ -39,6 +39,7 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.util.Clients; + /** * @author Óscar González Fernández * @@ -71,7 +72,7 @@ public class LongOperationFeedback { return; } - Clients.showBusy(longOperation.getName(), true); + Clients.showBusy(longOperation.getName()); executeLater(component, new Runnable() { public void run() { try { @@ -80,8 +81,8 @@ public class LongOperationFeedback { } catch (Exception e) { throw new RuntimeException(e); } finally { - alreadyInside.set(false); - Clients.showBusy(null, false); + alreadyInside.remove(); + Clients.clearBusy(); } } }); @@ -95,10 +96,11 @@ public class LongOperationFeedback { component.addEventListener(eventName, new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { try { runnable.run(); } finally { + Clients.clearBusy(); component.removeEventListener(eventName, this); } } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/MenuBuilder.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/MenuBuilder.java index f1c7d63c5..2dc4606ee 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/MenuBuilder.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/util/MenuBuilder.java @@ -116,7 +116,7 @@ public class MenuBuilder { result.addEventListener("onOpen", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { OpenEvent openEvent = (OpenEvent) event; referenced = (T) openEvent.getReference(); } @@ -126,7 +126,7 @@ public class MenuBuilder { Menuitem menuItem = item.createMenuItem(); menuItem.addEventListener("onClick", new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) { ItemAction action = item.action; action.onEvent(referenced, event); } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/PreAndPostNotReentrantActionsWrapper.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/PreAndPostNotReentrantActionsWrapper.java index 7e8c49c92..8e01b4f38 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/PreAndPostNotReentrantActionsWrapper.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/util/PreAndPostNotReentrantActionsWrapper.java @@ -27,12 +27,14 @@ import org.apache.commons.lang.Validate; */ public abstract class PreAndPostNotReentrantActionsWrapper { - private final ThreadLocal inside = new ThreadLocal() { + private static final class BooleanThreadLocal extends ThreadLocal { @Override protected Boolean initialValue() { return false; } - }; + } + + private final ThreadLocal inside = new BooleanThreadLocal(); public void doAction(IAction action) { Validate.notNull(action); @@ -49,7 +51,7 @@ public abstract class PreAndPostNotReentrantActionsWrapper { try { action.doAction(); } finally { - inside.set(false); + inside.remove(); postAction(); } } diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/IScriptsRegister.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/script/IScriptsRegister.java deleted file mode 100644 index e2fcb02aa..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/IScriptsRegister.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz.util.script; - -public interface IScriptsRegister { - - public void register(Class klassContainingScripts) - throws IllegalArgumentException; - -} diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptDependenciesSorter.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptDependenciesSorter.java deleted file mode 100644 index 10b36964b..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptDependenciesSorter.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz.util.script; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.apache.commons.lang.Validate; - -public class ScriptDependenciesSorter implements IScriptsRegister { - - public static List extractFrom(Class classWithScripts) { - ScriptsRequiredDeclaration annotation = classWithScripts - .getAnnotation(ScriptsRequiredDeclaration.class); - if (annotation == null) { - throw new IllegalArgumentException(classWithScripts - + " must be annotated with " - + ScriptsRequiredDeclaration.class.getName()); - } - List dependsOn = getDependencies(annotation); - List result = new ArrayList(); - for (Field field : getStringFields(getStaticFields(classWithScripts - .getFields()))) { - result.add(new ScriptDependency(getValueFromStringField(field), - dependsOn)); - } - return result; - } - - static ArrayList getDependencies( - ScriptsRequiredDeclaration declaration) { - Class[] dependsOn = declaration.dependsOn(); - ArrayList result = new ArrayList(); - for (Class klass : dependsOn) { - result.addAll(extractFrom(klass)); - } - return result; - } - - static String getValueFromStringField(Field stringField) { - try { - return (String) stringField.get(null); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private static List getStaticFields(Field[] fields) { - List result = new ArrayList(); - for (Field field : fields) { - if (Modifier.isStatic(field.getModifiers())) { - result.add(field); - } - } - return result; - } - - static List getStringFields(Collection fields) { - List stringFields = new ArrayList(); - for (Field field : fields) { - if (field.getType().equals(String.class)) { - stringFields.add(field); - } - } - return stringFields; - } - - private List allScripts = new ArrayList(); - - public ScriptDependenciesSorter() { - } - - public void add(ScriptDependency scriptDependency) { - addAll(Arrays.asList(scriptDependency)); - } - - public void addAll(List dependencies) { - Validate.noNullElements(dependencies); - allScripts.addAll(dependencies); - } - - public List getScriptDependenciesOrderered() { - List result = new ArrayList(); - Set alreadyAdded = new HashSet(); - for (ScriptDependency scriptDependency : allScripts) { - result.addAll(extract(alreadyAdded, scriptDependency)); - } - return Collections.unmodifiableList(result); - } - - private List extract(Set alreadyAdded, - ScriptDependency scriptDependency) { - List result = new ArrayList(); - if (alreadyAdded.contains(scriptDependency)) { - return result; - } - for (ScriptDependency d : scriptDependency.getDependsOn()) { - result.addAll(extract(alreadyAdded, d)); - } - result.add(scriptDependency); - alreadyAdded.add(scriptDependency); - return result; - } - - @Override - public void register(Class klassContainingScripts) - throws IllegalArgumentException { - addAll(extractFrom(klassContainingScripts)); - } - -} diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptDependency.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptDependency.java deleted file mode 100644 index aa90f78d7..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptDependency.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz.util.script; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.apache.commons.lang.Validate; -import org.apache.commons.lang.builder.HashCodeBuilder; - -/** - * Represents a dependency to a script - * @author Óscar González Fernández - */ -public class ScriptDependency { - - public static List getOnlyURLs( - Collection dependencies) { - List result = new ArrayList(); - for (ScriptDependency scriptDependency : dependencies) { - result.add(scriptDependency.getURL()); - } - return result; - } - - private final String url; - private final List dependsOn; - - public ScriptDependency(String url) { - this(url, Collections. emptyList()); - } - - public ScriptDependency(String url, Collection dependencies) { - Validate.notEmpty(url); - Validate.noNullElements(dependencies); - this.url = url; - this.dependsOn = Collections.unmodifiableList(new ArrayList( - dependencies)); - } - - public String getURL() { - return this.url; - } - - public List getDependsOn() { - return dependsOn; - } - - @Override - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (other instanceof ScriptDependency) { - return url.equals(((ScriptDependency) other).url); - } - return false; - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(url).toHashCode(); - } - - @Override - public String toString() { - return url; - } - -} diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptsComponent.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptsComponent.java deleted file mode 100644 index 5083e2e7a..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptsComponent.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz.util.script; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.zkoss.ganttz.util.OnZKDesktopRegistry; -import org.zkoss.zk.ui.Execution; -import org.zkoss.zk.ui.Executions; -import org.zkoss.zk.ui.HtmlMacroComponent; - -public class ScriptsComponent extends HtmlMacroComponent { - - private List current = Collections.emptyList(); - - public ScriptsComponent() { - OnZKDesktopRegistry singleton = getScriptsRegister(); - ScriptRegister register; - if (singleton.isRegistered()) { - register = (ScriptRegister) singleton.retrieve(); - } else { - register = new ScriptRegister(); - singleton.store(register); - } - register.addDependant(this); - } - - private OnZKDesktopRegistry getScriptsRegister() { - return OnZKDesktopRegistry.getLocatorFor(IScriptsRegister.class); - } - - public List getScriptDependencies() { - return current; - } - - void setDependencies(List current) { - this.current = current; - if (!executionIsUpdatingPage()) { - recreate(); - } - } - - private boolean executionIsUpdatingPage() { - return Executions.getCurrent().isAsyncUpdate(null); - } - -} - -class ScriptRegister implements IScriptsRegister { - private ScriptDependenciesSorter dependenciesSorter = new ScriptDependenciesSorter(); - - private List dependant = new ArrayList(); - - void addDependant(ScriptsComponent component) { - dependant.add(component); - } - - @Override - public void register(Class klassContainingScripts) - throws IllegalArgumentException { - dependenciesSorter.register(klassContainingScripts); - notifyDependant(encodeURLs(dependenciesSorter - .getScriptDependenciesOrderered())); - } - - private List encodeURLs( - List scriptDependenciesOrderered) { - List result = new ArrayList(); - Execution execution = Executions.getCurrent(); - for (ScriptDependency s : scriptDependenciesOrderered) { - result.add(new ScriptDependency(execution.encodeURL(s.getURL()))); - } - return result; - } - - private void notifyDependant(List current) { - for (ScriptsComponent d : dependant) { - d.setDependencies(current); - } - } -} diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptsRequiredDeclaration.java b/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptsRequiredDeclaration.java deleted file mode 100644 index 1bb2eeac9..000000000 --- a/ganttzk/src/main/java/org/zkoss/ganttz/util/script/ScriptsRequiredDeclaration.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of NavalPlan - * - * Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e - * Desenvolvemento Tecnolóxico de Galicia - * Copyright (C) 2010-2011 Igalia, S.L. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package org.zkoss.ganttz.util.script; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface ScriptsRequiredDeclaration { - - public Class[] dependsOn() default {}; -} diff --git a/ganttzk/src/main/resources/i18n/es.po b/ganttzk/src/main/resources/i18n/es.po index 84017e998..71926ea2f 100644 --- a/ganttzk/src/main/resources/i18n/es.po +++ b/ganttzk/src/main/resources/i18n/es.po @@ -12,8 +12,8 @@ msgid "" msgstr "" "Project-Id-Version: 1.1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-11 18:16+0200\n" -"PO-Revision-Date: 2011-04-08 11:11+0200\n" +"POT-Creation-Date: 2011-06-06 22:45+0200\n" +"PO-Revision-Date: 2011-06-06 22:51+0200\n" "Last-Translator: Manuel Rego Casasnovas \n" "Language-Team: Spanish <>\n" "Language: es\n" @@ -43,20 +43,16 @@ msgstr "Inicio" msgid "Show reported hours" msgstr "Mostrar horas reportadas" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:78 -msgid "Show/Hide Progress" -msgstr "Mostrar/ocultar progreso" - #: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:92 msgid "by criteria" msgstr "por criterios" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:70 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:72 msgid "Show/Hide reported hours" -msgstr "Mostrar/ocultar horas reportardas" +msgstr "Mostrar/Ocultar horas reportardas" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:45 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:36 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:46 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:35 msgid "Zoom" msgstr "Zoom" @@ -72,6 +68,10 @@ msgstr "La dependencia especificada no está permitida" msgid "Set End-End" msgstr "Definir Fin-Fin" +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:80 +msgid "Show/Hide progress" +msgstr "Mostrar/Ocultar progreso" + #: ganttzk/src/main/java/org/zkoss/ganttz/data/resourceload/TimeLineRole.java:58 msgid "Task" msgstr "Tarea" @@ -84,7 +84,7 @@ msgstr "por recursos" msgid "Criterion" msgstr "Criterio" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:40 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:41 msgid "Print" msgstr "Imprimir" @@ -108,6 +108,10 @@ msgstr "filtrando por nombre" msgid "End" msgstr "Fin" +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:37 +msgid "Choosing Template" +msgstr "Selección de plantilla" + #: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java:243 msgid "changing zoom" msgstr "cambiando zoom" @@ -120,24 +124,24 @@ msgstr "Trimestre" msgid "None" msgstr "Ninguno" -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:44 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:43 msgid "Filter" msgstr "Filtro" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:67 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:69 msgid "Flatten/Unflatten tree" -msgstr "Aplanar/expandir árbol" +msgstr "Aplanar/Expandir árbol" #: ganttzk/src/main/java/org/zkoss/ganttz/data/resourceload/TimeLineRole.java:58 msgid "Project" msgstr "Proyecto" -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:51 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:50 msgid "Name filter" msgstr "Filtro por nombres" #: ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul:28 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:69 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:68 msgid "Name" msgstr "Nombre" @@ -145,9 +149,13 @@ msgstr "Nombre" msgid "Show progress" msgstr "Mostrar progreso" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:64 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:66 msgid "Expand/Collapse all" -msgstr "Expandir/plegar todo" +msgstr "Expandir/Plegar todo" + +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:56 +msgid "Show/Hide critical path" +msgstr "Mostrar/Ocultar camino crítico" #: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:36 msgid "Create Project" @@ -165,9 +173,9 @@ msgstr "mostrando criterios" msgid "Month" msgstr "Mes" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:61 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:63 msgid "Show/Hide resources" -msgstr "Mostrar/ocultar recursos" +msgstr "Mostrar/Ocultar recursos" #: ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java:246 msgid "Set End-Start" @@ -189,10 +197,6 @@ msgstr "Ocultar horas reportadas" msgid "Day" msgstr "Día" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:55 -msgid "Show/Hide Critical path" -msgstr "Mostrar/ocultar camino crítico" - #: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:142 msgid "showing resources" msgstr "mostrando recursos" @@ -201,16 +205,16 @@ msgstr "mostrando recursos" msgid "Load: {0}%" msgstr "Carga: {0}%" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:58 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:60 msgid "Show/Hide labels" -msgstr "Mostrar/ocultar etiquetas" +msgstr "Mostrar/Ocultar etiquetas" #: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/zoom/ZoomLevel.java:97 msgid "Hour" msgstr "Hora" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:114 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:92 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:116 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:91 msgid "Graphics" msgstr "Gráficas" @@ -234,7 +238,7 @@ msgstr "Mostrar todos los elementos" msgid "All" msgstr "Todos" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:38 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:39 msgid "Refresh" msgstr "Actualizar" diff --git a/ganttzk/src/main/resources/i18n/gl.po b/ganttzk/src/main/resources/i18n/gl.po index 1859e9d48..0868b2fa7 100644 --- a/ganttzk/src/main/resources/i18n/gl.po +++ b/ganttzk/src/main/resources/i18n/gl.po @@ -3,7 +3,7 @@ # Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e # Desenvolvemento Tecnolóxico de Galicia # Copyright (C) 2010-2011 Igalia, S.L. -# This file is distributed under the same license as the PACKAGE package. +# This file is distributed under the same license as the NavalPlan package. # Igalia , 2009. # Jacobo Aragunde Pérez , 2010. # Manuel Rego Casasnovas , 2010, 2011. @@ -12,8 +12,8 @@ msgid "" msgstr "" "Project-Id-Version: 1.1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-11 18:16+0200\n" -"PO-Revision-Date: 2011-04-08 11:11+0200\n" +"POT-Creation-Date: 2011-06-06 22:45+0200\n" +"PO-Revision-Date: 2011-06-06 22:50+0200\n" "Last-Translator: Manuel Rego Casasnovas \n" "Language-Team: Galician <>\n" "Language: gl\n" @@ -43,20 +43,16 @@ msgstr "Inicio" msgid "Show reported hours" msgstr "Mostrar horas reportadas" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:78 -msgid "Show/Hide Progress" -msgstr "Mostrar/ocultar progreso" - #: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:92 msgid "by criteria" msgstr "por criterios" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:70 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:72 msgid "Show/Hide reported hours" -msgstr "Mostrar/ocultar horas reportadas" +msgstr "Mostrar/Ocultar horas reportadas" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:45 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:36 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:46 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:35 msgid "Zoom" msgstr "Zoom" @@ -72,6 +68,10 @@ msgstr "A dependencia especificada non está permitida" msgid "Set End-End" msgstr "Definir Fin-Fin" +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:80 +msgid "Show/Hide progress" +msgstr "Mostrar/Ocultar progreso" + #: ganttzk/src/main/java/org/zkoss/ganttz/data/resourceload/TimeLineRole.java:58 msgid "Task" msgstr "Tarefa" @@ -84,7 +84,7 @@ msgstr "por recursos" msgid "Criterion" msgstr "Criterio" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:40 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:41 msgid "Print" msgstr "Imprimir" @@ -108,6 +108,10 @@ msgstr "filtrando por nome" msgid "End" msgstr "Fin" +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:37 +msgid "Choosing Template" +msgstr "Selección de modelo" + #: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java:243 msgid "changing zoom" msgstr "cambiando zoom" @@ -120,24 +124,24 @@ msgstr "Trimestre" msgid "None" msgstr "Ningún" -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:44 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:43 msgid "Filter" msgstr "Filtro" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:67 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:69 msgid "Flatten/Unflatten tree" -msgstr "Aplanar/expandir árbore" +msgstr "Aplanar/Expandir árbore" #: ganttzk/src/main/java/org/zkoss/ganttz/data/resourceload/TimeLineRole.java:58 msgid "Project" msgstr "Proxecto" -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:51 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:50 msgid "Name filter" msgstr "Filtro por nomes" #: ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul:28 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:69 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:68 msgid "Name" msgstr "Nome" @@ -145,9 +149,13 @@ msgstr "Nome" msgid "Show progress" msgstr "Mostrar progreso" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:64 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:66 msgid "Expand/Collapse all" -msgstr "Expandir/pregar todo" +msgstr "Expandir/Pregar todo" + +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:56 +msgid "Show/Hide critical path" +msgstr "Mostrar/Ocultar camiño crítico" #: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:36 msgid "Create Project" @@ -165,9 +173,9 @@ msgstr "mostrando criterios" msgid "Month" msgstr "Mes" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:61 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:63 msgid "Show/Hide resources" -msgstr "Mostrar/ocultar recursos" +msgstr "Mostrar/Ocultar recursos" #: ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java:246 msgid "Set End-Start" @@ -189,10 +197,6 @@ msgstr "Ocultar horas reportadas" msgid "Day" msgstr "Día" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:55 -msgid "Show/Hide Critical path" -msgstr "Ocultar/ocultar camiño crítico" - #: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:142 msgid "showing resources" msgstr "mostrando recursos" @@ -201,16 +205,16 @@ msgstr "mostrando recursos" msgid "Load: {0}%" msgstr "Carga: {0}%" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:58 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:60 msgid "Show/Hide labels" -msgstr "Mostrar/ocultar etiquetas" +msgstr "Mostrar/Ocultar etiquetas" #: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/zoom/ZoomLevel.java:97 msgid "Hour" msgstr "Hora" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:114 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:92 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:116 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:91 msgid "Graphics" msgstr "Gráficas" @@ -234,7 +238,7 @@ msgstr "Mostrar tódolos elementos" msgid "All" msgstr "Todos" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:38 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:39 msgid "Refresh" msgstr "Actualizar" diff --git a/ganttzk/src/main/resources/i18n/keys.pot b/ganttzk/src/main/resources/i18n/keys.pot index 21c39939f..f04e9367c 100644 --- a/ganttzk/src/main/resources/i18n/keys.pot +++ b/ganttzk/src/main/resources/i18n/keys.pot @@ -10,9 +10,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 1.1.0\n" +"Project-Id-Version: 1.1.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-11 18:16+0200\n" +"POT-Creation-Date: 2011-06-06 22:45+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -42,20 +42,16 @@ msgstr "" msgid "Show reported hours" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:78 -msgid "Show/Hide Progress" -msgstr "" - #: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:92 msgid "by criteria" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:70 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:72 msgid "Show/Hide reported hours" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:45 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:36 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:46 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:35 msgid "Zoom" msgstr "" @@ -71,6 +67,10 @@ msgstr "" msgid "Set End-End" msgstr "" +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:80 +msgid "Show/Hide progress" +msgstr "" + #: ganttzk/src/main/java/org/zkoss/ganttz/data/resourceload/TimeLineRole.java:58 msgid "Task" msgstr "" @@ -83,7 +83,7 @@ msgstr "" msgid "Criterion" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:40 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:41 msgid "Print" msgstr "" @@ -107,6 +107,10 @@ msgstr "" msgid "End" msgstr "" +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:37 +msgid "Choosing Template" +msgstr "" + #: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java:243 msgid "changing zoom" msgstr "" @@ -119,11 +123,11 @@ msgstr "" msgid "None" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:44 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:43 msgid "Filter" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:67 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:69 msgid "Flatten/Unflatten tree" msgstr "" @@ -131,12 +135,12 @@ msgstr "" msgid "Project" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:51 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:50 msgid "Name filter" msgstr "" #: ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul:28 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:69 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:68 msgid "Name" msgstr "" @@ -144,10 +148,14 @@ msgstr "" msgid "Show progress" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:64 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:66 msgid "Expand/Collapse all" msgstr "" +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:56 +msgid "Show/Hide critical path" +msgstr "" + #: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:36 msgid "Create Project" msgstr "" @@ -164,7 +172,7 @@ msgstr "" msgid "Month" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:61 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:63 msgid "Show/Hide resources" msgstr "" @@ -188,10 +196,6 @@ msgstr "" msgid "Day" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:55 -msgid "Show/Hide Critical path" -msgstr "" - #: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:142 msgid "showing resources" msgstr "" @@ -200,7 +204,7 @@ msgstr "" msgid "Load: {0}%" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:58 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:60 msgid "Show/Hide labels" msgstr "" @@ -208,8 +212,8 @@ msgstr "" msgid "Hour" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:114 -#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:92 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:116 +#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:91 msgid "Graphics" msgstr "" @@ -233,7 +237,7 @@ msgstr "" msgid "All" msgstr "" -#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:38 +#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:39 msgid "Refresh" msgstr "" diff --git a/ganttzk/src/main/resources/metainfo/zk/lang-addon.xml b/ganttzk/src/main/resources/metainfo/zk/lang-addon.xml index 44f071ab3..65c70da24 100755 --- a/ganttzk/src/main/resources/metainfo/zk/lang-addon.xml +++ b/ganttzk/src/main/resources/metainfo/zk/lang-addon.xml @@ -14,6 +14,7 @@ planner org.zkoss.ganttz.Planner + ganttz.Planner ~./ganttz/zul/plannerLayout.zul @@ -64,9 +67,11 @@ ganttpanel org.zkoss.ganttz.GanttPanel + ganttz.GanttPanel default - ~./ganttz/ganttpanel.dsp + + mold/gantt-panel.js @@ -74,9 +79,11 @@ resourceload org.zkoss.ganttz.resourceload.ResourceLoadComponent + ganttz.resourceload.ResourceLoadComponent default - ~./ganttz/resourceload/resourceload.dsp + mold/resource-load-component.js + @@ -84,27 +91,33 @@ taskRow org.zkoss.ganttz.TaskRow + ganttz.TaskRow default - ~./ganttz/row.dsp + + mold/task-row.js task org.zkoss.ganttz.TaskComponent + ganttz.TaskComponent default - ~./ganttz/task.dsp + + mold/task-component.js milestone org.zkoss.ganttz.MilestoneComponent + ganttz.Milestone default - ~./ganttz/milestone.dsp + + mold/milestone.js @@ -113,27 +126,33 @@ taskcontainer org.zkoss.ganttz.TaskContainerComponent + ganttz.TaskContainerComponent default - ~./ganttz/taskcontainer.dsp + mold/task-container.js + tasklist org.zkoss.ganttz.TaskList + ganttz.TaskList default - ~./ganttz/tasklist.dsp + + mold/task-list.js dependencylist org.zkoss.ganttz.DependencyList + ganttz.DependencyList default - ~./ganttz/dependencylist.dsp + + mold/dependency-list.js @@ -141,9 +160,11 @@ dependency org.zkoss.ganttz.DependencyComponent + ganttz.DependencyComponent default - ~./ganttz/dependency.dsp + mold/dependency-component.js + @@ -151,7 +172,8 @@ timetracker org.zkoss.ganttz.timetracker.TimeTrackerComponent - ~./ganttz/zul/timetracker/timetracker.zul + ganttz.TimeTracker + ~./ganttz/zul/timetracker/timetracker.zul @@ -160,10 +182,4 @@ ~./ganttz/zul/timetracker/timetrackedtable.zul - - scripts - org.zkoss.ganttz.util.script.ScriptsComponent - ~./ganttz/zul/scripts.zul - - diff --git a/ganttzk/src/main/resources/web/ganttz/zul/leftPane.zul b/ganttzk/src/main/resources/web/ganttz/zul/leftPane.zul index 9c56ddef4..8c1349ad4 100644 --- a/ganttzk/src/main/resources/web/ganttz/zul/leftPane.zul +++ b/ganttzk/src/main/resources/web/ganttz/zul/leftPane.zul @@ -19,7 +19,7 @@ along with this program. If not, see . --> - - - + +
+
\ No newline at end of file diff --git a/ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul b/ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul index 0833e2c85..c8bfcfd2b 100644 --- a/ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul +++ b/ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul @@ -19,15 +19,15 @@ along with this program. If not, see . --> -
- - - + + + -
\ No newline at end of file +
diff --git a/ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul b/ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul index cda703cfa..16e6f6396 100644 --- a/ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul +++ b/ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul @@ -18,102 +18,99 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - - - - - + + + - + + + + - + + + - +