From: <ptr...@us...> - 2009-12-10 14:43:04
|
Revision: 1342 http://j-trac.svn.sourceforge.net/j-trac/?rev=1342&view=rev Author: ptrthomas Date: 2009-12-10 14:42:53 +0000 (Thu, 10 Dec 2009) Log Message: ----------- moving to maven-ant-tasks instead of custom maven plugin, refer http://is.gd/5hVQ7 - jetty start targets seem ok, others need more testing, also the "ant all" target works, can be used for pre-release testing, netbeans project files have been removed, developers can open project using maven support from now on Modified Paths: -------------- trunk/jtrac/build.xml trunk/jtrac/pom.xml Added Paths: ----------- trunk/jtrac/etc/maven-ant-tasks.jar Removed Paths: ------------- trunk/jtrac/nbproject/ Modified: trunk/jtrac/build.xml =================================================================== --- trunk/jtrac/build.xml 2009-12-09 13:28:27 UTC (rev 1341) +++ trunk/jtrac/build.xml 2009-12-10 14:42:53 UTC (rev 1342) @@ -7,10 +7,36 @@ findbugs.home=C:/peter/opt/findbugs-1.3.1 [optional, for running findbugs] --> - <property file="build.properties"/> - <property file="build-deps.properties"/> + <property file="build.properties"/> <property name="war.name" value="jtrac"/> + <!-- ========================= MAVEN ============================ --> + + <target name="mvn-init" unless="mvn.inited" xmlns:artifact="urn:maven-artifact-ant"> + <property name="mvn.inited" value="true"/> + <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" + classpath="etc/maven-ant-tasks.jar"/> + <condition property="maven.repo.local" value="${maven.repo.local}" else="${user.home}/.m2/repository"> + <isset property="maven.repo.local"/> + </condition> + <artifact:localRepository id="local.repository" path="${maven.repo.local}"/> + <artifact:pom file="pom.xml" id="maven.project"/> + <artifact:dependencies pathId="compile.classpath" filesetId="compile.fileset" useScope="compile"> + <pom refid="maven.project"/> + <localRepository refid="local.repository"/> + </artifact:dependencies> + <artifact:dependencies pathId="test.classpath" filesetId="test.fileset" useScope="test"> + <pom refid="maven.project"/> + <localRepository refid="local.repository"/> + </artifact:dependencies> + <artifact:dependencies pathId="runtime.classpath" filesetId="runtime.fileset" useScope="runtime"> + <pom refid="maven.project"/> + <localRepository refid="local.repository"/> + </artifact:dependencies> + </target> + + <!-- ============================= BUILD =============================== --> + <target name="clean"> <delete includeemptydirs="true" failonerror="false"> <fileset dir="target"/> @@ -25,7 +51,7 @@ </delete> </target> - <target name="compile"> + <target name="compile" depends="mvn-init"> <mkdir dir="target/classes"/> <property name="debug" value="true"/> <!-- @@ -33,7 +59,7 @@ <isset property="production.mode"/> </condition> --> - <javac srcdir="src/main/java" destdir="target/classes" debug="${debug}" classpath="${test.jars}" target="1.5"> + <javac srcdir="src/main/java" destdir="target/classes" debug="${debug}" classpathref="compile.classpath" target="1.5"> <!-- <compilerarg value="-Xlint:unchecked"/> --> <compilerarg value="-Xlint:deprecation"/> </javac> @@ -73,9 +99,9 @@ <target name="hbm-export" depends="compile"> <input message="Hibernate Dialect:" addproperty="dialect"/> <java classname="org.hibernate.tool.hbm2ddl.SchemaExport" fork="true"> - <classpath> - <path path="${test.jars}"/> - <path path="target/classes"/> + <classpath> + <path path="target/classes"/> + <path refid="test.classpath"/> </classpath> <jvmarg value="-Dhibernate.dialect=${dialect}"/> <arg value="--text"/> @@ -87,8 +113,7 @@ <!-- cannot be used when jtrac application is connected --> <target name="hsqldb-manager"> - <java classname="org.hsqldb.util.DatabaseManagerSwing" fork="true"> - <classpath path="${test.jars}"/> + <java classname="org.hsqldb.util.DatabaseManagerSwing" fork="true" classpathref="test.classpath"> <arg line="-url jdbc:hsqldb:file:home/db/jtrac"/> </java> </target> @@ -140,14 +165,8 @@ <exclude name="doc/**"/> </fileset> </delete> - </target> + </target> - <target name="dist-lib"> - <copy todir="lib"> - <fileset dir="${m2.repo}" includes="${all.jars}" casesensitive="false"/> - </copy> - </target> - <target name="dist-jtrac-src"> <mkdir dir="target"/> <zip destfile="target/jtrac-src.zip"> @@ -158,32 +177,21 @@ </zip> </target> - <target name="mvn-export"> - <copy todir="lib"> - <fileset dir="${m2.repo}" includes="${all.jars}" casesensitive="false"/> - </copy> - </target> - <!-- ========================== TEST ============================ --> - <target name="all" depends="clean, compile-test"> - <checkstyle-macro/> - <style in="target/reports/checkstyle.xml" out="target/reports/checkstyle.html" - style="etc/checkstyle-noframes-sorted.xsl"/> - <antcall target="test-coverage"/> - </target> + <target name="all" depends="clean, compile-test, checkstyle, test-coverage"/> <target name="compile-test" depends="compile"> <mkdir dir="target/test-classes"/> <javac srcdir="src/test/java" destdir="target/test-classes" debug="true" target="1.5"> <classpath> <path path="target/classes"/> - <path path="${test.jars}"/> + <path refid="test.classpath"/> </classpath> </javac> </target> - <target name="test-coverage" depends="compile-test"> + <target name="test-coverage" depends="emma-init, compile-test"> <test-macro emmaEnabled="true"/> <junitreport todir="target/reports"> <fileset dir="target/reports"> @@ -213,7 +221,7 @@ <path id="test-classpath"> <path path="target/classes"/> <path path="target/test-classes"/> - <path path="${test.jars}"/> + <path refid="test.classpath"/> </path> <nbjpdastart name="${files}" addressproperty="jpda.address" transport="dt_socket"> <classpath refid="test-classpath"/> @@ -236,7 +244,7 @@ <path id="test-classpath"> <path path="target/classes"/> <path path="target/test-classes"/> - <path path="${test.jars}"/> + <path refid="test.classpath"/> </path> <junit fork="true" dir="." tempdir="target"> <classpath refid="test-classpath"/> @@ -248,7 +256,13 @@ </junit> </target> - <taskdef resource="emma_ant.properties" classpath="${emma.jars}"/> + <target name="emma-init" depends="mvn-init" xmlns:artifact="urn:maven-artifact-ant"> + <artifact:dependencies pathId="emma.classpath"> + <dependency groupId="emma" artifactId="emma" version="2.0.5312"/> + <dependency groupId="emma" artifactId="emma_ant" version="2.0.5312"/> + </artifact:dependencies> + <taskdef resource="emma_ant.properties" classpathref="emma.classpath"/> + </target> <macrodef name="test-macro"> <attribute name="includes" default="**/*Test.java"/> @@ -272,8 +286,8 @@ <path path="target/instr-classes"/> <path path="target/classes"/> <path path="target/test-classes"/> - <path path="${test.jars}"/> - <path path="${emma.jars}"/> + <path refid="test.classpath"/> + <path refid="emma.classpath"/> </classpath> <jvmarg value="-Demma.coverage.out.file=${basedir}/target/coverage.emma"/> <jvmarg value="-Demma.coverage.out.merge=true"/> @@ -296,18 +310,28 @@ <!-- ======================= CHECKSTYLE ========================= --> - <taskdef resource="checkstyletask.properties" classpath="${checkstyle.jars}"/> + <target name="checkstyle-init" depends="mvn-init" xmlns:artifact="urn:maven-artifact-ant"> + <artifact:dependencies pathId="checkstyle.classpath"> + <dependency groupId="checkstyle" artifactId="checkstyle" version="4.3"/> + </artifact:dependencies> + <taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath"/> + </target> - <target name="checkstyle"> + <target name="checkstyle" depends="checkstyle-init"> <checkstyle-macro/> + <style + in="target/reports/checkstyle.xml" + out="target/reports/checkstyle.html" + style="etc/checkstyle-noframes-sorted.xsl"/> + </target> + + <target name="checkstyle-dump" depends="checkstyle"> <concat> <fileset dir="target/reports" includes="checkstyle.txt"/> </concat> - <style in="target/reports/checkstyle.xml" out="target/reports/checkstyle.html" - style="etc/checkstyle-noframes-sorted.xsl"/> </target> - <target name="checkstyle-single" depends="compile"> + <target name="checkstyle-single" depends="compile, checkstyle-init"> <!-- files property expected from netbeans --> <fail unless="files">no files selected</fail> <checkstyle-macro files="${files}"/> @@ -327,7 +351,7 @@ <!-- <fileset dir="src/main/resources" includes="@{files}"/> --> <classpath> <path path="target/classes"/> - <path path="${test.jars}"/> + <path refid="test.classpath"/> </classpath> <formatter type="xml" toFile="target/reports/checkstyle.xml"/> <formatter type="plain" toFile="target/reports/checkstyle.txt"/> @@ -338,8 +362,7 @@ <!-- ========================= FINDBUGS ========================= --> <target name="findbugs" depends="compile"> - <java classname="bsh.Interpreter" fork="true"> - <classpath path="${test.jars}"/> + <java classname="bsh.Interpreter" fork="true" classpathref="test.classpath"> <arg line="etc/findbugs-project-gen.bsh"/> </java> <path id="findbugs.classpath"> @@ -352,20 +375,25 @@ </target> <target name="findbugs-console-dump"> - <java classname="bsh.Interpreter" fork="true"> - <classpath path="${test.jars}"/> + <java classname="bsh.Interpreter" fork="true" classpathref="test.classpath"> <arg line="etc/findbugs-console-dump.bsh"/> </java> </target> <!-- =========================== PMD ============================ --> - <target name="pmd"> + <target name="pmd-init" depends="mvn-init" xmlns:artifact="urn:maven-artifact-ant"> + <artifact:dependencies pathId="pmd.classpath"> + <dependency groupId="pmd" artifactId="pmd" version="4.1.1"/> + </artifact:dependencies> + </target> + + <target name="pmd" depends="pmd-init"> <mkdir dir="target/reports"/> <java classname="net.sourceforge.pmd.PMD" fork="true" output="target/reports/pmd.xml"> <classpath> - <path path="${pmd.jars}"/> - <path path="${test.jars}"/> + <path refid="pmd.classpath"/> + <path refid="test.classpath"/> </classpath> <jvmarg value="-Xmx512m"/> <arg value="src/main/java"/> @@ -375,18 +403,17 @@ </target> <target name="pmd-console-dump"> - <java classname="bsh.Interpreter" fork="true"> - <classpath path="${test.jars}"/> + <java classname="bsh.Interpreter" fork="true" classpathref="test.classpath"> <arg line="etc/pmd-console-dump.bsh"/> </java> </target> - <target name="pmd-cpd"> + <target name="pmd-cpd" depends="pmd-init"> <mkdir dir="target/reports"/> <java classname="net.sourceforge.pmd.cpd.CPD" fork="true"> <classpath> - <path path="${pmd.jars}"/> - <path path="${test.jars}"/> + <path refid="pmd.classpath"/> + <path refid="test.classpath"/> </classpath> <jvmarg value="-Xmx512m"/> <arg line="--minimum-tokens 100"/> @@ -415,7 +442,13 @@ <fail if="abort">User aborted.</fail> </target> - <target name="jetty-setup" depends="war-exploded"> + <target name="jetty-setup" depends="war-exploded" xmlns:artifact="urn:maven-artifact-ant"> + <artifact:dependencies filesetId="jetty.jars"> + <dependency groupId="org.mortbay.jetty" artifactId="jetty" version="6.1.1"/> + </artifact:dependencies> + <artifact:dependencies filesetId="jetty.start"> + <dependency groupId="org.mortbay.jetty" artifactId="start" version="6.1.1"/> + </artifact:dependencies> <copy todir="target/jetty/lib" flatten="true"> <fileset dir="${m2.repo}" includes="${jetty.jars}" casesensitive="false"/> </copy> @@ -546,7 +579,7 @@ <!-- ========================= SELENIUM ============================ --> <target name="selenium-start"> - <java classname="org.openqa.selenium.server.SeleniumServer" fork="true" classpath="${test.jars}"/> + <java classname="org.openqa.selenium.server.SeleniumServer" fork="true" classpathref="test.classpath"/> </target> <target name="selenium-stop"> @@ -576,7 +609,8 @@ <sourcepath> <path path="src/main/java"/> </sourcepath> - </nbjpdaconnect> + </nbjpdaconnect> + <nbbrowse url="http://localhost:8080/jtrac"/> </target> <!-- target for NetBeans Profiler on Windows --> @@ -584,6 +618,6 @@ <property name="nbprof.home" value="${netbeans.home}/../profiler2/lib"/> <property name="agent.path" value="${nbprof.home}/deployed/jdk15/windows/profilerinterface.dll=${nbprof.home},5140"/> <jetty-start arg1="-agentpath:${agent.path}" arg2="-Xmx512m" wicketConfig=""/> - </target> + </target> </project> Added: trunk/jtrac/etc/maven-ant-tasks.jar =================================================================== (Binary files differ) Property changes on: trunk/jtrac/etc/maven-ant-tasks.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2009-12-09 13:28:27 UTC (rev 1341) +++ trunk/jtrac/pom.xml 2009-12-10 14:42:53 UTC (rev 1342) @@ -5,7 +5,7 @@ <groupId>info.jtrac</groupId> <artifactId>jtrac</artifactId> <packaging>war</packaging> - <version>2.1.0</version> + <version>2.2.0</version> <name>JTrac</name> <description> JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields @@ -53,13 +53,19 @@ <url>http://ptrthomas.wordpress.com</url> <timezone>+5.5</timezone> </developer> + <developer> + <name>Manfred Wolff</name> + <id>manfredwolff</id> + <url>http://pointers.de</url> + <timezone>+1</timezone> + </developer> </developers> <repositories> <repository> <id>openqa.org</id> <name>selenium snapshot</name> - <url>http://nexus.openqa.org/service/local/repositories/releases/content</url> + <url>http://nexus.openqa.org/service/local/repositories/releases/content</url> </repository> </repositories> @@ -462,79 +468,8 @@ </systemProperties> </configuration> </plugin> - --> - <!-- - - the info.jtrac/maven-antprops-plugin below - - is a custom plugin to make dependencies available - - to an Ant build and then some, comment out if required - --> + --> <plugin> - <groupId>info.jtrac</groupId> - <artifactId>maven-antprops-plugin</artifactId> - <configuration> - <extraPaths> - <extraPath> - <name>checkstyle.jars</name> - <dependencies> - <dependency> - <groupId>checkstyle</groupId> - <artifactId>checkstyle</artifactId> - <version>4.3</version> - </dependency> - </dependencies> - </extraPath> - <extraPath> - <name>emma.jars</name> - <dependencies> - <dependency> - <groupId>emma</groupId> - <artifactId>emma</artifactId> - <version>2.0.5312</version> - </dependency> - <dependency> - <groupId>emma</groupId> - <artifactId>emma_ant</artifactId> - <version>2.0.5312</version> - </dependency> - </dependencies> - </extraPath> - <extraPath> - <name>pmd.jars</name> - <dependencies> - <dependency> - <groupId>pmd</groupId> - <artifactId>pmd</artifactId> - <version>4.1.1</version> - <resolve>false</resolve> - </dependency> - </dependencies> - </extraPath> - <extraPath> - <fileset>true</fileset> - <name>jetty.jars</name> - <dependencies> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty</artifactId> - <version>6.1.1</version> - </dependency> - </dependencies> - </extraPath> - <extraPath> - <fileset>true</fileset> - <name>jetty.start</name> - <dependencies> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>start</artifactId> - <version>6.1.1</version> - </dependency> - </dependencies> - </extraPath> - </extraPaths> - </configuration> - </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2010-05-11 14:07:01
|
Revision: 1349 http://j-trac.svn.sourceforge.net/j-trac/?rev=1349&view=rev Author: manfredwolff Date: 2010-05-11 14:06:52 +0000 (Tue, 11 May 2010) Log Message: ----------- Fixing #2974643 (new option for mail.smtp.localhost) including the message files (default, English, German). Also updating the documentation with some releasenotes for 2.2.0 and the new setting screen. Modified Paths: -------------- trunk/jtrac/doc/src/images/settings.png trunk/jtrac/doc/src/index.xml trunk/jtrac/src/main/java/info/jtrac/domain/Config.java trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java trunk/jtrac/src/main/resources/messages.properties trunk/jtrac/src/main/resources/messages_de.properties trunk/jtrac/src/main/resources/messages_en.properties Modified: trunk/jtrac/doc/src/images/settings.png =================================================================== (Binary files differ) Modified: trunk/jtrac/doc/src/index.xml =================================================================== --- trunk/jtrac/doc/src/index.xml 2010-05-11 11:51:04 UTC (rev 1348) +++ trunk/jtrac/doc/src/index.xml 2010-05-11 14:06:52 UTC (rev 1349) @@ -11,12 +11,16 @@ <bookinfo> <title>JTrac</title> <subtitle>User / Developer Guide</subtitle> - <releaseinfo>2.1.0</releaseinfo> + <releaseinfo>2.2.0</releaseinfo> <authorgroup> <author> <firstname>Peter</firstname> <surname>Thomas</surname> </author> + <author> + <firstname>Manfred</firstname> + <surname>Wolff</surname> + </author> </authorgroup> </bookinfo> @@ -84,6 +88,30 @@ upgrade. </para> </sect1> + + <sect1 id="introduction-releasenotes-2_2"> + <title>Release Notes: Version 2.2.0</title> + <para> + There are no database changes between version 2.1.0 and 2.2.0. Instructions on how to upgrade are + available in the "<link linkend="upgrading">upgrading</link>" section of this document. + </para> + <para> + There where some minor changes and bugfixes: + <itemizedlist> + <listitem> + <para>It is possible to configure an individual header and an individual logo for your own JTrac.</para> + </listitem> + <listitem> + <para>Errors that were occured because of missing language ressources are fixed.</para> + </listitem> + <listitem> + <para>Some email-issues e.g. sending duplicate mails are fixed.</para> + </listitem> + </itemizedlist> + For details see the <ulink url="https://sourceforge.net/projects/j-trac/">different tracker at + the sourceforge website.</ulink> + </para> + </sect1> </chapter> <chapter id="features"> @@ -757,7 +785,16 @@ <para> JTrac also can lookup and use a JNDI mail session (javax.mail.Session) if required. If you provide a JNDI name, JTrac will ignore the SMTP server details provided. - </para> + </para> + + <para> + JTrac provides also other settings for an individual Headline (jtrac.header.text) and an + individual logo on the right side (jtrac.header.text). If no logo is set the original + JTrac logo is shown. If the jtrac.edit.item configuration item is set to true people may + edit their own items while no change is happens (editable item up to the first history entry). + Admins are always able to change the original item text. + </para> + </sect1> <sect1 id="installation-war"> <title>Using only the WAR file</title> Modified: trunk/jtrac/src/main/java/info/jtrac/domain/Config.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2010-05-11 11:51:04 UTC (rev 1348) +++ trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2010-05-11 14:06:52 UTC (rev 1349) @@ -42,6 +42,7 @@ PARAMS.add("mail.server.starttls.enable"); PARAMS.add("mail.subject.prefix"); PARAMS.add("mail.from"); + PARAMS.add("mail.smtp.localhost"); PARAMS.add("mail.session.jndiname"); PARAMS.add("jtrac.url.base"); PARAMS.add("jtrac.header.picture"); Modified: trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java 2010-05-11 11:51:04 UTC (rev 1348) +++ trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java 2010-05-11 14:06:52 UTC (rev 1349) @@ -268,7 +268,8 @@ logger.warn("'mail.server.host' config is null, mail sender not initialized"); return; } - String port = config.get("mail.server.port"); + String port = config.get("mail.server.port"); + String localhost = config.get("mail.smtp.localhost"); from = config.get("mail.from"); prefix = config.get("mail.subject.prefix"); String userName = config.get("mail.server.username"); @@ -289,17 +290,30 @@ sender = new JavaMailSenderImpl(); sender.setHost(host); sender.setPort(p); + Properties props = null; + if (userName != null) { // authentication requested - Properties props = new Properties(); + props = new Properties(); props.put("mail.smtp.auth", "true"); if (startTls != null && startTls.toLowerCase().equals("true")) { props.put("mail.smtp.starttls.enable", "true"); } - sender.setJavaMailProperties(props); sender.setUsername(userName); sender.setPassword(password); } + + if (localhost != null) { + if (props == null) { + props = new Properties(); + } + props.put("mail.smtp.localhost", localhost); + } + + if (props != null) { + sender.setJavaMailProperties(props); + } + logger.info("email sender initialized from config: host = '" + host + "', port = '" + p + "'"); } Modified: trunk/jtrac/src/main/resources/messages.properties =================================================================== --- trunk/jtrac/src/main/resources/messages.properties 2010-05-11 11:51:04 UTC (rev 1348) +++ trunk/jtrac/src/main/resources/messages.properties 2010-05-11 14:06:52 UTC (rev 1349) @@ -185,6 +185,7 @@ config.mail.subject.prefix = Text that will be prefixed to the e-mail subject-line (default [jtrac]) config.mail.session.jndiname = javax.mail.Session JNDI name - if present, this will be used instead of the SMTP server details above config.mail.from = When generating e-mail, this will be used as the 'from' address +config.mail.smtp.localhost = Override for the HELO setting of very strict SMPT relays config.jtrac.url.base = Base URL of your JTrac installation ( e.g. http://myserver/jtrac ) required for links in the e-mails to work config.jtrac.header.picture = Individual header picture config.jtrac.header.text = Individual header text Modified: trunk/jtrac/src/main/resources/messages_de.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_de.properties 2010-05-11 11:51:04 UTC (rev 1348) +++ trunk/jtrac/src/main/resources/messages_de.properties 2010-05-11 14:06:52 UTC (rev 1349) @@ -184,6 +184,7 @@ config.mail.subject.prefix = Text der dem eMail Betreff vorangestellt wird (Default [jtrac]) config.mail.session.jndiname = javax.mail.Session JNDI Name - Wenn vorhanden wird diese Verbindung statt dem SMTP Server benutzt config.mail.from = Wir in eMails als Absenderadresse gesetzt +config.mail.smtp.localhost = \xDCberladen der HELO Settings f\xFCr sehr strikte SMPT Server config.jtrac.url.base = URL dieser Installation ( zB. http://myserver/jtrac ) wird ben\u00F6tigt f\u00FCr Links in den eMails config.jtrac.header.picture = Inidividuelles Bild config.jtrac.header.text = Individueller Text Modified: trunk/jtrac/src/main/resources/messages_en.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_en.properties 2010-05-11 11:51:04 UTC (rev 1348) +++ trunk/jtrac/src/main/resources/messages_en.properties 2010-05-11 14:06:52 UTC (rev 1349) @@ -185,6 +185,7 @@ config.mail.subject.prefix = Text that will be prefixed to the e-mail subject-line (default [jtrac]) config.mail.session.jndiname = javax.mail.Session JNDI name - if present, this will be used instead of the SMTP server details above config.mail.from = When generating e-mail, this will be used as the 'from' address +config.mail.smtp.localhost = Override for the HELO setting of very strict SMPT relays config.jtrac.url.base = Base URL of your JTrac installation ( e.g. http://myserver/jtrac ) required for links in the e-mails to work config.jtrac.header.picture = Individual header picture config.jtrac.header.text = Individual header text This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2010-08-31 06:27:13
|
Revision: 1354 http://j-trac.svn.sourceforge.net/j-trac/?rev=1354&view=rev Author: manfredwolff Date: 2010-08-31 06:27:07 +0000 (Tue, 31 Aug 2010) Log Message: ----------- #3054238: A user may submit a post (a new issue or update to an existing issue) and that post may be recorded as being posted by a different use. Updated to Wicket 1.3.7 with impact in the signature in ReloadingWicketFilter.java. The tests has not shown any impact. Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/wicket/devmode/ReloadingWicketFilter.java Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2010-08-31 06:22:26 UTC (rev 1353) +++ trunk/jtrac/pom.xml 2010-08-31 06:27:07 UTC (rev 1354) @@ -330,12 +330,12 @@ <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket</artifactId> - <version>1.3.1</version> + <version>1.3.7</version> </dependency> <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-extensions</artifactId> - <version>1.3.1</version> + <version>1.3.7</version> </dependency> <dependency> <groupId>org.slf4j</groupId> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/devmode/ReloadingWicketFilter.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/devmode/ReloadingWicketFilter.java 2010-08-31 06:22:26 UTC (rev 1353) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/devmode/ReloadingWicketFilter.java 2010-08-31 06:27:07 UTC (rev 1354) @@ -56,7 +56,7 @@ } @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) + public boolean doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (reloadingClassLoader.hasChanges()) { logger.debug("changes to reloadable classes detected, reloading..."); @@ -64,7 +64,7 @@ // request.getSession().invalidate(); super.init(filterConfig); } - super.doGet(request, response); + return super.doGet(request, response); } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2010-12-19 20:19:37
|
Revision: 1362 http://j-trac.svn.sourceforge.net/j-trac/?rev=1362&view=rev Author: magog96 Date: 2010-12-19 20:19:30 +0000 (Sun, 19 Dec 2010) Log Message: ----------- Some cleanup (basically did an rtrim on the lines to remove spaces and the end of lines) Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/webapp/WEB-INF/applicationContext.xml Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2010-10-05 11:54:21 UTC (rev 1361) +++ trunk/jtrac/pom.xml 2010-12-19 20:19:30 UTC (rev 1362) @@ -1,26 +1,25 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> <groupId>info.jtrac</groupId> <artifactId>jtrac</artifactId> <packaging>war</packaging> <version>2.2.0</version> - <name>JTrac</name> + <name>JTrac</name> <description> JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields and drop-downs. Features include customizable workflow, field level permissions, e-mail integration, file attachments and a detailed history view. </description> <url>http://jtrac.info</url> - + <licenses> <license> <name>The Apache Software License, Version 2.0</name> <url>license.txt</url> </license> </licenses> - + <scm> <connection>scm:svn:https://j-trac.svn.sourceforge.net/svnroot/j-trac/trunk/jtrac</connection> <url>http://j-trac.svn.sourceforge.net/viewvc/j-trac/trunk/jtrac/</url> @@ -31,9 +30,9 @@ <id>website</id> <url>scp://shell.sourceforge.net/home/groups/j/j-/j-trac/htdocs</url> </site> - </distributionManagement> + </distributionManagement> - <mailingLists> + <mailingLists> <mailingList> <name>JTrac Mailing List</name> <subscribe>https://lists.sourceforge.net/lists/listinfo/j-trac-users</subscribe> @@ -42,32 +41,32 @@ <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=j-trac-users</archive> <otherArchives> <otherArchive>http://www.nabble.com/j-trac-users-f20276.html</otherArchive> - </otherArchives> - </mailingList> - </mailingLists> + </otherArchives> + </mailingList> + </mailingLists> <developers> <developer> <name>Peter Thomas</name> <id>ptrthomas</id> - <url>http://ptrthomas.wordpress.com</url> + <url>http://ptrthomas.wordpress.com</url> <timezone>+5.5</timezone> </developer> <developer> <name>Manfred Wolff</name> <id>manfredwolff</id> - <url>http://pointers.de</url> + <url>http://pointers.de</url> <timezone>+1</timezone> - </developer> + </developer> </developers> - + <repositories> <repository> <id>openqa.org</id> - <name>selenium snapshot</name> + <name>selenium snapshot</name> <url>http://nexus.openqa.org/content/repositories/releases</url> - </repository> - </repositories> + </repository> + </repositories> <dependencies> <dependency> @@ -97,9 +96,9 @@ <exclusion> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> - </exclusion> - </exclusions> - </dependency> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.acegisecurity</groupId> <artifactId>acegi-security</artifactId> @@ -132,7 +131,7 @@ <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> - </exclusion> + </exclusion> </exclusions> </dependency> <dependency> @@ -140,7 +139,7 @@ <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> - </dependency> + </dependency> <dependency> <groupId>jfree</groupId> <artifactId>jfreechart</artifactId> @@ -150,8 +149,8 @@ <groupId>gnujaxp</groupId> <artifactId>gnujaxp</artifactId> </exclusion> - </exclusions> - </dependency> + </exclusions> + </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> @@ -168,8 +167,8 @@ <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>geronimo-spec</groupId> @@ -181,7 +180,7 @@ <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4</version> - </dependency> + </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> @@ -198,8 +197,8 @@ <!--exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - </exclusion--> - </exclusions> + </exclusion--> + </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -233,8 +232,8 @@ <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -249,8 +248,8 @@ <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.springmodules</groupId> @@ -272,11 +271,11 @@ <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> - </exclusion> + </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> - </exclusion> + </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> @@ -296,7 +295,7 @@ <exclusion> <groupId>org.apache</groupId> <artifactId>poi</artifactId> - </exclusion> + </exclusion> <exclusion> <groupId>org.apache</groupId> <artifactId>poi-scratchpad</artifactId> @@ -308,7 +307,7 @@ <exclusion> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> - </exclusion> + </exclusion> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> @@ -316,36 +315,36 @@ <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> - </exclusion> - </exclusions> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket</artifactId> - <version>1.3.7</version> - </dependency> + <version>1.3.7</version> + </dependency> <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-extensions</artifactId> - <version>1.3.7</version> + <version>1.3.7</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.4.2</version> <scope>runtime</scope> - </dependency> + </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl104-over-slf4j</artifactId> <version>1.4.2</version> <scope>runtime</scope> - </dependency> + </dependency> <dependency> <groupId>poi</groupId> <artifactId>poi</artifactId> - <version>2.5.1-final-20040804</version> - </dependency> + <version>2.5.1-final-20040804</version> + </dependency> <dependency> <groupId>org.tmate</groupId> <artifactId>javasvn</artifactId> @@ -355,14 +354,14 @@ <groupId>ch.ethz.ganymed</groupId> <artifactId>ganymed-ssh2</artifactId> </exclusion> - </exclusions> + </exclusions> </dependency> <dependency> <groupId>org.beanshell</groupId> <artifactId>bsh</artifactId> <version>2.0b4</version> <scope>runtime</scope> - </dependency> + </dependency> <dependency> <groupId>hsqldb</groupId> <artifactId>hsqldb</artifactId> @@ -378,19 +377,19 @@ <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - </exclusion> + </exclusion> </exclusions> - </dependency> + </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> - <version>1.2.2</version> + <version>1.2.2</version> <exclusions> <exclusion> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> </exclusion> - </exclusions> + </exclusions> </dependency> <dependency> <groupId>net.sf.ehcache</groupId> @@ -402,20 +401,20 @@ <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> - </exclusions> - </dependency> + </exclusions> + </dependency> <dependency> <groupId>org.openqa.selenium.client-drivers</groupId> <artifactId>selenium-java-client-driver</artifactId> - <version>0.9.0</version> + <version>0.9.0</version> <scope>test</scope> - </dependency> + </dependency> <dependency> <groupId>org.openqa.selenium.server</groupId> <artifactId>selenium-server</artifactId> - <version>0.9.0</version> + <version>0.9.0</version> <scope>test</scope> - </dependency> + </dependency> </dependencies> <build> @@ -424,18 +423,18 @@ <resources> <resource> <directory>src/main/resources</directory> - <includes> + <includes> <include>**</include> </includes> - </resource> + </resource> <resource> <directory>src/main/java</directory> - <includes> + <includes> <include>**</include> </includes> - <excludes> + <excludes> <exclude>**/*.java</exclude> - </excludes> + </excludes> </resource> </resources> <plugins> @@ -463,21 +462,21 @@ --> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> + <artifactId>maven-surefire-plugin</artifactId> <configuration> <excludes> <exclude>info/jtrac/selenium/**</exclude> - <exclude>info/jtrac/test/**</exclude> + <exclude>info/jtrac/test/**</exclude> </excludes> </configuration> - </plugin> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <configuration> <templateFile>src/site/resources/template/maven-site.vm</templateFile> </configuration> - </plugin> + </plugin> </plugins> </build> </project> Modified: trunk/jtrac/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- trunk/jtrac/src/main/webapp/WEB-INF/applicationContext.xml 2010-10-05 11:54:21 UTC (rev 1361) +++ trunk/jtrac/src/main/webapp/WEB-INF/applicationContext.xml 2010-12-19 20:19:30 UTC (rev 1362) @@ -4,24 +4,23 @@ <!-- application context / root Spring IoC container config for JTrac --> <beans> - <!-- custom Configurer that extends the spring PropertyPlaceholderConfigurer --> - <bean class="info.jtrac.config.JtracConfigurer"/> - + <bean class="info.jtrac.config.JtracConfigurer"/> + <!-- this Acegi helper finds its way into our root Spring context because JtracImpl depends on it --> <bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/> - + <!-- i18n message source --> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename" value="messages"/> - </bean> + </bean> <!-- the business service tier / facade is behind an AOP interceptor (see "target" property) only the update operations require transactions across multiple dao update operations --> <bean id="jtrac" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> - <property name="transactionManager" ref="transactionManager"/> - <property name="target"> + <property name="transactionManager" ref="transactionManager"/> + <property name="target"> <bean class="info.jtrac.JtracImpl" init-method="init"> <property name="dao" ref="dao"/> <property name="passwordEncoder" ref="passwordEncoder"/> @@ -33,22 +32,22 @@ <property name="releaseTimestamp" value="${jtrac.timestamp}"/> <property name="jtracHome" value="${jtrac.home}"/> </bean> - </property> + </property> <property name="transactionAttributes"> - <props> + <props> <prop key="store*">PROPAGATION_REQUIRED</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> - <prop key="remove*">PROPAGATION_REQUIRED</prop> + <prop key="remove*">PROPAGATION_REQUIRED</prop> <prop key="bulkUpdate*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_SUPPORTS,readOnly</prop> </props> - </property> - </bean> + </property> + </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> - + <!-- custom factory bean that uses spring single connection data source if embedded HSQLDB is being used, else Apache DBCP with connection pooling --> <bean id="dataSource" class="info.jtrac.config.DataSourceFactoryBean"> @@ -58,16 +57,16 @@ <property name="password" value="${database.password}"/> <property name="validationQuery" value="${database.validationQuery}"/> <property name="dataSourceJndiName" value="${database.datasource.jndiname}"/> - </bean> - + </bean> + <!-- Hibernate SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="mappingResources" value="jtrac.hbm.xml"/> <property name="hibernateProperties"> <props> - <prop key="hibernate.dialect">${hibernate.dialect}</prop> - <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> + <prop key="hibernate.dialect">${hibernate.dialect}</prop> + <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> </props> </property> <property name="eventListeners"> @@ -86,24 +85,22 @@ <property name="sessionFactory" ref="sessionFactory"/> <property name="flushMode"> <bean id="org.springframework.orm.hibernate3.HibernateAccessor.FLUSH_COMMIT" - class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/> + class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/> </property> </bean> - </property> + </property> <!-- <property name="sessionFactory" ref="sessionFactory"/> --> <property name="schemaHelper"> - <bean class="info.jtrac.hibernate.SchemaHelper"> + <bean class="info.jtrac.hibernate.SchemaHelper"> <property name="mappingResources" value="jtrac.hbm.xml"/> <property name="driverClassName" value="${database.driver}"/> <property name="url" value="${database.url}"/> <property name="username" value="${database.username}"/> <property name="password" value="${database.password}"/> - <property name="hibernateDialect" value="${hibernate.dialect}"/> + <property name="hibernateDialect" value="${hibernate.dialect}"/> <property name="dataSourceJndiName" value="${database.datasource.jndiname}"/> - </bean> + </bean> </property> - </bean> + </bean> -</beans> - - +</beans> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-08-03 17:13:00
|
Revision: 1374 http://sourceforge.net/p/j-trac/code/1374 Author: udittmer Date: 2021-08-03 17:12:52 +0000 (Tue, 03 Aug 2021) Log Message: ----------- upgrade many dependencies, add Ukrainian translation, add mail.server.ssl.enable setting, run only over HTTPS Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/domain/Config.java trunk/jtrac/src/main/java/info/jtrac/domain/ExcelFile.java trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java trunk/jtrac/src/main/java/info/jtrac/util/ExcelUtils.java trunk/jtrac/src/main/resources/messages_de.properties trunk/jtrac/src/main/resources/messages_en.properties trunk/jtrac/src/main/webapp/WEB-INF/web.xml Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2011-10-28 16:02:57 UTC (rev 1373) +++ trunk/jtrac/pom.xml 2021-08-03 17:12:52 UTC (rev 1374) @@ -1,482 +1,503 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>info.jtrac</groupId> - <artifactId>jtrac</artifactId> - <packaging>war</packaging> - <version>2.2.0</version> - <name>JTrac</name> - <description> - JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields - and drop-downs. Features include customizable workflow, field level permissions, e-mail integration, - file attachments and a detailed history view. - </description> - <url>http://jtrac.info</url> - - <licenses> - <license> - <name>The Apache Software License, Version 2.0</name> - <url>license.txt</url> - </license> - </licenses> - - <scm> - <connection>scm:svn:https://j-trac.svn.sourceforge.net/svnroot/j-trac/trunk/jtrac</connection> - <url>http://j-trac.svn.sourceforge.net/viewvc/j-trac/trunk/jtrac/</url> - </scm> - - <distributionManagement> - <site> - <id>website</id> - <url>scp://shell.sourceforge.net/home/groups/j/j-/j-trac/htdocs</url> - </site> - </distributionManagement> - - <mailingLists> - <mailingList> - <name>JTrac Mailing List</name> - <subscribe>https://lists.sourceforge.net/lists/listinfo/j-trac-users</subscribe> - <unsubscribe>-</unsubscribe> - <post>-</post> - <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=j-trac-users</archive> - <otherArchives> - <otherArchive>http://www.nabble.com/j-trac-users-f20276.html</otherArchive> - </otherArchives> - </mailingList> - </mailingLists> - - <developers> - <developer> - <name>Peter Thomas</name> - <id>ptrthomas</id> - <url>http://ptrthomas.wordpress.com</url> - <timezone>+5.5</timezone> - </developer> - <developer> - <name>Manfred Wolff</name> - <id>manfredwolff</id> - <url>http://pointers.de</url> - <timezone>+1</timezone> - </developer> - </developers> - - <repositories> - <repository> - <id>openqa.org</id> - <name>selenium snapshot</name> - <url>http://nexus.openqa.org/content/repositories/releases</url> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>jaxen</groupId> - <artifactId>jaxen</artifactId> - <version>1.1-beta-9</version> - <scope>runtime</scope> - <exclusions> - <exclusion> - <groupId>jdom</groupId> - <artifactId>jdom</artifactId> - </exclusion> - <exclusion> - <groupId>xom</groupId> - <artifactId>xom</artifactId> - </exclusion> - <exclusion> - <groupId>xerces</groupId> - <artifactId>xmlParserAPIs</artifactId> - </exclusion> - <exclusion> - <groupId>xerces</groupId> - <artifactId>xercesImpl</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.acegisecurity</groupId> - <artifactId>acegi-security</artifactId> - <version>1.0.2</version> - <exclusions> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-remoting</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-support</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jfree</groupId> - <artifactId>jfreechart</artifactId> - <version>1.0.0</version> - <exclusions> - <exclusion> - <groupId>gnujaxp</groupId> - <artifactId>gnujaxp</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - <version>3.2.5.ga</version> - <exclusions> - <exclusion> - <groupId>javax.transaction</groupId> - <artifactId>jta</artifactId> - </exclusion> - <exclusion> - <groupId>asm</groupId> - <artifactId>asm-attrs</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>geronimo-spec</groupId> - <artifactId>geronimo-spec-jta</artifactId> - <version>1.0.1B-rc4</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>javax.mail</groupId> - <artifactId>mail</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring</artifactId> - <version>2.5.1</version> - <exclusions> - <exclusion> - <groupId>avalon-framework</groupId> - <artifactId>avalon-framework</artifactId> - </exclusion> - <exclusion> - <groupId>logkit</groupId> - <artifactId>logkit</artifactId> - </exclusion> - <!--exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion--> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>2.5.1</version> - <exclusions> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-context-support</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <version>2.5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>struts</groupId> - <artifactId>struts</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springmodules</groupId> - <artifactId>spring-modules-lucene</artifactId> - <version>0.8</version> - <exclusions> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-dao</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-support</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-aop</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-jca</artifactId> - </exclusion> - <exclusion> - <groupId>concurrent</groupId> - <artifactId>concurrent</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache</groupId> - <artifactId>poi</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache</groupId> - <artifactId>poi-scratchpad</artifactId> - </exclusion> - <exclusion> - <groupId>jexcelapi</groupId> - <artifactId>jxl</artifactId> - </exclusion> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib-nodep</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.wicket</groupId> - <artifactId>wicket</artifactId> - <version>1.3.7</version> - </dependency> - <dependency> - <groupId>org.apache.wicket</groupId> - <artifactId>wicket-extensions</artifactId> - <version>1.3.7</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.2</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.2</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>poi</groupId> - <artifactId>poi</artifactId> - <version>2.5.1-final-20040804</version> - </dependency> - <dependency> - <groupId>org.tmate</groupId> - <artifactId>javasvn</artifactId> - <version>1.0.3</version> - <exclusions> - <exclusion> - <groupId>ch.ethz.ganymed</groupId> - <artifactId>ganymed-ssh2</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.beanshell</groupId> - <artifactId>bsh</artifactId> - <version>2.0b4</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>hsqldb</groupId> - <artifactId>hsqldb</artifactId> - <version>1.8.0.1</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>cas</groupId> - <artifactId>casclient</artifactId> - <version>2.1.1</version> - <scope>runtime</scope> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - <version>1.2.2</version> - <exclusions> - <exclusion> - <groupId>xml-apis</groupId> - <artifactId>xml-apis</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>net.sf.ehcache</groupId> - <artifactId>ehcache</artifactId> - <version>1.2.4</version> - <scope>runtime</scope> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.openqa.selenium.client-drivers</groupId> - <artifactId>selenium-java-client-driver</artifactId> - <version>0.9.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.openqa.selenium.server</groupId> - <artifactId>selenium-server</artifactId> - <version>0.9.0</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <finalName>jtrac</finalName> - <!-- for Wicket HTML files --> - <resources> - <resource> - <directory>src/main/resources</directory> - <includes> - <include>**</include> - </includes> - </resource> - <resource> - <directory>src/main/java</directory> - <includes> - <include>**</include> - </includes> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.5</source> - <target>1.5</target> - </configuration> - </plugin> - <!-- - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <configuration> - <systemProperties> - <systemProperty> - <name>jtrac.home</name> - <value>home</value> - </systemProperty> - </systemProperties> - </configuration> - </plugin> - --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <excludes> - <exclude>info/jtrac/selenium/**</exclude> - <exclude>info/jtrac/test/**</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <configuration> - <templateFile>src/site/resources/template/maven-site.vm</templateFile> - </configuration> - </plugin> - </plugins> - </build> -</project> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>info.jtrac</groupId> + <artifactId>jtrac</artifactId> + <packaging>war</packaging> + <version>2.2.0-b1</version> + <name>JTrac</name> + <description> + JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields + and drop-downs. Features include customizable workflow, field level permissions, e-mail integration, + file attachments and a detailed history view. + </description> + <url>http://jtrac.info</url> + + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>license.txt</url> + </license> + </licenses> + + <scm> + <connection>scm:svn:https://j-trac.svn.sourceforge.net/svnroot/j-trac/trunk/jtrac</connection> + <url>http://j-trac.svn.sourceforge.net/viewvc/j-trac/trunk/jtrac/</url> + </scm> + + <distributionManagement> + <site> + <id>website</id> + <url>scp://shell.sourceforge.net/home/groups/j/j-/j-trac/htdocs</url> + </site> + </distributionManagement> + + <mailingLists> + <mailingList> + <name>JTrac Mailing List</name> + <subscribe>https://lists.sourceforge.net/lists/listinfo/j-trac-users</subscribe> + <unsubscribe>-</unsubscribe> + <post>-</post> + <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=j-trac-users</archive> + <otherArchives> + <otherArchive>http://www.nabble.com/j-trac-users-f20276.html</otherArchive> + </otherArchives> + </mailingList> + </mailingLists> + + <developers> + <developer> + <name>Peter Thomas</name> + <id>ptrthomas</id> + <url>http://ptrthomas.wordpress.com</url> + <timezone>+5.5</timezone> + </developer> + <developer> + <name>Ulf Dittmer</name> + <id>udittmer</id> + <url>http://ulfdittmer.com</url> + <timezone>+1</timezone> + </developer> + </developers> + + <repositories> + <repository> + <id>openqa.org</id> + <name>selenium snapshot</name> + <url>https://repo.spring.io/plugins-release/</url> + <snapshots> + <enabled>true</enabled> + <updatePolicy>always</updatePolicy> + <checksumPolicy>warn</checksumPolicy> + </snapshots> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>jaxen</groupId> + <artifactId>jaxen</artifactId> + <version>1.2.0</version> + <scope>runtime</scope> + <exclusions> + <exclusion> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + </exclusion> + <exclusion> + <groupId>xom</groupId> + <artifactId>xom</artifactId> + </exclusion> + <exclusion> + <groupId>xerces</groupId> + <artifactId>xmlParserAPIs</artifactId> + </exclusion> + <exclusion> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.acegisecurity</groupId> + <artifactId>acegi-security</artifactId> + <version>1.0.7</version> + <exclusions> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-remoting</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-support</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>javax.servlet-api</artifactId> + <version>3.1.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jfree</groupId> + <artifactId>jfreechart</artifactId> + <version>1.0.13</version> + <exclusions> + <exclusion> + <groupId>gnujaxp</groupId> + <artifactId>gnujaxp</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.7.ga</version> + <exclusions> + <exclusion> + <groupId>javax.transaction</groupId> + <artifactId>jta</artifactId> + </exclusion> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm-attrs</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>geronimo-spec</groupId> + <artifactId>geronimo-spec-jta</artifactId> + <version>1.0.1B-rc4</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>com.sun.mail</groupId> + <artifactId>jakarta.mail</artifactId> + <version>1.6.7</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring</artifactId> + <version>2.5.6</version> + <exclusions> + <exclusion> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + </exclusion> + <exclusion> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + </exclusion> + <!--exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion--> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-webmvc</artifactId> + <version>2.5.6</version> + <exclusions> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-context-support</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>2.5.6</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>struts</groupId> + <artifactId>struts</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springmodules</groupId> + <artifactId>spring-modules-lucene</artifactId> + <version>0.8</version> + <exclusions> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-dao</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-support</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-jca</artifactId> + </exclusion> + <exclusion> + <groupId>concurrent</groupId> + <artifactId>concurrent</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache</groupId> + <artifactId>poi</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache</groupId> + <artifactId>poi-scratchpad</artifactId> + </exclusion> + <exclusion> + <groupId>jexcelapi</groupId> + <artifactId>jxl</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.wicket</groupId> + <artifactId>wicket</artifactId> + <version>1.3.7</version> + <type>pom</type> + </dependency> + <dependency> + <groupId>org.apache.wicket</groupId> + <artifactId>wicket-extensions</artifactId> + <version>1.3.7</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.3</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.3</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + <version>4.1.2</version> + </dependency> + <dependency> + <groupId>org.tmate</groupId> + <artifactId>javasvn</artifactId> + <version>1.0.4</version> + <exclusions> + <exclusion> + <groupId>ch.ethz.ganymed</groupId> + <artifactId>ganymed-ssh2</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.beanshell</groupId> + <artifactId>bsh</artifactId> + <version>2.0b5</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <version>2.5.2</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>cas</groupId> + <artifactId>casclient</artifactId> + <version>2.1.1</version> + <scope>runtime</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>1.4</version> + <exclusions> + <exclusion> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>net.sf.ehcache</groupId> + <artifactId>ehcache</artifactId> + <version>1.7.2</version> + <scope>runtime</scope> + <type>pom</type> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <!-- + <dependency> + <groupId>org.openqa.selenium.client-drivers</groupId> + <artifactId>selenium-java-client-driver</artifactId> + <version>0.9.2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.openqa.selenium.server</groupId> + <artifactId>selenium-server</artifactId> + <version>0.9.2</version> + <scope>test</scope> + </dependency> + --> + </dependencies> + + <build> + <finalName>jtrac</finalName> + <!-- for Wicket HTML files --> + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>**</include> + </includes> + </resource> + <resource> + <directory>src/main/java</directory> + <includes> + <include>**</include> + </includes> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + <executions> + <execution> + <id>default-testCompile</id> + <phase>test-compile</phase> + <goals> + <goal>testCompile</goal> + </goals> + <configuration> + <skip>true</skip> + </configuration> + </execution> + </executions> + </plugin> + <!-- + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>maven-jetty-plugin</artifactId> + <configuration> + <systemProperties> + <systemProperty> + <name>jtrac.home</name> + <value>home</value> + </systemProperty> + </systemProperties> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>info/jtrac/selenium/**</exclude> + <exclude>info/jtrac/test/**</exclude> + </excludes> + </configuration> + </plugin> + --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <configuration> + <templateFile>src/site/resources/template/maven-site.vm</templateFile> + </configuration> + </plugin> + </plugins> + </build> +</project> Modified: trunk/jtrac/src/main/java/info/jtrac/domain/Config.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2011-10-28 16:02:57 UTC (rev 1373) +++ trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-08-03 17:12:52 UTC (rev 1374) @@ -1,103 +1,104 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.domain; - -import java.io.Serializable; -import java.util.LinkedHashSet; -import java.util.Set; - -/** - * Simple name value pair to hold configuration parameters - * in the database for JTrac, e.g. SMTP e-mail server, etc. - * TODO better validation, type-safety, masking of mail server password - */ -public class Config implements Serializable { - - private String param; // someone reported that "key" is a reserved word in MySQL - private String value; - - private static final Set<String> PARAMS; - - // set up a static set of valid config key names - static { - PARAMS = new LinkedHashSet<String>(); - PARAMS.add("mail.server.host"); - PARAMS.add("mail.server.port"); - PARAMS.add("mail.server.username"); - PARAMS.add("mail.server.password"); - PARAMS.add("mail.server.starttls.enable"); - PARAMS.add("mail.subject.prefix"); - PARAMS.add("mail.from"); - PARAMS.add("mail.smtp.localhost"); - PARAMS.add("mail.session.jndiname"); - PARAMS.add("jtrac.url.base"); - PARAMS.add("jtrac.header.picture"); - PARAMS.add("jtrac.header.text"); - PARAMS.add("jtrac.edit.item"); - PARAMS.add("locale.default"); - PARAMS.add("session.timeout"); - PARAMS.add("attachment.maxsize"); - } - - public static Set<String> getParams() { - return PARAMS; - } - - public Config() { - // zero arg constructor - } - - public Config(String param, String value) { - this.param = param; - this.value = value; - } - - public boolean isMailConfig() { - return param.startsWith("mail.") || param.startsWith("jtrac.url."); - } - - public boolean isAttachmentConfig() { - return param.startsWith("attachment."); - } - - public boolean isSessionTimeoutConfig() { - return param.startsWith("session."); - } - - public boolean isLocaleConfig() { - return param.startsWith("locale."); - } - - //========================================================================== - - public String getParam() { - return param; - } - - public void setParam(String param) { - this.param = param; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.domain; + +import java.io.Serializable; +import java.util.LinkedHashSet; +import java.util.Set; + +/** + * Simple name value pair to hold configuration parameters + * in the database for JTrac, e.g. SMTP e-mail server, etc. + * TODO better validation, type-safety, masking of mail server password + */ +public class Config implements Serializable { + + private String param; // someone reported that "key" is a reserved word in MySQL + private String value; + + private static final Set<String> PARAMS; + + // set up a static set of valid config key names + static { + PARAMS = new LinkedHashSet<String>(); + PARAMS.add("mail.server.host"); + PARAMS.add("mail.server.port"); + PARAMS.add("mail.server.username"); + PARAMS.add("mail.server.password"); + PARAMS.add("mail.server.starttls.enable"); + PARAMS.add("mail.server.ssl.enable"); + PARAMS.add("mail.subject.prefix"); + PARAMS.add("mail.from"); + PARAMS.add("mail.smtp.localhost"); + PARAMS.add("mail.session.jndiname"); + PARAMS.add("jtrac.url.base"); + PARAMS.add("jtrac.header.picture"); + PARAMS.add("jtrac.header.text"); + PARAMS.add("jtrac.edit.item"); + PARAMS.add("locale.default"); + PARAMS.add("session.timeout"); + PARAMS.add("attachment.maxsize"); + } + + public static Set<String> getParams() { + return PARAMS; + } + + public Config() { + // zero arg constructor + } + + public Config(String param, String value) { + this.param = param; + this.value = value; + } + + public boolean isMailConfig() { + return param.startsWith("mail.") || param.startsWith("jtrac.url."); + } + + public boolean isAttachmentConfig() { + return param.startsWith("attachment."); + } + + public boolean isSessionTimeoutConfig() { + return param.startsWith("session."); + } + + public boolean isLocaleConfig() { + return param.startsWith("locale."); + } + + //========================================================================== + + public String getParam() { + return param; + } + + public void setParam(String param) { + this.param = param; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + +} Modified: trunk/jtrac/src/main/java/info/jtrac/domain/ExcelFile.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/ExcelFile.java 2011-10-28 16:02:57 UTC (rev 1373) +++ trunk/jtrac/src/main/java/info/jtrac/domain/ExcelFile.java 2021-08-03 17:12:52 UTC (rev 1374) @@ -1,570 +1,573 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.domain; - -import info.jtrac.domain.ColumnHeading.Name; -import static info.jtrac.domain.ColumnHeading.Name.*; -import info.jtrac.util.DateUtils; -import info.jtrac.util.ItemUtils; -import java.io.InputStream; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFRow; -import org.apache.poi.hssf.usermodel.HSSFSheet; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.poifs.filesystem.POIFSFileSystem; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Class that encapsulates an Excel Sheet / Workbook - * and is used to process, cleanse and import contents of an - * uploaded excel file into JTrac - */ -public class ExcelFile implements Serializable { - - private static final Logger logger = LoggerFactory.getLogger(ExcelFile.class); - - /** - * represents a column heading and mapping to a Space built-in / custom field - */ - public class Column implements Serializable { - - private String label; - private ColumnHeading columnHeading; - - public Column(String label) { - this.label = label; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public void setColumnHeading(ColumnHeading columnHeading) { - this.columnHeading = columnHeading; - } - - public ColumnHeading getColumnHeading() { - return columnHeading; - } - - public Column getClone() { - Column column = new Column(label); - column.setColumnHeading(columnHeading); - return column; - } - - } - - /** - * represents a cell value, acts as object holder - */ - public class Cell implements Serializable { - - private Object value; - // internal key value for cells mapped to drop downs - private Object key; - - public Cell(Object value) { - this.value = value; - } - - private boolean isEmpty() { - return value == null || value.toString().trim().length() == 0; - } - - public boolean isValid(ColumnHeading ch) { - if(ch.isField()) { - switch(ch.getField().getName().getType()) { - case 1: - case 2: - case 3: - if(key == null || key instanceof Integer) { - return true; - } - break; - case 4: - if(value == null || value instanceof Double) { - return true; - } - break; - case 5: - return true; - case 6: - if(value == null || value instanceof Date) { - return true; - } - break; - } - - } else { - switch(ch.getName()) { - case SUMMARY: - case DETAIL: - if(!isEmpty()) { - return true; - } - break; - case LOGGED_BY: - case ASSIGNED_TO: - if(key != null && key instanceof User) { - return true; - } - break; - case STATUS: - if(key != null && key instanceof Integer) { - return true; - } - break; - case TIME_STAMP: - if(value == null || value instanceof Date) { - return true; - } - break; - } - } - return false; - } - - public void setValue(Object value) { - this.value = value; - } - - public Object getValue() { - return value; - } - - public void setKey(Object key) { - this.key = key; - } - - public Object getKey() { - return key; - } - - public String getValueAsString() { - if (value == null) { - return ""; - } - if (value instanceof String) { - return ItemUtils.fixWhiteSpace((String) value); - } - if(value instanceof Date) { - return DateUtils.formatTimeStamp((Date) value); - } - return value.toString(); - } - - public Cell getClone() { - Cell cell = new Cell(value); - cell.setKey(key); - return cell; - } - - } - - //========================================================================== - // grid data - - private List<Column> columns; - private List<List<Cell>> rows; - - public List<List<Cell>> getRows() { - return rows; - } - - public List<Column> getColumns() { - return columns; - } - - //========================================================================== - // form binding - - private List<Integer> selectedColumns = new ArrayList<Integer>(); - private List<Integer> selectedRows = new ArrayList<Integer>(); - - public List<Integer> getSelectedColumns() { - return selectedColumns; - } - - public void setSelectedColumns(List<Integer> selectedColumns) { - this.selectedColumns = selectedColumns; - } - - public List<Integer> getSelectedRows() { - return selectedRows; - } - - public void setSelectedRows(List<Integer> selectedRows) { - this.selectedRows = selectedRows; - } - - //========================================================================== - // operations - - public boolean isColumnSelected() { - return selectedColumns.size() > 0; - } - - public boolean isRowSelected() { - return selectedRows.size() > 0; - } - - public Column getFirstSelectedColumn() { - if(selectedColumns.size() == 0) { - return null; - } - int index = selectedColumns.get(0); - return columns.get(index); - } - - public List<Cell> getFirstSelectedRow() { - if(selectedRows.size() == 0) { - return null; - } - int index = selectedRows.get(0); - return rows.get(index); - } - - public void clearSelected() { - selectedColumns = new ArrayList<Integer>(); - selectedRows = new ArrayList<Integer>(); - } - - public List<ColumnHeading> getMappedColumnHeadings() { - List<ColumnHeading> list = new ArrayList<ColumnHeading>(); - for(Column c : columns) { - if(c.columnHeading != null) { - list.add(c.columnHeading); - } - } - return list; - } - - public ColumnHeading getDuplicatedColumnHeadings() { - Set<ColumnHeading> set = new HashSet<ColumnHeading>(); - for(ColumnHeading ch : getMappedColumnHeadings()) { - if(set.contains(ch)) { - return ch; - } - set.add(ch); - } - return null; - } - - public List<ColumnHeading> getUnMappedColumnHeadings() { - // status will default to Open - // timestamp will default to now - // custom field mandatory check will be ignored if any - // the following 4 are the only MANDATORY fields for import - Set<ColumnHeading> set = new HashSet<ColumnHeading>(); - ColumnHeading summary = new ColumnHeading(Name.SUMMARY); - ColumnHeading detail = new ColumnHeading(Name.DETAIL); - ColumnHeading loggedBy = new ColumnHeading(Name.LOGGED_BY); - ColumnHeading assignedTo = new ColumnHeading(Name.ASSIGNED_TO); - set.add(summary); - set.add(detail); - set.add(loggedBy); - set.add(assignedTo); - set.removeAll(getMappedColumnHeadings()); - return new ArrayList(set); - } - - public List<Cell> getColumnCells(int index) { - List<Cell> list = new ArrayList<Cell>(rows.size()); - for(List<Cell> rowCells : rows) { - list.add(rowCells.get(index)); - } - return list; - } - - public List<Cell> getColumnCellsCloned(int index) { - List<Cell> list = new ArrayList<Cell>(rows.size()); - for(List<Cell> rowCells : rows) { - list.add(rowCells.get(index).getClone()); - } - return list; - } - - public void setColumnCells(int index, List<Cell> columnCells) { - int count = 0; - for(List<Cell> rowCells : rows) { - rowCells.set(index, columnCells.get(count)); - count++; - } - } - - public List<Cell> getRowCellsCloned(int index) { - List<Cell> list = new ArrayList<Cell>(columns.size()); - List<Cell> rowCells = rows.get(index); - for(Cell cell : rowCells) { - list.add(cell.getClone()); - } - return list; - } - - public void setRowCells(int index, List<Cell> rowCells) { - rows.set(index, rowCells); - } - - public List<String> getColumnDistinctCellValues(int index) { - Set<String> set = new TreeSet<String>(); - for(List<Cell> rowCells : rows) { - set.add(rowCells.get(index).getValueAsString()); - } - return new ArrayList(set); - } - - public List<Item> getAsItems(Space s) { - List<Item> items = new ArrayList<Item>(rows.size()); - for(List<Cell> rowCells : rows) { - Item item = new Item(); - item.setSpace(s); - for(int i = 0; i < columns.size(); i++) { - ColumnHeading ch = columns.get(i).columnHeading; - if(ch == null) { - continue; - } - Cell cell = rowCells.get(i); - if(ch.isField()) { - Field field = ch.getField(); - if(field.isDropDownType()) { - if(cell.key != null) { - item.setValue(field.getName(), cell.key); - } - } else { - if(cell.value != null) { - item.setValue(field.getName(), cell.value); - } - } - } else { - switch(ch.getName()) { - // next 4 are the only MANDATORY fields in import - case SUMMARY: - item.setSummary(cell.value.toString()); - break; - case DETAIL: - item.setDetail(cell.value.toString()); - break; - case LOGGED_BY: - item.setLoggedBy((User) cell.key); - break; - case ASSIGNED_TO: - item.setAssignedTo((User) cell.key); - break; - case STATUS: - if(cell.key != null) { - item.setStatus((Integer) cell.key); - } - break; - case TIME_STAMP: - // timestamp will be set by JtracImpl if null - if(cell.value != null) { - item.setTimeStamp((Date) cell.value); - } - break; - } - } - } - // if no status, assume Open - if(item.getStatus() == null) { - item.setStatus(State.OPEN); - } - items.add(item); - } - return items; - } - - //========================================================================== - // edits - - public void deleteSelectedRowsAndColumns() { - int cursor = 0; - for(int i : selectedRows) { - rows.remove(i - cursor); - cursor++; - } - cursor = 0; - for(int i : selectedColumns) { - columns.remove(i - cursor); - for(List<Cell> cells : rows) { - cells.remove(i - cursor); - } - cursor++; - } - } - - public void convertSelectedColumnsToDate() { - // could not find a better way to convert excel number to date - HSSFWorkbook wb = new HSSFWorkbook(); - HSSFSheet sheet = wb.createSheet(); - HSSFRow row = sheet.createRow(0); - HSSFCell cell = row.createCell((short) 0); - for(int i : selectedColumns) { - for(List<Cell> cells : rows) { - Cell c = cells.get(i); - if (c != null && c.value instanceof Double) { - cell.setCellValue((Double) c.value); - c.value = cell.getDateCellValue(); - } - } - } - } - - public void concatenateSelectedColumns() { - List<Cell> list = new ArrayList<Cell>(rows.size()); - for(List<Cell> rowCells : rows) { - list.add(new Cell(null)); - } - int first = selectedColumns.get(0); - for(int i : selectedColumns) { - int rowIndex = 0; - for(List<Cell> cells : rows) { - Cell c = cells.get(i); - if (c != null) { - String s = (String) list.get(rowIndex).value; - if (s == null) { - ... [truncated message content] |
From: <udi...@us...> - 2021-08-04 09:26:45
|
Revision: 1375 http://sourceforge.net/p/j-trac/code/1375 Author: udittmer Date: 2021-08-04 09:26:42 +0000 (Wed, 04 Aug 2021) Log Message: ----------- implement DKIM, add Ukrainian translation Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/domain/Config.java trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java trunk/jtrac/src/main/resources/jtrac-init.properties trunk/jtrac/src/main/resources/messages.properties trunk/jtrac/src/main/resources/messages_de.properties trunk/jtrac/src/main/resources/messages_en.properties trunk/jtrac/src/main/resources/messages_hu.properties trunk/jtrac/src/main/webapp/WEB-INF/log4j.properties Added Paths: ----------- trunk/jtrac/src/main/resources/messages_uk.properties Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-08-03 17:12:52 UTC (rev 1374) +++ trunk/jtrac/pom.xml 2021-08-04 09:26:42 UTC (rev 1375) @@ -186,6 +186,11 @@ <artifactId>jakarta.mail</artifactId> <version>1.6.7</version> </dependency> + <dependency> + <groupId>net.markenwerk</groupId> + <artifactId>utils-mail-dkim</artifactId> + <version>1.4.0</version> + </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> Modified: trunk/jtrac/src/main/java/info/jtrac/domain/Config.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-08-03 17:12:52 UTC (rev 1374) +++ trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-08-04 09:26:42 UTC (rev 1375) @@ -45,6 +45,10 @@ PARAMS.add("mail.from"); PARAMS.add("mail.smtp.localhost"); PARAMS.add("mail.session.jndiname"); + PARAMS.add("mail.dkim.signingDomain"); + PARAMS.add("mail.dkim.selector"); + PARAMS.add("mail.dkim.derFile"); + PARAMS.add("mail.dkim.identity"); PARAMS.add("jtrac.url.base"); PARAMS.add("jtrac.header.picture"); PARAMS.add("jtrac.header.text"); Modified: trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java 2021-08-03 17:12:52 UTC (rev 1374) +++ trunk/jtrac/src/main/java/info/jtrac/mail/MailSender.java 2021-08-04 09:26:42 UTC (rev 1375) @@ -21,6 +21,7 @@ import info.jtrac.domain.User; import info.jtrac.util.ItemUtils; +import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -34,8 +35,9 @@ import javax.mail.Session; import javax.mail.internet.MimeMessage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import net.markenwerk.utils.mail.dkim.DkimMessage; +import net.markenwerk.utils.mail.dkim.DkimSigner; + import org.springframework.context.MessageSource; import org.springframework.jndi.JndiObjectFactoryBean; import org.springframework.mail.javamail.JavaMailSenderImpl; @@ -42,6 +44,9 @@ import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Class to handle sending of E-mail and pre-formatted messages */ @@ -56,6 +61,12 @@ private MessageSource messageSource; private Locale defaultLocale; + // for DKIM + private String signingDomain; + private String selector; + private String derFile; + private String identity; + public MailSender(Map<String, String> config, MessageSource messageSource, String defaultLocale) { // initialize email sender this.messageSource = messageSource; @@ -96,7 +107,27 @@ logger.debug("send mail thread start"); try { try { - sender.send(message); + MimeMessage signedMessage = message; + + // no point in trying DKIM if the relevant properties have not been set + if (StringUtils.hasText(signingDomain) && StringUtils.hasText(derFile)) { + try { + DkimSigner dkimSigner = new DkimSigner(signingDomain, selector, new File(derFile)); + dkimSigner.setIdentity(identity); + /* + dkimSigner.setHeaderCanonicalization(Canonicalization.SIMPLE); + dkimSigner.setBodyCanonicalization(Canonicalization.RELAXED); + dkimSigner.setSigningAlgorithm(SigningAlgorithm.SHA256_WITH_RSA); + dkimSigner.setLengthParam(true); + dkimSigner.setCopyHeaderFields(false); + */ + signedMessage = new DkimMessage(signedMessage, dkimSigner); + } catch (Exception ex) { + logger.warn("Can't use DKIM: "+ex.getMessage()); + } + } + + sender.send(signedMessage); logger.debug("send mail thread successfull"); } catch (Exception e) { logger.error("send mail thread failed", e); @@ -332,6 +363,15 @@ sender.setJavaMailProperties(props); } + signingDomain = config.get("mail.dkim.signingDomain"); + selector = config.get("mail.dkim.selector"); + if (! StringUtils.hasText(selector)) + selector = "default"; + derFile = config.get("mail.dkim.derFile"); + identity = config.get("mail.dkim.identity"); + if (! StringUtils.hasText(identity)) + identity = from; + logger.info("email sender initialized from config: host = '" + host + "', port = '" + p + "'"); } Modified: trunk/jtrac/src/main/resources/jtrac-init.properties =================================================================== --- trunk/jtrac/src/main/resources/jtrac-init.properties 2021-08-03 17:12:52 UTC (rev 1374) +++ trunk/jtrac/src/main/resources/jtrac-init.properties 2021-08-04 09:26:42 UTC (rev 1375) @@ -1,5 +1,12 @@ -# uncomment / edit this file to customize the location -# of the JTrac "home" directory e.g. jtrac.home=C:/jtrac -# please refer the documentation at http://jtrac.info/doc/html/installation.html - -# jtrac.home=C:/jtrac +# uncomment / edit this file to customize the location +# of the JTrac "home" directory e.g. jtrac.home=C:/jtrac +# please refer the documentation at http://j-trac.sourceforge.net/ + +jtrac.home=/Users/ulf/Development/Java/jtrac-2.1.0/live-data +jtrac.url.base=https://trac.ulf:8443/ + +#jtrac.home=/home/udittmer/tomcat/webapps/jtrac-data +#jtrac.url.base=https://trac.care-with-care.com/ + +locale.default=en + Modified: trunk/jtrac/src/main/resources/messages.properties =================================================================== --- trunk/jtrac/src/main/resources/messages.properties 2021-08-03 17:12:52 UTC (rev 1374) +++ trunk/jtrac/src/main/resources/messages.properties 2021-08-04 09:26:42 UTC (rev 1375) @@ -1,452 +1,460 @@ -# please refer documentation before starting work on a translation: -# http://jtrac.info/doc/html/dev-guide.html#dev-translating - -# globals -submit = Submit -cancel = Cancel -delete = Delete -back = Back -next = Next -edit = Edit -view = View -search = Search -new = New -save = Save - -# override default messages for spring mvc form binding errors -typeMismatch.java.lang.Double = Please enter a valid number -typeMismatch.java.util.Date = Please enter a valid date in the format\: yyyy-mm-dd - -# wicket globals -null = -nullValid = -Required = Please enter mandatory fields -IConverter.Double = ${label}\: Please enter a valid number -IConverter.Date = ${label}\: Please enter a valid date in the format yyyy-mm-dd - -# generic form validation message -error.empty = Value Required - -# header navigation -header.dashboard = DASHBOARD -header.new = NEW -header.search = SEARCH -header.options = OPTIONS -header.login = LOGIN -header.logout = LOGOUT - -# dashboard -dashboard.noSpaces = You are not mapped to any Spaces -dashboard.space = Space -dashboard.action = Action -dashboard.status = Status -dashboard.loggedByMe = Logged<br/>By Me -dashboard.assignedToMe = Assigned<br/>To Me -dashboard.all = All -dashboard.new = NEW -dashboard.search = SEARCH -dashboard.showDetails = Show Details -dashboard.hideDetails = Hide Details - -# item_form -item_form.summary = Summary -item_form.detail = Detail -item_form.assignTo = Assign To -item_form.editReason = Edit Reason -item_form.sendNotifications = send email notifications -item_form.notifyByEmail = Notify By Email -item_form.attachment = Attachment -item_form.error.version = Item modified by another user or you used the browser back-button. - -# item_view (note this is rendered within a taglib and not in a JSP) -item_view.id = ID -item_view.relatedItems = Related Items -item_view.remove = Remove -item_view.relatedTo = is related to -item_view.duplicateOf = is duplicate of -item_view.dependsOn = depends on -item_view.relatedToThis = is related to this -item_view.duplicateOfThis = is duplicate of this -item_view.dependsOnThis = depends on this -item_view.this = this -item_view.status = Status -item_view.loggedBy = Logged By -item_view.assignedTo = Assigned To -item_view.summary = Summary -item_view.detail = Detail -item_view.history = History -item_view.comment = Comment -item_view.timeStamp = Time Stamp - -# item_view_form -item_view_form.relateTo = Relate this item to -item_view_form.duplicateOf = is duplicate of this -item_view_form.dependsOn = depends on this -item_view_form.relatedTo = is related to this -item_view_form.newStatus = New Status -item_view_form.assignTo = Assign To -item_view_form.comment = Comment -item_view_form.sendNotifications = send email notifications -item_view_form.addRelatedItem = add related item -item_view_form.change = change -item_view_form.notifyByEmail = Notify By Email -item_view_form.attachment = Attachment -item_view_form.assignedTo.error = Assign To: Required if Status other than {0} -item_view_form.status.error = Required if Assigning -item_view_form.chooseStatus = -- choose status -- - -# item_search_form -item_search_form.searchingForRelated = Searching for items related to -item_search_form.viewItemById = View Item by ID -item_search_form.textSearch = Text Search -item_search_form.resultsPerPage = Results / Page -item_search_form.noLimit = No Limit -item_search_form.sortOnColumn = Sort On Column -item_search_form.id = ID -item_search_form.descending = Descending -item_search_form.showDetail = Show Detail -item_search_form.showHistory = Show History -item_search_form.loggedBy = Logged By -item_search_form.assignedTo = Assigned To -item_search_form.createdDate = Created Date -item_search_form.onOrAfter = On / After -item_search_form.onOrBefore = On / Before -item_search_form.status = Status -item_search_form.severity = Severity -item_search_form.priority = Priority -item_search_form.historyUpdatedDate = History Updated Date -item_search_form.space = Space -item_search_form.error.refId.invalid = Invalid ID -item_search_form.error.refId.notFound = Item not found -item_search_form.error.summary.invalid = Invalid Search String - -# item_list (most rendered within a taglib not JSP, some reused also for excel export) -item_list.searchingForRelated = Searching for items related to -item_list.modifySearch = Modify Search -item_list.recordFound = Record Found -item_list.recordsFound = Records Found -item_list.exportToExcel = Excel -item_list.exportToXml = XML -item_list.id = ID -item_list.summary = Summary -item_list.detail = Detail -item_list.loggedBy = Logged By -item_list.status = Status -item_list.assignedTo = Assigned To -item_list.timeStamp = Time Stamp -item_list.history = History -item_list.space = Space - -# options -options.optionsMenu = Options Menu -options.editYourProfile = Edit User Profile -options.manageUsers = Manage Users -options.manageSpaces = Manage Spaces -options.manageSettings = Manage Settings -options.rebuildIndexes = Rebuild Indexes -options.importFromExcel = Import From Excel - -# user_form -user_form.userDetails = User Details -user_form.loginId = Login ID -user_form.fullName = Full Name -user_form.emailId = E-Mail ID -user_form.language = Language -user_form.passwordMessage = A password will be generated and e-mailed by default.<br/>The fields below are optional. -user_form.password = Password -user_form.confirmPassword = Confirm Password -user_form.loginId.error.invalid = Login ID contains invalid characters -user_form.loginId.error.exists = Login ID already exists -user_form.passwordConfirm.error = Passwords do not match. -user_form.mailPassword = send password by e-mail -user_form.locked = Locked - -# logout -logout.title = Logout Successful -logout.home = Home -logout.message = Logout Successful. Any active "remember me" sessions have been disabled. -logout.login = Login - -# login -login.title = JTrac Login -login.home = Home -login.loginName = Login Name / email ID -login.password = Password -login.rememberMe = remember me -login.submit = Submit -login.error = Bad Credentials - -# config explanations (used in both config_list and config_form screens) -config.mail.server.host = Hostname or IP address of the SMTP server to be used for sending e-mail -config.mail.server.port = Port used by the SMTP server (default 25) -config.mail.server.username = Username for the SMTP server if it requires authentication -config.mail.server.password = Password for the SMTP server if it requires authentication -config.mail.server.starttls.enable = Use "true" for secure (SSL) connection if required by the SMTP server -config.mail.subject.prefix = Text that will be prefixed to the e-mail subject-line (default [jtrac]) -config.mail.session.jndiname = javax.mail.Session JNDI name - if present, this will be used instead of the SMTP server details above -config.mail.from = When generating e-mail, this will be used as the 'from' address -config.mail.smtp.localhost = Override for the HELO setting of very strict SMPT relays -config.jtrac.url.base = Base URL of your JTrac installation ( e.g. http://myserver/jtrac ) required for links in the e-mails to work -config.jtrac.header.picture = Individual header picture -config.jtrac.header.text = Individual header text -config.jtrac.edit.item = Should the owner of the task edit their items? -config.locale.default = Default language used for this JTrac installation e.g. "de" for German -config.session.timeout = Time in minutes after which user session expires (default 30 minutes) -config.attachment.maxsize = Maximum size in MB of file-attachments. (default 5 MB) Use -1 for no-limit - -# config_list (config_form does not have any extra messages) -config_list.configurationSettings = Configuration Settings -config_list.parameter = Parameter Key -config_list.value = Value -config_list.edit = Edit -config_list.description = Description - -# excel_upload -excel_upload.uploadExcelFile = Upload Excel File -excel_upload.error.invalidFile = Error processing file, may not be valid Excel file. - -# excel_view -excel_view.previewImportedData= Preview Imported Data -excel_view.selectActionToPerform = -- select action to perform -- -excel_view.deleteSelected = Delete Selected Columns / Rows -excel_view.convertToDate = Convert Format of Selected Columns to Date -excel_view.concatenateFields = Concatenate Content of Selected Columns -excel_view.extractFirstEighty = Extract First 80 Characters into new Column -excel_view.duplicateColumn = Duplicate Selected Column -excel_view.mapToField = Map Selected Column to Space Field -excel_view.editRow = Edit Selected Row Data -excel_view.import = Import into Selected Space - -excel_view.error.noActionSelected = Please select an action to perform -excel_view.error.noSpaceSelected = Please choose a space first -excel_view.error.noColumnSelected = Please select a column -excel_view.error.noRowSelected = Please select a row -excel_view.error.noColumnOrRowSelected = Please select columns / rows -excel_view.error.atLeastTwoColumns = Please select at least two columns -excel_view.error.duplicateMapping = Field mapped more than once: '{0}' -excel_view.error.notMapped = Field has to be mapped: '{0}' -excel_view.error.invalidValue = Some cells have invalid data - -excel_view.selectSpace = Choose Space -excel_view.selectedSpace = Selected Space -excel_view.noSpaceSelected = (no space selected) -excel_view.preview = Preview -excel_view.distinctValues = Distinct Values -excel_view.mapTo = Map To -excel_view.columnData = Column Data -excel_view.selectedColumn = Selected Column: -excel_view.update = Update -excel_view.importSuccess = Items Imported Successfully - -# exception_flow -exception_flow.unsupportedNavigation = Unsupported Navigation -exception_flow.line1 = Browser back button / page refresh - is not supported in this version. -exception_flow.line2 = This error is not recoverable and you have to re-start your previous navigation. -exception_flow.line3 = To avoid this error, please use the links or buttons within the application to navigate. - -# index_rebuild_success -index_rebuild.heading = Rebuild Indexes -index_rebuild.warning = This may take a long time and it is recommended that no other users be logged in. - -# index_rebuild_success -index_rebuild_success.message = Indexes Rebuilt Successfully - -# space_allocate -space_allocate.usersAllocatedToSpace = Users Allocated To Space -space_allocate.loginName = Login Name -space_allocate.fullName = Full Name -space_allocate.role = Role -space_allocate.remove = Remove -space_allocate.allocateUser = Choose User and Role to allocate -space_allocate.createNewUser = Create New User -space_allocate.user = User -space_allocate.allocate = Allocate - -# space_delete -space_delete.confirm = Confirm Space Delete -space_delete.line1 = Are you sure that you want to delete this Space? -space_delete.line2 = This will delete all items within this Space. -space_delete.line3 = You cannot undo database updates for this operation. - -# space_field_delete -space_field_delete.confirm = Confirm Field Delete -space_field_delete.line1 = Are you sure that you want to delete this Field? -space_field_delete.line2 = No of affected database records = {0} -space_field_delete.line3 = You cannot undo database updates for this operation. - -# space_field_form -space_field_form.editField = Edit Field -space_field_form.internalName = Internal Name -space_field_form.label = Label -space_field_form.optional = Optional -space_field_form.options = Options -space_field_form.addOption = Add Option -space_field_form.update = Update -space_field_form.done = Done -space_field_form.error.optionExists = Option already exists - -# space_field_option_delete -space_field_option_delete.confirm = Confirm Option Delete -space_field_option_delete.line1 = Are you sure that you want to delete this Option? -space_field_option_delete.line2 = No of affected database records = {0} -space_field_option_delete.line3 = You cannot undo database updates for this operation. - -# space_field_option_edit -space_field_option_edit.editOption = Edit Option for Field -space_field_option_edit.error.optionEmpty = Option cannot be empty -space_field_option_edit.error.exists = Option already exists - -# space_fields -space_fields.customFields = Custom Fields for Space -space_fields.move = Move -space_fields.internalName = Internal Name -space_fields.type = Type -space_fields.optional = Optional -space_fields.label = Label -space_fields.optionList = Option List -space_fields.chooseType = Choose Type of Custom Field to add -space_fields.addField = Add Field -space_fields.type_1 = Severity (Drop Down) -space_fields.type_2 = Priority (Drop Down) -space_fields.type_3 = Drop Down List -space_fields.type_4 = Decimal Number -space_fields.type_5 = Free Text Field -space_fields.type_6 = Date Field -space_fields.typeRemaining = {0} left - -# space_form -space_form.spaceDetails = Space Details -space_form.displayName = Display Name -space_form.spaceKey = Space Key (Short Name) -space_form.description = Description -space_form.makePublic = Make Public -space_form.allowGuest = Allow Guest (read only) Access -space_form.copyExisting = Copy Existing Space -space_form.createFresh = create from scratch -space_form.error.prefixCode.tooShort = Length should be at least 3 characters. -space_form.error.prefixCode.tooLong = Length should not be greater than 10 characters. -space_form.error.prefixCode.invalid = Only capital letters and numeric characters allowed -space_form.error.prefixCode.exists = A Space with this Key already exists - -# space_list -space_list.spaceList = Space List -space_list.createNewSpace = Create New Space -space_list.key = Key -space_list.name = Name -space_list.edit = Edit -space_list.description = Description -space_list.users = Users - -# space_role_delete -space_role_delete.confirm = Confirm Role Delete -space_role_delete.line1 = There are users allocated to this space ({0}) with this Role. -space_role_delete.line2 = Are you sure that you want to delete this Role? -space_role_delete.line3 = You cannot undo database updates for this operation. - -# space_role_form -space_role_form.editRoleName = Edit Role Name -space_role_form.error.role.invalid = Role name has to be all capital letters or digits ('_' allowed within) -space_role_form.error.role.exists = A Role with that name already exists -space_role_form.error.role.reserved = This Role name is reserved for internal use - -# space_role_form_confirm -space_role_form_confirm.confirm = Confirm Role Rename: {0} to {1} -space_role_form_confirm.line1 = Are you sure that you want to rename this Role? -space_role_form_confirm.line2 = You cannot undo database updates for this operation. - -# space_roles -space_roles.spaceRoles = Space Roles and State-Transitions (Workflow) for Space -space_roles.addState = Add State -space_roles.addRole = Add Role -space_roles.nextAllowedState = Next Allowed State -space_roles.fieldLevelPermissions = Field Level Permissions -space_roles.state = State -space_roles.role = Role -space_roles.mandatory = Mandatory -space_roles.optional = Optional -space_roles.readonly = Read-Only - -# space_state_delete -space_state_delete.confirm = Confirm State Delete -space_state_delete.line1 = Are you sure that you want to delete this State? -space_state_delete.line2 = No of affected database records = {0} -space_state_delete.line3 = You cannot undo database updates for this operation. - -# space_state_form -space_state_form.editState = Edit State -space_state_form.error.state.invalid = State name has to be Camel-Case with dashes ('-') to separate words e.g. 'Fixed', 'On-Hold' or 'Work-In-Progress' -space_state_form.error.state.exists = A State with that name already exists - -# user_allocate_space -user_allocate_space.spacesAllocated = Spaces Allocated to User -user_allocate_space.space = Space -user_allocate_space.role = Role -user_allocate_space.remove = Remove -user_allocate_space.chooseSpace = Choose a Space to allocate to this User -user_allocate_space.makeUserAdmin = Make this user an Administrator (for all Spaces) -user_allocate_space.makeAdmin = Make Admin -user_allocate_space.allSpaces = (all spaces) - -# user_allocate_space_role -user_allocate_space_role.allocateRole = Allocate Role for User {0} within Space -user_allocate_space_role.allocate = Allocate - -# user_list -user_list.usersAndSpaces = Users and allocated Spaces -user_list.createNewUser = Create New User -user_list.userName = User Name -user_list.loginName = Login Name -user_list.editProfile = Edit Profile -user_list.locked = Locked -user_list.spaceRole = Space (Role) -user_list.allocateSpaceRole = Allocate<br/>Space / Role -user_list.locale = Language -user_list.email = E Mail -user_list.filterBy = Filter by - -# mail_sender (this is in the mail sending code, not a JSP) -mail_sender.loginMailSubject = JTrac login details -mail_sender.loginMailGreeting = Hi -mail_sender.loginMailLine1 = Your login details have been created / updated as follows: -mail_sender.loginName = Login Name -mail_sender.password = Password -mail_sender.loginMailLine2 = Use the link below to log in: - -# new item_relate_remove -item_relate_remove.heading = Confirm relationship delete - -# item_delete -item_delete.confirm = Confirm Item Delete -item_delete.line1 = Are you sure that you want to delete this Item? -item_delete.line2 = You cannot undo database updates for this operation. - -# user_delete -user_delete.confirm = Confirm User Delete -user_delete.line1 = Are you sure that you want to delete this User? -user_delete.line2 = You cannot undo database updates for this operation. -user_delete.notPossible = This user is referenced by items and cannot be deleted. Try locking this user or deleting the items involved first. - -# generic error messages -error.itemBelongsToUnallocatedSpace = You do not have permissions to view this item - -# item search filter wizard -item_filter.showColumn = Show in Results -item_filter.expression = Search Filter -item_filter.expandAll = (expand all) -item_filter.in = has values -item_filter.notIn = does not have values -item_filter.like = contains text -item_filter.equal = equal to -item_filter.notEqual = not equal to -item_filter.greaterThan = greater than -item_filter.lessThan = less than -item_filter.between = between - -# rest API messages -rest_multi_action_controller.anExceptionOcurred.error=An exception ocurred.\ -rest_multi_action_controller.itemNotFound.error=Item not found:\ -rest_multi_action_controller.newStatusNotPermitted.error=The new status is not permitted from the current status -rest_multi_action_controller.requiredParameterNotFound.error=The required parameter was not found in the request:\ -rest_multi_action_controller.spaceNotFound.error=Space not found:\ -rest_multi_action_controller.userNotAbleToTransition.error=The user is not authorized to do the transition from the current status to the new status:\ -rest_multi_action_controller.userNotRegistered.error=User not registered:\ +# please refer documentation before starting work on a translation: +# http://jtrac.info/doc/html/dev-guide.html#dev-translating + +# globals +submit = Submit +cancel = Cancel +delete = Delete +back = Back +next = Next +edit = Edit +view = View +search = Search +new = New +save = Save + +# override default messages for spring mvc form binding errors +typeMismatch.java.lang.Double = Please enter a valid number +typeMismatch.java.util.Date = Please enter a valid date in the format\: yyyy-mm-dd + +# wicket globals +null = +nullValid = +Required = Please enter mandatory fields +IConverter.Double = ${label}\: Please enter a valid number +IConverter.Date = ${label}\: Please enter a valid date in the format yyyy-mm-dd + +# generic form validation message +error.empty = Value Required + +# header navigation +header.dashboard = DASHBOARD +header.new = NEW +header.search = SEARCH +header.options = OPTIONS +header.login = LOGIN +header.logout = LOGOUT + +# dashboard +dashboard.noSpaces = You are not mapped to any Spaces +dashboard.space = Space +dashboard.action = Action +dashboard.status = Status +dashboard.loggedByMe = Logged<br/>By Me +dashboard.assignedToMe = Assigned<br/>To Me +dashboard.all = All +dashboard.new = NEW +dashboard.search = SEARCH +dashboard.showDetails = Show Details +dashboard.hideDetails = Hide Details + +# item_form +item_form.summary = Summary +item_form.detail = Detail +item_form.assignTo = Assign To +item_form.editReason = Edit Reason +item_form.sendNotifications = send email notifications +item_form.notifyByEmail = Notify By Email +item_form.attachment = Attachment +item_form.error.version = Item modified by another user or you used the browser back-button. + +# item_view (note this is rendered within a taglib and not in a JSP) +item_view.id = ID +item_view.relatedItems = Related Items +item_view.remove = Remove +item_view.relatedTo = is related to +item_view.duplicateOf = is duplicate of +item_view.dependsOn = depends on +item_view.relatedToThis = is related to this +item_view.duplicateOfThis = is duplicate of this +item_view.dependsOnThis = depends on this +item_view.this = this +item_view.status = Status +item_view.loggedBy = Logged By +item_view.assignedTo = Assigned To +item_view.summary = Summary +item_view.detail = Detail +item_view.history = History +item_view.comment = Comment +item_view.timeStamp = Time Stamp + +# item_view_form +item_view_form.relateTo = Relate this item to +item_view_form.duplicateOf = is duplicate of this +item_view_form.dependsOn = depends on this +item_view_form.relatedTo = is related to this +item_view_form.newStatus = New Status +item_view_form.assignTo = Assign To +item_view_form.comment = Comment +item_view_form.sendNotifications = send email notifications +item_view_form.addRelatedItem = add related item +item_view_form.change = change +item_view_form.notifyByEmail = Notify By Email +item_view_form.attachment = Attachment +item_view_form.assignedTo.error = Assign To: Required if Status other than {0} +item_view_form.status.error = Required if Assigning +item_view_form.chooseStatus = -- choose status -- + +# item_search_form +item_search_form.searchingForRelated = Searching for items related to +item_search_form.viewItemById = View Item by ID +item_search_form.textSearch = Text Search +item_search_form.resultsPerPage = Results / Page +item_search_form.noLimit = No Limit +item_search_form.sortOnColumn = Sort On Column +item_search_form.id = ID +item_search_form.descending = Descending +item_search_form.showDetail = Show Detail +item_search_form.showHistory = Show History +item_search_form.loggedBy = Logged By +item_search_form.assignedTo = Assigned To +item_search_form.createdDate = Created Date +item_search_form.onOrAfter = On / After +item_search_form.onOrBefore = On / Before +item_search_form.status = Status +item_search_form.severity = Severity +item_search_form.priority = Priority +item_search_form.historyUpdatedDate = History Updated Date +item_search_form.space = Space +item_search_form.error.refId.invalid = Invalid ID +item_search_form.error.refId.notFound = Item not found +item_search_form.error.summary.invalid = Invalid Search String + +# item_list (most rendered within a taglib not JSP, some reused also for excel export) +item_list.searchingForRelated = Searching for items related to +item_list.modifySearch = Modify Search +item_list.recordFound = Record Found +item_list.recordsFound = Records Found +item_list.exportToExcel = Excel +item_list.exportToXml = XML +item_list.id = ID +item_list.summary = Summary +item_list.detail = Detail +item_list.loggedBy = Logged By +item_list.status = Status +item_list.assignedTo = Assigned To +item_list.timeStamp = Time Stamp +item_list.history = History +item_list.space = Space + +# options +options.optionsMenu = Options Menu +options.editYourProfile = Edit User Profile +options.manageUsers = Manage Users +options.manageSpaces = Manage Spaces +options.manageSettings = Manage Settings +options.rebuildIndexes = Rebuild Indexes +options.importFromExcel = Import From Excel + +# user_form +user_form.userDetails = User Details +user_form.loginId = Login ID +user_form.fullName = Full Name +user_form.emailId = E-Mail ID +user_form.language = Language +user_form.passwordMessage = A password will be generated and e-mailed by default.<br/>The fields below are optional. +user_form.password = Password +user_form.confirmPassword = Confirm Password +user_form.loginId.error.invalid = Login ID contains invalid characters +user_form.loginId.error.exists = Login ID already exists +user_form.passwordConfirm.error = Passwords do not match. +user_form.mailPassword = send password by e-mail +user_form.locked = Locked + +# logout +logout.title = Logout Successful +logout.home = Home +logout.message = Logout Successful. Any active "remember me" sessions have been disabled. +logout.login = Login + +# login +login.title = JTrac Login +login.home = Home +login.loginName = Login Name / email ID +login.password = Password +login.rememberMe = remember me +login.submit = Submit +login.error = Bad Credentials + +# config explanations (used in both config_list and config_form screens) +config.mail.server.host = Hostname or IP address of the SMTP server to be used for sending e-mail +config.mail.server.port = Port used by the SMTP server (default 25) +config.mail.server.username = Username for the SMTP server if it requires authentication +config.mail.server.password = Password for the SMTP server if it requires authentication +config.mail.server.starttls.enable = Use "true" for secure (SSL) connection if required by the SMTP server +config.mail.server.ssl.enable = Use "true" for secure (SSL) connection if required by the SMTP server +config.mail.subject.prefix = Text that will be prefixed to the e-mail subject-line (default [jtrac]) +config.mail.session.jndiname = javax.mail.Session JNDI name - if present, this will be used instead of the SMTP server details above +config.mail.from = When generating e-mail, this will be used as the 'from' address +config.mail.smtp.localhost = Override for the HELO setting of very strict SMTP relays + +# DKIM properties for additional mail authenticity +config.mail.dkim.signingDomain = Signing domain +config.mail.dkim.selector = Selector (default is "default") +config.mail.dkim.derFile = Path to the DER encoded RSA private key +config.mail.dkim.identity = Identity (default is "mail.from") + +config.jtrac.url.base = Base URL of your JTrac installation ( e.g. http://myserver/jtrac ) required for links in the e-mails to work +config.jtrac.header.picture = Individual header picture +config.jtrac.header.text = Individual header text +config.jtrac.edit.item = Should the owner of the task edit their items? (set to true, default is false) +config.locale.default = Default language used for this JTrac installation e.g. "de" for German +config.session.timeout = Time in minutes after which user session expires (default 30 minutes) +config.attachment.maxsize = Maximum size in MB of file-attachments. (default 5 MB) Use -1 for no-limit + +# config_list (config_form does not have any extra messages) +config_list.configurationSettings = Configuration Settings +config_list.parameter = Parameter Key +config_list.value = Value +config_list.edit = Edit +config_list.description = Description + +# excel_upload +excel_upload.uploadExcelFile = Upload Excel File +excel_upload.error.invalidFile = Error processing file, may not be valid Excel file. + +# excel_view +excel_view.previewImportedData= Preview Imported Data +excel_view.selectActionToPerform = -- select action to perform -- +excel_view.deleteSelected = Delete Selected Columns / Rows +excel_view.convertToDate = Convert Format of Selected Columns to Date +excel_view.concatenateFields = Concatenate Content of Selected Columns +excel_view.extractFirstEighty = Extract First 80 Characters into new Column +excel_view.duplicateColumn = Duplicate Selected Column +excel_view.mapToField = Map Selected Column to Space Field +excel_view.editRow = Edit Selected Row Data +excel_view.import = Import into Selected Space + +excel_view.error.noActionSelected = Please select an action to perform +excel_view.error.noSpaceSelected = Please choose a space first +excel_view.error.noColumnSelected = Please select a column +excel_view.error.noRowSelected = Please select a row +excel_view.error.noColumnOrRowSelected = Please select columns / rows +excel_view.error.atLeastTwoColumns = Please select at least two columns +excel_view.error.duplicateMapping = Field mapped more than once: '{0}' +excel_view.error.notMapped = Field has to be mapped: '{0}' +excel_view.error.invalidValue = Some cells have invalid data + +excel_view.selectSpace = Choose Space +excel_view.selectedSpace = Selected Space +excel_view.noSpaceSelected = (no space selected) +excel_view.preview = Preview +excel_view.distinctValues = Distinct Values +excel_view.mapTo = Map To +excel_view.columnData = Column Data +excel_view.selectedColumn = Selected Column: +excel_view.update = Update +excel_view.importSuccess = Items Imported Successfully + +# exception_flow +exception_flow.unsupportedNavigation = Unsupported Navigation +exception_flow.line1 = Browser back button / page refresh - is not supported in this version. +exception_flow.line2 = This error is not recoverable and you have to re-start your previous navigation. +exception_flow.line3 = To avoid this error, please use the links or buttons within the application to navigate. + +# index_rebuild_success +index_rebuild.heading = Rebuild Indexes +index_rebuild.warning = This may take a long time and it is recommended that no other users be logged in. + +# index_rebuild_success +index_rebuild_success.message = Indexes Rebuilt Successfully + +# space_allocate +space_allocate.usersAllocatedToSpace = Users Allocated To Space +space_allocate.loginName = Login Name +space_allocate.fullName = Full Name +space_allocate.role = Role +space_allocate.remove = Remove +space_allocate.allocateUser = Choose User and Role to allocate +space_allocate.createNewUser = Create New User +space_allocate.user = User +space_allocate.allocate = Allocate + +# space_delete +space_delete.confirm = Confirm Space Delete +space_delete.line1 = Are you sure that you want to delete this Space? +space_delete.line2 = This will delete all items within this Space. +space_delete.line3 = You cannot undo database updates for this operation. + +# space_field_delete +space_field_delete.confirm = Confirm Field Delete +space_field_delete.line1 = Are you sure that you want to delete this Field? +space_field_delete.line2 = No of affected database records = {0} +space_field_delete.line3 = You cannot undo database updates for this operation. + +# space_field_form +space_field_form.editField = Edit Field +space_field_form.internalName = Internal Name +space_field_form.label = Label +space_field_form.optional = Optional +space_field_form.options = Options +space_field_form.addOption = Add Option +space_field_form.update = Update +space_field_form.done = Done +space_field_form.error.optionExists = Option already exists + +# space_field_option_delete +space_field_option_delete.confirm = Confirm Option Delete +space_field_option_delete.line1 = Are you sure that you want to delete this Option? +space_field_option_delete.line2 = No of affected database records = {0} +space_field_option_delete.line3 = You cannot undo database updates for this operation. + +# space_field_option_edit +space_field_option_edit.editOption = Edit Option for Field +space_field_option_edit.error.optionEmpty = Option cannot be empty +space_field_option_edit.error.exists = Option already exists + +# space_fields +space_fields.customFields = Custom Fields for Space +space_fields.move = Move +space_fields.internalName = Internal Name +space_fields.type = Type +space_fields.optional = Optional +space_fields.label = Label +space_fields.optionList = Option List +space_fields.chooseType = Choose Type of Custom Field to add +space_fields.addField = Add Field +space_fields.type_1 = Severity (Drop Down) +space_fields.type_2 = Priority (Drop Down) +space_fields.type_3 = Drop Down List +space_fields.type_4 = Decimal Number +space_fields.type_5 = Free Text Field +space_fields.type_6 = Date Field +space_fields.typeRemaining = {0} left + +# space_form +space_form.spaceDetails = Space Details +space_form.displayName = Display Name +space_form.spaceKey = Space Key (Short Name) +space_form.description = Description +space_form.makePublic = Make Public +space_form.allowGuest = Allow Guest (read only) Access +space_form.copyExisting = Copy Existing Space +space_form.createFresh = create from scratch +space_form.error.prefixCode.tooShort = Length should be at least 3 characters. +space_form.error.prefixCode.tooLong = Length should not be greater than 10 characters. +space_form.error.prefixCode.invalid = Only capital letters and numeric characters allowed +space_form.error.prefixCode.exists = A Space with this Key already exists + +# space_list +space_list.spaceList = Space List +space_list.createNewSpace = Create New Space +space_list.key = Key +space_list.name = Name +space_list.edit = Edit +space_list.description = Description +space_list.users = Users + +# space_role_delete +space_role_delete.confirm = Confirm Role Delete +space_role_delete.line1 = There are users allocated to this space ({0}) with this Role. +space_role_delete.line2 = Are you sure that you want to delete this Role? +space_role_delete.line3 = You cannot undo database updates for this operation. + +# space_role_form +space_role_form.editRoleName = Edit Role Name +space_role_form.error.role.invalid = Role name has to be all capital letters or digits ('_' allowed within) +space_role_form.error.role.exists = A Role with that name already exists +space_role_form.error.role.reserved = This Role name is reserved for internal use + +# space_role_form_confirm +space_role_form_confirm.confirm = Confirm Role Rename: {0} to {1} +space_role_form_confirm.line1 = Are you sure that you want to rename this Role? +space_role_form_confirm.line2 = You cannot undo database updates for this operation. + +# space_roles +space_roles.spaceRoles = Space Roles and State-Transitions (Workflow) for Space +space_roles.addState = Add State +space_roles.addRole = Add Role +space_roles.nextAllowedState = Next Allowed State +space_roles.fieldLevelPermissions = Field Level Permissions +space_roles.state = State +space_roles.role = Role +space_roles.mandatory = Mandatory +space_roles.optional = Optional +space_roles.readonly = Read-Only + +# space_state_delete +space_state_delete.confirm = Confirm State Delete +space_state_delete.line1 = Are you sure that you want to delete this State? +space_state_delete.line2 = No of affected database records = {0} +space_state_delete.line3 = You cannot undo database updates for this operation. + +# space_state_form +space_state_form.editState = Edit State +space_state_form.error.state.invalid = State name has to be Camel-Case with dashes ('-') to separate words e.g. 'Fixed', 'On-Hold' or 'Work-In-Progress' +space_state_form.error.state.exists = A State with that name already exists + +# user_allocate_space +user_allocate_space.spacesAllocated = Spaces Allocated to User +user_allocate_space.space = Space +user_allocate_space.role = Role +user_allocate_space.remove = Remove +user_allocate_space.chooseSpace = Choose a Space to allocate to this User +user_allocate_space.makeUserAdmin = Make this user an Administrator (for all Spaces) +user_allocate_space.makeAdmin = Make Admin +user_allocate_space.allSpaces = (all spaces) + +# user_allocate_space_role +user_allocate_space_role.allocateRole = Allocate Role for User {0} within Space +user_allocate_space_role.allocate = Allocate + +# user_list +user_list.usersAndSpaces = Users and allocated Spaces +user_list.createNewUser = Create New User +user_list.userName = User Name +user_list.loginName = Login Name +user_list.editProfile = Edit Profile +user_list.locked = Locked +user_list.spaceRole = Space (Role) +user_list.allocateSpaceRole = Allocate<br/>Space / Role +user_list.locale = Language +user_list.email = E Mail +user_list.filterBy = Filter by + +# mail_sender (this is in the mail sending code, not a JSP) +mail_sender.loginMailSubject = JTrac login details +mail_sender.loginMailGreeting = Hi +mail_sender.loginMailLine1 = Your login details have been created / updated as follows: +mail_sender.loginName = Login Name +mail_sender.password = Password +mail_sender.loginMailLine2 = Use the link below to log in: + +# new item_relate_remove +item_relate_remove.heading = Confirm relationship delete + +# item_delete +item_delete.confirm = Confirm Item Delete +item_delete.line1 = Are you sure that you want to delete this Item? +item_delete.line2 = You cannot undo database updates for this operation. + +# user_delete +user_delete.confirm = Confirm User Delete +user_delete.line1 = Are you sure that you want to delete this User? +user_delete.line2 = You cannot undo database updates for this operation. +user_delete.notPossible = This user is referenced by items and cannot be deleted. Try locking this user or deleting the items involved first. + +# generic error messages +error.itemBelongsToUnallocatedSpace = You do not have permissions to view this item + +# item search filter wizard +item_filter.showColumn = Show in Results +item_filter.expression = Search Filter +item_filter.expandAll = (expand all) +item_filter.in = has values +item_filter.notIn = does not have values +item_filter.like = contains text +item_filter.equal = equal to +item_filter.notEqual = not equal to +item_filter.greaterThan = greater than +item_filter.lessThan = less than +item_filter.between = between + +# rest API messages +rest_multi_action_controller.anExceptionOcurred.error=An exception ocurred.\ +rest_multi_action_controller.itemNotFound.error=Item not found:\ +rest_multi_action_controller.newStatusNotPermitted.error=The new status is not permitted from the current status +rest_multi_action_controller.requiredParameterNotFound.error=The required parameter was not found in the request:\ +rest_multi_action_controller.spaceNotFound.error=Space not found:\ +rest_multi_action_controller.userNotAbleToTransition.error=The user is not authorized to do the transition from the current status to the new status:\ +rest_multi_action_controller.userNotRegistered.error=User not registered:\ Modified: trunk/jtrac/src/main/resources/messages_de.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_de.properties 2021-08-03 17:12:52 UTC (rev 1374) +++ trunk/jtrac/src/main/resources/messages_de.properties 2021-08-04 09:26:42 UTC (rev 1375) @@ -185,7 +185,14 @@ config.mail.subject.prefix = Text der dem eMail Betreff vorangestellt wird (Default [jtrac]) config.mail.session.jndiname = javax.mail.Session JNDI Name - Wenn vorhanden wird diese Verbindung statt dem SMTP Server benutzt config.mail.from = Wir in eMails als Absenderadresse gesetzt -config.mail.smtp.localhost = \xDCberladen der HELO Settings f\xFCr sehr strikte SMPT Server +config.mail.smtp.localhost = \xDCberladen der HELO Settings f\xFCr sehr strikte SMTP Server + +# DKIM properties for additional mail authenticity +config.mail.dkim.signingDomain = Dom\u00e4ne f\u00fc die signiert wird +config.mail.dkim.selector = Selektor (default ist "default") +config.mail.dkim.derFile = Pfad zum DER-kodierten privaten RSA Schl\u00fcssel +config.mail.dkim.identity = Identit\u00e4t (default ist "mail.from") + config.jtrac.url.base = URL dieser Installation ( zB. http://myserver/jtrac ) wird ben\u00F6tigt f\u00FCr Links in den eMails config.jtrac.header.picture = Inidividuelles Bild config.jtrac.header.text = Individueller Text Modified: trunk/jtrac/src/main/resources/messages_en.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_en.properties 2021-08-03 17:12:52 UTC (rev 1374) +++ trunk/jtrac/src/main/resources/messages_en.properties 2021-08-04 09:26:42 UTC (rev 1375) @@ -186,7 +186,14 @@ config.mail.subject.prefix = Text that will be prefixed to the e-mail subject-line (default [jtrac]) config.mail.session.jndiname = javax.mail.Session JNDI name - if present, this will be used instead of the SMTP server details above config.mail.from = When generating e-mail, this will be used as the 'from' address -config.mail.smtp.localhost = Override for the HELO setting of very strict SMPT relays +config.mail.smtp.localhost = Override for the HELO setting of very strict SMTP relays + +# DKIM properties for additional mail authenticity +config.mail.dkim.signingDomain = Signing domain +config.mail.dkim.selector = Selector (default is "default") +config.mail.dkim.derFile = Path to the DER encoded RSA private key +config.mail.dkim.identity = Identity (default is "mail.from") + config.jtrac.url.base = Base URL of your JTrac installation ( e.g. http://myserver/jtrac ) required for links in the e-mails to work config.jtrac.header.picture = Individual header picture config.jtrac.header.text = Individual header text Modified: trunk/jtrac/src/main/resources/messages_hu.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_hu.properties 2021-08-03 17:12:52 UTC (rev 1374) +++ trunk/jtrac/src/main/resources/messages_hu.properties 2021-08-04 09:26:42 UTC (rev 1375) @@ -1,410 +1,410 @@ -# please refer documentation before starting work on a translation: -# http://jtrac.info/doc/html/dev-guide.html#dev-translating - -# globals -submit = Ment\xE9s -cancel = M\xE9gsem -delete = T\xF6rl\xE9s -back = Vissza -next = K\xF6vetkez\xF5 -edit = M\xF3dos\xEDt -view = Mutat -search = Keres -new = \xDAj -save = Ment\xE9s - -# override default messages for spring mvc form binding errors -typeMismatch.java.lang.Double = Adjon meg egy \xE9rv\xE9nyes sz\xE1mot -typeMismatch.java.util.Date = Adjon meg egy \xE9rv\xE9nyes d\xE1tumot ebben a form\xE1ban\: yyyy-mm-dd - -# wicket globals -null = -nullValid = -Required = T\xF6ltse ki a k\xF6telez\xF5en kit\xF6ltend\xF5 mez\xF5ket -IConverter.Double = ${label}\: Adjon meg egy \xE9rv\xE9nyes sz\xE1mot -IConverter.Date = ${label}\: Adjon meg egy \xE9rv\xE9nyes d\xE1tumot ebben a form\xE1ban yyyy-mm-dd - -# generic form validation message -error.empty = \xC9rt\xE9k Sz\xFCks\xE9ges - -# header navigation -header.dashboard = TER\xDCLETEK -header.new = \xDAJ -header.search = KERES -header.options = BE\xC1LL\xCDT\xC1SOK -header.login = BEL\xC9P\xC9S -header.logout = KIL\xC9P\xC9S - -# dashboard -dashboard.noSpaces = Egy ter\xFClethez sincs joga -dashboard.space = Ter\xFClet -dashboard.action = Akci\xF3 -dashboard.status = St\xE1tusz -dashboard.loggedByMe = \xC1ltalam<br/>R\xF6gz\xEDtve -dashboard.assignedToMe = Hozz\xE1m<br/>Rendelve -dashboard.all = \xD6sszes -dashboard.new = \xDAJ -dashboard.search = KERES -dashboard.showDetails = R\xE9szletek mutat\xE1sa -dashboard.hideDetails = R\xE9szletek elrejt\xE9se - -# item_form -item_form.summary = T\xE1rgy -item_form.detail = R\xE9szletek -item_form.assignTo = Hozz\xE1rendelve -item_form.editReason = Ok m\xF3dos\xEDt\xE1sa -item_form.sendNotifications = email \xE9rtes\xEDt\xE9sek k\xFCld\xE9se -item_form.notifyByEmail = \xC9rtes\xEDtsd Email -ben -item_form.attachment = Csatolm\xE1ny -item_form.error.version = A t\xE9tel m\xE1s felhaszn\xE1l\xF3 m\xF3dos\xEDtotta vagy a b\xF6ng\xE9sz\xF5 VISSZA gombj\xE1t haszn\xE1lta. - -# item_view (note this is rendered within a taglib and not in a JSP) -item_view.id = ID -item_view.relatedItems = Vonatkoz\xF3 t\xE9telek -item_view.remove = T\xF6r\xF6l -item_view.relatedTo = kapcsol\xF3dik ehhez -item_view.duplicateOf = m\xE1solata ennek -item_view.dependsOn = f\xFCgg ett\xF5l -item_view.relatedToThis = kapcsol\xF3dik ehhez -item_view.duplicateOfThis = m\xE1solata ennek -item_view.dependsOnThis = f\xFCgg ett\xF5l -item_view.this = ez -item_view.status = St\xE1tusz -item_view.loggedBy = R\xF6gz\xEDtve -item_view.assignedTo = Hozz\xE1rendelve -item_view.summary = T\xE1rgy -item_view.detail = R\xE9szletek -item_view.history = T\xF6rt\xE9net -item_view.comment = Megjegyz\xE9s -item_view.timeStamp = Id\xF5pont - -# item_view_form -item_view_form.relateTo = Kapcsol\xF3djon ez a t\xE9tel ehhez -item_view_form.duplicateOf = m\xE1solata ennek -item_view_form.dependsOn = f\xFCgg ett\xF5l -item_view_form.relatedTo = kapcsol\xF3dik ehhez -item_view_form.newStatus = \xDAj St\xE1tusz -item_view_form.assignTo = Rendeld Hozz\xE1 -item_view_form.comment = Megjegyz\xE9s -item_view_form.sendNotifications = email \xE9rtes\xEDt\xE9sek k\xFCld\xE9se -item_view_form.addRelatedItem = vonatkoz\xF3 t\xE9tel hozz\xE1ad\xE1sa -item_view_form.change = v\xE1ltoz\xE1s -item_view_form.notifyByEmail = \xC9rtes\xEDtsd Email \xFAtj\xE1n -item_view_form.attachment = Csatolm\xE1ny -item_view_form.assignedTo.error = Rendeld Hozz\xE1: Sz\xFCks\xE9ges ha a st\xE1tusz nem {0} -item_view_form.status.error = Sz\xFCks\xE9ges hozz\xE1rendel\xE9skor -item_view_form.chooseStatus = -- v\xE1lasszon st\xE1tuszt -- - -# item_search_form -item_search_form.searchingForRelated = Ehhez kapcsol\xF3d\xF3 t\xE9telek keres\xE9se -item_search_form.viewItemById = T\xE9telek megtekint\xE9se ID szerint -item_search_form.textSearch = Sz\xF6veg Keres\xE9s -item_search_form.resultsPerPage = Eredm\xE9ny / Oldal -item_search_form.noLimit = Nincs Hat\xE1r -item_search_form.sortOnColumn = Oszlop Rendez\xE9s -item_search_form.id = ID -item_search_form.descending = Cs\xF6kken\xF5 -item_search_form.showDetail = R\xE9szletek Mutat\xE1sa -item_search_form.showHistory = T\xF6rt\xE9net Mutat\xE1sa -item_search_form.loggedBy = Bejelentkezve -item_search_form.assignedTo = Hozz\xE1rendelve -item_search_form.createdDate = L\xE9trehoz\xE1s D\xE1tuma -item_search_form.onOrAfter = On / After -item_search_form.onOrBefore = On / Before -item_search_form.status = St\xE1tusz -item_search_form.severity = Severity -item_search_form.priority = Priorit\xE1s -item_search_form.historyUpdatedDate = History Updated Date -item_search_form.space = Ter\xFClet -item_search_form.error.refId.invalid = \xC9rv\xE9nytelen ID -item_search_form.error.refId.notFound = T\xE9tel nem tal\xE1lhat\xF3 -item_search_form.error.summary.invalid = \xC9rv\xE9nytelen Keres\xE9si Felt\xE9tel - -# item_list (most rendered within a taglib not JSP, some reused also for excel export) -item_list.searchingForRelated = T\xE9telek keres\xE9se amik erre vonatkoznak -item_list.modifySearch = Keres\xE9s M\xF3dos\xEDt\xE1sa -item_list.recordFound = T\xE9tel Tal\xE1lat -item_list.recordsFound = T\xE9telt Tal\xE1ltam -item_list.exportToExcel = Export\xE1l\xE1s Excel -be -item_list.id = ID -item_list.summary = T\xE1rgy -item_list.detail = R\xE9szletek -item_list.loggedBy = R\xF6gz\xEDtve -item_list.status = St\xE1tusz -item_list.assignedTo = Hozz\xE1rendelve -item_list.timeStamp = Id\xF5pont -item_list.history = T\xF6rt\xE9net -item_list.space = Ter\xFClet - -# options -options.optionsMenu = Be\xE1ll\xEDt\xE1sok Men\xFC -options.editYourProfile = Felhaszn\xE1l\xF3i Profil M\xF3dos\xEDt\xE1sa -options.manageUsers = Felhaszn\xE1l\xF3k Karbantart\xE1sa -options.manageSpaces = Ter\xFCletek Karbantart\xE1sa -options.manageSettings = \xC1ltal\xE1nos Be\xE1ll\xEDt\xE1sok -options.rebuildIndexes = Index -ek \xDAjra\xE9p\xEDt\xE9se -options.importFromExcel = Bet\xF6lt\xE9s Excel -b\xF5l - -# user_form -user_form.userDetails = Felhaszn\xE1l\xF3i R\xE9szletek -user_form.loginId = Login ID -user_form.fullName = Teljes N\xE9v -user_form.emailId = E-Mail ID -user_form.language = Nyelv -user_form.passwordMessage = Alap\xE9rtelmez\xE9sk\xE9nt egy jelsz\xF3 gener\xE1l\xF3dni fog \xE9s e-mail \xFAtj\xE1n el lesz k\xFCldve.<br/>A mez\xF5k al\xE1bb opcion\xE1lisan t\xF6ltend\xF5k. -user_form.password = Jelsz\xF3 -user_form.confirmPassword = Jelsz\xF3 Meger\xF5s\xEDt\xE9s -user_form.loginId.error.invalid = A Login ID \xE9rv\xE9nytelen karaktereket tartalmaz -user_form.loginId.error.exists = Login ID m\xE1r l\xE9tezik -user_form.passwordConfirm.error = A jelszavak nem egyeznek. -user_form.mailPassword = jelsz\xF3 k\xFCld\xE9se e-mail \xFAtj\xE1n -user_form.locked = Z\xE1rolva - -# logout -logout.title = Kil\xE9p\xE9s Sikeres -logout.home = Haza -logout.message = Kil\xE9p\xE9s Sikeres. Az \xF6sszes akt\xEDv "eml\xE9kezz r\xE1m" kapcsolat megsz\xFBnt. -logout.login = Bel\xE9p\xE9s - -# login -login.title = JTrac Login -login.home = Home -login.loginName = Felhaszn\xE1l\xF3i azonos\xEDt\xF3 / email ID -login.password = Jelsz\xF3 -login.rememberMe = eml\xE9kezz r\xE1m -login.submit = Bel\xE9p\xE9s -login.error = Hib\xE1s felhaszn\xE1l\xF3i azonos\xEDt\xF3 vagy jelsz\xF3 - -# config explanations (used in both config_list and config_form screens) -config.mail.server.host = SMPTP szerver host neve vagy IP c\xEDme az elk\xFCldend\xF5 levelek sz\xE1m\xE1ra -config.mail.server.port = SMTP szerver portja (alap\xE9rtelmez\xE9s 25) -config.mail.server.username = Felhaszn\xE1l\xF3i n\xE9v az SMTP szerver sz\xE1m\xE1ra ha az authetik\xE1ci\xF3t ig\xE9nyel -config.mail.server.password = Jelsz\xF3 az SMTP szerver sz\xE1m\xE1ra ha az authetik\xE1ci\xF3t ig\xE9nyel -config.mail.server.starttls.enable = \xC1ll\xEDtsa "true" -ra a biztons\xE1gos (SSL) kapcsolat haszn\xE1lat\xE1ra ha ezt az SMTP szerver ig\xE9nyli -config.mail.subject.prefix = Email t\xE1rgy sz\xF6veg\xE9nek prefixe (alap\xE9rtelmez\xE9s [jtrac]) -config.mail.session.jndiname = javax.mail.Session JNDI n\xE9v - ha ez be van \xE1ll\xEDtva, akkor ez lesz haszn\xE1lva a fenti SMTP szerver be\xE1ll\xEDt\xE1sok helyett -config.mail.from = E-mail gener\xE1l\xE1s eset\xE9n ez lesz haszn\xE1lva mint a 'k\xFCld\xF5' c\xEDme -config.jtrac.url.base = Alap URL -je a JTrac install\xE1ci\xF3nak ( pl.: http://myserver/jtrac ) az e-mail -ekben l\xE9v\xF5 linkek miatt sz\xFCks\xE9ges -config.locale.default = Alap\xE9rtelmezett nyelv ehhez a JTrac install\xE1ci\xF3hoz pl.: "de" N\xE9met eset\xE9n -config.session.timeout = Percben megadott session timeout (alap\xE9rtelmez\xE9s 30 perc) -config.attachment.maxsize = Maxim\xE1lis m\xE9rete MB -ban a file -ok csatolm\xE1ny\xE1nak. (alap\xE9rtelmez\xE9s 5 MB) Haszn\xE1ljon -1 -et ha nem akar limitet - -# config_list (config_form does not have any extra messages) -config_list.configurationSettings = Konfigur\xE1ci\xF3s Be\xE1ll\xEDt\xE1sok -config_list.parameter = Param\xE9ter Kulcs -config_list.value = \xC9rt\xE9k -config_list.edit = M\xF3dos\xEDt -config_list.description = Le\xEDr\xE1s - -# excel_upload -excel_upload.uploadExcelFile = Excel \xC1llom\xE1ny Felt\xF6lt\xE9s -excel_upload.error.invalidFile = Hiba a feldolgoz\xE1s sor\xE1n, lehet hogy az Excel \xE1llom\xE1ny nem \xE9rv\xE9nyes. - -# excel_view -excel_view.previewImportedData= Import\xE1lt Adatok El\xF5n\xE9zete -excel_view.selectActionToPerform = v\xE1lasszon akci\xF3t -excel_view.deleteSelected = Kiv\xE1lasztott Oszlopok / Sorok T\xF6rl\xE9se -excel_view.convertToDate = Konvert\xE1l\xE1si Form\xE1tuma a Kiv\xE1lasztott Oszlopoknak D\xE1tumm\xE1 -excel_view.concatenateFields = Kiv\xE1lasztott Oszlopok Tartalm\xE1nak \xD6sszef\xFBz\xE9se -excel_view.extractFirstEighty = Tedd ki az Els\xF5 80 Karaktert egy \xFAj Oszlopba - -# exception_flow -exception_flow.unsupportedNavigation = Nem T\xE1mogatott Navig\xE1ci\xF3 -exception_flow.line1 = A b\xF6ng\xE9sz\xF5 Vissza gombja / oldal friss\xEDt\xE9s - nem t\xE1mogatott ebben a verzi\xF3ban. -exception_flow.line2 = Ez a hiba nem helyre\xE1ll\xEDthat\xF3 \xE9s vissza kell \xE1ll\xEDtania ez el\xF5z\xF5 oldalt a navig\xE1ci\xF3 haszn\xE1lat\xE1val. -exception_flow.line3 = Hogy elker\xFClje ezt a hib\xE1t, k\xE9rem haszn\xE1lja navig\xE1l\xE1sra a linkeket vagy nyom\xF3gombokat az alkalmaz\xE1sban. - -# index_rebuild_success -index_rebuild.heading = Index -ek \xDAjra\xE9p\xEDt\xE9se - -# index_rebuild_success -index_rebuild_success.message = Az Index -ek sikeresen \xFAjra\xE9p\xFCltek - -# space_allocate -space_allocate.usersAllocatedToSpace = Ter\xFClethez Rendelt Felhaszn\xE1l\xF3k -space_allocate.loginName = Felhaszn\xE1l\xF3i azonos\xEDt\xF3 -space_allocate.fullName = Teljes N\xE9v -space_allocate.role = Szerepk\xF6r -space_allocate.remove = T\xF6rl\xE9s -space_allocate.allocateUser = V\xE1lasszon Felhaszn\xE1l\xF3t \xE9s Szerepk\xF6rt a ment\xE9shez -space_allocate.createNewUser = \xDAj Felhaszn\xE1l\xF3 L\xE9trehoz\xE1sa -space_allocate.user = Felhaszn\xE1l\xF3 -space_allocate.allocate = Ment\xE9s - -# space_delete -space_delete.confirm = Ter\xFClet T\xF6rl\xE9s Meger\xF5s\xEDt\xE9s -space_delete.line1 = Biztos, hogy t\xF6r\xF6lni akarja ezt a Ter\xFCletet? -space_delete.line2 = Ez az \xF6sszes bejegyz\xE9st t\xF6r\xF6lni fogja ezen a Ter\xFCleten. -space_delete.line3 = Az adatb\xE1zis m\xF3dos\xEDt\xE1sok nem vonhat\xF3k vissza ezek ut\xE1n. - -# space_field_delete -space_field_delete.confirm = Mez\xF5 T\xF6rl\xE9s Meger\xF5s\xEDt\xE9s -space_field_delete.line1 = Biztos, hogy t\xF6rli ezt a Mez\xF5t? -space_field_delete.line2 = Az \xE9rintett adatb\xE1zis bejegyz\xE9sek sz\xE1ma = {0} -space_field_delete.line3 = Az adatb\xE1zis m\xF3dos\xEDt\xE1sok nem vonhat\xF3k vissza ezek ut\xE1n. - -# space_field_form -space_field_form.editField = Mez\xF5 M\xF3dos\xEDt\xE1s -space_field_form.internalName = Bels\xF5 N\xE9v -space_field_form.label = Cimke -space_field_form.optional = Opcion\xE1lis -space_field_form.options = Opci\xF3 -space_field_form.addOption = Opci\xF3 Hozz\xE1ad\xE1s -space_field_form.update = Ment\xE9s -space_field_form.done = K\xE9sz -space_field_form.error.optionExists = Az opci\xF3 m\xE1r l\xE9tezik - -# space_field_option_delete -space_field_option_delete.confirm = Opci\xF3 T\xF6rl\xE9s Meger\xF5s\xEDt\xE9s -space_field_option_delete.line1 = Biztos benne, hogy t\xF6rli ezt az Opci\xF3t? -space_field_option_delete.line2 = Az \xE9rintett adatb\xE... [truncated message content] |
From: <udi...@us...> - 2021-08-04 13:06:51
|
Revision: 1378 http://sourceforge.net/p/j-trac/code/1378 Author: udittmer Date: 2021-08-04 13:06:48 +0000 (Wed, 04 Aug 2021) Log Message: ----------- add {U+201C}time.pretty{U+201D} setting for displaying dates and times in a relative format rather than in absolute times Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/domain/Config.java trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java trunk/jtrac/src/main/resources/messages.properties trunk/jtrac/src/main/resources/messages_de.properties trunk/jtrac/src/main/resources/messages_en.properties Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-08-04 10:45:46 UTC (rev 1377) +++ trunk/jtrac/pom.xml 2021-08-04 13:06:48 UTC (rev 1378) @@ -191,6 +191,11 @@ <artifactId>utils-mail-dkim</artifactId> <version>1.4.0</version> </dependency> + <dependency> + <groupId>org.ocpsoft.prettytime</groupId> + <artifactId>prettytime</artifactId> + <version>5.0.1.Final</version> + </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> @@ -455,6 +460,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> @@ -499,6 +505,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> + <version>3.9.1</version> <configuration> <templateFile>src/site/resources/template/maven-site.vm</templateFile> </configuration> Modified: trunk/jtrac/src/main/java/info/jtrac/domain/Config.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-08-04 10:45:46 UTC (rev 1377) +++ trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-08-04 13:06:48 UTC (rev 1378) @@ -57,6 +57,7 @@ PARAMS.add("session.timeout"); PARAMS.add("attachment.maxsize"); PARAMS.add("pwd.minLength"); + PARAMS.add("time.pretty"); } public static Set<String> getParams() { Modified: trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java 2021-08-04 10:45:46 UTC (rev 1377) +++ trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java 2021-08-04 13:06:48 UTC (rev 1378) @@ -1,47 +1,71 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.util; - -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * Date Formatting helper, currently date formats are hard-coded for the entire app - * hence the use of static SimpleDateFormat instances, although they are known not to be synchronized - */ -public class DateUtils { - - private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - private static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - public static String format(Date date) { - return date == null ? "" : dateFormat.format(date); - } - - public static String formatTimeStamp(Date date) { - return date == null ? "" : dateTimeFormat.format(date); - } - - public static Date convert(String s) { - try { - return dateFormat.parse(s); - } catch(Exception e) { - throw new RuntimeException(e); - } - } - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.util; + +import info.jtrac.wicket.JtracApplication; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.springframework.util.StringUtils; + +import org.ocpsoft.prettytime.PrettyTime; + +/** + * Date Formatting helper, currently date formats are hard-coded for the entire app + * hence the use of static SimpleDateFormat instances, although they are known not to be synchronized + * + * TODO: for pretty printing, instead of using the system default locale, use the user's locale + */ +public class DateUtils { + + private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + private static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + private static boolean showPretty() { + String pretty = JtracApplication.get().getJtrac().loadConfig("time.pretty"); + if (StringUtils.hasText(pretty)) { + return pretty.trim().equalsIgnoreCase("true"); + } else { + return false; + } + } + + public static String format (Date date) { + return date == null + ? "" + : (showPretty() + ? new PrettyTime(JtracApplication.get().getJtrac().getDefaultLocale()).format(date) + : dateFormat.format(date)); + } + + public static String formatTimeStamp (Date date) { + return date == null + ? "" + : (showPretty() + ? new PrettyTime(JtracApplication.get().getJtrac().getDefaultLocale()).format(date) + : dateTimeFormat.format(date)); + } + + public static Date convert (String s) { + try { + return dateFormat.parse(s); + } catch(Exception e) { + throw new RuntimeException(e); + } + } +} Modified: trunk/jtrac/src/main/resources/messages.properties =================================================================== --- trunk/jtrac/src/main/resources/messages.properties 2021-08-04 10:45:46 UTC (rev 1377) +++ trunk/jtrac/src/main/resources/messages.properties 2021-08-04 13:06:48 UTC (rev 1378) @@ -1,5 +1,5 @@ # please refer documentation before starting work on a translation: -# http://jtrac.info/doc/html/dev-guide.html#dev-translating +# http://j-trac.sourceforge.net/doc/html/dev-guide.html#dev-translating # globals submit = Submit @@ -203,6 +203,7 @@ config.session.timeout = Time in minutes after which user session expires (default 30 minutes) config.attachment.maxsize = Maximum size in MB of file-attachments. (default 5 MB) Use -1 for no-limit config.pwd.minLength = Minimal length of passwords (default is 8) +config.time.pretty = Show relative timestamps as on Github, Twitter and Facebook (set to true, default is false) # config_list (config_form does not have any extra messages) config_list.configurationSettings = Configuration Settings Modified: trunk/jtrac/src/main/resources/messages_de.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_de.properties 2021-08-04 10:45:46 UTC (rev 1377) +++ trunk/jtrac/src/main/resources/messages_de.properties 2021-08-04 13:06:48 UTC (rev 1378) @@ -1,4 +1,5 @@ -# german translation last updated by Manfred Wolff +# Bitte hier lesen bevor Du an einer \xDCbersetzung arbeitest: +# http://j-trac.sourceforge.net/doc/html/dev-guide.html#dev-translating # globals submit = OK @@ -197,11 +198,12 @@ config.jtrac.url.base = URL dieser Installation ( zB. http://myserver/jtrac ) wird ben\u00F6tigt f\u00FCr Links in den eMails config.jtrac.header.picture = Inidividuelles Bild config.jtrac.header.text = Individueller Text -config.jtrac.edit.item = Soll der Ersteller eines Eintrages diesen editieren k\xF6nnen? (setzte auf true, default ist false) +config.jtrac.edit.item = Soll der Ersteller eines Eintrages diesen editieren k\xF6nnen? (auf true setzen, Default ist false) config.locale.default = Default Sprache zB. "de" f\u00FCr Deutsch config.session.timeout = Session Timeout in Minuten (Default 30 Minuten) config.attachment.maxsize = Maximalgr\u00F6\u00DFe f\u00FCr Anlagen in MB, "-1" f\u00FCr Kein-Limit (Default 5) config.pwd.minLength = Minimale L\u00e4nge von Passw\u00f6rtern (Default 8) +config.time.pretty = Relative Zeiten anzeigen wie auf Github, Twitter und Facebook (auf true setzen, Default ist false) # config_list (config_form does not have any extra messages) config_list.configurationSettings = Einstellungen Modified: trunk/jtrac/src/main/resources/messages_en.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_en.properties 2021-08-04 10:45:46 UTC (rev 1377) +++ trunk/jtrac/src/main/resources/messages_en.properties 2021-08-04 13:06:48 UTC (rev 1378) @@ -1,5 +1,5 @@ # please refer documentation before starting work on a translation: -# http://jtrac.info/doc/html/dev-guide.html#dev-translating +# http://j-trac.sourceforge.net/doc/html/dev-guide.html#dev-translating # globals submit = Submit @@ -203,6 +203,7 @@ config.session.timeout = Time in minutes after which user session expires (default 30 minutes) config.attachment.maxsize = Maximum size in MB of file-attachments. (default 5 MB) Use -1 for no-limit config.pwd.minLength = Minimal length of passwords (default is 8) +config.time.pretty = Show relative timestamps as on Github, Twitter and Facebook (set to true, default is false) # config_list (config_form does not have any extra messages) config_list.configurationSettings = Configuration Settings This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-08-05 11:18:35
|
Revision: 1380 http://sourceforge.net/p/j-trac/code/1380 Author: udittmer Date: 2021-08-05 11:18:30 +0000 (Thu, 05 Aug 2021) Log Message: ----------- purge the hijacked domain jtrac.info from source code, add automated version and timestamp properties Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.html trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.html trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.html trunk/jtrac/src/main/resources/jtrac-init.properties trunk/jtrac/src/main/resources/messages_cs.properties trunk/jtrac/src/main/resources/messages_el.properties trunk/jtrac/src/main/resources/messages_es.properties trunk/jtrac/src/main/resources/messages_fr.properties trunk/jtrac/src/main/resources/messages_hu.properties trunk/jtrac/src/main/resources/messages_ko.properties trunk/jtrac/src/main/resources/messages_nl.properties trunk/jtrac/src/main/resources/messages_no.properties trunk/jtrac/src/main/resources/messages_pl.properties trunk/jtrac/src/main/resources/messages_sl.properties trunk/jtrac/src/main/resources/messages_zh_CN.properties trunk/jtrac/src/main/webapp/WEB-INF/applicationContext-acegi-cas.xml trunk/jtrac/src/site/site.xml Added Paths: ----------- trunk/jtrac/src/main/resources/jtrac-version.properties Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-08-04 13:32:09 UTC (rev 1379) +++ trunk/jtrac/pom.xml 2021-08-05 11:18:30 UTC (rev 1380) @@ -442,6 +442,7 @@ <resources> <resource> <directory>src/main/resources</directory> + <filtering>true</filtering> <includes> <include>**</include> </includes> @@ -512,4 +513,9 @@ </plugin> </plugins> </build> + + <properties> + <timestamp>${maven.build.timestamp}</timestamp> + <maven.build.timestamp.format>yyyy-MM-dd HH:mm z</maven.build.timestamp.format> + </properties> </project> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.html 2021-08-04 13:32:09 UTC (rev 1379) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/BasePage.html 2021-08-05 11:18:30 UTC (rev 1380) @@ -15,7 +15,7 @@ <table width="100%" class="jtrac"> <tr class="alt"> <td align="right"> - <i>powered by <a href="http://jtrac.info" target="_blank">JTrac</a> <span wicket:id="version"></span></i> + <i>powered by <a href="http://j-trac.sourceforge.net/" target="_blank">JTrac</a> <span wicket:id="version"></span></i> </td> </tr> </table> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.html 2021-08-04 13:32:09 UTC (rev 1379) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/LoginPage.html 2021-08-05 11:18:30 UTC (rev 1380) @@ -41,7 +41,7 @@ <table width="100%" class="jtrac"> <tr class="alt"> <td align="right"> - <i>powered by <a href="http://jtrac.info" target="_blank">JTrac</a> <span wicket:id="version"></span></i> + <i>powered by <a href="http://j-trac.sourceforge.net/" target="_blank">JTrac</a> <span wicket:id="version"></span></i> </td> </tr> </table> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.html 2021-08-04 13:32:09 UTC (rev 1379) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/LogoutPage.html 2021-08-05 11:18:30 UTC (rev 1380) @@ -30,7 +30,7 @@ <table width="100%" class="jtrac"> <tr class="alt"> <td align="right"> - <i>powered by <a href="http://jtrac.info" target="_blank">JTrac</a> <span wicket:id="version"></span></i> + <i>powered by <a href="http://j-trac.sourceforge.net/" target="_blank">JTrac</a> <span wicket:id="version"></span></i> </td> </tr> </table> Modified: trunk/jtrac/src/main/resources/jtrac-init.properties =================================================================== --- trunk/jtrac/src/main/resources/jtrac-init.properties 2021-08-04 13:32:09 UTC (rev 1379) +++ trunk/jtrac/src/main/resources/jtrac-init.properties 2021-08-05 11:18:30 UTC (rev 1380) @@ -1,3 +1,12 @@ # uncomment / edit this file to customize the location # of the JTrac "home" directory e.g. jtrac.home=C:/jtrac # please refer the documentation at http://j-trac.sourceforge.net/ + +#jtrac.home=/Users/ulf/Development/Java/jtrac-2.1.0/live-data +#jtrac.url.base=https://trac.ulf:8443/ + +jtrac.home=/home/udittmer/tomcat/webapps/jtrac-data +jtrac.url.base=https://trac.care-with-care.com/ + +locale.default=en + Added: trunk/jtrac/src/main/resources/jtrac-version.properties =================================================================== --- trunk/jtrac/src/main/resources/jtrac-version.properties (rev 0) +++ trunk/jtrac/src/main/resources/jtrac-version.properties 2021-08-05 11:18:30 UTC (rev 1380) @@ -0,0 +1,3 @@ +version=${pom.version} +timestamp=${timestamp} + Modified: trunk/jtrac/src/main/resources/messages_cs.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_cs.properties 2021-08-04 13:32:09 UTC (rev 1379) +++ trunk/jtrac/src/main/resources/messages_cs.properties 2021-08-05 11:18:30 UTC (rev 1380) @@ -1,439 +1,439 @@ -# please refer documentation before starting work on a translation: -# http://jtrac.info/doc/html/dev-guide.html#dev-translating - -# globals -submit = Vlo\u017Eit -cancel = Zru\u0161it -delete = Vymazat -back = Zp\u011Bt -next = Dal\u0161\u00ED -edit = Upravit -view = N\u00E1hled -search = Vyhledat -new = Nov\u00FD -save = Ulo\u017Eit - -# override default messages for spring mvc form binding errors -typeMismatch.java.lang.Double = Pros\u00EDm, zadejte spr\u00E1vn\u00E9 \u010D\u00EDslo. -typeMismatch.java.util.Date = Pros\u00EDm, zadejte spr\u00E1vn\u00FD datum ve form\u00E1tu\: rrrr-mm-dd - -# wicket globals -null = -nullValid = -Required = Pros\u00EDm, vypl\u0148te povinn\u00E1 pole. -IConverter.Double = ${label}\: Pros\u00EDm, zadejte spr\u00E1vn\u00E9 \u010D\u00EDslo -IConverter.Date = ${label}\: Pros\u00EDm, zadejte spr\u00E1vn\u00FD datum ve form\u00E1tu\: rrrr-mm-dd - -# generic form validation message -error.empty = Nutno zadat hodnotu - -# header navigation -header.dashboard = N\u00C1HLED -header.new = NOV\u00DD -header.search = HLEDAT -header.options = MO\u017DNOSTI -header.login = P\u0158IHL\u00C1SIT -header.logout = ODHL\u00C1SIT - -# dashboard -dashboard.noSpaces = Nejste p\u0159id\u011Blen k \u017E\u00E1dn\u00E9mu projektu -dashboard.space = Projekt -dashboard.action = Akce -dashboard.status = Status -dashboard.loggedByMe = Mnou<br/>Otev\u0159en -dashboard.assignedToMe = Mn\u011B<br/>P\u0159id\u011Blen -dashboard.all = V\u0161e -dashboard.new = Nov\u00E9 -dashboard.search = HLEDAT -dashboard.showDetails = Uka\u017E Detaily -dashboard.hideDetails = Skryj Detaily - -# item_form -item_form.summary = Zhrnut\u00ED -item_form.detail = Detailn\u00ED popis -item_form.assignTo = Komu P\u0159edat -item_form.editReason = D\u016Fvod opravy -item_form.sendNotifications = po\u0161li upozorn\u011Bn\u00ED emailem -item_form.notifyByEmail = Upozorni Emailem -item_form.attachment = P\u0159\u00EDloha -item_form.error.version = Pr\u00E1v\u011B je opravov\u00E1no jin\u00FDm u\u017Eivatelem nebo jste pou\u017Eil zp\u011Btn\u00E9 tla\u010D\u00EDtko v prohl\u00ED\u017Ee\u010Di. - -# item_view (note this is rendered within a taglib and not in a JSP) -item_view.id = Kl\u00ED\u010D -item_view.relatedItems = Podobn\u00E9 p\u0159\u00EDpady -item_view.remove = Vymazat -item_view.relatedTo = souvis\u00ED s -item_view.duplicateOf = je kopie -item_view.dependsOn = z\u00E1vis\u00ED na -item_view.relatedToThis = souvis\u00ED s t\u00EDmto -item_view.duplicateOfThis = je kopie tohoto -item_view.dependsOnThis = z\u00E1vis\u00ED na tomto -item_view.this = Toto -item_view.status = Status -item_view.loggedBy = Zapsal -item_view.assignedTo = P\u0159id\u011Bleno -item_view.summary = Souhrn -item_view.detail = Detail -item_view.history = Historie -item_view.comment = Koment\u00E1\u0159 -item_view.timeStamp = Zaznamen\u00E1no - -# item_view_form -item_view_form.relateTo = Vztvo\u0159 souvislost s jin\u00FDm p\u0159\u00EDpadem -item_view_form.duplicateOf = je kopie tohoto -item_view_form.dependsOn = z\u00E1vis\u00ED na tomto -item_view_form.relatedTo = souvis\u00ED s t\u00EDmto -item_view_form.newStatus = Nov\u00FD Status -item_view_form.assignTo = P\u0159id\u011Bl -item_view_form.comment = Koment\u00E1\u0159 -item_view_form.sendNotifications = po\u0161li e-mailov\u00E9 upozorn\u011Bn\u00ED -item_view_form.addRelatedItem = p\u0159idej souvisej\u00EDc\u00ED p\u0159\u00EDpad -item_view_form.change = zm\u011Bna -item_view_form.notifyByEmail = Upozorn\u011Bn\u00ED e-mailem -item_view_form.attachment = P\u0159\u00EDloha -item_view_form.assignedTo.error = P\u0159id\u011Bl: Nutn\u00E9 pokud Status je jin\u00FD ne\u017E {0} -item_view_form.status.error = Nutn\u00E9 p\u0159i p\u0159id\u011Blov\u00E1n\u00ED -item_view_form.chooseStatus = -- vyber status -- - -# item_search_form -item_search_form.searchingForRelated = Hled\u00E1n\u00ED p\u0159\u00EDpad\u016F souvisej\u00EDc\u00EDch s -item_search_form.viewItemById = Prohl\u00ED\u017Een\u00ED p\u0159\u00EDpad\u016F podle kl\u00ED\u010De -item_search_form.textSearch = Textov\u00E9 Vzhled\u00E1v\u00E1n\u00ED -item_search_form.resultsPerPage = V\u00FDsledk\u016F na Stranu -item_search_form.noLimit = Bez Limitu -item_search_form.sortOnColumn = T\u0159\u00EDd\u011Bn\u00ED podle Sloupce -item_search_form.id = Kl\u00ED\u010D -item_search_form.descending = Sestupn\u011B -item_search_form.showDetail = Uka\u017E Detaily -item_search_form.showHistory = Uka\u017E Historii -item_search_form.loggedBy = Otev\u0159eno -item_search_form.assignedTo = P\u0159id\u011Bleno -item_search_form.createdDate = Vztvo\u0159eno Dne -item_search_form.onOrAfter = Od / Pot\u00E9 -item_search_form.onOrBefore = Do / P\u0159ed -item_search_form.status = Status -item_search_form.severity = D\u016Fle\u017Eitost -item_search_form.priority = Priorita -item_search_form.historyUpdatedDate = Datum z\u00E1pisu -item_search_form.space = Projekt -item_search_form.error.refId.invalid = Neplatn\u00FD kl\u00ED\u010D -item_search_form.error.refId.notFound = P\u0159\u00EDpad nebyl nalezen -item_search_form.error.summary.invalid = \u0160patn\u00FD hledan\u00FD text - -# item_list (most rendered within a taglib not JSP, some reused also for excel export) -item_list.searchingForRelated = Held\u00E1n\u00ED souvisej\u00EDc\u00EDch p\u0159\u00EDpad\u016F -item_list.modifySearch = Zm\u011Bn Vyhled\u00E1v\u00E1n\u00ED -item_list.recordFound = Z\u00E1znam\u016F nelezeno -item_list.recordsFound = Z\u00E1znam\u016F nelezeno -item_list.exportToExcel = Excel -item_list.exportToXml = XML -item_list.id = ID -item_list.summary = Souhrn -item_list.detail = Detaily -item_list.loggedBy = Zapsal -item_list.status = Status -item_list.assignedTo = P\u0159id\u011Bleno -item_list.timeStamp = Zaznamen\u00E1no -item_list.history = Historie -item_list.space = Projekt - -# options -options.optionsMenu = Mo\u017Enosti -options.editYourProfile = Oprava Profilu U\u017Eivatele -options.manageUsers = Zpr\u00E1va U\u017Eivatel\u016F -options.manageSpaces = Zpr\u00E1va Projekt\u016F -options.manageSettings = Zpr\u00E1va Mo\u017Enost\u00ED -options.rebuildIndexes = Re-Indexace -options.importFromExcel = Na\u010Dten\u00ED z Excelu - -# user_form -user_form.userDetails = Detaily U\u017Eivatele -user_form.loginId = U\u017Eivatel -user_form.fullName = Pln\u00E9 jm\u00E9no -user_form.emailId = E-Mailov\u00E1 adresa -user_form.language = Jazyk -user_form.passwordMessage = Nov\u011B Vygenerovan\u00E9 Heslo v\u00E1m bude zasl\u00E1no e-mailem.<br/>N\u00E1sleduj\u00EDc\u00ED pole nejsou nutn\u00E1. -user_form.password = Heslo -user_form.confirmPassword = Potvr\u010F heslo -user_form.loginId.error.invalid = U\u017Eivatelsk\u00E9 jm\u00E9no obsahuje nedovolen\u00E9 znaky -user_form.loginId.error.exists = U\u017Eivatelsk\u00E9 jm\u00E9no ji\u017E existuje. -user_form.passwordConfirm.error = Hesla jsou r\u016Fzn\u00E1. -user_form.mailPassword = po\u0161li heslo e-mailem -user_form.locked = Zablokov\u00E1n - -# logout -logout.title = \u00DAsp\u011B\u0161n\u00E9 odhl\u00E1\u0161en\u00ED -logout.home = Dom\u016F -logout.message = \u00DAsp\u011B\u0161n\u00E9 odhl\u00E1\u0161en\u00ED. Nastaven\u00ED jak\u00E9koli aktivn\u00ED "zapamatuj si mne" slu\u017Eby bylo vymaz\u00E1no. -logout.login = P\u0159ihl\u00E1\u0161en\u00ED - -# login -login.title = JTrac P\u0159ihl\u00E1\u0161en\u00ED -login.home = Dom\u016F -login.loginName = U\u017Eivatelsk\u00E9 jm\u00E9no / email -login.password = Heslo -login.rememberMe = zapamatuj si mne -login.submit = Vlo\u017E -login.error = \u0160patn\u00E9 jm\u00E9no nebo heslo - -# config explanations (used in both config_list and config_form screens) -config.mail.server.host = Jm\u00E9no nebo IP adresa SMTP serveru, kter\u00FD bude pou\u017Eit k zas\u00EDlan\u00ED e-mail\u016F -config.mail.server.port = Port SMTP serveru (oby\u010Dejn\u011B 25) -config.mail.server.username = U\u017Eivatelsk\u00E9 jm\u00E9no, pokud SMTP server vy\u017Eaduje authentikaci -config.mail.server.password = Heslo, pokud SMTP server vy\u017Eaduje authentikaci -config.mail.server.starttls.enable = Vlo\u017E "true", pokud SMTP server vy\u017Eaduje beype\u010Dn\u00E9 (SSL) p\u0159ipojen\u00ED -config.mail.subject.prefix = Text, kter\u00FD bude p\u0159edch\u00E1zet ka\u017Ed\u00E9mu subjektu v e-mailech (oby\u010Dejn\u011B [jtrac]) -config.mail.session.jndiname = javax.mail.Session JNDI jm\u00E9no - pokud je vzpln\u00EDte, tak bude pou\u017Eito m\u00EDsto SMTP serveru -config.mail.from = Generovan\u00E9 e-maily jsou posl\u00E1ny z t\u00E9to 'from' adresy -config.jtrac.url.base = Z\u00E1kladn\u00ED URL va\u0161\u00ED JTrac instalace ( nap\u0159. http://mujserver/jtrac ) = je zapot\u0159eb\u00ED pro spr\u00E1vnou funkc\u00ED odeslan\u00FDch e-mail\u016F -config.locale.default = Z\u00E1kladn\u00ED jazyk t\u00E9to JTrac instalce nap\u0159. "cz" pro \u010Ce\u0161tinu -config.session.timeout = \u010Cas v minut\u00E1ch po jeho\u017E ub\u011Bhnut\u00ED bude zru\u0161eno u\u017Eivatelsk\u00E9 spojen\u00ED (oby\u010Dejn\u011B 30 minut) -config.attachment.maxsize = Maxim\u00E1ln\u00ED velikost p\u0159\u00EDloh v MB. (obz\u010Dejn\u011B 5 MB) Vlo\u017E -1 pro neomezenou velikost. - -# config_list (config_form does not have any extra messages) -config_list.configurationSettings = Nastaven\u00ED konfigurace -config_list.parameter = Parameter -config_list.value = Hodnota -config_list.edit = Oprava -config_list.description = Popis - -# excel_upload -excel_upload.uploadExcelFile = Nahr\u00E1t soubor v Excelu -excel_upload.error.invalidFile = Probl\u00E9m se zpracov\u00E1n\u00EDm souboru, mo\u017En\u00E1 to nen\u00ED platn\u00FD Excel form\u00E1t. - -# excel_view -excel_view.previewImportedData= N\u00E1hled na Importovan\u00E1 Data -excel_view.selectActionToPerform = -- vyber akci k v\u00FDkonu -- -excel_view.deleteSelected = Vyma\u017E vzbran\u00E9 Sloupce / \u0158ady -excel_view.convertToDate = Zm\u011B\u0148 Format vybran\u00FDch Sloupc\u016F na Date -excel_view.concatenateFields = Spoj obsah vybran\u00FDch Sloupc\u016F -excel_view.extractFirstEighty = Vyber prvn\u00EDch 80 znak\u016F do nov\u00E9ho Sloupce -excel_view.duplicateColumn = Duplikuj Vybran\u00FD Sloupec -excel_view.mapToField = Zmapuj Vybran\u00FD Sloupec s Polem v Projektu -excel_view.editRow = Oprav Vybran\u00FD \u0158adek Dat -excel_view.import = Import do Vybran\u00E9ho Projektu - -excel_view.error.noActionSelected = Pros\u00EDm, zvolte akci k v\u00FDkonu -excel_view.error.noSpaceSelected = Pros\u00EDm, zvolte nejd\u0159\u00EDve projekt -excel_view.error.noColumnSelected = Pros\u00EDm, vyberte sloupec -excel_view.error.noRowSelected = Pros\u00EDm, vyberte \u0159adu -excel_view.error.noColumnOrRowSelected = Pros\u00EDm, vyberte sloupce / \u0159ady -excel_view.error.atLeastTwoColumns = Pros\u00EDm, vyberte alespo\u0148 dva sloupce -excel_view.error.duplicateMapping = Pole zmapov\u00E1no v\u00EDce ne\u017E jednou: '{0}' -excel_view.error.notMapped = Pole mus\u00ED b\u00FDt zmapov\u00E1no: '{0}' -excel_view.error.invalidValue = N\u011Bkter\u00E9 skl\u00EDpky obsahuj\u00ED \u0161patn\u00E1 data. - -excel_view.selectSpace = Zvol Projekt -excel_view.selectedSpace = Zvolen\u00FD Projekt -excel_view.noSpaceSelected = (\u017E\u00E1dn\u00FD projekt nebyl vybr\u00E1n) -excel_view.preview = N\u00E1hled -excel_view.distinctValues = R\u016Fzn\u00E9 Hodnoty -excel_view.mapTo = Zmapuj s -excel_view.columnData = Sloupec Dat -excel_view.selectedColumn = Vybran\u00FD Sloupec: -excel_view.update = Zm\u011B\u0148 -excel_view.importSuccess = Pr\u00EDpady byly \u00FAsp\u011B\u0161n\u011B Importov\u00E1ny - -# exception_flow -exception_flow.unsupportedNavigation = Nepodporovan\u00E1 Navigace -exception_flow.line1 = Zp\u011Btn\u00E9 tla\u010D\u00EDtko Prohl\u00ED\u017Ee\u010De / obnova strany - nen\u00ED v t\u00E9to verzi podporov\u00E1na. -exception_flow.line2 = Tento probl\u00E9m nelze vy\u0159e\u0161it a budete muset zopakovat p\u0159edch\u00E1zej\u00EDc\u00ED \u00FAkon. -exception_flow.line3 = Abzchom se vyhnuli tomuto probl\u00E9mu, pou\u017E\u00EDvejte, pros\u00EDm, pouze tla\u010D\u00EDtka v t\u00E9to aplikaci. - -# index_rebuild_success -index_rebuild.heading = Re-Indexeace -index_rebuild.warning = Tohle m\u016F\u017Ee trvat del\u0161\u00ED dobu a nedoporu\u010Duje se, aby byli ve stejnou dobu p\u0159ihl\u00E1\u0161eni jin\u00ED u\u017Eivatel\u00E9. - -# index_rebuild_success -index_rebuild_success.message = Re-Indexace prob\u011Bhla \u00FAsp\u011B\u0161n\u011B - -# space_allocate -space_allocate.usersAllocatedToSpace = U\u017Eivatel\u00E9 p\u0159i\u0159azeni k Projektu -space_allocate.loginName = U\u017Eivatelsk\u00E9 jm\u00E9no -space_allocate.fullName = Jm\u00E9no a P\u0159ijmen\u00ED -space_allocate.role = Role -space_allocate.remove = Vymazat -space_allocate.allocateUser = Vyber U\u017Eivatele a Roli k p\u0159i\u0159azen\u00ED -space_allocate.createNewUser = Vytvo\u0159 nov\u00E9ho U\u017Eivatele -space_allocate.user = U\u017Eivatel -space_allocate.allocate = P\u0159i\u0159a\u010F - -# space_delete -space_delete.confirm = Potvr\u010F vymaz\u00E1n\u00ED Projektu -space_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tento Projekt? -space_delete.line2 = Tohle vyma\u017Ee v\u0161echny p\u0159\u00EDpady tohoto Projektu. -space_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. - -# space_field_delete -space_field_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED tohoto pole -space_field_delete.line1 = Jste si jisti, \u017Ee chcete vymazat toto pole? -space_field_delete.line2 = Po\u010Det zm\u011Bn\u011Bn\u00FDch z\u00E1znam\u016F v datab\u00E1zi = {0} -space_field_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. - -# space_field_form -space_field_form.editField = Oprava Pole -space_field_form.internalName = Intern\u00ED jm\u00E9no -space_field_form.label = Ozna\u010Den\u00ED -space_field_form.optional = Nen\u00ED nutn\u00E9 -space_field_form.options = Mo\u017Enosti -space_field_form.addOption = P\u0159idej Mo\u017Enost -space_field_form.update = Zapsat -space_field_form.done = Hotovo -space_field_form.error.optionExists = Takov\u00E1 Mo\u017Enost ji\u017E existuje - -# space_field_option_delete -space_field_option_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED t\u00E9to mo\u017Enosti -space_field_option_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tuto Mo\u017Enost? -space_field_option_delete.line2 = Po\u010Det zm\u011Bn\u011Bn\u00FDch z\u00E1znam\u016F v datab\u00E1zi = {0} -space_field_option_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. - -# space_field_option_edit -space_field_option_edit.editOption = Oprava Mo\u017Enost\u00ED tohoto Pole -space_field_option_edit.error.optionEmpty = Tato Mo\u017Enost nem\u016F\u017Ee b\u00FDt pr\u00E1zdn\u00E1 -space_field_option_edit.error.exists = Takov\u00E1 Mo\u017Enost ji\u017E existuje - -# space_fields -space_fields.customFields = Specialn\u00ED Pole tohoto Projektu -space_fields.move = Posu\u0148 -space_fields.internalName = Intern\u00ED jm\u00E9no -space_fields.type = Typ -space_fields.optional = Nen\u00ED nutn\u00E9 -space_fields.label = Ozna\u010Den\u00ED -space_fields.optionList = Seznam Mo\u017Enost\u00ED -space_fields.chooseType = Vzber tzp p\u0159id\u00E1van\u00E9ho Pole -space_fields.addField = P\u0159idej Pole -space_fields.type_1 = D\u016Fle\u017Eitost (Drop Down) -space_fields.type_2 = Priorita (Drop Down) -space_fields.type_3 = Drop Down Seznam -space_fields.type_4 = Decimaln\u00ED \u010C\u00EDslo -space_fields.type_5 = Textov\u00E9 Pole -space_fields.type_6 = Datum -space_fields.typeRemaining = {0} zb\u00FDv\u00E1 - -# space_form -space_form.spaceDetails = Detaily Projektu -space_form.displayName = Jm\u00E9no -space_form.spaceKey = Kl\u00ED\u010D Projektu (kr\u00E1tk\u00E9 jm\u00E9no) -space_form.description = Popis -space_form.makePublic = Opublikovat -space_form.allowGuest = Povol p\u0159\u00EDstup host\u016Fm (pouze pro \u010Dten\u00ED) -space_form.copyExisting = Zkop\u00EDruj Existuj\u00EDc\u00ED Projekt -space_form.createFresh = vztvo\u0159 zcela nov\u00FD -space_form.error.prefixCode.tooShort = D\u00E9lka mus\u00ED b\u00FDt minim\u00E1ln\u011B 3 znaky. -space_form.error.prefixCode.tooLong = D\u00E9lka by nem\u011Bla b\u00FDt v\u00EDc ne\u017E 10 znak\u016F. -space_form.error.prefixCode.invalid = Povolena jsou pouze velk\u00E1 p\u00EDsmena a \u010D\u00EDslice -space_form.error.prefixCode.exists = Projekt s t\u00EDmto kl\u00ED\u010Dem ji\u017E existuje - -# space_list -space_list.spaceList = Seznam Projekt\u016F -space_list.createNewSpace = Vytvo\u0159 nov\u00FD Projekt -space_list.key = Kl\u00ED\u010D -space_list.name = Jm\u00E9no -space_list.edit = Oprav -space_list.description = Popis -space_list.users = U\u017Eivatel\u00E9 - -# space_role_delete -space_role_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED t\u00E9to Role -space_role_delete.line1 = Existuj\u00ED u\u017Eivatel\u00E9 p\u0159i\u0159azeni k tomuto Projektu ({0}) s touto Rol\u00ED. -space_role_delete.line2 = Jste si jisti, \u017Ee chcete vymazat tuto Roli? -space_role_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. - -# space_role_form -space_role_form.editRoleName = Oprava Jm\u00E9na Role -space_role_form.error.role.invalid = Jm\u00E9no Role m\u00E1 povolena pouze velk\u00E1 p\u00EDsmena a \u010D\u00EDslice ('_' je povoleno uvnit\u0159 jm\u00E9na) -space_role_form.error.role.exists = Role s t\u00EDmto jm\u00E9nem ji\u017E existuje -space_role_form.error.role.reserved = Toto jm\u00E9no Role je reservov\u00E1no k vnit\u0159n\u00EDmu pou\u017Eit\u00ED - -# space_role_form_confirm -space_role_form_confirm.confirm = Potvr\u010F zm\u011Bnu jm\u00E9na Role : {0} na {1} -space_role_form_confirm.line1 = Jste si jisti, \u017Ee chcete p\u0159ejmenovat tuto Roli? -space_role_form_confirm.line2 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. - -# space_roles -space_roles.spaceRoles = Role v Projektu a Zm\u011Bny Stavu (Workflow State-Transitions) pro Projekt -space_roles.addState = P\u0159idej Stav -space_roles.addRole = P\u0159idej Roli -space_roles.nextAllowedState = P\u0159\u00ED\u0161t\u00ED povolen\u00FD Stav -space_roles.fieldLevelPermissions = Pravomoce na \u00FArovni pole -space_roles.state = Stav -space_roles.role = Role -space_roles.mandatory = Povinn\u00FD -space_roles.optional = Nepovinn\u00FD -space_roles.readonly = Pouze pro \u010Dten\u00ED - -# space_state_delete -space_state_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED tohoto Stavu -space_state_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tento Stav? -space_state_delete.line2 = Po\u010Det zm\u011Bn\u011Bn\u00FDch z\u00E1znam\u016F v datab\u00E1zi = {0} -space_state_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. - -# space_state_form -space_state_form.editState = Oprava Stavu -space_state_form.error.state.invalid = Jm\u00E9no Stavu mus\u00ED pou\u017E\u00EDt znak minus ('-') k odd\u011Blen\u00ED slov nap\u0159. 'Opraveno', 'Pozastaven' nebo 'Pracuje-se-na-tom' -space_state_form.error.state.exists = Stav tohoto jm\u00E9na ji\u017E existuje - -# user_allocate_space -user_allocate_space.spacesAllocated = Projekty p\u0159i\u0159azen\u00E9 U\u017Eivateli -user_allocate_space.space = Projekt -user_allocate_space.role = Role -user_allocate_space.remove = Vymazat -user_allocate_space.chooseSpace = Vzber Projekt k p\u0159i\u0159azen\u00ED tomuto U\u017Eivateli -user_allocate_space.makeUserAdmin = Udelej tohoto U\u017Eivatele Administratorem (v\u0161ech Projekt\u016F) -user_allocate_space.makeAdmin = Ud\u011Blej Adminem -user_allocate_space.allSpaces = (v\u0161echny projekty) - -# user_allocate_space_role -user_allocate_space_role.allocateRole = P\u0159i\u0159a\u010F Roli U\u017Eivateli {0} v r\u00E1mci Projektu -user_allocate_space_role.allocate = P\u0159i\u0159a\u010F - -# user_list -user_list.usersAndSpaces = U\u017Eivatel\u00E9 a p\u0159i\u0159azen\u00E9 Projekty -user_list.createNewUser = Vytvo\u0159 Nov\u00E9ho U\u017Eivatele -user_list.userName = U\u017Eivatelsk\u00E9 jm\u00E9no -user_list.loginName = U\u017Eivatel -user_list.editProfile = Oprav Profil -user_list.locked = Zablokov\u00E1n -user_list.spaceRole = Projekt (Role) -user_list.allocateSpaceRole = P\u0159i\u0159a\u010F<br/>Projekt / Roli -user_list.locale = Jazyk -user_list.email = E Mail -user_list.filterBy = Filtrovat - -# mail_sender (this is in the mail sending code, not a JSP) -mail_sender.loginMailSubject = JTrac detaily nutn\u00E9 k p\u0159ihl\u011B\u0161en\u00ED -mail_sender.loginMailGreeting = Ahoj -mail_sender.loginMailLine1 = Nasleduj\u00ED tvoje nov\u00E9 / opraven\u00E9 detaily nutn\u00E9 k p\u0159ihl\u011B\u0161en\u00ED: -mail_sender.loginName = U\u017Eivatelsk\u00E9 jm\u00E9no -mail_sender.password = Heslo -mail_sender.loginMailLine2 = Pou\u017Eij tento link k p\u0159ihl\u00E1\u0161en\u00ED: - -# new item_relate_remove -item_relate_remove.heading = Potvr\u010Fte vymaz\u00E1n\u00ED t\u00E9to souvislosti - -# item_delete -item_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED tohoto P\u0159\u00EDpadu -item_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tento P\u0159\u00EDpad? -item_delete.line2 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. - -# user_delete -user_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED tohoto U\u017Eivatele -user_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tohoto U\u017Eivatele? -user_delete.line2 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. -user_delete.notPossible = Tento U\u017Eivatel je uveden v n\u011Bkolika P\u0159\u00EDpadech. Pokuste se ho zablokovat nebo zma\u017Ete prvn\u011B takov\u00E9 P\u0159\u00EDpady. - -# generic error messages -error.itemBelongsToUnallocatedSpace = Nem\u00E1te opr\u00E1vn\u011Bn\u00ED prohl\u00E9dnout si tento P\u0159\u00EDpad - -# item search filter wizard -item_filter.showColumn = Uka\u017E ve V\u00FDsledc\u00EDch -item_filter.expression = Vzhled\u00E1vac\u00ED Filtr -item_filter.expandAll = (uka\u017E v\u0161e) -item_filter.in = m\u00E1 hotnoty -item_filter.notIn = nem\u00E1 hotnoty -item_filter.like = obsahuje text -item_filter.equal = je shodn\u00FD s -item_filter.notEqual = nen\u00ED shodn\u00FD s -item_filter.greaterThan = v\u011Bt\u0161\u00ED ne\u017E -item_filter.lessThan = men\u0161\u00ED ne\u017E -item_filter.between = mezi \ No newline at end of file +# please refer documentation before starting work on a translation: +# http://j-trac.sourceforge.net/doc/html/dev-guide.html#dev-translating + +# globals +submit = Vlo\u017Eit +cancel = Zru\u0161it +delete = Vymazat +back = Zp\u011Bt +next = Dal\u0161\u00ED +edit = Upravit +view = N\u00E1hled +search = Vyhledat +new = Nov\u00FD +save = Ulo\u017Eit + +# override default messages for spring mvc form binding errors +typeMismatch.java.lang.Double = Pros\u00EDm, zadejte spr\u00E1vn\u00E9 \u010D\u00EDslo. +typeMismatch.java.util.Date = Pros\u00EDm, zadejte spr\u00E1vn\u00FD datum ve form\u00E1tu\: rrrr-mm-dd + +# wicket globals +null = +nullValid = +Required = Pros\u00EDm, vypl\u0148te povinn\u00E1 pole. +IConverter.Double = ${label}\: Pros\u00EDm, zadejte spr\u00E1vn\u00E9 \u010D\u00EDslo +IConverter.Date = ${label}\: Pros\u00EDm, zadejte spr\u00E1vn\u00FD datum ve form\u00E1tu\: rrrr-mm-dd + +# generic form validation message +error.empty = Nutno zadat hodnotu + +# header navigation +header.dashboard = N\u00C1HLED +header.new = NOV\u00DD +header.search = HLEDAT +header.options = MO\u017DNOSTI +header.login = P\u0158IHL\u00C1SIT +header.logout = ODHL\u00C1SIT + +# dashboard +dashboard.noSpaces = Nejste p\u0159id\u011Blen k \u017E\u00E1dn\u00E9mu projektu +dashboard.space = Projekt +dashboard.action = Akce +dashboard.status = Status +dashboard.loggedByMe = Mnou<br/>Otev\u0159en +dashboard.assignedToMe = Mn\u011B<br/>P\u0159id\u011Blen +dashboard.all = V\u0161e +dashboard.new = Nov\u00E9 +dashboard.search = HLEDAT +dashboard.showDetails = Uka\u017E Detaily +dashboard.hideDetails = Skryj Detaily + +# item_form +item_form.summary = Zhrnut\u00ED +item_form.detail = Detailn\u00ED popis +item_form.assignTo = Komu P\u0159edat +item_form.editReason = D\u016Fvod opravy +item_form.sendNotifications = po\u0161li upozorn\u011Bn\u00ED emailem +item_form.notifyByEmail = Upozorni Emailem +item_form.attachment = P\u0159\u00EDloha +item_form.error.version = Pr\u00E1v\u011B je opravov\u00E1no jin\u00FDm u\u017Eivatelem nebo jste pou\u017Eil zp\u011Btn\u00E9 tla\u010D\u00EDtko v prohl\u00ED\u017Ee\u010Di. + +# item_view (note this is rendered within a taglib and not in a JSP) +item_view.id = Kl\u00ED\u010D +item_view.relatedItems = Podobn\u00E9 p\u0159\u00EDpady +item_view.remove = Vymazat +item_view.relatedTo = souvis\u00ED s +item_view.duplicateOf = je kopie +item_view.dependsOn = z\u00E1vis\u00ED na +item_view.relatedToThis = souvis\u00ED s t\u00EDmto +item_view.duplicateOfThis = je kopie tohoto +item_view.dependsOnThis = z\u00E1vis\u00ED na tomto +item_view.this = Toto +item_view.status = Status +item_view.loggedBy = Zapsal +item_view.assignedTo = P\u0159id\u011Bleno +item_view.summary = Souhrn +item_view.detail = Detail +item_view.history = Historie +item_view.comment = Koment\u00E1\u0159 +item_view.timeStamp = Zaznamen\u00E1no + +# item_view_form +item_view_form.relateTo = Vztvo\u0159 souvislost s jin\u00FDm p\u0159\u00EDpadem +item_view_form.duplicateOf = je kopie tohoto +item_view_form.dependsOn = z\u00E1vis\u00ED na tomto +item_view_form.relatedTo = souvis\u00ED s t\u00EDmto +item_view_form.newStatus = Nov\u00FD Status +item_view_form.assignTo = P\u0159id\u011Bl +item_view_form.comment = Koment\u00E1\u0159 +item_view_form.sendNotifications = po\u0161li e-mailov\u00E9 upozorn\u011Bn\u00ED +item_view_form.addRelatedItem = p\u0159idej souvisej\u00EDc\u00ED p\u0159\u00EDpad +item_view_form.change = zm\u011Bna +item_view_form.notifyByEmail = Upozorn\u011Bn\u00ED e-mailem +item_view_form.attachment = P\u0159\u00EDloha +item_view_form.assignedTo.error = P\u0159id\u011Bl: Nutn\u00E9 pokud Status je jin\u00FD ne\u017E {0} +item_view_form.status.error = Nutn\u00E9 p\u0159i p\u0159id\u011Blov\u00E1n\u00ED +item_view_form.chooseStatus = -- vyber status -- + +# item_search_form +item_search_form.searchingForRelated = Hled\u00E1n\u00ED p\u0159\u00EDpad\u016F souvisej\u00EDc\u00EDch s +item_search_form.viewItemById = Prohl\u00ED\u017Een\u00ED p\u0159\u00EDpad\u016F podle kl\u00ED\u010De +item_search_form.textSearch = Textov\u00E9 Vzhled\u00E1v\u00E1n\u00ED +item_search_form.resultsPerPage = V\u00FDsledk\u016F na Stranu +item_search_form.noLimit = Bez Limitu +item_search_form.sortOnColumn = T\u0159\u00EDd\u011Bn\u00ED podle Sloupce +item_search_form.id = Kl\u00ED\u010D +item_search_form.descending = Sestupn\u011B +item_search_form.showDetail = Uka\u017E Detaily +item_search_form.showHistory = Uka\u017E Historii +item_search_form.loggedBy = Otev\u0159eno +item_search_form.assignedTo = P\u0159id\u011Bleno +item_search_form.createdDate = Vztvo\u0159eno Dne +item_search_form.onOrAfter = Od / Pot\u00E9 +item_search_form.onOrBefore = Do / P\u0159ed +item_search_form.status = Status +item_search_form.severity = D\u016Fle\u017Eitost +item_search_form.priority = Priorita +item_search_form.historyUpdatedDate = Datum z\u00E1pisu +item_search_form.space = Projekt +item_search_form.error.refId.invalid = Neplatn\u00FD kl\u00ED\u010D +item_search_form.error.refId.notFound = P\u0159\u00EDpad nebyl nalezen +item_search_form.error.summary.invalid = \u0160patn\u00FD hledan\u00FD text + +# item_list (most rendered within a taglib not JSP, some reused also for excel export) +item_list.searchingForRelated = Held\u00E1n\u00ED souvisej\u00EDc\u00EDch p\u0159\u00EDpad\u016F +item_list.modifySearch = Zm\u011Bn Vyhled\u00E1v\u00E1n\u00ED +item_list.recordFound = Z\u00E1znam\u016F nelezeno +item_list.recordsFound = Z\u00E1znam\u016F nelezeno +item_list.exportToExcel = Excel +item_list.exportToXml = XML +item_list.id = ID +item_list.summary = Souhrn +item_list.detail = Detaily +item_list.loggedBy = Zapsal +item_list.status = Status +item_list.assignedTo = P\u0159id\u011Bleno +item_list.timeStamp = Zaznamen\u00E1no +item_list.history = Historie +item_list.space = Projekt + +# options +options.optionsMenu = Mo\u017Enosti +options.editYourProfile = Oprava Profilu U\u017Eivatele +options.manageUsers = Zpr\u00E1va U\u017Eivatel\u016F +options.manageSpaces = Zpr\u00E1va Projekt\u016F +options.manageSettings = Zpr\u00E1va Mo\u017Enost\u00ED +options.rebuildIndexes = Re-Indexace +options.importFromExcel = Na\u010Dten\u00ED z Excelu + +# user_form +user_form.userDetails = Detaily U\u017Eivatele +user_form.loginId = U\u017Eivatel +user_form.fullName = Pln\u00E9 jm\u00E9no +user_form.emailId = E-Mailov\u00E1 adresa +user_form.language = Jazyk +user_form.passwordMessage = Nov\u011B Vygenerovan\u00E9 Heslo v\u00E1m bude zasl\u00E1no e-mailem.<br/>N\u00E1sleduj\u00EDc\u00ED pole nejsou nutn\u00E1. +user_form.password = Heslo +user_form.confirmPassword = Potvr\u010F heslo +user_form.loginId.error.invalid = U\u017Eivatelsk\u00E9 jm\u00E9no obsahuje nedovolen\u00E9 znaky +user_form.loginId.error.exists = U\u017Eivatelsk\u00E9 jm\u00E9no ji\u017E existuje. +user_form.passwordConfirm.error = Hesla jsou r\u016Fzn\u00E1. +user_form.mailPassword = po\u0161li heslo e-mailem +user_form.locked = Zablokov\u00E1n + +# logout +logout.title = \u00DAsp\u011B\u0161n\u00E9 odhl\u00E1\u0161en\u00ED +logout.home = Dom\u016F +logout.message = \u00DAsp\u011B\u0161n\u00E9 odhl\u00E1\u0161en\u00ED. Nastaven\u00ED jak\u00E9koli aktivn\u00ED "zapamatuj si mne" slu\u017Eby bylo vymaz\u00E1no. +logout.login = P\u0159ihl\u00E1\u0161en\u00ED + +# login +login.title = JTrac P\u0159ihl\u00E1\u0161en\u00ED +login.home = Dom\u016F +login.loginName = U\u017Eivatelsk\u00E9 jm\u00E9no / email +login.password = Heslo +login.rememberMe = zapamatuj si mne +login.submit = Vlo\u017E +login.error = \u0160patn\u00E9 jm\u00E9no nebo heslo + +# config explanations (used in both config_list and config_form screens) +config.mail.server.host = Jm\u00E9no nebo IP adresa SMTP serveru, kter\u00FD bude pou\u017Eit k zas\u00EDlan\u00ED e-mail\u016F +config.mail.server.port = Port SMTP serveru (oby\u010Dejn\u011B 25) +config.mail.server.username = U\u017Eivatelsk\u00E9 jm\u00E9no, pokud SMTP server vy\u017Eaduje authentikaci +config.mail.server.password = Heslo, pokud SMTP server vy\u017Eaduje authentikaci +config.mail.server.starttls.enable = Vlo\u017E "true", pokud SMTP server vy\u017Eaduje beype\u010Dn\u00E9 (SSL) p\u0159ipojen\u00ED +config.mail.subject.prefix = Text, kter\u00FD bude p\u0159edch\u00E1zet ka\u017Ed\u00E9mu subjektu v e-mailech (oby\u010Dejn\u011B [jtrac]) +config.mail.session.jndiname = javax.mail.Session JNDI jm\u00E9no - pokud je vzpln\u00EDte, tak bude pou\u017Eito m\u00EDsto SMTP serveru +config.mail.from = Generovan\u00E9 e-maily jsou posl\u00E1ny z t\u00E9to 'from' adresy +config.jtrac.url.base = Z\u00E1kladn\u00ED URL va\u0161\u00ED JTrac instalace ( nap\u0159. http://mujserver/jtrac ) = je zapot\u0159eb\u00ED pro spr\u00E1vnou funkc\u00ED odeslan\u00FDch e-mail\u016F +config.locale.default = Z\u00E1kladn\u00ED jazyk t\u00E9to JTrac instalce nap\u0159. "cz" pro \u010Ce\u0161tinu +config.session.timeout = \u010Cas v minut\u00E1ch po jeho\u017E ub\u011Bhnut\u00ED bude zru\u0161eno u\u017Eivatelsk\u00E9 spojen\u00ED (oby\u010Dejn\u011B 30 minut) +config.attachment.maxsize = Maxim\u00E1ln\u00ED velikost p\u0159\u00EDloh v MB. (obz\u010Dejn\u011B 5 MB) Vlo\u017E -1 pro neomezenou velikost. + +# config_list (config_form does not have any extra messages) +config_list.configurationSettings = Nastaven\u00ED konfigurace +config_list.parameter = Parameter +config_list.value = Hodnota +config_list.edit = Oprava +config_list.description = Popis + +# excel_upload +excel_upload.uploadExcelFile = Nahr\u00E1t soubor v Excelu +excel_upload.error.invalidFile = Probl\u00E9m se zpracov\u00E1n\u00EDm souboru, mo\u017En\u00E1 to nen\u00ED platn\u00FD Excel form\u00E1t. + +# excel_view +excel_view.previewImportedData= N\u00E1hled na Importovan\u00E1 Data +excel_view.selectActionToPerform = -- vyber akci k v\u00FDkonu -- +excel_view.deleteSelected = Vyma\u017E vzbran\u00E9 Sloupce / \u0158ady +excel_view.convertToDate = Zm\u011B\u0148 Format vybran\u00FDch Sloupc\u016F na Date +excel_view.concatenateFields = Spoj obsah vybran\u00FDch Sloupc\u016F +excel_view.extractFirstEighty = Vyber prvn\u00EDch 80 znak\u016F do nov\u00E9ho Sloupce +excel_view.duplicateColumn = Duplikuj Vybran\u00FD Sloupec +excel_view.mapToField = Zmapuj Vybran\u00FD Sloupec s Polem v Projektu +excel_view.editRow = Oprav Vybran\u00FD \u0158adek Dat +excel_view.import = Import do Vybran\u00E9ho Projektu + +excel_view.error.noActionSelected = Pros\u00EDm, zvolte akci k v\u00FDkonu +excel_view.error.noSpaceSelected = Pros\u00EDm, zvolte nejd\u0159\u00EDve projekt +excel_view.error.noColumnSelected = Pros\u00EDm, vyberte sloupec +excel_view.error.noRowSelected = Pros\u00EDm, vyberte \u0159adu +excel_view.error.noColumnOrRowSelected = Pros\u00EDm, vyberte sloupce / \u0159ady +excel_view.error.atLeastTwoColumns = Pros\u00EDm, vyberte alespo\u0148 dva sloupce +excel_view.error.duplicateMapping = Pole zmapov\u00E1no v\u00EDce ne\u017E jednou: '{0}' +excel_view.error.notMapped = Pole mus\u00ED b\u00FDt zmapov\u00E1no: '{0}' +excel_view.error.invalidValue = N\u011Bkter\u00E9 skl\u00EDpky obsahuj\u00ED \u0161patn\u00E1 data. + +excel_view.selectSpace = Zvol Projekt +excel_view.selectedSpace = Zvolen\u00FD Projekt +excel_view.noSpaceSelected = (\u017E\u00E1dn\u00FD projekt nebyl vybr\u00E1n) +excel_view.preview = N\u00E1hled +excel_view.distinctValues = R\u016Fzn\u00E9 Hodnoty +excel_view.mapTo = Zmapuj s +excel_view.columnData = Sloupec Dat +excel_view.selectedColumn = Vybran\u00FD Sloupec: +excel_view.update = Zm\u011B\u0148 +excel_view.importSuccess = Pr\u00EDpady byly \u00FAsp\u011B\u0161n\u011B Importov\u00E1ny + +# exception_flow +exception_flow.unsupportedNavigation = Nepodporovan\u00E1 Navigace +exception_flow.line1 = Zp\u011Btn\u00E9 tla\u010D\u00EDtko Prohl\u00ED\u017Ee\u010De / obnova strany - nen\u00ED v t\u00E9to verzi podporov\u00E1na. +exception_flow.line2 = Tento probl\u00E9m nelze vy\u0159e\u0161it a budete muset zopakovat p\u0159edch\u00E1zej\u00EDc\u00ED \u00FAkon. +exception_flow.line3 = Abzchom se vyhnuli tomuto probl\u00E9mu, pou\u017E\u00EDvejte, pros\u00EDm, pouze tla\u010D\u00EDtka v t\u00E9to aplikaci. + +# index_rebuild_success +index_rebuild.heading = Re-Indexeace +index_rebuild.warning = Tohle m\u016F\u017Ee trvat del\u0161\u00ED dobu a nedoporu\u010Duje se, aby byli ve stejnou dobu p\u0159ihl\u00E1\u0161eni jin\u00ED u\u017Eivatel\u00E9. + +# index_rebuild_success +index_rebuild_success.message = Re-Indexace prob\u011Bhla \u00FAsp\u011B\u0161n\u011B + +# space_allocate +space_allocate.usersAllocatedToSpace = U\u017Eivatel\u00E9 p\u0159i\u0159azeni k Projektu +space_allocate.loginName = U\u017Eivatelsk\u00E9 jm\u00E9no +space_allocate.fullName = Jm\u00E9no a P\u0159ijmen\u00ED +space_allocate.role = Role +space_allocate.remove = Vymazat +space_allocate.allocateUser = Vyber U\u017Eivatele a Roli k p\u0159i\u0159azen\u00ED +space_allocate.createNewUser = Vytvo\u0159 nov\u00E9ho U\u017Eivatele +space_allocate.user = U\u017Eivatel +space_allocate.allocate = P\u0159i\u0159a\u010F + +# space_delete +space_delete.confirm = Potvr\u010F vymaz\u00E1n\u00ED Projektu +space_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tento Projekt? +space_delete.line2 = Tohle vyma\u017Ee v\u0161echny p\u0159\u00EDpady tohoto Projektu. +space_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. + +# space_field_delete +space_field_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED tohoto pole +space_field_delete.line1 = Jste si jisti, \u017Ee chcete vymazat toto pole? +space_field_delete.line2 = Po\u010Det zm\u011Bn\u011Bn\u00FDch z\u00E1znam\u016F v datab\u00E1zi = {0} +space_field_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. + +# space_field_form +space_field_form.editField = Oprava Pole +space_field_form.internalName = Intern\u00ED jm\u00E9no +space_field_form.label = Ozna\u010Den\u00ED +space_field_form.optional = Nen\u00ED nutn\u00E9 +space_field_form.options = Mo\u017Enosti +space_field_form.addOption = P\u0159idej Mo\u017Enost +space_field_form.update = Zapsat +space_field_form.done = Hotovo +space_field_form.error.optionExists = Takov\u00E1 Mo\u017Enost ji\u017E existuje + +# space_field_option_delete +space_field_option_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED t\u00E9to mo\u017Enosti +space_field_option_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tuto Mo\u017Enost? +space_field_option_delete.line2 = Po\u010Det zm\u011Bn\u011Bn\u00FDch z\u00E1znam\u016F v datab\u00E1zi = {0} +space_field_option_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. + +# space_field_option_edit +space_field_option_edit.editOption = Oprava Mo\u017Enost\u00ED tohoto Pole +space_field_option_edit.error.optionEmpty = Tato Mo\u017Enost nem\u016F\u017Ee b\u00FDt pr\u00E1zdn\u00E1 +space_field_option_edit.error.exists = Takov\u00E1 Mo\u017Enost ji\u017E existuje + +# space_fields +space_fields.customFields = Specialn\u00ED Pole tohoto Projektu +space_fields.move = Posu\u0148 +space_fields.internalName = Intern\u00ED jm\u00E9no +space_fields.type = Typ +space_fields.optional = Nen\u00ED nutn\u00E9 +space_fields.label = Ozna\u010Den\u00ED +space_fields.optionList = Seznam Mo\u017Enost\u00ED +space_fields.chooseType = Vzber tzp p\u0159id\u00E1van\u00E9ho Pole +space_fields.addField = P\u0159idej Pole +space_fields.type_1 = D\u016Fle\u017Eitost (Drop Down) +space_fields.type_2 = Priorita (Drop Down) +space_fields.type_3 = Drop Down Seznam +space_fields.type_4 = Decimaln\u00ED \u010C\u00EDslo +space_fields.type_5 = Textov\u00E9 Pole +space_fields.type_6 = Datum +space_fields.typeRemaining = {0} zb\u00FDv\u00E1 + +# space_form +space_form.spaceDetails = Detaily Projektu +space_form.displayName = Jm\u00E9no +space_form.spaceKey = Kl\u00ED\u010D Projektu (kr\u00E1tk\u00E9 jm\u00E9no) +space_form.description = Popis +space_form.makePublic = Opublikovat +space_form.allowGuest = Povol p\u0159\u00EDstup host\u016Fm (pouze pro \u010Dten\u00ED) +space_form.copyExisting = Zkop\u00EDruj Existuj\u00EDc\u00ED Projekt +space_form.createFresh = vztvo\u0159 zcela nov\u00FD +space_form.error.prefixCode.tooShort = D\u00E9lka mus\u00ED b\u00FDt minim\u00E1ln\u011B 3 znaky. +space_form.error.prefixCode.tooLong = D\u00E9lka by nem\u011Bla b\u00FDt v\u00EDc ne\u017E 10 znak\u016F. +space_form.error.prefixCode.invalid = Povolena jsou pouze velk\u00E1 p\u00EDsmena a \u010D\u00EDslice +space_form.error.prefixCode.exists = Projekt s t\u00EDmto kl\u00ED\u010Dem ji\u017E existuje + +# space_list +space_list.spaceList = Seznam Projekt\u016F +space_list.createNewSpace = Vytvo\u0159 nov\u00FD Projekt +space_list.key = Kl\u00ED\u010D +space_list.name = Jm\u00E9no +space_list.edit = Oprav +space_list.description = Popis +space_list.users = U\u017Eivatel\u00E9 + +# space_role_delete +space_role_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED t\u00E9to Role +space_role_delete.line1 = Existuj\u00ED u\u017Eivatel\u00E9 p\u0159i\u0159azeni k tomuto Projektu ({0}) s touto Rol\u00ED. +space_role_delete.line2 = Jste si jisti, \u017Ee chcete vymazat tuto Roli? +space_role_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. + +# space_role_form +space_role_form.editRoleName = Oprava Jm\u00E9na Role +space_role_form.error.role.invalid = Jm\u00E9no Role m\u00E1 povolena pouze velk\u00E1 p\u00EDsmena a \u010D\u00EDslice ('_' je povoleno uvnit\u0159 jm\u00E9na) +space_role_form.error.role.exists = Role s t\u00EDmto jm\u00E9nem ji\u017E existuje +space_role_form.error.role.reserved = Toto jm\u00E9no Role je reservov\u00E1no k vnit\u0159n\u00EDmu pou\u017Eit\u00ED + +# space_role_form_confirm +space_role_form_confirm.confirm = Potvr\u010F zm\u011Bnu jm\u00E9na Role : {0} na {1} +space_role_form_confirm.line1 = Jste si jisti, \u017Ee chcete p\u0159ejmenovat tuto Roli? +space_role_form_confirm.line2 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. + +# space_roles +space_roles.spaceRoles = Role v Projektu a Zm\u011Bny Stavu (Workflow State-Transitions) pro Projekt +space_roles.addState = P\u0159idej Stav +space_roles.addRole = P\u0159idej Roli +space_roles.nextAllowedState = P\u0159\u00ED\u0161t\u00ED povolen\u00FD Stav +space_roles.fieldLevelPermissions = Pravomoce na \u00FArovni pole +space_roles.state = Stav +space_roles.role = Role +space_roles.mandatory = Povinn\u00FD +space_roles.optional = Nepovinn\u00FD +space_roles.readonly = Pouze pro \u010Dten\u00ED + +# space_state_delete +space_state_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED tohoto Stavu +space_state_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tento Stav? +space_state_delete.line2 = Po\u010Det zm\u011Bn\u011Bn\u00FDch z\u00E1znam\u016F v datab\u00E1zi = {0} +space_state_delete.line3 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. + +# space_state_form +space_state_form.editState = Oprava Stavu +space_state_form.error.state.invalid = Jm\u00E9no Stavu mus\u00ED pou\u017E\u00EDt znak minus ('-') k odd\u011Blen\u00ED slov nap\u0159. 'Opraveno', 'Pozastaven' nebo 'Pracuje-se-na-tom' +space_state_form.error.state.exists = Stav tohoto jm\u00E9na ji\u017E existuje + +# user_allocate_space +user_allocate_space.spacesAllocated = Projekty p\u0159i\u0159azen\u00E9 U\u017Eivateli +user_allocate_space.space = Projekt +user_allocate_space.role = Role +user_allocate_space.remove = Vymazat +user_allocate_space.chooseSpace = Vzber Projekt k p\u0159i\u0159azen\u00ED tomuto U\u017Eivateli +user_allocate_space.makeUserAdmin = Udelej tohoto U\u017Eivatele Administratorem (v\u0161ech Projekt\u016F) +user_allocate_space.makeAdmin = Ud\u011Blej Adminem +user_allocate_space.allSpaces = (v\u0161echny projekty) + +# user_allocate_space_role +user_allocate_space_role.allocateRole = P\u0159i\u0159a\u010F Roli U\u017Eivateli {0} v r\u00E1mci Projektu +user_allocate_space_role.allocate = P\u0159i\u0159a\u010F + +# user_list +user_list.usersAndSpaces = U\u017Eivatel\u00E9 a p\u0159i\u0159azen\u00E9 Projekty +user_list.createNewUser = Vytvo\u0159 Nov\u00E9ho U\u017Eivatele +user_list.userName = U\u017Eivatelsk\u00E9 jm\u00E9no +user_list.loginName = U\u017Eivatel +user_list.editProfile = Oprav Profil +user_list.locked = Zablokov\u00E1n +user_list.spaceRole = Projekt (Role) +user_list.allocateSpaceRole = P\u0159i\u0159a\u010F<br/>Projekt / Roli +user_list.locale = Jazyk +user_list.email = E Mail +user_list.filterBy = Filtrovat + +# mail_sender (this is in the mail sending code, not a JSP) +mail_sender.loginMailSubject = JTrac detaily nutn\u00E9 k p\u0159ihl\u011B\u0161en\u00ED +mail_sender.loginMailGreeting = Ahoj +mail_sender.loginMailLine1 = Nasleduj\u00ED tvoje nov\u00E9 / opraven\u00E9 detaily nutn\u00E9 k p\u0159ihl\u011B\u0161en\u00ED: +mail_sender.loginName = U\u017Eivatelsk\u00E9 jm\u00E9no +mail_sender.password = Heslo +mail_sender.loginMailLine2 = Pou\u017Eij tento link k p\u0159ihl\u00E1\u0161en\u00ED: + +# new item_relate_remove +item_relate_remove.heading = Potvr\u010Fte vymaz\u00E1n\u00ED t\u00E9to souvislosti + +# item_delete +item_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED tohoto P\u0159\u00EDpadu +item_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tento P\u0159\u00EDpad? +item_delete.line2 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. + +# user_delete +user_delete.confirm = Potvr\u010Fte vymaz\u00E1n\u00ED tohoto U\u017Eivatele +user_delete.line1 = Jste si jisti, \u017Ee chcete vymazat tohoto U\u017Eivatele? +user_delete.line2 = Z\u00E1pisy do datab\u00E1ze z t\u00E9to operace nelze vr\u00E1tit. +user_delete.notPossible = Tento U\u017Eivatel je uveden v n\u011Bkolika P\u0159\u00EDpadech. Pokuste se ho zablokovat nebo zma\u017Ete prvn\u011B takov\u00E9 P\u0159\u00EDpady. + +# generic error messages +error.itemBelongsToUnallocatedSpace = Nem\u00E1te opr\u00E1vn\u011Bn\u00ED prohl\u00E9dnout si tento P\u0159\u00EDpad + +# item search filter wizard +item_filter.showColumn = Uka\u017E ve V\u00FDsledc\u00EDch +item_filter.expression = Vzhled\u00E1vac\u00ED Filtr +item_filter.expandAll = (uka\u017E v\u0161e) +item_filter.in = m\u00E1 hotnoty +item_filter.notIn = nem\u00E1 hotnoty +item_filter.like = obsahuje text +item_filter.equal = je shodn\u00FD s +item_filter.notEqual = nen\u00ED shodn\u00FD s +item_filter.greaterThan = v\u011Bt\u0161\u00ED ne\u017E +item_filter.lessThan = men\u0161\u00ED ne\u017E +item_filter.between = mezi Modified: trunk/jtrac/src/main/resources/messages_el.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_el.properties 2021-08-04 13:32:09 UTC (rev 1379) +++ trunk/jtrac/src/main/resources/messages_el.properties 2021-08-05 11:18:30 UTC (rev 1380) @@ -1,5 +1,5 @@ # please refer documentation before starting work on a translation: -# http://jtrac.info/doc/html/dev-guide.html#dev-translating +# http://j-trac.sourceforge.net/doc/html/dev-guide.html#dev-translating # Initial version contributed by manos batsis, Abiss.gr. See http://dev.abiss.gr # globals Modified: trunk/jtrac/src/main/resources/messages_es.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_es.properties 2021-08-04 13:32:09 UTC (rev 1379) +++ trunk/jtrac/src/main/resources/messages_es.properties 2021-08-05 11:18:30 UTC (rev 1380) @@ -1,407 +1,408 @@ -# please refer documentation before starting work on a translation: -# http://jtrac.info/doc/html/dev-guide.html#dev-translating -# globals -submit = Aceptar -cancel = Cancelar -delete = Borrar -back = Atr\xE1s -next = Siguiente -edit = Editar -view = Ver -search = Buscar -new = Nuevo -save = Guardar - -# override default messages for spring mvc form binding errors -typeMismatch.java.lang.Double = Por favor, introduzca un valor num\xE9rico v\xE1lido -typeMismatch.java.util.Date = Por favor, introduzca un valor de fecha v\xE1lido. Formato\: aaaa-mm-dd - -# wicket globals -null = -nullValid = -Required = Por favor, rellene los campos obligatorios -IConverter.Double = ${label}\: Por favor, introduzca un n\xFAmero v\xE1lido -IConverter.Date = ${label}\: Por favor, introduzca una fecha v\xE1lida con el formato aaaa-mm-dd -# generic form validation message -error.empty = Valor requerido - -# header navigation -header.dashboard = PORTADA -header.new = NUEVO -header.search = BUSCAR -header.options = OPCIONES -header.login = ENTRAR -header.logout = DESCONECTAR - -# dashboard -dashboard.noSpaces = No est\xE1 asignado a ning\xFAn Proyecto -dashboard.space = Proyecto -dashboard.action = Acci\xF3n -dashboard.status = Estado -dashboard.loggedByMe = Mis<br/>incidencias -dashboard.assignedToMe = Asignada<br/>a mi -dashboard.all = Todos -dashboard.new = NUEVO -dashboard.search = BUSCAR -dashboard.showDetails = Mostrar Detalles -dashboard.hideDetails = Ocultar Detalles - -# item_form -item_form.summary = Resumen -item_form.detail = Detalles -item_form.assignTo = Asignar A -item_form.editReason = Editar Motivo -item_form.sendNotifications = enviar notificaciones por e-mail -item_form.notifyByEmail = Notificar por e-mail -item_form.attachment = Anexo -item_form.error.version = Incidencia modificada por otro usuario o se utiliz\xF3 el bot\xF3n "Atr\xE1s" del navegador. - -# item_view (note this is rendered within a taglib and not in a JSP) -item_view.id = ID -item_view.relatedItems = Incidencias Relacionadas -item_view.remove = Eliminar -item_view.relatedTo = est\xE1 relacionada con -item_view.duplicateOf = es un duplicado de -item_view.dependsOn = depende de -item_view.relatedToThis = est\xE1 relacionada con \xE9sta -item_view.duplicateOfThis = es duplicado de \xE9sta -item_view.dependsOnThis = depende de \xE9sta -item_view.this = este -item_view.status = Estado -item_view.loggedBy = Autor -item_view.assignedTo = Asignado a -item_view.summary = Resumen -item_view.detail = Detalles -item_view.history = Hist\xF3rico -item_view.comment = Comentario -item_view.timeStamp = Marca de Tiempo - -# item_view_form -item_view_form.relateTo = Relacionar esta incidencia con -item_view_form.duplicateOf = es duplicado de \xE9sta -item_view_form.dependsOn = depende de \xE9sta -item_view_form.relatedTo = est\xE1 relacionada con \xE9sta -item_view_form.newStatus = Nuevo Estado -item_view_form.assignTo = Asignar A -item_view_form.comment = Comentario -item_view_form.sendNotifications = enviar notificaciones por e-mail -item_view_form.addRelatedItem = a\xF1adir incidencia relacionada -item_view_form.change = cambiar -item_view_form.notifyByEmail = Notificar por E-mail -item_view_form.attachment = Anexo -item_view_form.assignedTo.error = Oligatorio si el estado es distinto de Cerrado -item_view_form.status.error = Oligatorio si se est\xE1 asignando -item_view_form.chooseStatus = -- seleccione Estado -- - -# item_search_form -item_search_form.searchingForRelated = Buscando incidencias relacionadas con -item_search_form.viewItemById = Ver incidencia por ID -item_search_form.textSearch = Busqueda de Texto -item_search_form.resultsPerPage = Resultados / P\xE1gina -item_search_form.noLimit = Sin L\xEDmite -item_search_form.sortOnColumn = Ordenar por columna -item_search_form.id = ID -item_search_form.descending = Descendente -item_search_form.showDetail = Mostrar Detalles -item_search_form.showHistory = Mostrar Hist\xF3rico -item_search_form.loggedBy = Logado Por -item_search_form.assignedTo = Asignado A -item_search_form.createdDate = Fecha de Creaci\xF3n -item_search_form.onOrAfter = En / Despu\xE9s de -item_search_form.onOrBefore = En / Antes de -item_search_form.status = Estado -item_search_form.severity = Urgencia -item_search_form.priority = Prioridad -item_search_form.historyUpdatedDate = Fecha de modificaci\xF3n del Hist\xF3rico -item_search_form.space = Proyecto -item_search_form.error.refId.invalid = ID no v\xE1lido -item_search_form.error.refId.notFound = Incidencia no encontrado -item_search_form.error.summary.invalid = Cadena de b\xFAsqueda no v\xE1lida - -# item_list (most rendered within a taglib not JSP, some reused also for excel export) -item_list.searchingForRelated = Buscando incidencias relacionadas con -item_list.modifySearch = Modificar B\xFAsqueda -item_list.recordFound = Registro Encontrado -item_list.recordsFound = Registros Encontrados -item_list.exportToExcel = Exportar a Excel -item_list.id = ID -item_list.summary = Resumen -item_list.detail = Detalles -item_list.loggedBy = Autor -item_list.status = Estado -item_list.assignedTo = Asignado A -item_list.timeStamp = Marca de Tiempo -item_list.history = Hist\xF3rico -item_list.space = Proyecto - -# options -options.optionsMenu = Men\xFA de Opciones -options.editYourProfile = Edite su perfil -options.manageUsers = Gesti\xF3n de Usuarios -options.manageSpaces = Gesti\xF3n de Proyectos -options.manageSettings = Gesti\xF3n de Configuraci\xF3n -options.rebuildIndexes = Reconstruir \xEDndices -options.importFromExcel = Importar de un Excel - -# user_form -user_form.userDetails = Detalles de Usuario -user_form.loginId = Login ID -user_form.fullName = Nombre Completo -user_form.emailId = E-Mail ID -user_form.language = Lenguaje -user_form.passwordMessage = Un password ser\xE1 generado y enviado a su e-mail por defecto.</br>Los campos a continuacion son opcionales -user_form.password = Password -user_form.confirmPassword = Confirme Password -user_form.loginId.error.invalid = S\xF3lo min\xFAsculas y n\xFAmeros permitidos -user_form.loginId.error.exists = El Login ID ya existe -user_form.passwordConfirm.error = Confirmaci\xF3n de Password Incorrecta -user_form.mailPassword = enviar password por e-mail -user_form.locked = Bloqueado - -# logout -logout.title = Desconectado -logout.home = Inicio -logout.message = Desconectado. Cualquier sesi\xF3n "recu\xE9rdeme" ha sido deshabilitada. -logout.login = Login - -# login -login.title = JTrac Login -login.home = Inicio -login.loginName = Login / email ID -login.password = Password -login.rememberMe = recu\xE9rdeme -login.submit = Aceptar -login.error = Credenciales err\xF3neas - -# config explanations (used in both config_list and config_form screens) -config.mail.server.host = Nombre del Host o direcci\xF3n IP del servidor SMTP usado para el env\xEDo de e-mail -config.mail.server.port = Puerto usado por el servidor SMTP (por defecto 25) -config.mail.server.username = Nombre de usuario para el servidor SMTP, si \xE9ste requiere autenticaci\xF3n -config.mail.server.password = Password para el servidor SMTP, si \xE9ste requiere autenticaci\xF3n -config.mail.server.starttls.enable = Usar "Verdadero" para conexiones seguras (SSL) , si se requiere en el servidor SMTP -config.mail.subject.prefix = Texto prefijo para el asunto de los e-mail (por defecto [jtrac]) -config.mail.from = Cuando se genere un e-mail, \xE9sta ser\xE1 la direcci\xF3n 'from' -config.jtrac.url.base = URB base de la instalaci\xF3n JTrac (p.e. http://miservidor/jtrac), requerido para el funcionamiento correcto de los enlaces en los e-mail -config.locale.default = Lenguaje por defecto usado en esta instalaci\xF3n de JTrac (p.e. "es" para Espa\xF1ol) -config.session.timeout = Tiempo en minutos para la expiraci\xF3n de la sesi\xF3n (por defecto 30 minutos) -config.attachment.maxsize = Tama\xF1o m\xE1ximo en MB de los ficheros adjuntos (por defecto 5 MB). Use -1 para no tener l\xEDmite - -# config_list (config_form does not have any extra messages) -config_list.configurationSettings = Configuraci\xF3n -config_list.parameter = Clave del Parametro -config_list.value = Valor -config_list.edit = Editar -config_list.description = Descripci\xF3n - -# excel_upload -excel_upload.uploadExcelFile = Subir fichero Excel -excel_upload.error.invalidFile = Error procesando el fichero, puede que no sea un fichero Excel v\xE1lido. - -# excel_view -excel_view.previewImportedData= Preview de los Datos Importados -excel_view.selectActionToPerform = seleccione la acci\xF3n a realizar -excel_view.deleteSelected = Borrar las filas/columnas seleccionadas -excel_view.convertToDate = Convertir el formato de las columnas seleccionadas a Fecha -excel_view.concatenateFields = Concatenar el contenido de las columnas seleccionadas -excel_view.extractFirstEighty = Extraer los primeros 80 caracteres a una nueva columna - -# exception_flow -... [truncated message content] |
From: <udi...@us...> - 2021-08-08 10:56:55
|
Revision: 1382 http://sourceforge.net/p/j-trac/code/1382 Author: udittmer Date: 2021-08-08 10:56:51 +0000 (Sun, 08 Aug 2021) Log Message: ----------- make SSL-only optional, additional repos for Selenium Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/webapp/WEB-INF/web.xml Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-08-05 12:29:09 UTC (rev 1381) +++ trunk/jtrac/pom.xml 2021-08-08 10:56:51 UTC (rev 1382) @@ -65,6 +65,10 @@ <id>openqa.org</id> <name>selenium snapshot</name> <url>https://repo.spring.io/plugins-release/</url> + <!-- + <url>http://maven.geomajas.org/</url> + <url>https://maven.onehippo.com/maven2/</url> + --> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> @@ -479,7 +483,6 @@ </execution> </executions> </plugin> - <!-- <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> @@ -502,6 +505,7 @@ </excludes> </configuration> </plugin> + <!-- --> <plugin> <groupId>org.apache.maven.plugins</groupId> Modified: trunk/jtrac/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/jtrac/src/main/webapp/WEB-INF/web.xml 2021-08-05 12:29:09 UTC (rev 1381) +++ trunk/jtrac/src/main/webapp/WEB-INF/web.xml 2021-08-08 10:56:51 UTC (rev 1382) @@ -132,6 +132,7 @@ </resource-ref> --> + <!-- <security-constraint> <display-name>HTTPS</display-name> <web-resource-collection> @@ -142,6 +143,7 @@ <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> + --> <welcome-file-list> <welcome-file>index.html</welcome-file> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-08-09 09:03:19
|
Revision: 1383 http://sourceforge.net/p/j-trac/code/1383 Author: udittmer Date: 2021-08-09 09:03:17 +0000 (Mon, 09 Aug 2021) Log Message: ----------- version 2.2.0; remove nabble.com as mailing list archive; fix Norwegian translation file Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/resources/messages_no.properties Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-08-08 10:56:51 UTC (rev 1382) +++ trunk/jtrac/pom.xml 2021-08-09 09:03:17 UTC (rev 1383) @@ -4,7 +4,7 @@ <groupId>info.jtrac</groupId> <artifactId>jtrac</artifactId> <packaging>war</packaging> - <version>2.2.0-b1</version> + <version>2.2.0</version> <name>JTrac</name> <description> JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields @@ -39,9 +39,6 @@ <unsubscribe>-</unsubscribe> <post>-</post> <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=j-trac-users</archive> - <otherArchives> - <otherArchive>http://www.nabble.com/j-trac-users-f20276.html</otherArchive> - </otherArchives> </mailingList> </mailingLists> Modified: trunk/jtrac/src/main/resources/messages_no.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_no.properties 2021-08-08 10:56:51 UTC (rev 1382) +++ trunk/jtrac/src/main/resources/messages_no.properties 2021-08-09 09:03:17 UTC (rev 1383) @@ -9,7 +9,7 @@ next = Neste edit = Rediger view = Visning -search = S\xBFk +search = S\u00f8k new = Ny save = Lagre @@ -20,24 +20,24 @@ # wicket globals null = nullValid = -Required = Fyll inn n\xBFdvendige felt +Required = Fyll inn n\u00f8dvendige felt IConverter.Double = ${label}\: Legg inn et gyldig tall IConverter.Date = ${label}\: Legg inn en gyldig dato i formatet\: yyyy-mm-dd # generic form validation message -error.empty = M\x8C fylles ut +error.empty = M\u00e5 fylles ut # header navigation header.dashboard = Oversikt header.new = Ny -header.search = S\xBFk +header.search = S\u00f8k header.options = Alternativer header.login = Logg inn header.logout = Logg ut # dashboard -dashboard.noSpaces = Du er ikke koblet til noen omr\x8Cder -dashboard.space = Omr\x8Cde +dashboard.noSpaces = Du er ikke koblet til noen omr\u00e5der +dashboard.space = Omr\u00e5de dashboard.action = Handling dashboard.status = Status dashboard.loggedByMe = Lagt inn<br/>av meg @@ -44,7 +44,7 @@ dashboard.assignedToMe = Tildelt<br/>meg dashboard.all = Alle dashboard.new = Ny -dashboard.search = S\xBFk +dashboard.search = S\u00f8k dashboard.showDetails = Vis detaljer dashboard.hideDetails = Skjul detaljer @@ -52,7 +52,7 @@ item_form.summary = Overskrift item_form.detail = Beskrivelse item_form.assignTo = Tildelt -item_form.editReason = Rediger \x8Crsak +item_form.editReason = Rediger \u00e5rsak item_form.sendNotifications = send epost meldinger item_form.notifyByEmail = Varsle med epost item_form.attachment = Vedlegg @@ -91,17 +91,17 @@ item_view_form.change = endre item_view_form.notifyByEmail = Varsle med epost item_view_form.attachment = Vedlegg -item_view_form.assignedTo.error = Tildeles: P\x8Ckrevd hvis status annet enn {0} -item_view_form.status.error = P\x8Ckrevd ved fordeling +item_view_form.assignedTo.error = Tildeles: P\u00e5krevd hvis status annet enn {0} +item_view_form.status.error = P\u00e5krevd ved fordeling item_view_form.chooseStatus = -- velg status -- # item_search_form -item_search_form.searchingForRelated = S\xBFk etter emner relatert til +item_search_form.searchingForRelated = S\u00f8k etter emner relatert til item_search_form.viewItemById = Se emner etter id -item_search_form.textSearch = Teksts\xBFk +item_search_form.textSearch = Teksts\u00f8k item_search_form.resultsPerPage = Resultater / Side item_search_form.noLimit = Ingen begrensning -item_search_form.sortOnColumn = Sorter p\x8C en kolonne +item_search_form.sortOnColumn = Sorter p\u00e5 en kolonne item_search_form.id = ID item_search_form.descending = Fallende item_search_form.showDetail = Vis detalj @@ -109,20 +109,20 @@ item_search_form.loggedBy = Registrert av item_search_form.assignedTo = Tildelt item_search_form.createdDate = Opprettet dato -item_search_form.onOrAfter = P\x8C / Etter -item_search_form.onOrBefore = P\x8C / F\xBFr +item_search_form.onOrAfter = P\u00e5 / Etter +item_search_form.onOrBefore = P\u00e5 / F\u00f8r item_search_form.status = Status item_search_form.severity = Alvorlighet item_search_form.priority = Prioritering item_search_form.historyUpdatedDate = Historie oppdatert dato -item_search_form.space = Omr\x8Cde +item_search_form.space = Omr\u00e5de item_search_form.error.refId.invalid = Ugyldig id item_search_form.error.refId.notFound = Post ble ikke funnet -item_search_form.error.summary.invalid = Ugyldig s\xBFkestreng +item_search_form.error.summary.invalid = Ugyldig s\u00f8kestreng # item_list (most rendered within a taglib not JSP, some reused also for excel export) -item_list.searchingForRelated = S\xBFker etter emner relatert til -item_list.modifySearch = Endre s\xBFk +item_list.searchingForRelated = S\u00f8ker etter emner relatert til +item_list.modifySearch = Endre s\u00f8k item_list.recordFound = post funnet item_list.recordsFound = poster funnet item_list.exportToExcel = Excel @@ -135,15 +135,15 @@ item_list.assignedTo = Tildelt item_list.timeStamp = Tid item_list.history = Historie -item_list.space = Omr\x8Cde +item_list.space = Omr\u00e5de # options options.optionsMenu = Alternativer meny options.editYourProfile = Rediger brukerprofil options.manageUsers = Administrer brukere -options.manageSpaces = Administrer omr\x8Cder +options.manageSpaces = Administrer omr\u00e5der options.manageSettings = Administrer innstillinger -options.rebuildIndexes = Bygg indekser p\x8C nytt +options.rebuildIndexes = Bygg indekser p\u00e5 nytt options.importFromExcel = Importer fra Excel # user_form @@ -151,15 +151,15 @@ user_form.loginId = Logginn id user_form.fullName = Fullt navn user_form.emailId = E-post id -user_form.language = Spr\x8Ck +user_form.language = Spr\u00e5k user_form.passwordMessage = Et passord vil bli generert og sendt pr epost automatisk.<br/>Feltene under er valgfrie user_form.password = Passord user_form.confirmPassword = Bekreft passord user_form.loginId.error.invalid = Logginn id inneholder ugyldige tegn -user_form.loginId.error.exists = Logginn id finnes fra f\xBFr +user_form.loginId.error.exists = Logginn id finnes fra f\u00f8r user_form.passwordConfirm.error = Passordene er ikke like user_form.mailPassword = send passord med epost -user_form.locked = L\x8Cst +user_form.locked = L\u00e5st # logout logout.title = Utloggingen var vellykket @@ -177,7 +177,7 @@ login.error = Ugyldig brukernavn og/eller passord # config explanations (used in both config_list and config_form screens) -config.mail.server.host = Vertsnavn eller ip-adresse til SMTP-serveren som skal brukes til \x8C sende epost +config.mail.server.host = Vertsnavn eller ip-adresse til SMTP-serveren som skal brukes til \u00e5 sende epost config.mail.server.port = Port-nr brukt av SMTP-server (default 25) config.mail.server.username = Brukernavn for SMTP-server hvis denne krever autentisering config.mail.server.password = Passord for SMTP-server hvis denne krever autentisering @@ -184,18 +184,18 @@ config.mail.server.starttls.enable = Bruk "true" for sikker (SSL) forbindelse hvis SMTP-serveren krever det config.mail.subject.prefix = Tekst som vil bli lagt til i starten av epost tittel (standard [jtrac]) config.mail.session.jndiname = javax.mail.Session JNDI navn - hvis angitt vil denne bli brukt i stedet for SMTP-detaljene over -config.mail.from = N\x8Cr epost genereres, vil denne bli brukt i stedet for 'fra' adressen -config.jtrac.url.base = Basis URL for JTrac installasjonen ( f.eks http://myserver/jtrac ) n\xBFdvendig for at linker i epost skal virke +config.mail.from = N\u00e5r epost genereres, vil denne bli brukt i stedet for 'fra' adressen +config.jtrac.url.base = Basis URL for JTrac installasjonen ( f.eks http://myserver/jtrac ) n\u00f8dvendig for at linker i epost skal virke config.jtrac.header.picture = Individuelt header-bilde config.jtrac.header.text = Individuell header-tekst config.jtrac.edit.item = Skal eieren av dette emnet redigere sine elementer? -config.locale.default = Standard spr\x8Ck for enne JTrac installasjonen f.eks "no" for Norsk +config.locale.default = Standard spr\u00e5k for enne JTrac installasjonen f.eks "no" for Norsk config.session.timeout = Tid i minutter for bruker-sesjonen (standard 30 minutter) -config.attachment.maxsize = Max str i MB p\x8C filvedlegg. (standard 5 MB) Bruk -1 for ingen begrensning +config.attachment.maxsize = Max str i MB p\u00e5 filvedlegg. (standard 5 MB) Bruk -1 for ingen begrensning # config_list (config_form does not have any extra messages) config_list.configurationSettings = Konfigurasjonssettinger -config_list.parameter = Parameter N\xBFkkel +config_list.parameter = Parameter N\u00f8kkel config_list.value = Verdi config_list.edit = Rediger config_list.description = Beskrivelse @@ -202,34 +202,34 @@ # excel_upload excel_upload.uploadExcelFile = Last opp Excel fil -excel_upload.error.invalidFile = Feil ved prosessering av fil, kan v\xBEre at det ikke er en gyldig Excel-fil. +excel_upload.error.invalidFile = Feil ved prosessering av fil, kan v\u00e6re at det ikke er en gyldig Excel-fil. # excel_view -excel_view.previewImportedData = Forh\x8Cndsvisning av importerte data -excel_view.selectActionToPerform = -- valg handling \x8C utf\xBFre -- +excel_view.previewImportedData = Forh\u00e5ndsvisning av importerte data +excel_view.selectActionToPerform = -- valg handling \u00e5 utf\u00f8re -- excel_view.deleteSelected = Slett valgte kolonner / rader excel_view.convertToDate = Konverter formatet i valgte kolonner til dato -excel_view.concatenateFields = Sl\x8C sammen innholdet i valgte kolonner -excel_view.extractFirstEighty = Trekk ut f\xBFrste 80 tegn til en ny kolonne +excel_view.concatenateFields = Sl\u00e5 sammen innholdet i valgte kolonner +excel_view.extractFirstEighty = Trekk ut f\u00f8rste 80 tegn til en ny kolonne excel_view.duplicateColumn = Dupliser valgte kolonne -excel_view.mapToField = Knytt valgte kolonne til omr\x8Cde-felt +excel_view.mapToField = Knytt valgte kolonne til omr\u00e5de-felt excel_view.editRow = Rediger data for valgt rad -excel_view.import = Importer til valgt omr\x8Cde +excel_view.import = Importer til valgt omr\u00e5de -excel_view.error.noActionSelected = Velg en handling \x8C utf\xBFre -excel_view.error.noSpaceSelected = Velg et omr\x8Cde f\xBFrst +excel_view.error.noActionSelected = Velg en handling \u00e5 utf\u00f8re +excel_view.error.noSpaceSelected = Velg et omr\u00e5de f\u00f8rst excel_view.error.noColumnSelected = Velg en kolonne excel_view.error.noRowSelected = Velg en rad excel_view.error.noColumnOrRowSelected = Velg kolonner/rader excel_view.error.atLeastTwoColumns = Velg minst to kolonner excel_view.error.duplicateMapping = Feltet er brukt mer enn to ganger: '{0}' -excel_view.error.notMapped = Feltet m\x8C knyttes opp mot noe: '{0}' +excel_view.error.notMapped = Feltet m\u00e5 knyttes opp mot noe: '{0}' excel_view.error.invalidValue = Noen celler har ugyldige data -excel_view.selectSpace = Velg omr\x8Cde -excel_view.selectedSpace = Valgt omr\x8Cde -excel_view.noSpaceSelected = (Ikke noe omr\x8Cde valgt) -excel_view.preview = Forh\x8Cndsvisning +excel_view.selectSpace = Velg omr\u00e5de +excel_view.selectedSpace = Valgt omr\u00e5de +excel_view.noSpaceSelected = (Ikke noe omr\u00e5de valgt) +excel_view.preview = Forh\u00e5ndsvisning excel_view.distinctValues = Bestemte verdier excel_view.mapTo = Knytt til excel_view.columnData = Kolonnedata @@ -238,13 +238,13 @@ excel_view.importSuccess = Import av poster var vellykket # exception_flow -exception_flow.unsupportedNavigation = Ikke st\xBFtte for denne navigasjonen -exception_flow.line1 = Nettleserens tilbakeknapp / relasting av side - er ikke st\xBFttet i denne versjonen. -exception_flow.line2 = Kan ikke rette opp denne feilen, s\x8C du m\x8C start denne navigasjonen p\x8C nytt -exception_flow.line3 = For \x8C unng\x8C denne feilen m\x8C du bruke knapper og linker i applikasjonen. +exception_flow.unsupportedNavigation = Ikke st\u00f8tte for denne navigasjonen +exception_flow.line1 = Nettleserens tilbakeknapp / relasting av side - er ikke st\u00f8ttet i denne versjonen. +exception_flow.line2 = Kan ikke rette opp denne feilen, s\u00e5 du m\u00e5 start denne navigasjonen p\u00e5 nytt +exception_flow.line3 = For \u00e5 unng\u00e5 denne feilen m\u00e5 du bruke knapper og linker i applikasjonen. # index_rebuild_success -index_rebuild.heading = Bygg indekser p\x8C nytt +index_rebuild.heading = Bygg indekser p\u00e5 nytt index_rebuild.warning = Dette kan ta lang tid og det anbefales at ingen andre brukere er innlogget. # index_rebuild_success @@ -251,7 +251,7 @@ index_rebuild_success.message = Bygging av indekser var vellykket # space_allocate -space_allocate.usersAllocatedToSpace = Brukere tilknyttet omr\x8Cdet +space_allocate.usersAllocatedToSpace = Brukere tilknyttet omr\u00e5det space_allocate.loginName = Logginn navn space_allocate.fullName = Fullt navn space_allocate.role = Rolle @@ -262,7 +262,7 @@ space_allocate.allocate = Sett sammen # space_delete -space_delete.confirm = Bekreft sletting av omr\x8Cde +space_delete.confirm = Bekreft sletting av omr\u00e5de space_delete.line1 = Are you sure that you want to delete this Space? space_delete.line2 = This will delete all items within this Space. space_delete.line3 = You cannot undo database updates for this operation. @@ -269,9 +269,9 @@ # space_field_delete space_field_delete.confirm = Confirm Field Delete -space_field_delete.line1 = Er du sikker p\x8C at du vil slette dette omr\x8Cdet? -space_field_delete.line2 = Antall p\x8Cvirkede databaseregistreringer = {0} -space_field_delete.line3 = Du kan ikke gj\xBFre om endringer i databasen for denne operasjonen. +space_field_delete.line1 = Er du sikker p\u00e5 at du vil slette dette omr\u00e5det? +space_field_delete.line2 = Antall p\u00e5virkede databaseregistreringer = {0} +space_field_delete.line3 = Du kan ikke gj\u00f8re om endringer i databasen for denne operasjonen. # space_field_form space_field_form.editField = Rediger felt @@ -292,11 +292,11 @@ # space_field_option_edit space_field_option_edit.editOption = Rediger alternativer for felt -space_field_option_edit.error.optionEmpty = Alternativ kan ikke v\xBEre tomt +space_field_option_edit.error.optionEmpty = Alternativ kan ikke v\u00e6re tomt space_field_option_edit.error.exists = Alternativ finnes allerede # space_fields -space_fields.customFields = Egendefinerte felt for omr\x8Cde +space_fields.customFields = Egendefinerte felt for omr\u00e5de space_fields.move = Flytt space_fields.internalName = Internt navn space_fields.type = Type @@ -314,23 +314,23 @@ space_fields.typeRemaining = {0} igjen # space_form -space_form.spaceDetails = Omr\x8Cdedetaljer +space_form.spaceDetails = Omr\u00e5dedetaljer space_form.displayName = Visningsnavn -space_form.spaceKey = Omr\x8Cden\xBFkkel (Kort navn) +space_form.spaceKey = Omr\u00e5den\u00f8kkel (Kort navn) space_form.description = Beskrivelse -space_form.makePublic = Gj\xBFr offentlig +space_form.makePublic = Gj\u00f8r offentlig space_form.allowGuest = Gi gjest kun lesetilgang -space_form.copyExisting = Kopier eksisterende omr\x8Cde -space_form.createFresh = opprett fra tomt omr\x8Cde -space_form.error.prefixCode.tooShort = Lengde skal v\xBEre minst 3 tegn. -space_form.error.prefixCode.tooLong = Lengde skal ikke v\xBEre mer enn 10 tegn +space_form.copyExisting = Kopier eksisterende omr\u00e5de +space_form.createFresh = opprett fra tomt omr\u00e5de +space_form.error.prefixCode.tooShort = Lengde skal v\u00e6re minst 3 tegn. +space_form.error.prefixCode.tooLong = Lengde skal ikke v\u00e6re mer enn 10 tegn space_form.error.prefixCode.invalid = Bare store bokstaver og tall er tillatt -space_form.error.prefixCode.exists = Et omr\x8Cde med denne n\xBFkkelen finnes allerede +space_form.error.prefixCode.exists = Et omr\u00e5de med denne n\u00f8kkelen finnes allerede # space_list -space_list.spaceList = Omr\x8Cdeliste -space_list.createNewSpace = Opprett nytt omr\x8Cde -space_list.key = N\xBFkkel +space_list.spaceList = Omr\u00e5deliste +space_list.createNewSpace = Opprett nytt omr\u00e5de +space_list.key = N\u00f8kkel space_list.name = Navn space_list.edit = Rediger space_list.description = Beskrivelse @@ -338,68 +338,68 @@ # space_role_delete space_role_delete.confirm = Bekreft sletting av rolle -space_role_delete.line1 = Det finnes brukere knyttet til dett omr\x8Cdet ({0}) med denne rollen. -space_role_delete.line2 = Er du sikker p\x8C at du vil slette denne rollen? -space_role_delete.line3 = Du kan ikke gj\xBFre om databaseoppdateringer for denne operasjonen. +space_role_delete.line1 = Det finnes brukere knyttet til dett omr\u00e5det ({0}) med denne rollen. +space_role_delete.line2 = Er du sikker p\u00e5 at du vil slette denne rollen? +space_role_delete.line3 = Du kan ikke gj\u00f8re om databaseoppdateringer for denne operasjonen. # space_role_form space_role_form.editRoleName = Rediger rollenavn -space_role_form.error.role.invalid = Rollenavn m\x8C v\xBEre store bokstaver eller tall ('_' tillatt inni) +space_role_form.error.role.invalid = Rollenavn m\u00e5 v\u00e6re store bokstaver eller tall ('_' tillatt inni) space_role_form.error.role.exists = En rolle med dette navnet ekstisterer allerede space_role_form.error.role.reserved = Dette rollenavnet er reservert til intern bruk # space_role_form_confirm space_role_form_confirm.confirm = Bekreft rollenavn: {0} til {1} -space_role_form_confirm.line1 = Er du sikker p\x8C at du vil gi denne rollen nytt navn? -space_role_form_confirm.line2 = Du kan ikke gj\xBFre om databaseoppdateringer for denne operasjonen. +space_role_form_confirm.line1 = Er du sikker p\u00e5 at du vil gi denne rollen nytt navn? +space_role_form_confirm.line2 = Du kan ikke gj\u00f8re om databaseoppdateringer for denne operasjonen. # space_roles -space_roles.spaceRoles = Omr\x8Cderoller og statusforandringer (Arbeidsflyt) for omr\x8Cde +space_roles.spaceRoles = Omr\u00e5deroller og statusforandringer (Arbeidsflyt) for omr\u00e5de space_roles.addState = Legg til status space_roles.addRole = Legg til rolle space_roles.nextAllowedState = Neste tillatte status -space_roles.fieldLevelPermissions = Tillatelser p\x8C feltniv\x8C +space_roles.fieldLevelPermissions = Tillatelser p\u00e5 feltniv\u00e5 space_roles.state = Status space_roles.role = Rolle -space_roles.mandatory = P\x8Ckrevd +space_roles.mandatory = P\u00e5krevd space_roles.optional = Valgfri space_roles.readonly = Kun lese # space_state_delete space_state_delete.confirm = Bekreft sletting av status -space_state_delete.line1 = Er du sikker p\x8C at du vil slette denne statusen? +space_state_delete.line1 = Er du sikker p\u00e5 at du vil slette denne statusen? space_state_delete.line2 = Antall endrede databaseregistreringer = {0} -space_state_delete.line3 = Du kan ikke gj\xBFre om databaseoppdateringer for denne operasjonen. +space_state_delete.line3 = Du kan ikke gj\u00f8re om databaseoppdateringer for denne operasjonen. # space_state_form space_state_form.editState = Rediger status -space_state_form.error.state.invalid = Statusnavn m\x8C v\xBEre "Camel-Case - Status-Navn" med bindestrek ('-') for \x8C skille ord. 'Fast', 'P\x8C-Vent' eller 'Under-Arbeid' +space_state_form.error.state.invalid = Statusnavn m\u00e5 v\u00e6re "Camel-Case - Status-Navn" med bindestrek ('-') for \u00e5 skille ord. 'Fast', 'P\u00e5-Vent' eller 'Under-Arbeid' space_state_form.error.state.exists = En status med dette navnet eksisterer allerede # user_allocate_space -user_allocate_space.spacesAllocated = Omr\x8Cder knyttet til denne brukeren -user_allocate_space.space = Omr\x8Cde +user_allocate_space.spacesAllocated = Omr\u00e5der knyttet til denne brukeren +user_allocate_space.space = Omr\u00e5de user_allocate_space.role = Rolle user_allocate_space.remove = Fjern -user_allocate_space.chooseSpace = Velg et omr\x8Cde \x8C knytte til denne brukeren -user_allocate_space.makeUserAdmin = Gj\xBFr denne brukeren til en Administrator (for alle omr\x8Cder) -user_allocate_space.makeAdmin = Gj\xBFr til Admin -user_allocate_space.allSpaces = (alle omr\x8Cder) +user_allocate_space.chooseSpace = Velg et omr\u00e5de \u00e5 knytte til denne brukeren +user_allocate_space.makeUserAdmin = Gj\u00f8r denne brukeren til en Administrator (for alle omr\u00e5der) +user_allocate_space.makeAdmin = Gj\u00f8r til Admin +user_allocate_space.allSpaces = (alle omr\u00e5der) # user_allocate_space_role -user_allocate_space_role.allocateRole = Knytt rolle til bruker {0} innen omr\x8Cde +user_allocate_space_role.allocateRole = Knytt rolle til bruker {0} innen omr\u00e5de user_allocate_space_role.allocate = Knytt # user_list -user_list.usersAndSpaces = Brukere og tilknyttede omr\x8Cder +user_list.usersAndSpaces = Brukere og tilknyttede omr\u00e5der user_list.createNewUser = Opprett ny bruker user_list.userName = Brukernavn user_list.loginName = Logginn navn user_list.editProfile = Rediger profil -user_list.locked = L\x8Cst -user_list.spaceRole = Omr\x8Cde (Rolle) -user_list.allocateSpaceRole = Tilknytt<br/>Omr\x8Cde / Rolle -user_list.locale = Spr\x8Ck +user_list.locked = L\u00e5st +user_list.spaceRole = Omr\u00e5de (Rolle) +user_list.allocateSpaceRole = Tilknytt<br/>Omr\u00e5de / Rolle +user_list.locale = Spr\u00e5k user_list.email = Epost user_list.filterBy = Filtrer med @@ -409,7 +409,7 @@ mail_sender.loginMailLine1 = Dine logginn detaljer har blitt opprettet / oppdatert slik: mail_sender.loginName = Logginn navn mail_sender.password = Passord -mail_sender.loginMailLine2 = Bruk linken under til \x8C logge inn: +mail_sender.loginMailLine2 = Bruk linken under til \u00e5 logge inn: # new item_relate_remove item_relate_remove.heading = Bekreft sletting av relasjon @@ -416,21 +416,21 @@ # item_delete item_delete.confirm = Bekreft sletting av post -item_delete.line1 = Er du sikker p\x8C at du vil slette denne posten? -item_delete.line2 = Du kan ikke gj\xBFre om databaseoppdateringer for denne operasjonen. +item_delete.line1 = Er du sikker p\u00e5 at du vil slette denne posten? +item_delete.line2 = Du kan ikke gj\u00f8re om databaseoppdateringer for denne operasjonen. # user_delete user_delete.confirm = Bekreft sletting av bruker -user_delete.line1 = Er du sikker p\x8C at du vil slette denne brukeren? -user_delete.line2 = Du kan ikke gj\xBFre om databaseoppdateringer for denne operasjonen. -user_delete.notPossible = Denne brukeren er brukt i poster og kan ikke slettes. Pr\xBFv \x8C l\x8Cse brukeren eller slette postene f\xBFrst. +user_delete.line1 = Er du sikker p\u00e5 at du vil slette denne brukeren? +user_delete.line2 = Du kan ikke gj\u00f8re om databaseoppdateringer for denne operasjonen. +user_delete.notPossible = Denne brukeren er brukt i poster og kan ikke slettes. Pr\u00f8v \u00e5 l\u00e5se brukeren eller slette postene f\u00f8rst. # generic error messages -error.itemBelongsToUnallocatedSpace = Du har ikke adgang til \x8C se denne posten +error.itemBelongsToUnallocatedSpace = Du har ikke adgang til \u00e5 se denne posten # item search filter wizard item_filter.showColumn = Vis i resultat -item_filter.expression = S\xBFkefilter +item_filter.expression = S\u00f8kefilter item_filter.expandAll = (ekspander alle) item_filter.in = har verdier item_filter.notIn = har ikke verdier @@ -437,6 +437,6 @@ item_filter.like = inneholder tekst item_filter.equal = er lik item_filter.notEqual = er ikke lik -item_filter.greaterThan = st\xBFrre enn +item_filter.greaterThan = st\u00f8rre enn item_filter.lessThan = mindre enn item_filter.between = mellom This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-08-09 09:12:22
|
Revision: 1384 http://sourceforge.net/p/j-trac/code/1384 Author: udittmer Date: 2021-08-09 09:12:19 +0000 (Mon, 09 Aug 2021) Log Message: ----------- set source encoding to UTF-8; use Servlet API 3.1 web.xml header Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/webapp/WEB-INF/web.xml Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-08-09 09:03:17 UTC (rev 1383) +++ trunk/jtrac/pom.xml 2021-08-09 09:12:19 UTC (rev 1384) @@ -502,8 +502,6 @@ </excludes> </configuration> </plugin> - <!-- - --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> @@ -516,6 +514,7 @@ </build> <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <timestamp>${maven.build.timestamp}</timestamp> <maven.build.timestamp.format>yyyy-MM-dd HH:mm z</maven.build.timestamp.format> </properties> Modified: trunk/jtrac/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/jtrac/src/main/webapp/WEB-INF/web.xml 2021-08-09 09:03:17 UTC (rev 1383) +++ trunk/jtrac/src/main/webapp/WEB-INF/web.xml 2021-08-09 09:12:19 UTC (rev 1384) @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<web-app xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" - version="2.4"> +<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" + version="3.1"> <!-- Spring context config location(s) --> <context-param> @@ -132,7 +132,7 @@ </resource-ref> --> - <!-- +<!-- <security-constraint> <display-name>HTTPS</display-name> <web-resource-collection> @@ -143,7 +143,7 @@ <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> - --> +--> <welcome-file-list> <welcome-file>index.html</welcome-file> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-08-10 09:29:31
|
Revision: 1387 http://sourceforge.net/p/j-trac/code/1387 Author: udittmer Date: 2021-08-10 09:29:28 +0000 (Tue, 10 Aug 2021) Log Message: ----------- lint compiler args in POM, obscure displayed passwords Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigListPage.java Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-08-09 09:43:08 UTC (rev 1386) +++ trunk/jtrac/pom.xml 2021-08-10 09:29:28 UTC (rev 1387) @@ -466,6 +466,12 @@ <configuration> <source>1.8</source> <target>1.8</target> + <compilerArgs> + <arg>-Xlint:deprecation</arg> + <!-- + <arg>-Xlint:unchecked</arg> + --> + </compilerArgs> </configuration> <executions> <execution> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigListPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigListPage.java 2021-08-09 09:43:08 UTC (rev 1386) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigListPage.java 2021-08-10 09:29:28 UTC (rev 1387) @@ -1,82 +1,84 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.Config; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import org.apache.wicket.behavior.SimpleAttributeModifier; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.markup.html.list.ListItem; -import org.apache.wicket.markup.html.list.ListView; - -/** - * This class is responsible to list all configuration parameters. - * It also declares which edit forms will be called to modify the - * configuration parameters. - */ -public class ConfigListPage extends BasePage { - /** - * Constructor - * - * @param selectedParam - */ - public ConfigListPage(final String selectedParam) { - - final Map<String, String> configMap = getJtrac().loadAllConfig(); - - List<String> params = new ArrayList(Config.getParams()); - - final SimpleAttributeModifier sam = new SimpleAttributeModifier("class", "alt"); - - add(new ListView("configs", params) { - protected void populateItem(ListItem listItem) { - final String param = (String) listItem.getModelObject(); - final String value = configMap.get(param); - - if (param.equals(selectedParam)) { - listItem.add(new SimpleAttributeModifier("class", "selected")); - } else if(listItem.getIndex() % 2 == 1) { - listItem.add(sam); - } - - listItem.add(new Label("param", param)); - listItem.add(new Label("value", value)); - - if (param.toLowerCase().indexOf("password") != -1) { - // Password value to be edited - listItem.add(new Link("link") { - public void onClick() { - setResponsePage(new ConfigPasswordFormPage(param, value)); - } - }); - } else { - // Normal text value to be edited - listItem.add(new Link("link") { - public void onClick() { - setResponsePage(new ConfigFormPage(param, value)); - } - }); - } - listItem.add(new Label("description", localize("config." + param))); - } - }); - - } -} \ No newline at end of file +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.domain.Config; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.apache.wicket.behavior.SimpleAttributeModifier; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; + +/** + * This class is responsible to list all configuration parameters. + * It also declares which edit forms will be called to modify the configuration parameters. + */ + +public class ConfigListPage extends BasePage { + + private static final SimpleAttributeModifier SAM_ALT = new SimpleAttributeModifier("class", "alt"); + private static final SimpleAttributeModifier SAM_SEL = new SimpleAttributeModifier("class", "selected"); + + public ConfigListPage(final String selectedParam) { + + final Map<String, String> configMap = getJtrac().loadAllConfig(); + + List<String> params = new ArrayList(Config.getParams()); + + add(new ListView("configs", params) { + protected void populateItem (ListItem listItem) { + final String param = (String) listItem.getModelObject(); + final String value = configMap.get(param); + + if (param.equals(selectedParam)) { + listItem.add(SAM_SEL); + } else if (listItem.getIndex() % 2 == 1) { + listItem.add(SAM_ALT); + } + + listItem.add(new Label("param", param)); + + if (param.toLowerCase().indexOf("password") != -1) { + // Password value to be edited + + // obscure the password, but give an indication of its length + listItem.add(new Label("value", new String(new char[value.length()]).replaceAll("\0", "*"))); + + listItem.add(new Link("link") { + public void onClick() { + setResponsePage(new ConfigPasswordFormPage(param, value)); + } + }); + } else { + // Normal text value to be edited + + listItem.add(new Label("value", value)); + + listItem.add(new Link("link") { + public void onClick() { + setResponsePage(new ConfigFormPage(param, value)); + } + }); + } + listItem.add(new Label("description", localize("config." + param))); + } + }); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-09-24 13:38:28
|
Revision: 1396 http://sourceforge.net/p/j-trac/code/1396 Author: udittmer Date: 2021-09-24 13:38:25 +0000 (Fri, 24 Sep 2021) Log Message: ----------- show additional field {U+201C}Last Changed{U+201D}, which displays the date of the last comment Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java trunk/jtrac/src/main/java/info/jtrac/domain/Item.java trunk/jtrac/src/main/java/info/jtrac/domain/ItemSearch.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java trunk/jtrac/src/main/resources/messages_de.properties trunk/jtrac/src/main/resources/messages_en.properties Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-09-23 08:50:14 UTC (rev 1395) +++ trunk/jtrac/pom.xml 2021-09-24 13:38:25 UTC (rev 1396) @@ -339,6 +339,7 @@ <artifactId>wicket</artifactId> <version>1.3.7</version> <!-- + <version>1.4.23</version> <version>1.5.16</version> --> <type>pom</type> @@ -348,6 +349,7 @@ <artifactId>wicket-extensions</artifactId> <version>1.3.7</version> <!-- + <version>1.4.23</version> <version>1.5.16</version> --> </dependency> Modified: trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java 2021-09-23 08:50:14 UTC (rev 1395) +++ trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java 2021-09-24 13:38:25 UTC (rev 1396) @@ -1,843 +1,848 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.domain; - -import info.jtrac.Jtrac; -import info.jtrac.domain.FilterCriteria.Expression; -import info.jtrac.util.DateUtils; -import info.jtrac.wicket.JtracCheckBoxMultipleChoice; -import info.jtrac.wicket.yui.YuiCalendar; - -import static info.jtrac.domain.ColumnHeading.Name.*; -import static info.jtrac.domain.FilterCriteria.Expression.*; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.apache.wicket.MarkupContainer; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.form.IChoiceRenderer; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.markup.html.panel.Fragment; -import org.apache.wicket.model.PropertyModel; -import org.hibernate.criterion.DetachedCriteria; -import org.hibernate.criterion.MatchMode; -import org.hibernate.criterion.Restrictions; - -/** - * used to render columns in the search results table - * and also in the search filter screen - */ -public class ColumnHeading implements Serializable { - - private static final Map<String, Name> NAMES_MAP; - - // set up a static Map to resolve a String to our ColumnHeading.Name enum value - static { - NAMES_MAP = new HashMap<String, Name>(); - for (Name n : Name.values()) { - NAMES_MAP.put(n.text, n); - } - } - - /** - * Resolve a String to a valid enum value for ColumnHeading.Name - */ - private static Name convertToName(String text) { - Name n = NAMES_MAP.get(text); - if (n == null) { - throw new RuntimeException("Bad name " + text); - } - return n; - } - - /** - * test if a given string is a valid column heading name - */ - public static boolean isValidName(String text) { - return NAMES_MAP.containsKey(text); - } - - public static boolean isValidFieldOrColumnName(String text) { - return isValidName(text) || Field.isValidName(text); - } - - public enum Name { - - ID("id"), - SUMMARY("summary"), - DETAIL("detail"), - LOGGED_BY("loggedBy"), - STATUS("status"), - ASSIGNED_TO("assignedTo"), - TIME_STAMP("timeStamp"), - SPACE("space"); - - private String text; - - Name(String text) { - this.text = text; - } - - public String getText() { - return text; - } - - @Override - public String toString() { - return text; - } - - } - - private Field field; - private Name name; - private String label; - private boolean visible = true; - private Processor processor; - - private FilterCriteria filterCriteria = new FilterCriteria(); - - public ColumnHeading(Name name) { - this.name = name; - if(name == DETAIL || name == SPACE) { - visible = false; - } - processor = getProcessor(); - } - - public ColumnHeading(Field field) { - this.field = field; - this.label = field.getLabel(); - processor = getProcessor(); - } - - public boolean isField() { - return field != null; - } - - public boolean isDropDownType() { - if(isField()) { - return field.isDropDownType(); - } else { - return name == LOGGED_BY - || name == ASSIGNED_TO - || name == STATUS; - } - } - - public static List<ColumnHeading> getColumnHeadings(Space s) { - List<ColumnHeading> list = new ArrayList<ColumnHeading>(); - list.add(new ColumnHeading(ID)); - list.add(new ColumnHeading(SUMMARY)); - list.add(new ColumnHeading(DETAIL)); - list.add(new ColumnHeading(STATUS)); - list.add(new ColumnHeading(LOGGED_BY)); - list.add(new ColumnHeading(ASSIGNED_TO)); - for(Field f : s.getMetadata().getFieldList()) { - list.add(new ColumnHeading(f)); - } - list.add(new ColumnHeading(TIME_STAMP)); - return list; - } - - public static List<ColumnHeading> getColumnHeadings() { - List<ColumnHeading> list = new ArrayList<ColumnHeading>(); - list.add(new ColumnHeading(ID)); - list.add(new ColumnHeading(SPACE)); - list.add(new ColumnHeading(SUMMARY)); - list.add(new ColumnHeading(DETAIL)); - list.add(new ColumnHeading(LOGGED_BY)); - list.add(new ColumnHeading(ASSIGNED_TO)); - list.add(new ColumnHeading(TIME_STAMP)); - return list; - } - - public List<Expression> getValidFilterExpressions() { - return processor.getValidFilterExpressions(); - } - - public Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - return processor.getFilterUiFragment(container, user, space, jtrac); - } - - public void addRestrictions(DetachedCriteria criteria) { - processor.addRestrictions(criteria); - } - - public String getAsQueryString() { - return processor.getAsQueryString(); - } - - public void loadFromQueryString(String s, User user, Jtrac jtrac) { - processor.loadFromQueryString(s, user, jtrac); - } - - /** - * also see description below for the private getProcessor() method - */ - private abstract class Processor implements Serializable { - - /* return the possible expressions (equals, greater-than etc) to show on filter UI for selection */ - abstract List<Expression> getValidFilterExpressions(); - - /* return the wicket ui fragment that will be shown over ajax (based on selected expression) */ - abstract Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac); - - /* get as hibernate restriction and append to passed in criteria that will be used to query the database */ - abstract void addRestrictions(DetachedCriteria criteria); - - /* return a querystring representation of the filter criteria to create a bookmarkable url */ - abstract String getAsQueryString(); - - /* load a querystring representation and initialize filter critera when acting on a bookmarkable url */ - abstract void loadFromQueryString(String s, User user, Jtrac jtrac); - - } - - /** - * this routine is a massive if-then construct that acts as a factory for the - * right implementation of the responsibilities defined in the "Processor" class (above) - * based on the type of ColumnHeading - the right implementation will be returned. - * having everything in one place below, makes it easy to maintain, as the - * logic of each of the methods are closely interdependent for a given column type - * for e.g. the kind of hibernate criteria needed depends on what is made available on the UI - */ - private Processor getProcessor() { - if(isField()) { - switch(field.getName().getType()) { - //============================================================== - case 1: - case 2: - case 3: - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(IN); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - Fragment fragment = new Fragment("fragParent", "multiSelect", container); - final Map<String, String> options = field.getOptions(); - JtracCheckBoxMultipleChoice choice = new JtracCheckBoxMultipleChoice("values", new ArrayList(options.keySet()), new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return options.get(o); - } - public String getIdValue(Object o, int i) { - return o.toString(); - } - }); - fragment.add(choice); - choice.setModel(new PropertyModel(filterCriteria, "values")); - return fragment; - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValueList()) { - List values = filterCriteria.getValues(); - List<Integer> keys = new ArrayList<Integer>(values.size()); - for(Object o : values) { - keys.add(new Integer(o.toString())); - } - criteria.add(Restrictions.in(getNameText(), keys)); - } - } - String getAsQueryString() { - return getQueryStringFromValueList(); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setValueListFromQueryString(s); - } - }; - //============================================================== - case 4: // decimal number - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(EQ, NOT_EQ, GT, LT, BETWEEN); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - Fragment fragment = new Fragment("fragParent", "textField", container); - TextField textField = new TextField("value", Double.class); - textField.setModel(new PropertyModel(filterCriteria, "value")); - fragment.add(textField); - if(filterCriteria.getExpression() == BETWEEN) { - TextField textField2 = new TextField("value2", Double.class); - textField.setModel(new PropertyModel(filterCriteria, "value2")); - fragment.add(textField2); - } else { - fragment.add(new WebMarkupContainer("value2").setVisible(false)); - } - return fragment; - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValue()) { - Object value = filterCriteria.getValue(); - switch(filterCriteria.getExpression()) { - case EQ: criteria.add(Restrictions.eq(getNameText(), value)); break; - case NOT_EQ: criteria.add(Restrictions.not(Restrictions.eq(name.text, value))); break; - case GT: criteria.add(Restrictions.gt(getNameText(), value)); break; - case LT: criteria.add(Restrictions.lt(getNameText(), value)); break; - case BETWEEN: - criteria.add(Restrictions.gt(getNameText(), value)); - criteria.add(Restrictions.lt(getNameText(), filterCriteria.getValue2())); - break; - default: - } - } - } - String getAsQueryString() { - return getQueryStringFromValue(Double.class); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setValueFromQueryString(s, Double.class); - } - - }; - //============================================================== - case 6: // date - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(EQ, NOT_EQ, GT, LT, BETWEEN); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - Fragment fragment = new Fragment("fragParent", "dateField", container); - YuiCalendar calendar = new YuiCalendar("value", new PropertyModel(filterCriteria, "value"), false); - fragment.add(calendar); - if(filterCriteria.getExpression() == BETWEEN) { - YuiCalendar calendar2 = new YuiCalendar("value2", new PropertyModel(filterCriteria, "value2"), false); - fragment.add(calendar2); - } else { - fragment.add(new WebMarkupContainer("value2").setVisible(false)); - } - return fragment; - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValue()) { - Object value = filterCriteria.getValue(); - switch(filterCriteria.getExpression()) { - case EQ: criteria.add(Restrictions.eq(getNameText(), value)); break; - case NOT_EQ: criteria.add(Restrictions.not(Restrictions.eq(getNameText(), value))); break; - case GT: criteria.add(Restrictions.gt(getNameText(), value)); break; - case LT: criteria.add(Restrictions.lt(getNameText(), value)); break; - case BETWEEN: - criteria.add(Restrictions.gt(getNameText(), value)); - criteria.add(Restrictions.lt(getNameText(), filterCriteria.getValue2())); - break; - default: - } - } - } - String getAsQueryString() { - return getQueryStringFromValue(Date.class); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setValueFromQueryString(s, Date.class); - } - }; - //============================================================== - case 5: // free text - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(CONTAINS); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - return getTextFieldFragment(container); - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValue()) { - criteria.add(Restrictions.ilike(getNameText(), - (String) filterCriteria.getValue(), MatchMode.ANYWHERE)); - } - } - String getAsQueryString() { - return getQueryStringFromValue(String.class); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setValueFromQueryString(s, String.class); - } - }; - //============================================================== - default: - throw new RuntimeException("Unknown Column Heading " + name); - } - } else { // this is not a custom field but one of the "built-in" columns - switch(name) { - //============================================================== - case ID: - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(EQ); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - return getTextFieldFragment(container); - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValue()) { - // should never come here for criteria: see ItemSearch#getRefId() - throw new RuntimeException("should not come here for 'id'"); - } - } - String getAsQueryString() { - return getQueryStringFromValue(String.class); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setValueFromQueryString(s, String.class); - } - }; - //============================================================== - case SUMMARY: - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(CONTAINS); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - return getTextFieldFragment(container); - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValue()) { - criteria.add(Restrictions.ilike(getNameText(), (String) filterCriteria.getValue(), MatchMode.ANYWHERE)); - } - } - String getAsQueryString() { - return getQueryStringFromValue(String.class); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setValueFromQueryString(s, String.class); - } - }; - //============================================================== - case DETAIL: - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(CONTAINS); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - return getTextFieldFragment(container); - } - void addRestrictions(DetachedCriteria criteria) { - // do nothing, 'detail' already processed, see: ItemSearch#getSearchText() - } - String getAsQueryString() { - return getQueryStringFromValue(String.class); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setValueFromQueryString(s, String.class); - } - }; - - //============================================================== - case STATUS: - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(IN); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - Fragment fragment = new Fragment("fragParent", "multiSelect", container); - // status selectable only when context space is not null - final Map<Integer, String> options = space.getMetadata().getStatesMap(); - options.remove(State.NEW); - JtracCheckBoxMultipleChoice choice = new JtracCheckBoxMultipleChoice("values", new ArrayList(options.keySet()), new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return options.get(o); - } - public String getIdValue(Object o, int i) { - return o.toString(); - } - }); - fragment.add(choice); - choice.setModel(new PropertyModel(filterCriteria, "values")); - return fragment; - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValueList()) { - criteria.add(Restrictions.in(getNameText(), filterCriteria.getValues())); - } - } - String getAsQueryString() { - return getQueryStringFromValueList(); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setStatusListFromQueryString(s); - } - }; - //============================================================== - case ASSIGNED_TO: - case LOGGED_BY: - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(IN); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - Fragment fragment = new Fragment("fragParent", "multiSelect", container); - List<User> users = null; - if(space == null) { - users = jtrac.findUsersForUser(user); - } else { - users = jtrac.findUsersForSpace(space.getId()); - } - JtracCheckBoxMultipleChoice choice = new JtracCheckBoxMultipleChoice("values", users, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((User) o).getName(); - } - public String getIdValue(Object o, int i) { - return ((User) o).getId() + ""; - } - }); - fragment.add(choice); - choice.setModel(new PropertyModel(filterCriteria, "values")); - return fragment; - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValueList()) { - criteria.add(Restrictions.in(getNameText(), filterCriteria.getValues())); - } - } - String getAsQueryString() { - return getQueryStringFromUserList(); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setUserListFromQueryString(s, jtrac); - } - }; - //============================================================== - case TIME_STAMP: - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(BETWEEN, GT, LT); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - Fragment fragment = new Fragment("fragParent", "dateField", container); - YuiCalendar calendar = new YuiCalendar("value", new PropertyModel(filterCriteria, "value"), false); - fragment.add(calendar); - if(filterCriteria.getExpression() == BETWEEN) { - YuiCalendar calendar2 = new YuiCalendar("value2", new PropertyModel(filterCriteria, "value2"), false); - fragment.add(calendar2); - } else { - fragment.add(new WebMarkupContainer("value2").setVisible(false)); - } - return fragment; - } - void addRestrictions(DetachedCriteria criteria) { - if(filterHasValue()) { - Object value = filterCriteria.getValue(); - switch(filterCriteria.getExpression()) { - case GT: criteria.add(Restrictions.gt(getNameText(), value)); break; - case LT: criteria.add(Restrictions.lt(getNameText(), value)); break; - case BETWEEN: - criteria.add(Restrictions.gt(getNameText(), value)); - criteria.add(Restrictions.lt(getNameText(), filterCriteria.getValue2())); - break; - default: - } - } - } - String getAsQueryString() { - return getQueryStringFromValue(Date.class); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setValueFromQueryString(s, Date.class); - } - }; - //============================================================== - case SPACE: - return new Processor() { - List<Expression> getValidFilterExpressions() { - return getAsList(IN); - } - Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { - Fragment fragment = new Fragment("fragParent", "multiSelect", container); - List<Space> spaces = new ArrayList(user.getSpaces()); - JtracCheckBoxMultipleChoice choice = new JtracCheckBoxMultipleChoice("values", spaces, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((Space) o).getName(); - } - public String getIdValue(Object o, int i) { - return ((Space) o).getId() + ""; - } - }); - fragment.add(choice); - choice.setModel(new PropertyModel(filterCriteria, "values")); - return fragment; - } - void addRestrictions(DetachedCriteria criteria) { - // already handled space as special case, see ItemSearch#getSelectedSpaces() - } - String getAsQueryString() { - return getQueryStringFromSpaceList(); - } - void loadFromQueryString(String s, User user, Jtrac jtrac) { - setSpaceListFromQueryString(s, user, jtrac); - } - }; - //============================================================== - default: - throw new RuntimeException("Unknown Column Heading " + name); - } - } - } - - private List<Expression> getAsList(Expression... expressions) { - List<Expression> list = new ArrayList<Expression>(); - for(Expression e : expressions) { - list.add(e); - } - return list; - } - - private Fragment getTextFieldFragment(MarkupContainer container) { - Fragment fragment = new Fragment("fragParent", "textField", container); - TextField textField = new TextField("value", String.class); - textField.setModel(new PropertyModel(filterCriteria, "value")); - fragment.add(textField); - fragment.add(new WebMarkupContainer("value2").setVisible(false)); - return fragment; - } - - private boolean filterHasValueList() { - if(filterCriteria.getExpression() != null - && filterCriteria.getValues() != null - && filterCriteria.getValues().size() > 0) { - return true; - } - return false; - } - - private boolean filterHasValue() { - Object value = filterCriteria.getValue(); - if(filterCriteria.getExpression() != null && value != null && value.toString().trim().length() > 0) { - return true; - } - return false; - } - - private String prependExpression(String s) { - return filterCriteria.getExpression().getKey() + "_" + s; - } - - private String getQueryStringFromValueList() { - if(!filterHasValueList()) { - return null; - } - String temp = ""; - for(Object o : filterCriteria.getValues()) { - if(temp.length() > 0) { - temp = temp + "_"; - } - temp = temp + o; - } - return prependExpression(temp); - } - - private String getQueryStringFromValue(Class clazz) { - if(!filterHasValue()) { - return null; - } - String temp = ""; - if(clazz.equals(Date.class)) { - temp = DateUtils.format((Date) filterCriteria.getValue()); - if(filterCriteria.getValue2() != null) { - temp = temp + "_" + DateUtils.format((Date) filterCriteria.getValue2()); - } - } else { - temp = filterCriteria.getValue() + ""; - if(filterCriteria.getValue2() != null) { - temp = temp + "_" + filterCriteria.getValue2(); - } - } - return prependExpression(temp); - } - - // TODO refactor code duplication - private String getQueryStringFromUserList() { - if(!filterHasValueList()) { - return null; - } - String temp = ""; - for(User u : (List<User>) filterCriteria.getValues()) { - if(temp.length() > 0) { - temp = temp + "_"; - } - temp = temp + u.getId(); - } - return prependExpression(temp); - } - - // TODO refactor code duplication - private String getQueryStringFromSpaceList() { - if(!filterHasValueList()) { - return null; - } - String temp = ""; - for(Space s : (List<Space>) filterCriteria.getValues()) { - if(temp.length() > 0) { - temp = temp + "_"; - } - temp = temp + s.getId(); - } - return prependExpression(temp); - } - - private List<String> setExpressionAndGetRemainingTokens(String s) { - String [] tokens = s.split("_"); - filterCriteria.setExpression(FilterCriteria.convertToExpression(tokens[0])); - List<String> remainingTokens = new ArrayList<String>(); - // ignore first token, this has been parsed as Expression above - for(int i = 1; i < tokens.length; i++ ) { - remainingTokens.add(tokens[i]); - } - return remainingTokens; - } - - private void setValueListFromQueryString(String raw) { - filterCriteria.setValues(setExpressionAndGetRemainingTokens(raw)); - } - - // TODO refactor with more methods in filtercriteria - private void setValueFromQueryString(String raw, Class clazz) { - List<String> tokens = setExpressionAndGetRemainingTokens(raw); - String v1 = tokens.get(0); - String v2 = tokens.size() > 1 ? tokens.get(1) : null; - if(clazz.equals(Double.class)) { - filterCriteria.setValue(new Double(v1)); - if(v2 != null) { - filterCriteria.setValue2(new Double(v2)); - } - } else if(clazz.equals(Date.class)) { - filterCriteria.setValue(DateUtils.convert(v1)); - if(v2 != null) { - filterCriteria.setValue2(DateUtils.convert(v2)); - } - } else { // String - filterCriteria.setValue(v1); - if(v2 != null) { - filterCriteria.setValue2(v2); - } - } - - } - - private void setUserListFromQueryString(String raw, Jtrac jtrac) { - List<String> tokens = setExpressionAndGetRemainingTokens(raw); - List<User> users = jtrac.findUsersWhereIdIn(getAsListOfLong(tokens)); - filterCriteria.setValues(users); - } - - private void setSpaceListFromQueryString(String raw, User user, Jtrac jtrac) { - List<String> tokens = setExpressionAndGetRemainingTokens(raw); - List<Space> temp = jtrac.findSpacesWhereIdIn(getAsListOfLong(tokens)); - // for security, prevent URL spoofing to show spaces not allocated to user - List<Space> spaces = new ArrayList<Space>(); - for(Space s : temp) { - if(user.isAllocatedToSpace(s.getId())) { - spaces.add(s); - } - } - filterCriteria.setValues(spaces); - } - - private void setStatusListFromQueryString(String raw) { - List<String> tokens = setExpressionAndGetRemainingTokens(raw); - List<Integer> statuses = new ArrayList<Integer>(); - for(String s : tokens) { - statuses.add(new Integer(s)); - } - filterCriteria.setValues(statuses); - } - - private List<Long> getAsListOfLong(List<String> tokens) { - List<Long> ids = new ArrayList<Long>(); - for(String s : tokens) { - ids.add(new Long(s)); - } - return ids; - } - - /* custom accessor */ - public void setName(String nameAsString) { - name = convertToName(nameAsString); - } - - public String getNameText() { - if(isField()) { - return field.getName().getText(); - } - return name.text; - } - - //========================================================================== - - public Name getName() { - return name; - } - - public Field getField() { - return field; - } - - public String getLabel() { - return label; - } - - public FilterCriteria getFilterCriteria() { - return filterCriteria; - } - - public void setFilterCriteria(FilterCriteria filterCriteria) { - this.filterCriteria = filterCriteria; - } - - public boolean isVisible() { - return visible; - } - - public void setVisible(boolean visible) { - this.visible = visible; - } - - @Override - public int hashCode() { - if(isField()) { - return field.hashCode(); - } - return name.hashCode(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof ColumnHeading)) { - return false; - } - final ColumnHeading ch = (ColumnHeading) o; - if(ch.isField()) { - return ch.field.equals(field); - } - return ch.name.equals(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("name [").append(name); - sb.append("]; filterCriteria [").append(filterCriteria); - sb.append("]"); - return sb.toString(); - } - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.domain; + +import info.jtrac.Jtrac; +import info.jtrac.domain.FilterCriteria.Expression; +import info.jtrac.util.DateUtils; +import info.jtrac.wicket.JtracCheckBoxMultipleChoice; +import info.jtrac.wicket.yui.YuiCalendar; + +import static info.jtrac.domain.ColumnHeading.Name.*; +import static info.jtrac.domain.FilterCriteria.Expression.*; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.model.PropertyModel; +import org.hibernate.criterion.DetachedCriteria; +import org.hibernate.criterion.MatchMode; +import org.hibernate.criterion.Restrictions; + +/** + * used to render columns in the search results table + * and also in the search filter screen + */ +public class ColumnHeading implements Serializable { + + private static final Map<String, Name> NAMES_MAP; + + // set up a static Map to resolve a String to our ColumnHeading.Name enum value + static { + NAMES_MAP = new HashMap<String, Name>(); + for (Name n : Name.values()) { + NAMES_MAP.put(n.text, n); + } + } + + /** + * Resolve a String to a valid enum value for ColumnHeading.Name + */ + private static Name convertToName(String text) { + Name n = NAMES_MAP.get(text); + if (n == null) { + throw new RuntimeException("Bad name " + text); + } + return n; + } + + /** + * test if a given string is a valid column heading name + */ + public static boolean isValidName(String text) { + return NAMES_MAP.containsKey(text); + } + + public static boolean isValidFieldOrColumnName(String text) { + return isValidName(text) || Field.isValidName(text); + } + + public enum Name { + + ID("id"), + SUMMARY("summary"), + DETAIL("detail"), + LOGGED_BY("loggedBy"), + STATUS("status"), + ASSIGNED_TO("assignedTo"), + TIME_STAMP("timeStamp"), + SPACE("space"), + LAST_CHANGED("lastChanged"); + + private String text; + + Name(String text) { + this.text = text; + } + + public String getText() { + return text; + } + + @Override + public String toString() { + return text; + } + + } + + private Field field; + private Name name; + private String label; + private boolean visible = true; + private Processor processor; + + private FilterCriteria filterCriteria = new FilterCriteria(); + + public ColumnHeading(Name name) { + this.name = name; + if(name == DETAIL || name == SPACE) { + visible = false; + } + processor = getProcessor(); + } + + public ColumnHeading(Field field) { + this.field = field; + this.label = field.getLabel(); + processor = getProcessor(); + } + + public boolean isField() { + return field != null; + } + + public boolean isDropDownType() { + if(isField()) { + return field.isDropDownType(); + } else { + return name == LOGGED_BY + || name == ASSIGNED_TO + || name == STATUS; + } + } + + public static List<ColumnHeading> getColumnHeadings(Space s) { + List<ColumnHeading> list = new ArrayList<ColumnHeading>(); + list.add(new ColumnHeading(ID)); + list.add(new ColumnHeading(SUMMARY)); + list.add(new ColumnHeading(DETAIL)); + list.add(new ColumnHeading(STATUS)); + list.add(new ColumnHeading(LOGGED_BY)); + list.add(new ColumnHeading(ASSIGNED_TO)); + for(Field f : s.getMetadata().getFieldList()) { + list.add(new ColumnHeading(f)); + } + list.add(new ColumnHeading(TIME_STAMP)); + list.add(new ColumnHeading(LAST_CHANGED)); + return list; + } + + public static List<ColumnHeading> getColumnHeadings() { + List<ColumnHeading> list = new ArrayList<ColumnHeading>(); + list.add(new ColumnHeading(ID)); + list.add(new ColumnHeading(SPACE)); + list.add(new ColumnHeading(SUMMARY)); + list.add(new ColumnHeading(DETAIL)); + list.add(new ColumnHeading(LOGGED_BY)); + list.add(new ColumnHeading(ASSIGNED_TO)); + list.add(new ColumnHeading(TIME_STAMP)); + list.add(new ColumnHeading(LAST_CHANGED)); + return list; + } + + public List<Expression> getValidFilterExpressions() { + return processor.getValidFilterExpressions(); + } + + public Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { + return processor.getFilterUiFragment(container, user, space, jtrac); + } + + public void addRestrictions(DetachedCriteria criteria) { + processor.addRestrictions(criteria); + } + + public String getAsQueryString() { + return processor.getAsQueryString(); + } + + public void loadFromQueryString(String s, User user, Jtrac jtrac) { + processor.loadFromQueryString(s, user, jtrac); + } + + /** + * also see description below for the private getProcessor() method + */ + private abstract class Processor implements Serializable { + + /* return the possible expressions (equals, greater-than etc) to show on filter UI for selection */ + abstract List<Expression> getValidFilterExpressions(); + + /* return the wicket ui fragment that will be shown over ajax (based on selected expression) */ + abstract Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac); + + /* get as hibernate restriction and append to passed in criteria that will be used to query the database */ + abstract void addRestrictions(DetachedCriteria criteria); + + /* return a querystring representation of the filter criteria to create a bookmarkable url */ + abstract String getAsQueryString(); + + /* load a querystring representation and initialize filter critera when acting on a bookmarkable url */ + abstract void loadFromQueryString(String s, User user, Jtrac jtrac); + + } + + /** + * this routine is a massive if-then construct that acts as a factory for the + * right implementation of the responsibilities defined in the "Processor" class (above) + * based on the type of ColumnHeading - the right implementation will be returned. + * having everything in one place below, makes it easy to maintain, as the + * logic of each of the methods are closely interdependent for a given column type + * for e.g. the kind of hibernate criteria needed depends on what is made available on the UI + */ + private Processor getProcessor() { + if(isField()) { + switch(field.getName().getType()) { + //============================================================== + case 1: + case 2: + case 3: + return new Processor() { + List<Expression> getValidFilterExpressions() { + return getAsList(IN); + } + Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { + Fragment fragment = new Fragment("fragParent", "multiSelect", container); + final Map<String, String> options = field.getOptions(); + JtracCheckBoxMultipleChoice choice = new JtracCheckBoxMultipleChoice("values", new ArrayList(options.keySet()), new IChoiceRenderer() { + public Object getDisplayValue(Object o) { + return options.get(o); + } + public String getIdValue(Object o, int i) { + return o.toString(); + } + }); + fragment.add(choice); + choice.setModel(new PropertyModel(filterCriteria, "values")); + return fragment; + } + void addRestrictions(DetachedCriteria criteria) { + if(filterHasValueList()) { + List values = filterCriteria.getValues(); + List<Integer> keys = new ArrayList<Integer>(values.size()); + for(Object o : values) { + keys.add(new Integer(o.toString())); + } + criteria.add(Restrictions.in(getNameText(), keys)); + } + } + String getAsQueryString() { + return getQueryStringFromValueList(); + } + void loadFromQueryString(String s, User user, Jtrac jtrac) { + setValueListFromQueryString(s); + } + }; + //============================================================== + case 4: // decimal number + return new Processor() { + List<Expression> getValidFilterExpressions() { + return getAsList(EQ, NOT_EQ, GT, LT, BETWEEN); + } + Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { + Fragment fragment = new Fragment("fragParent", "textField", container); + TextField textField = new TextField("value", Double.class); + textField.setModel(new PropertyModel(filterCriteria, "value")); + fragment.add(textField); + if(filterCriteria.getExpression() == BETWEEN) { + TextField textField2 = new TextField("value2", Double.class); + textField.setModel(new PropertyModel(filterCriteria, "value2")); + fragment.add(textField2); + } else { + fragment.add(new WebMarkupContainer("value2").setVisible(false)); + } + return fragment; + } + void addRestrictions(DetachedCriteria criteria) { + if(filterHasValue()) { + Object value = filterCriteria.getValue(); + switch(filterCriteria.getExpression()) { + case EQ: criteria.add(Restrictions.eq(getNameText(), value)); break; + case NOT_EQ: criteria.add(Restrictions.not(Restrictions.eq(name.text, value))); break; + case GT: criteria.add(Restrictions.gt(getNameText(), value)); break; + case LT: criteria.add(Restrictions.lt(getNameText(), value)); break; + case BETWEEN: + criteria.add(Restrictions.gt(getNameText(), value)); + criteria.add(Restrictions.lt(getNameText(), filterCriteria.getValue2())); + break; + default: + } + } + } + String getAsQueryString() { + return getQueryStringFromValue(Double.class); + } + void loadFromQueryString(String s, User user, Jtrac jtrac) { + setValueFromQueryString(s, Double.class); + } + + }; + //============================================================== + case 6: // date + return new Processor() { + List<Expression> getValidFilterExpressions() { + return getAsList(EQ, NOT_EQ, GT, LT, BETWEEN); + } + Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { + Fragment fragment = new Fragment("fragParent", "dateField", container); + YuiCalendar calendar = new YuiCalendar("value", new PropertyModel(filterCriteria, "value"), false); + fragment.add(calendar); + if(filterCriteria.getExpression() == BETWEEN) { + YuiCalendar calendar2 = new YuiCalendar("value2", new PropertyModel(filterCriteria, "value2"), false); + fragment.add(calendar2); + } else { + fragment.add(new WebMarkupContainer("value2").setVisible(false)); + } + return fragment; + } + void addRestrictions(DetachedCriteria criteria) { + if(filterHasValue()) { + Object value = filterCriteria.getValue(); + switch(filterCriteria.getExpression()) { + case EQ: criteria.add(Restrictions.eq(getNameText(), value)); break; + case NOT_EQ: criteria.add(Restrictions.not(Restrictions.eq(getNameText(), value))); break; + case GT: criteria.add(Restrictions.gt(getNameText(), value)); break; + case LT: criteria.add(Restrictions.lt(getNameText(), value)); break; + case BETWEEN: + criteria.add(Restrictions.gt(getNameText(), value)); + criteria.add(Restrictions.lt(getNameText(), filterCriteria.getValue2())); + break; + default: + } + } + } + String getAsQueryString() { + return getQueryStringFromValue(Date.class); + } + void loadFromQueryString(String s, User user, Jtrac jtrac) { + setValueFromQueryString(s, Date.class); + } + }; + //============================================================== + case 5: // free text + return new Processor() { + List<Expression> getValidFilterExpressions() { + return getAsList(CONTAINS); + } + Fragment getFilterUiFragment(MarkupContainer container, User user, Space space, Jtrac jtrac) { + return getTextFieldFragment(container); + } + void addRestrictions(DetachedCriteria criteria) { + if(filterHasValue()) { + criteria.add(Restrictions.ilike(getNameText(), + (String) filterCriteria.getValue(), MatchMode.ANYWHERE)); + } + } + String getAsQueryString() { + return getQueryStringFromValue(String.class); + } + void loadFromQueryString(String s, User user, Jtrac jtrac) { + setValueFromQueryString(s, String.class); + } + }; + //============================================================== + default: + throw new RuntimeException("Unknown Column Heading " + name); + } + } else { // this is not a... [truncated message content] |
From: <udi...@us...> - 2021-10-06 08:41:44
|
Revision: 1398 http://sourceforge.net/p/j-trac/code/1398 Author: udittmer Date: 2021-10-06 08:41:39 +0000 (Wed, 06 Oct 2021) Log Message: ----------- update Wicket to 1.4 Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/wicket/HeaderPanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/IndexRebuildPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemFormPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewFormPanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/JtracCheckBoxMultipleChoice.java trunk/jtrac/src/main/java/info/jtrac/wicket/SpaceFieldFormPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/SpaceFormPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/UserFormPage.java Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-10-05 16:45:41 UTC (rev 1397) +++ trunk/jtrac/pom.xml 2021-10-06 08:41:39 UTC (rev 1398) @@ -4,7 +4,7 @@ <groupId>info.jtrac</groupId> <artifactId>jtrac</artifactId> <packaging>war</packaging> - <version>2.2.0-b1</version> + <version>2.2.0-b2</version> <name>JTrac</name> <description> JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields @@ -337,9 +337,9 @@ <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket</artifactId> + <version>1.4.23</version> + <!-- <version>1.3.7</version> - <!-- - <version>1.4.23</version> <version>1.5.16</version> --> <type>pom</type> @@ -347,9 +347,9 @@ <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-extensions</artifactId> + <version>1.4.23</version> + <!-- <version>1.3.7</version> - <!-- - <version>1.4.23</version> <version>1.5.16</version> --> </dependency> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/HeaderPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/HeaderPanel.java 2021-10-05 16:45:41 UTC (rev 1397) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/HeaderPanel.java 2021-10-06 08:41:39 UTC (rev 1398) @@ -1,133 +1,135 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.Space; -import info.jtrac.domain.State; -import info.jtrac.domain.User; -import java.util.ArrayList; -import java.util.List; -import javax.servlet.http.Cookie; -import org.acegisecurity.context.SecurityContextHolder; -import org.apache.wicket.PageParameters; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.protocol.http.WebRequest; -import org.apache.wicket.protocol.http.WebResponse; - -/** - * header navigation - */ -public class HeaderPanel extends BasePanel { - - public HeaderPanel() { - super("header"); - - final User user = getPrincipal(); - final Space space = getCurrentSpace(); - final List<Space> spaces = new ArrayList(user.getSpaces()); - - add(new Link("dashboard") { - public void onClick() { - setCurrentSpace(null); - setResponsePage(DashboardPage.class); - } - }); - - if (space == null) { - add(new WebMarkupContainer("spaceName").setVisible(false)); - add(new WebMarkupContainer("new").setVisible(false)); - add(new Link("search") { - public void onClick() { - // if only one space don't use generic search screen - if(spaces.size() == 1) { - Space current = spaces.get(0); - setCurrentSpace(current); - } else { - setCurrentSpace(null); // may have come here with back button! - } - setResponsePage(ItemSearchFormPage.class); - } - @Override - public boolean isVisible() { - return spaces.size() > 0; - } - }); - } else { - add(new Label("spaceName", space.getName())); - add(new Label("prefixCode", space.getPrefixCode())); - if (user.getPermittedTransitions(space, State.NEW).size() > 0) { - add(new Link("new") { - public void onClick() { - setResponsePage(ItemFormPage.class); - } - }); - } else { - add(new WebMarkupContainer("new").setVisible(false)); - } - - add(new Link("search") { - public void onClick() { - setResponsePage(ItemSearchFormPage.class); - } - }); - } - - if(user.getId() == 0) { - add(new WebMarkupContainer("options").setVisible(false)); - add(new WebMarkupContainer("logout").setVisible(false)); - add(new Link("login") { - public void onClick() { - setResponsePage(LoginPage.class); - } - }); - add(new WebMarkupContainer("user").setVisible(false)); - } else { - add(new Link("options") { - public void onClick() { - JtracSession.get().setCurrentSpace(null); - setResponsePage(OptionsPage.class); - } - }); - add(new Link("logout") { - public void onClick() { - Cookie cookie = new Cookie("jtrac", ""); - String path = ((WebRequest) getRequest()).getHttpServletRequest().getContextPath(); - cookie.setPath(path); - ((WebResponse) getResponse()).clearCookie(cookie); - getSession().invalidate(); - logger.debug("invalidated session and cleared cookie"); - // is acegi - cas being used ? - String logoutUrl = JtracApplication.get().getCasLogoutUrl(); - if(logoutUrl != null) { - logger.debug("cas authentication being used, clearing security context and redirecting to cas logout page"); - SecurityContextHolder.clearContext(); - // have to use stateless page reference because session is killed - setResponsePage(CasLogoutPage.class); - } else { - setResponsePage(LogoutPage.class, new PageParameters("locale=" + user.getLocale())); - } - } - }); - add(new WebMarkupContainer("login").setVisible(false)); - add(new Label("user", user.getName())); - } - - } - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.domain.Space; +import info.jtrac.domain.State; +import info.jtrac.domain.User; + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.Cookie; + +import org.acegisecurity.context.SecurityContextHolder; +import org.apache.wicket.PageParameters; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.protocol.http.WebRequest; +import org.apache.wicket.protocol.http.WebResponse; + +/** + * header navigation + */ +public class HeaderPanel extends BasePanel { + + public HeaderPanel() { + super("header"); + + final User user = getPrincipal(); + final Space space = getCurrentSpace(); + final List<Space> spaces = new ArrayList(user.getSpaces()); + + add(new Link("dashboard") { + public void onClick() { + setCurrentSpace(null); + setResponsePage(DashboardPage.class); + } + }); + + if (space == null) { + add(new WebMarkupContainer("spaceName").setVisible(false)); + add(new Label("prefixCode", "")); + add(new WebMarkupContainer("new").setVisible(false)); + add(new Link("search") { + public void onClick() { + // if only one space don't use generic search screen + if(spaces.size() == 1) { + Space current = spaces.get(0); + setCurrentSpace(current); + } else { + setCurrentSpace(null); // may have come here with back button! + } + setResponsePage(ItemSearchFormPage.class); + } + @Override + public boolean isVisible() { + return spaces.size() > 0; + } + }); + } else { + add(new Label("spaceName", space.getName())); + add(new Label("prefixCode", space.getPrefixCode())); + if (user.getPermittedTransitions(space, State.NEW).size() > 0) { + add(new Link("new") { + public void onClick() { + setResponsePage(ItemFormPage.class); + } + }); + } else { + add(new WebMarkupContainer("new").setVisible(false)); + } + + add(new Link("search") { + public void onClick() { + setResponsePage(ItemSearchFormPage.class); + } + }); + } + + if(user.getId() == 0) { + add(new WebMarkupContainer("options").setVisible(false)); + add(new WebMarkupContainer("logout").setVisible(false)); + add(new Link("login") { + public void onClick() { + setResponsePage(LoginPage.class); + } + }); + add(new WebMarkupContainer("user").setVisible(false)); + } else { + add(new Link("options") { + public void onClick() { + JtracSession.get().setCurrentSpace(null); + setResponsePage(OptionsPage.class); + } + }); + add(new Link("logout") { + public void onClick() { + Cookie cookie = new Cookie("jtrac", ""); + String path = ((WebRequest) getRequest()).getHttpServletRequest().getContextPath(); + cookie.setPath(path); + ((WebResponse) getResponse()).clearCookie(cookie); + getSession().invalidate(); + logger.debug("invalidated session and cleared cookie"); + // is acegi - cas being used ? + String logoutUrl = JtracApplication.get().getCasLogoutUrl(); + if(logoutUrl != null) { + logger.debug("cas authentication being used, clearing security context and redirecting to cas logout page"); + SecurityContextHolder.clearContext(); + // have to use stateless page reference because session is killed + setResponsePage(CasLogoutPage.class); + } else { + setResponsePage(LogoutPage.class, new PageParameters("locale=" + user.getLocale())); + } + } + }); + add(new WebMarkupContainer("login").setVisible(false)); + add(new Label("user", user.getName())); + } + } +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/IndexRebuildPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/IndexRebuildPage.java 2021-10-05 16:45:41 UTC (rev 1397) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/IndexRebuildPage.java 2021-10-06 08:41:39 UTC (rev 1398) @@ -1,117 +1,114 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.Jtrac; -import info.jtrac.domain.BatchInfo; -import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.Button; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.AbstractReadOnlyModel; -import org.apache.wicket.model.IModel; -import org.apache.wicket.util.time.Duration; - -/** - * rebuild indexes admin option - */ -public class IndexRebuildPage extends BasePage { - - public IndexRebuildPage(boolean success) { - if(success) { - add(new Label("heading", localize("index_rebuild_success.message"))); - add(new WebMarkupContainer("form").setVisible(false)); - } else { - add(new Label("heading", localize("index_rebuild.heading"))); - add(new RebuildIndexesForm("form")); - } - } - - /** - * wicket form - */ - private class RebuildIndexesForm extends Form { - - private BatchInfo batchInfo = new BatchInfo(); - private String errorMessage; - private boolean complete; - - public RebuildIndexesForm(String id) { - - super(id); - - final Label progress = new Label("progress"); - progress.setOutputMarkupId(true); - - Button button = new Button("start") { - @Override - public void onSubmit() { - // hide the button - this.setVisible(false); - // long running process, use thread - new Thread() { - private transient Jtrac jtrac = getJtrac(); - public void run() { - try { - jtrac.rebuildIndexes(batchInfo); - } catch (Exception e) { - logger.error("indexing error", e); - errorMessage = e.getMessage(); - } - complete = true; - } - }.start(); - - // poll and update the progress every 5 seconds - progress.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5))); - IModel model = new AbstractReadOnlyModel() { - public Object getObject() { - if(complete) { - if(errorMessage != null) { - setResponsePage(new ErrorPage(errorMessage)); - } else { - // reshow the page, with success message - setResponsePage(new IndexRebuildPage(true)); - } - } - int total = batchInfo.getTotalSize(); - int current = batchInfo.getCurrentPosition(); - int percent = total == 0 ? 0 : 100 * current / total; - return percent + "% [" + current + " / " + total + "]"; - }; - }; - progress.setModel(model); - } - }; - - add(button); - - add(new Link("cancel") { - public void onClick() { - setResponsePage(OptionsPage.class); - } - - }); - - add(progress); - } - - } - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.Jtrac; +import info.jtrac.domain.BatchInfo; +import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.AbstractReadOnlyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.util.time.Duration; + +/** + * rebuild indexes admin option + */ + +public class IndexRebuildPage extends BasePage { + + public IndexRebuildPage(boolean success) { + if(success) { + add(new Label("heading", localize("index_rebuild_success.message"))); + add(new WebMarkupContainer("form").setVisible(false)); + } else { + add(new Label("heading", localize("index_rebuild.heading"))); + add(new RebuildIndexesForm("form")); + } + } + + /** + * wicket form + */ + private class RebuildIndexesForm extends Form { + + private BatchInfo batchInfo = new BatchInfo(); + private String errorMessage; + private boolean complete; + + public RebuildIndexesForm(String id) { + super(id); + + final Label progress = new Label("progress"); + progress.setOutputMarkupId(true); + + Button button = new Button("start") { + @Override + public void onSubmit() { + // hide the button + this.setVisible(false); + // long running process, use thread + new Thread() { + private transient Jtrac jtrac = getJtrac(); + public void run() { + try { + jtrac.rebuildIndexes(batchInfo); + } catch (Exception e) { + logger.error("indexing error", e); + errorMessage = e.getMessage(); + } + complete = true; + } + }.start(); + + // poll and update the progress every 5 seconds + progress.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5))); + IModel model = new AbstractReadOnlyModel() { + public Object getObject() { + if(complete) { + if(errorMessage != null) { + setResponsePage(new ErrorPage(errorMessage)); + } else { + // reshow the page, with success message + setResponsePage(new IndexRebuildPage(true)); + } + } + int total = batchInfo.getTotalSize(); + int current = batchInfo.getCurrentPosition(); + int percent = total == 0 ? 0 : 100 * current / total; + return percent + "% [" + current + " / " + total + "]"; + }; + }; + progress.setDefaultModel(model); + } + }; + + add(button); + + add(new Link("cancel") { + public void onClick() { + setResponsePage(OptionsPage.class); + } + }); + + add(progress); + } + } +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemFormPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemFormPage.java 2021-10-05 16:45:41 UTC (rev 1397) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemFormPage.java 2021-10-06 08:41:39 UTC (rev 1398) @@ -1,317 +1,318 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.Item; -import info.jtrac.domain.ItemSearch; -import info.jtrac.domain.ItemUser; -import info.jtrac.domain.Space; -import info.jtrac.domain.State; -import info.jtrac.domain.User; -import info.jtrac.domain.UserSpaceRole; -import info.jtrac.util.UserUtils; -import java.util.List; -import org.apache.wicket.PageParameters; -import org.apache.wicket.behavior.HeaderContributor; -import org.apache.wicket.markup.html.IHeaderContributor; -import org.apache.wicket.markup.html.IHeaderResponse; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.form.Button; -import org.apache.wicket.markup.html.form.CheckBox; -import org.apache.wicket.markup.html.form.DropDownChoice; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.IChoiceRenderer; -import org.apache.wicket.markup.html.form.ListMultipleChoice; -import org.apache.wicket.markup.html.form.TextArea; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.markup.html.form.upload.FileUpload; -import org.apache.wicket.markup.html.form.upload.FileUploadField; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.markup.html.panel.FeedbackPanel; -import org.apache.wicket.model.BoundCompoundPropertyModel; -import org.apache.wicket.model.LoadableDetachableModel; -import org.apache.wicket.util.lang.Bytes; - -/** - * Create / Edit item form page - */ -public class ItemFormPage extends BasePage { - /** - * Default constructor - */ - public ItemFormPage() { - Item item = new Item(); - item.setSpace(getCurrentSpace()); - item.setStatus(State.NEW); - add(new ItemForm("form", item)); - } - - /** - * Constructor with provided item id. - * - * @param itemId The - */ - public ItemFormPage(long itemId) { - Item item = getJtrac().loadItem(itemId); - add(new ItemForm("form", item)); - } - - /** - * Wicket form - */ - private class ItemForm extends Form { - private JtracFeedbackMessageFilter filter; - private FileUploadField fileUploadField = new FileUploadField("file"); - private boolean editMode; - private int version; - - /** - * Constructor - * - * @param id - * @param item - */ - public ItemForm(String id, final Item item) { - super(id); - setMultiPart(true); - FeedbackPanel feedback = new FeedbackPanel("feedback"); - filter = new JtracFeedbackMessageFilter(); - feedback.setFilter(filter); - add(feedback); - version = item.getVersion(); - - if (item.getId() > 0) { - editMode = true; - } - - BoundCompoundPropertyModel model = null; - if (editMode) { - /* - * This ensures that the model object is re-loaded as part - * of the form submission workflow before form binding and - * avoids hibernate lazy loading issues during the whole - * update transaction. - */ - LoadableDetachableModel itemModel = new LoadableDetachableModel() { - protected Object load() { - logger.debug("attaching existing item " + item.getId()); - return getJtrac().loadItem(item.getId()); - } - }; - model = new BoundCompoundPropertyModel(itemModel); - } else { - model = new BoundCompoundPropertyModel(item); - } - setModel(model); - - /* - * =================================================== - * Summary - * =================================================== - */ - final TextField summaryField = new TextField("summary"); - summaryField.setRequired(true); - summaryField.add(new ErrorHighlighter()); - summaryField.setOutputMarkupId(true); - add(summaryField); - add(new HeaderContributor(new IHeaderContributor() { - public void renderHead(IHeaderResponse response) { - response.renderOnLoadJavascript("document.getElementById('" + - summaryField.getMarkupId() + "').focus()"); - } - })); - - /* - * =================================================== - * Delete button - * =================================================== - */ - Button delete = new Button("delete") { - @Override - public void onSubmit() { - String heading = localize("item_delete.confirm"); - String warning = localize("item_delete.line2"); - String line1 = localize("item_delete.line1"); - ConfirmPage confirm = new ConfirmPage(ItemFormPage.this, heading, warning, new String[] { line1 }) { - public void onConfirm() { - // avoid lazy init problem - getJtrac().removeItem(getJtrac().loadItem(item.getId())); - ItemSearch itemSearch = JtracSession.get().getItemSearch(); - if (itemSearch != null) { - setResponsePage(new ItemListPage(itemSearch)); - } else { - setResponsePage(DashboardPage.class); - } - } - }; - setResponsePage(confirm); - } - }; - - delete.setDefaultFormProcessing(false); - add(delete); - if (!editMode) { - delete.setVisible(false); - } - - /* - * =================================================== - * Detail - * =================================================== - */ - add(new TextArea("detail").setRequired(true).add(new ErrorHighlighter())); - - /* - * =================================================== - * Custom fields - * =================================================== - */ - if (editMode) { - add(new CustomFieldsFormPanel("fields", model, item.getSpace()).setRenderBodyOnly(true)); - } else { - add(new CustomFieldsFormPanel("fields", model, item, getPrincipal()).setRenderBodyOnly(true)); - } - - /* - * Hide some components if editing item - */ - WebMarkupContainer hideAssignedTo = new WebMarkupContainer("hideAssignedTo"); - WebMarkupContainer hideNotifyList = new WebMarkupContainer("hideNotifyList"); - WebMarkupContainer hideEditReason = new WebMarkupContainer("hideEditReason"); - add(hideAssignedTo); - add(hideNotifyList); - add(hideEditReason); - if (editMode) { - hideAssignedTo.setVisible(false); - hideNotifyList.setVisible(false); - hideEditReason.add(new TextArea("editReason").setRequired(true).add(new ErrorHighlighter())); - } else { - hideEditReason.setVisible(false); - - /* - * =================================================== - * Assigned to - * =================================================== - */ - Space space = item.getSpace(); - List<UserSpaceRole> userSpaceRoles = getJtrac().findUserRolesForSpace(space.getId()); - List<User> assignable = UserUtils.filterUsersAbleToTransitionFrom(userSpaceRoles, space, State.OPEN); - DropDownChoice choice = new DropDownChoice("assignedTo", assignable, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((User) o).getName(); - } - - public String getIdValue(Object o, int i) { - return ((User) o).getId() + ""; - } - }); - - choice.setNullValid(true); - choice.setRequired(true); - WebMarkupContainer border = new WebMarkupContainer("border"); - border.add(choice); - border.add(new ErrorHighlighter(choice)); - hideAssignedTo.add(border); - - /* - * =================================================== - * Notify list - * =================================================== - */ - List<ItemUser> choices = UserUtils.convertToItemUserList(userSpaceRoles); - ListMultipleChoice itemUsers = new JtracCheckBoxMultipleChoice("itemUsers", choices, - new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((ItemUser) o).getUser().getName(); - } - - public String getIdValue(Object o, int i) { - return ((ItemUser) o).getUser().getId() + ""; - } - }, true); - hideNotifyList.add(itemUsers); - - /* - * =================================================== - * Attachment - * =================================================== - */ - hideNotifyList.add(fileUploadField); - setMaxSize(Bytes.megabytes(getJtrac().getAttachmentMaxSizeInMb())); - } - - /* - * =================================================== - * Send notifications - * =================================================== - */ - add(new CheckBox("sendNotifications")); - - /* - * =================================================== - * Cancel - * =================================================== - */ - add(new Link("cancel") { - public void onClick() { - setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); - } - }.setVisible(editMode && JtracSession.get().getItemSearch() != null)); - } - - /* (non-Javadoc) - * @see org.apache.wicket.markup.html.form.Form#validate() - */ - @Override - protected void validate() { - filter.reset(); - Item item = (Item) getModelObject(); - if (editMode && item.getVersion() != version) { - /* - * User must have used back button after edit - */ - error(localize("item_form.error.version")); - } - super.validate(); - } - - /* (non-Javadoc) - * @see org.apache.wicket.markup.html.form.Form#onSubmit() - */ - @Override - protected void onSubmit() { - final FileUpload fileUpload = fileUploadField.getFileUpload(); - Item item = (Item) getModelObject(); - User user = getPrincipal(); - if (editMode) { - getJtrac().updateItem(item, user); - } else { - item.setLoggedBy(user); - item.setStatus(State.OPEN); - getJtrac().storeItem(item, fileUpload); - } - - /* - * On creating an item, clear any search filter (especially - * the related item) from session. - */ - JtracSession.get().setItemSearch(null); - setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); - } - - } // end inner class ItemForm -} \ No newline at end of file +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.domain.Item; +import info.jtrac.domain.ItemSearch; +import info.jtrac.domain.ItemUser; +import info.jtrac.domain.Space; +import info.jtrac.domain.State; +import info.jtrac.domain.User; +import info.jtrac.domain.UserSpaceRole; +import info.jtrac.util.UserUtils; + +import java.util.List; + +import org.apache.wicket.PageParameters; +import org.apache.wicket.behavior.HeaderContributor; +import org.apache.wicket.markup.html.IHeaderContributor; +import org.apache.wicket.markup.html.IHeaderResponse; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.ListMultipleChoice; +import org.apache.wicket.markup.html.form.TextArea; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.form.upload.FileUpload; +import org.apache.wicket.markup.html.form.upload.FileUploadField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.panel.FeedbackPanel; +import org.apache.wicket.model.BoundCompoundPropertyModel; +import org.apache.wicket.model.LoadableDetachableModel; +import org.apache.wicket.util.lang.Bytes; + +/** + * Create / Edit item form page + */ +public class ItemFormPage extends BasePage { + /** + * Default constructor + */ + public ItemFormPage() { + Item item = new Item(); + item.setSpace(getCurrentSpace()); + item.setStatus(State.NEW); + add(new ItemForm("form", item)); + } + + /** + * Constructor with provided item id. + * + * @param itemId The + */ + public ItemFormPage(long itemId) { + Item item = getJtrac().loadItem(itemId); + add(new ItemForm("form", item)); + } + + /** + * Wicket form + */ + private class ItemForm extends Form { + private JtracFeedbackMessageFilter filter; + private FileUploadField fileUploadField = new FileUploadField("file"); + private boolean editMode; + private int version; + + /** + * Constructor + * + * @param id + * @param item + */ + public ItemForm(String id, final Item item) { + super(id); + setMultiPart(true); + FeedbackPanel feedback = new FeedbackPanel("feedback"); + filter = new JtracFeedbackMessageFilter(); + feedback.setFilter(filter); + add(feedback); + version = item.getVersion(); + + if (item.getId() > 0) { + editMode = true; + } + + BoundCompoundPropertyModel model = null; + if (editMode) { + /* + * This ensures that the model object is re-loaded as part + * of the form submission workflow before form binding and + * avoids hibernate lazy loading issues during the whole + * update transaction. + */ + LoadableDetachableModel itemModel = new LoadableDetachableModel() { + protected Object load() { + logger.debug("attaching existing item " + item.getId()); + return getJtrac().loadItem(item.getId()); + } + }; + model = new BoundCompoundPropertyModel(itemModel); + } else { + model = new BoundCompoundPropertyModel(item); + } + setModel(model); + + /* + * =================================================== + * Summary + * =================================================== + */ + final TextField summaryField = new TextField("summary"); + summaryField.setRequired(true); + summaryField.add(new ErrorHighlighter()); + summaryField.setOutputMarkupId(true); + add(summaryField); + add(new HeaderContributor(new IHeaderContributor() { + public void renderHead(IHeaderResponse response) { + response.renderOnLoadJavascript("document.getElementById('" + + summaryField.getMarkupId() + "').focus()"); + } + })); + + /* + * =================================================== + * Delete button + * =================================================== + */ + Button delete = new Button("delete") { + @Override + public void onSubmit() { + String heading = localize("item_delete.confirm"); + String warning = localize("item_delete.line2"); + String line1 = localize("item_delete.line1"); + ConfirmPage confirm = new ConfirmPage(ItemFormPage.this, heading, warning, new String[] { line1 }) { + public void onConfirm() { + // avoid lazy init problem + getJtrac().removeItem(getJtrac().loadItem(item.getId())); + ItemSearch itemSearch = JtracSession.get().getItemSearch(); + if (itemSearch != null) { + setResponsePage(new ItemListPage(itemSearch)); + } else { + setResponsePage(DashboardPage.class); + } + } + }; + setResponsePage(confirm); + } + }; + + delete.setDefaultFormProcessing(false); + add(delete); + if (!editMode) { + delete.setVisible(false); + } + + /* + * =================================================== + * Detail + * =================================================== + */ + add(new TextArea("detail").setRequired(true).add(new ErrorHighlighter())); + + /* + * =================================================== + * Custom fields + * =================================================== + */ + if (editMode) { + add(new CustomFieldsFormPanel("fields", model, item.getSpace()).setRenderBodyOnly(true)); + } else { + add(new CustomFieldsFormPanel("fields", model, item, getPrincipal()).setRenderBodyOnly(true)); + } + + /* + * Hide some components if editing item + */ + WebMarkupContainer hideAssignedTo = new WebMarkupContainer("hideAssignedTo"); + WebMarkupContainer hideNotifyList = new WebMarkupContainer("hideNotifyList"); + WebMarkupContainer hideEditReason = new WebMarkupContainer("hideEditReason"); + add(hideAssignedTo); + add(hideNotifyList); + add(hideEditReason); + if (editMode) { + hideAssignedTo.setVisible(false); + hideNotifyList.setVisible(false); + hideEditReason.add(new TextArea("editReason").setRequired(true).add(new ErrorHighlighter())); + } else { + hideEditReason.setVisible(false); + + /* + * =================================================== + * Assigned to + * =================================================== + */ + Space space = item.getSpace(); + List<UserSpaceRole> userSpaceRoles = getJtrac().findUserRolesForSpace(space.getId()); + List<User> assignable = UserUtils.filterUsersAbleToTransitionFrom(userSpaceRoles, space, State.OPEN); + DropDownChoice choice = new DropDownChoice("assignedTo", assignable, new IChoiceRenderer() { + public Object getDisplayValue(Object o) { + return ((User) o).getName(); + } + + public String getIdValue(Object o, int i) { + return ((User) o).getId() + ""; + } + }); + + choice.setNullValid(true); + choice.setRequired(true); + WebMarkupContainer border = new WebMarkupContainer("border"); + border.add(choice); + border.add(new ErrorHighlighter(choice)); + hideAssignedTo.add(border); + + /* + * =================================================== + * Notify list + * =================================================== + */ + List<ItemUser> choices = UserUtils.convertToItemUserList(userSpaceRoles); + ListMultipleChoice itemUsers = new JtracCheckBoxMultipleChoice("itemUsers", choices, + new IChoiceRenderer() { + public Object getDisplayValue(Object o) { + return ((ItemUser) o).getUser().getName(); + } + + public String getIdValue(Object o, int i) { + return ((ItemUser) o).getUser().getId() + ""; + } + }, true); + hideNotifyList.add(itemUsers); + + /* + * =================================================== + * Attachment + * =================================================== + */ + hideNotifyList.add(fileUploadField); + setMaxSize(Bytes.megabytes(getJtrac().getAttachmentMaxSizeInMb())); + } + + /* + * =================================================== + * Send notifications + * =================================================== + */ + add(new CheckBox("sendNotifications")); + + /* + * =================================================== + * Cancel + * =================================================== + */ + add(new Link("cancel") { + public void onClick() { + setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); + } + }.setVisible(editMode && JtracSession.get().getItemSearch() != null)); + } + + /* (non-Javadoc) + * @see org.apache.wicket.markup.html.form.Form#onValidate() + */ + @Override + protected void onValidate() { + filter.reset(); + Item item = (Item) getModelObject(); + if (editMode && item.getVersion() != version) { + /* + * User must have used back button after edit + */ + error(localize("item_form.error.version")); + } + } + + /* (non-Javadoc) + * @see org.apache.wicket.markup.html.form.Form#onSubmit() + */ + @Override + protected void onSubmit() { + final FileUpload fileUpload = fileUploadField.getFileUpload(); + Item item = (Item) getModelObject(); + User user = getPrincipal(); + if (editMode) { + getJtrac().updateItem(item, user); + } else { + item.setLoggedBy(user); + item.setStatus(State.OPEN); + getJtrac().storeItem(item, fileUpload); + } + + /* + * On creating an item, clear any search filter (especially + * the related item) from session. + */ + JtracSession.get().setItemSearch(null); + setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); + } + + } // end inner class ItemForm +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewFormPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewFormPanel.java 2021-10-05 16:45:41 UTC (rev 1397) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewFormPanel.java 2021-10-06 08:41:39 UTC (rev 1398) @@ -1,200 +1,198 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.History; -import info.jtrac.domain.Item; -import info.jtrac.domain.ItemSearch; -import info.jtrac.domain.ItemUser; -import info.jtrac.domain.Space; -import info.jtrac.domain.State; -import info.jtrac.domain.User; -import info.jtrac.domain.UserSpaceRole; -import info.jtrac.util.UserUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import org.apache.wicket.PageParameters; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.form.CheckBox; -import org.apache.wicket.markup.html.form.DropDownChoice; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.FormComponent; -import org.apache.wicket.markup.html.form.IChoiceRenderer; -import org.apache.wicket.markup.html.form.ListMultipleChoice; -import org.apache.wicket.markup.html.form.TextArea; -import org.apache.wicket.markup.html.form.upload.FileUpload; -import org.apache.wicket.markup.html.form.upload.FileUploadField; -import org.apache.wicket.markup.html.form.validation.AbstractFormValidator; -import org.apache.wicket.markup.html.panel.FeedbackPanel; -import org.apache.wicket.model.BoundCompoundPropertyModel; -import org.apache.wicket.util.lang.Bytes; - -/** - * Form to update history for item - */ -public class ItemViewFormPanel extends BasePanel { - - private JtracFeedbackMessageFilter filter; - private ItemSearch itemSearch; - - public ItemViewFormPanel(String id, Item item, ItemSearch itemSearch) { - super(id); - this.itemSearch = itemSearch; - FeedbackPanel feedback = new FeedbackPanel("feedback"); - filter = new JtracFeedbackMessageFilter(); - feedback.setFilter(filter); - add(feedback); - add(new ItemViewForm("form", item)); - } - - /** - * wicket form - */ - private class ItemViewForm extends Form { - - private FileUploadField fileUploadField; - private long itemId; - private DropDownChoice assignedToChoice; - private DropDownChoice statusChoice; - - public ItemViewForm(String id, final Item item) { - super(id); - setMultiPart(true); - this.itemId = item.getId(); - final History history = new History(); - history.setItemUsers(item.getItemUsers()); - final BoundCompoundPropertyModel model = new BoundCompoundPropertyModel(history); - setModel(model); - add(new TextArea("comment").setRequired(true).add(new ErrorHighlighter())); - // custom fields =================================================== - User user = getPrincipal(); - add(new CustomFieldsFormPanel("fields", model, item, user)); - // ================================================================= - final Space space = item.getSpace(); - final List<UserSpaceRole> userSpaceRoles = getJtrac().findUserRolesForSpace(space.getId()); - // assigned to ===================================================== - final WebMarkupContainer border = new WebMarkupContainer("border"); - border.setOutputMarkupId(true); - final WebMarkupContainer hide = new WebMarkupContainer("hide"); - border.add(hide); - final List<User> emptyList = new ArrayList<User>(0); // will be populated over Ajax - assignedToChoice = new DropDownChoice("assignedTo", emptyList, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((User) o).getName(); - } - public String getIdValue(Object o, int i) { - return ((User) o).getId() + ""; - } - }); - assignedToChoice.setOutputMarkupId(true); - assignedToChoice.setVisible(false); - assignedToChoice.setNullValid(true); - border.add(new ErrorHighlighter(assignedToChoice)); - border.add(assignedToChoice); - add(border); - // status ========================================================== - final Map<Integer, String> statesMap = item.getPermittedTransitions(user); - List<Integer> states = new ArrayList(statesMap.keySet()); - statusChoice = new IndicatingDropDownChoice("status", states, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return statesMap.get(o); - } - public String getIdValue(Object o, int i) { - return o.toString(); - } - }); - statusChoice.setNullValid(true); - statusChoice.add(new ErrorHighlighter()); - statusChoice.add(new AjaxFormComponentUpdatingBehavior("onChange") { - protected void onUpdate(AjaxRequestTarget target) { - Integer selectedStatus = (Integer) getFormComponent().getConvertedInput(); - if (selectedStatus == null) { - assignedToChoice.setVisible(false); - hide.setVisible(true); - } else { - List<User> assignable = UserUtils.filterUsersAbleToTransitionFrom(userSpaceRoles, space, selectedStatus); - assignedToChoice.setChoices(assignable); - assignedToChoice.setVisible(true); - hide.setVisible(false); - } - target.addComponent(border); - } - }); - add(statusChoice); - // notify list ===================================================== - List<ItemUser> choices = UserUtils.convertToItemUserList(userSpaceRoles); - ListMultipleChoice itemUsers = new JtracCheckBoxMultipleChoice("itemUsers", choices, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((ItemUser) o).getUser().getName(); - } - public String getIdValue(Object o, int i) { - return ((ItemUser) o).getUser().getId() + ""; - } - }, true); - add(itemUsers); - // attachment ====================================================== - fileUploadField = new FileUploadField("file"); - add(fileUploadField); - setMaxSize(Bytes.megabytes(getJtrac().getAttachmentMaxSizeInMb())); - // send notifications=============================================== - add(new CheckBox("sendNotifications")); - // validation that assignedTo is not null if status is not null and not CLOSED - // have to use FormValidator because this is conditional validation across two FormComponents - add(new AbstractFormValidator() { - public FormComponent[] getDependentFormComponents() { - // actually we depend on assignedToChoice also, but wicket logs a warning when the - // component is not visible but we are doing ajax. anyway we use assignedToChoice.getInput() - // not assignedToChoice.convertedInput() so no danger there - return new FormComponent[] {statusChoice}; - } - public void validate(Form unused) { - if(assignedToChoice.getInput() == null || assignedToChoice.getInput().trim().length() == 0) { - Integer i = (Integer) statusChoice.getConvertedInput(); - if (i != null && i != State.CLOSED) { - // user may have customized the name of the CLOSED State e.g. for i18n - // so when reporting the error, use the display name - String closedDisplayName = space.getMetadata().getStatusValue(State.CLOSED); - assignedToChoice.error(localize("item_view_form.assignedTo.error", closedDisplayName)); - } - } - } - }); - } - - @Override - protected void validate() { - filter.reset(); - super.validate(); - } - - @Override - protected void onSubmit() { - final FileUpload fileUpload = fileUploadField.getFileUpload(); - History history = (History) getModelObject(); - User user = JtracSession.get().getUser(); - history.setLoggedBy(user); - getJtrac().storeHistoryForItem(itemId, history, fileUpload); - setResponsePage(ItemViewPage.class, new PageParameters("0=" + history.getRefId())); - } - - } - - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file... [truncated message content] |
From: <udi...@us...> - 2021-10-06 12:47:25
|
Revision: 1399 http://sourceforge.net/p/j-trac/code/1399 Author: udittmer Date: 2021-10-06 12:47:21 +0000 (Wed, 06 Oct 2021) Log Message: ----------- roll back Wicket 1.4 changes; needs more work Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java trunk/jtrac/src/main/java/info/jtrac/wicket/HeaderPanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/IndexRebuildPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemFormPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewFormPanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/JtracCheckBoxMultipleChoice.java trunk/jtrac/src/main/java/info/jtrac/wicket/SpaceFieldFormPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/SpaceFormPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/UserFormPage.java Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-10-06 08:41:39 UTC (rev 1398) +++ trunk/jtrac/pom.xml 2021-10-06 12:47:21 UTC (rev 1399) @@ -4,7 +4,7 @@ <groupId>info.jtrac</groupId> <artifactId>jtrac</artifactId> <packaging>war</packaging> - <version>2.2.0-b2</version> + <version>2.2.0-b1</version> <name>JTrac</name> <description> JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields @@ -337,9 +337,9 @@ <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket</artifactId> + <version>1.3.7</version> + <!-- <version>1.4.23</version> - <!-- - <version>1.3.7</version> <version>1.5.16</version> --> <type>pom</type> @@ -347,9 +347,9 @@ <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-extensions</artifactId> + <version>1.3.7</version> + <!-- <version>1.4.23</version> - <!-- - <version>1.3.7</version> <version>1.5.16</version> --> </dependency> Modified: trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java 2021-10-06 08:41:39 UTC (rev 1398) +++ trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java 2021-10-06 12:47:21 UTC (rev 1399) @@ -89,7 +89,8 @@ STATUS("status"), ASSIGNED_TO("assignedTo"), TIME_STAMP("timeStamp"), - SPACE("space"); + SPACE("space"), + LAST_CHANGED("lastChanged"); private String text; @@ -156,6 +157,7 @@ list.add(new ColumnHeading(f)); } list.add(new ColumnHeading(TIME_STAMP)); + list.add(new ColumnHeading(LAST_CHANGED)); return list; } @@ -168,6 +170,7 @@ list.add(new ColumnHeading(LOGGED_BY)); list.add(new ColumnHeading(ASSIGNED_TO)); list.add(new ColumnHeading(TIME_STAMP)); + list.add(new ColumnHeading(LAST_CHANGED)); return list; } @@ -516,6 +519,7 @@ }; //============================================================== case TIME_STAMP: + case LAST_CHANGED: return new Processor() { List<Expression> getValidFilterExpressions() { return getAsList(BETWEEN, GT, LT); Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/HeaderPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/HeaderPanel.java 2021-10-06 08:41:39 UTC (rev 1398) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/HeaderPanel.java 2021-10-06 12:47:21 UTC (rev 1399) @@ -1,135 +1,133 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.Space; -import info.jtrac.domain.State; -import info.jtrac.domain.User; - -import java.util.ArrayList; -import java.util.List; - -import javax.servlet.http.Cookie; - -import org.acegisecurity.context.SecurityContextHolder; -import org.apache.wicket.PageParameters; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.protocol.http.WebRequest; -import org.apache.wicket.protocol.http.WebResponse; - -/** - * header navigation - */ -public class HeaderPanel extends BasePanel { - - public HeaderPanel() { - super("header"); - - final User user = getPrincipal(); - final Space space = getCurrentSpace(); - final List<Space> spaces = new ArrayList(user.getSpaces()); - - add(new Link("dashboard") { - public void onClick() { - setCurrentSpace(null); - setResponsePage(DashboardPage.class); - } - }); - - if (space == null) { - add(new WebMarkupContainer("spaceName").setVisible(false)); - add(new Label("prefixCode", "")); - add(new WebMarkupContainer("new").setVisible(false)); - add(new Link("search") { - public void onClick() { - // if only one space don't use generic search screen - if(spaces.size() == 1) { - Space current = spaces.get(0); - setCurrentSpace(current); - } else { - setCurrentSpace(null); // may have come here with back button! - } - setResponsePage(ItemSearchFormPage.class); - } - @Override - public boolean isVisible() { - return spaces.size() > 0; - } - }); - } else { - add(new Label("spaceName", space.getName())); - add(new Label("prefixCode", space.getPrefixCode())); - if (user.getPermittedTransitions(space, State.NEW).size() > 0) { - add(new Link("new") { - public void onClick() { - setResponsePage(ItemFormPage.class); - } - }); - } else { - add(new WebMarkupContainer("new").setVisible(false)); - } - - add(new Link("search") { - public void onClick() { - setResponsePage(ItemSearchFormPage.class); - } - }); - } - - if(user.getId() == 0) { - add(new WebMarkupContainer("options").setVisible(false)); - add(new WebMarkupContainer("logout").setVisible(false)); - add(new Link("login") { - public void onClick() { - setResponsePage(LoginPage.class); - } - }); - add(new WebMarkupContainer("user").setVisible(false)); - } else { - add(new Link("options") { - public void onClick() { - JtracSession.get().setCurrentSpace(null); - setResponsePage(OptionsPage.class); - } - }); - add(new Link("logout") { - public void onClick() { - Cookie cookie = new Cookie("jtrac", ""); - String path = ((WebRequest) getRequest()).getHttpServletRequest().getContextPath(); - cookie.setPath(path); - ((WebResponse) getResponse()).clearCookie(cookie); - getSession().invalidate(); - logger.debug("invalidated session and cleared cookie"); - // is acegi - cas being used ? - String logoutUrl = JtracApplication.get().getCasLogoutUrl(); - if(logoutUrl != null) { - logger.debug("cas authentication being used, clearing security context and redirecting to cas logout page"); - SecurityContextHolder.clearContext(); - // have to use stateless page reference because session is killed - setResponsePage(CasLogoutPage.class); - } else { - setResponsePage(LogoutPage.class, new PageParameters("locale=" + user.getLocale())); - } - } - }); - add(new WebMarkupContainer("login").setVisible(false)); - add(new Label("user", user.getName())); - } - } -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.domain.Space; +import info.jtrac.domain.State; +import info.jtrac.domain.User; +import java.util.ArrayList; +import java.util.List; +import javax.servlet.http.Cookie; +import org.acegisecurity.context.SecurityContextHolder; +import org.apache.wicket.PageParameters; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.protocol.http.WebRequest; +import org.apache.wicket.protocol.http.WebResponse; + +/** + * header navigation + */ +public class HeaderPanel extends BasePanel { + + public HeaderPanel() { + super("header"); + + final User user = getPrincipal(); + final Space space = getCurrentSpace(); + final List<Space> spaces = new ArrayList(user.getSpaces()); + + add(new Link("dashboard") { + public void onClick() { + setCurrentSpace(null); + setResponsePage(DashboardPage.class); + } + }); + + if (space == null) { + add(new WebMarkupContainer("spaceName").setVisible(false)); + add(new WebMarkupContainer("new").setVisible(false)); + add(new Link("search") { + public void onClick() { + // if only one space don't use generic search screen + if(spaces.size() == 1) { + Space current = spaces.get(0); + setCurrentSpace(current); + } else { + setCurrentSpace(null); // may have come here with back button! + } + setResponsePage(ItemSearchFormPage.class); + } + @Override + public boolean isVisible() { + return spaces.size() > 0; + } + }); + } else { + add(new Label("spaceName", space.getName())); + add(new Label("prefixCode", space.getPrefixCode())); + if (user.getPermittedTransitions(space, State.NEW).size() > 0) { + add(new Link("new") { + public void onClick() { + setResponsePage(ItemFormPage.class); + } + }); + } else { + add(new WebMarkupContainer("new").setVisible(false)); + } + + add(new Link("search") { + public void onClick() { + setResponsePage(ItemSearchFormPage.class); + } + }); + } + + if(user.getId() == 0) { + add(new WebMarkupContainer("options").setVisible(false)); + add(new WebMarkupContainer("logout").setVisible(false)); + add(new Link("login") { + public void onClick() { + setResponsePage(LoginPage.class); + } + }); + add(new WebMarkupContainer("user").setVisible(false)); + } else { + add(new Link("options") { + public void onClick() { + JtracSession.get().setCurrentSpace(null); + setResponsePage(OptionsPage.class); + } + }); + add(new Link("logout") { + public void onClick() { + Cookie cookie = new Cookie("jtrac", ""); + String path = ((WebRequest) getRequest()).getHttpServletRequest().getContextPath(); + cookie.setPath(path); + ((WebResponse) getResponse()).clearCookie(cookie); + getSession().invalidate(); + logger.debug("invalidated session and cleared cookie"); + // is acegi - cas being used ? + String logoutUrl = JtracApplication.get().getCasLogoutUrl(); + if(logoutUrl != null) { + logger.debug("cas authentication being used, clearing security context and redirecting to cas logout page"); + SecurityContextHolder.clearContext(); + // have to use stateless page reference because session is killed + setResponsePage(CasLogoutPage.class); + } else { + setResponsePage(LogoutPage.class, new PageParameters("locale=" + user.getLocale())); + } + } + }); + add(new WebMarkupContainer("login").setVisible(false)); + add(new Label("user", user.getName())); + } + + } + +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/IndexRebuildPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/IndexRebuildPage.java 2021-10-06 08:41:39 UTC (rev 1398) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/IndexRebuildPage.java 2021-10-06 12:47:21 UTC (rev 1399) @@ -1,114 +1,117 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.Jtrac; -import info.jtrac.domain.BatchInfo; -import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.Button; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.AbstractReadOnlyModel; -import org.apache.wicket.model.IModel; -import org.apache.wicket.util.time.Duration; - -/** - * rebuild indexes admin option - */ - -public class IndexRebuildPage extends BasePage { - - public IndexRebuildPage(boolean success) { - if(success) { - add(new Label("heading", localize("index_rebuild_success.message"))); - add(new WebMarkupContainer("form").setVisible(false)); - } else { - add(new Label("heading", localize("index_rebuild.heading"))); - add(new RebuildIndexesForm("form")); - } - } - - /** - * wicket form - */ - private class RebuildIndexesForm extends Form { - - private BatchInfo batchInfo = new BatchInfo(); - private String errorMessage; - private boolean complete; - - public RebuildIndexesForm(String id) { - super(id); - - final Label progress = new Label("progress"); - progress.setOutputMarkupId(true); - - Button button = new Button("start") { - @Override - public void onSubmit() { - // hide the button - this.setVisible(false); - // long running process, use thread - new Thread() { - private transient Jtrac jtrac = getJtrac(); - public void run() { - try { - jtrac.rebuildIndexes(batchInfo); - } catch (Exception e) { - logger.error("indexing error", e); - errorMessage = e.getMessage(); - } - complete = true; - } - }.start(); - - // poll and update the progress every 5 seconds - progress.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5))); - IModel model = new AbstractReadOnlyModel() { - public Object getObject() { - if(complete) { - if(errorMessage != null) { - setResponsePage(new ErrorPage(errorMessage)); - } else { - // reshow the page, with success message - setResponsePage(new IndexRebuildPage(true)); - } - } - int total = batchInfo.getTotalSize(); - int current = batchInfo.getCurrentPosition(); - int percent = total == 0 ? 0 : 100 * current / total; - return percent + "% [" + current + " / " + total + "]"; - }; - }; - progress.setDefaultModel(model); - } - }; - - add(button); - - add(new Link("cancel") { - public void onClick() { - setResponsePage(OptionsPage.class); - } - }); - - add(progress); - } - } -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.Jtrac; +import info.jtrac.domain.BatchInfo; +import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.AbstractReadOnlyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.util.time.Duration; + +/** + * rebuild indexes admin option + */ +public class IndexRebuildPage extends BasePage { + + public IndexRebuildPage(boolean success) { + if(success) { + add(new Label("heading", localize("index_rebuild_success.message"))); + add(new WebMarkupContainer("form").setVisible(false)); + } else { + add(new Label("heading", localize("index_rebuild.heading"))); + add(new RebuildIndexesForm("form")); + } + } + + /** + * wicket form + */ + private class RebuildIndexesForm extends Form { + + private BatchInfo batchInfo = new BatchInfo(); + private String errorMessage; + private boolean complete; + + public RebuildIndexesForm(String id) { + + super(id); + + final Label progress = new Label("progress"); + progress.setOutputMarkupId(true); + + Button button = new Button("start") { + @Override + public void onSubmit() { + // hide the button + this.setVisible(false); + // long running process, use thread + new Thread() { + private transient Jtrac jtrac = getJtrac(); + public void run() { + try { + jtrac.rebuildIndexes(batchInfo); + } catch (Exception e) { + logger.error("indexing error", e); + errorMessage = e.getMessage(); + } + complete = true; + } + }.start(); + + // poll and update the progress every 5 seconds + progress.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5))); + IModel model = new AbstractReadOnlyModel() { + public Object getObject() { + if(complete) { + if(errorMessage != null) { + setResponsePage(new ErrorPage(errorMessage)); + } else { + // reshow the page, with success message + setResponsePage(new IndexRebuildPage(true)); + } + } + int total = batchInfo.getTotalSize(); + int current = batchInfo.getCurrentPosition(); + int percent = total == 0 ? 0 : 100 * current / total; + return percent + "% [" + current + " / " + total + "]"; + }; + }; + progress.setModel(model); + } + }; + + add(button); + + add(new Link("cancel") { + public void onClick() { + setResponsePage(OptionsPage.class); + } + + }); + + add(progress); + } + + } + +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemFormPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemFormPage.java 2021-10-06 08:41:39 UTC (rev 1398) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemFormPage.java 2021-10-06 12:47:21 UTC (rev 1399) @@ -1,318 +1,317 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.Item; -import info.jtrac.domain.ItemSearch; -import info.jtrac.domain.ItemUser; -import info.jtrac.domain.Space; -import info.jtrac.domain.State; -import info.jtrac.domain.User; -import info.jtrac.domain.UserSpaceRole; -import info.jtrac.util.UserUtils; - -import java.util.List; - -import org.apache.wicket.PageParameters; -import org.apache.wicket.behavior.HeaderContributor; -import org.apache.wicket.markup.html.IHeaderContributor; -import org.apache.wicket.markup.html.IHeaderResponse; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.form.Button; -import org.apache.wicket.markup.html.form.CheckBox; -import org.apache.wicket.markup.html.form.DropDownChoice; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.IChoiceRenderer; -import org.apache.wicket.markup.html.form.ListMultipleChoice; -import org.apache.wicket.markup.html.form.TextArea; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.markup.html.form.upload.FileUpload; -import org.apache.wicket.markup.html.form.upload.FileUploadField; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.markup.html.panel.FeedbackPanel; -import org.apache.wicket.model.BoundCompoundPropertyModel; -import org.apache.wicket.model.LoadableDetachableModel; -import org.apache.wicket.util.lang.Bytes; - -/** - * Create / Edit item form page - */ -public class ItemFormPage extends BasePage { - /** - * Default constructor - */ - public ItemFormPage() { - Item item = new Item(); - item.setSpace(getCurrentSpace()); - item.setStatus(State.NEW); - add(new ItemForm("form", item)); - } - - /** - * Constructor with provided item id. - * - * @param itemId The - */ - public ItemFormPage(long itemId) { - Item item = getJtrac().loadItem(itemId); - add(new ItemForm("form", item)); - } - - /** - * Wicket form - */ - private class ItemForm extends Form { - private JtracFeedbackMessageFilter filter; - private FileUploadField fileUploadField = new FileUploadField("file"); - private boolean editMode; - private int version; - - /** - * Constructor - * - * @param id - * @param item - */ - public ItemForm(String id, final Item item) { - super(id); - setMultiPart(true); - FeedbackPanel feedback = new FeedbackPanel("feedback"); - filter = new JtracFeedbackMessageFilter(); - feedback.setFilter(filter); - add(feedback); - version = item.getVersion(); - - if (item.getId() > 0) { - editMode = true; - } - - BoundCompoundPropertyModel model = null; - if (editMode) { - /* - * This ensures that the model object is re-loaded as part - * of the form submission workflow before form binding and - * avoids hibernate lazy loading issues during the whole - * update transaction. - */ - LoadableDetachableModel itemModel = new LoadableDetachableModel() { - protected Object load() { - logger.debug("attaching existing item " + item.getId()); - return getJtrac().loadItem(item.getId()); - } - }; - model = new BoundCompoundPropertyModel(itemModel); - } else { - model = new BoundCompoundPropertyModel(item); - } - setModel(model); - - /* - * =================================================== - * Summary - * =================================================== - */ - final TextField summaryField = new TextField("summary"); - summaryField.setRequired(true); - summaryField.add(new ErrorHighlighter()); - summaryField.setOutputMarkupId(true); - add(summaryField); - add(new HeaderContributor(new IHeaderContributor() { - public void renderHead(IHeaderResponse response) { - response.renderOnLoadJavascript("document.getElementById('" + - summaryField.getMarkupId() + "').focus()"); - } - })); - - /* - * =================================================== - * Delete button - * =================================================== - */ - Button delete = new Button("delete") { - @Override - public void onSubmit() { - String heading = localize("item_delete.confirm"); - String warning = localize("item_delete.line2"); - String line1 = localize("item_delete.line1"); - ConfirmPage confirm = new ConfirmPage(ItemFormPage.this, heading, warning, new String[] { line1 }) { - public void onConfirm() { - // avoid lazy init problem - getJtrac().removeItem(getJtrac().loadItem(item.getId())); - ItemSearch itemSearch = JtracSession.get().getItemSearch(); - if (itemSearch != null) { - setResponsePage(new ItemListPage(itemSearch)); - } else { - setResponsePage(DashboardPage.class); - } - } - }; - setResponsePage(confirm); - } - }; - - delete.setDefaultFormProcessing(false); - add(delete); - if (!editMode) { - delete.setVisible(false); - } - - /* - * =================================================== - * Detail - * =================================================== - */ - add(new TextArea("detail").setRequired(true).add(new ErrorHighlighter())); - - /* - * =================================================== - * Custom fields - * =================================================== - */ - if (editMode) { - add(new CustomFieldsFormPanel("fields", model, item.getSpace()).setRenderBodyOnly(true)); - } else { - add(new CustomFieldsFormPanel("fields", model, item, getPrincipal()).setRenderBodyOnly(true)); - } - - /* - * Hide some components if editing item - */ - WebMarkupContainer hideAssignedTo = new WebMarkupContainer("hideAssignedTo"); - WebMarkupContainer hideNotifyList = new WebMarkupContainer("hideNotifyList"); - WebMarkupContainer hideEditReason = new WebMarkupContainer("hideEditReason"); - add(hideAssignedTo); - add(hideNotifyList); - add(hideEditReason); - if (editMode) { - hideAssignedTo.setVisible(false); - hideNotifyList.setVisible(false); - hideEditReason.add(new TextArea("editReason").setRequired(true).add(new ErrorHighlighter())); - } else { - hideEditReason.setVisible(false); - - /* - * =================================================== - * Assigned to - * =================================================== - */ - Space space = item.getSpace(); - List<UserSpaceRole> userSpaceRoles = getJtrac().findUserRolesForSpace(space.getId()); - List<User> assignable = UserUtils.filterUsersAbleToTransitionFrom(userSpaceRoles, space, State.OPEN); - DropDownChoice choice = new DropDownChoice("assignedTo", assignable, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((User) o).getName(); - } - - public String getIdValue(Object o, int i) { - return ((User) o).getId() + ""; - } - }); - - choice.setNullValid(true); - choice.setRequired(true); - WebMarkupContainer border = new WebMarkupContainer("border"); - border.add(choice); - border.add(new ErrorHighlighter(choice)); - hideAssignedTo.add(border); - - /* - * =================================================== - * Notify list - * =================================================== - */ - List<ItemUser> choices = UserUtils.convertToItemUserList(userSpaceRoles); - ListMultipleChoice itemUsers = new JtracCheckBoxMultipleChoice("itemUsers", choices, - new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((ItemUser) o).getUser().getName(); - } - - public String getIdValue(Object o, int i) { - return ((ItemUser) o).getUser().getId() + ""; - } - }, true); - hideNotifyList.add(itemUsers); - - /* - * =================================================== - * Attachment - * =================================================== - */ - hideNotifyList.add(fileUploadField); - setMaxSize(Bytes.megabytes(getJtrac().getAttachmentMaxSizeInMb())); - } - - /* - * =================================================== - * Send notifications - * =================================================== - */ - add(new CheckBox("sendNotifications")); - - /* - * =================================================== - * Cancel - * =================================================== - */ - add(new Link("cancel") { - public void onClick() { - setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); - } - }.setVisible(editMode && JtracSession.get().getItemSearch() != null)); - } - - /* (non-Javadoc) - * @see org.apache.wicket.markup.html.form.Form#onValidate() - */ - @Override - protected void onValidate() { - filter.reset(); - Item item = (Item) getModelObject(); - if (editMode && item.getVersion() != version) { - /* - * User must have used back button after edit - */ - error(localize("item_form.error.version")); - } - } - - /* (non-Javadoc) - * @see org.apache.wicket.markup.html.form.Form#onSubmit() - */ - @Override - protected void onSubmit() { - final FileUpload fileUpload = fileUploadField.getFileUpload(); - Item item = (Item) getModelObject(); - User user = getPrincipal(); - if (editMode) { - getJtrac().updateItem(item, user); - } else { - item.setLoggedBy(user); - item.setStatus(State.OPEN); - getJtrac().storeItem(item, fileUpload); - } - - /* - * On creating an item, clear any search filter (especially - * the related item) from session. - */ - JtracSession.get().setItemSearch(null); - setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); - } - - } // end inner class ItemForm -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.domain.Item; +import info.jtrac.domain.ItemSearch; +import info.jtrac.domain.ItemUser; +import info.jtrac.domain.Space; +import info.jtrac.domain.State; +import info.jtrac.domain.User; +import info.jtrac.domain.UserSpaceRole; +import info.jtrac.util.UserUtils; +import java.util.List; +import org.apache.wicket.PageParameters; +import org.apache.wicket.behavior.HeaderContributor; +import org.apache.wicket.markup.html.IHeaderContributor; +import org.apache.wicket.markup.html.IHeaderResponse; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.ListMultipleChoice; +import org.apache.wicket.markup.html.form.TextArea; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.form.upload.FileUpload; +import org.apache.wicket.markup.html.form.upload.FileUploadField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.panel.FeedbackPanel; +import org.apache.wicket.model.BoundCompoundPropertyModel; +import org.apache.wicket.model.LoadableDetachableModel; +import org.apache.wicket.util.lang.Bytes; + +/** + * Create / Edit item form page + */ +public class ItemFormPage extends BasePage { + /** + * Default constructor + */ + public ItemFormPage() { + Item item = new Item(); + item.setSpace(getCurrentSpace()); + item.setStatus(State.NEW); + add(new ItemForm("form", item)); + } + + /** + * Constructor with provided item id. + * + * @param itemId The + */ + public ItemFormPage(long itemId) { + Item item = getJtrac().loadItem(itemId); + add(new ItemForm("form", item)); + } + + /** + * Wicket form + */ + private class ItemForm extends Form { + private JtracFeedbackMessageFilter filter; + private FileUploadField fileUploadField = new FileUploadField("file"); + private boolean editMode; + private int version; + + /** + * Constructor + * + * @param id + * @param item + */ + public ItemForm(String id, final Item item) { + super(id); + setMultiPart(true); + FeedbackPanel feedback = new FeedbackPanel("feedback"); + filter = new JtracFeedbackMessageFilter(); + feedback.setFilter(filter); + add(feedback); + version = item.getVersion(); + + if (item.getId() > 0) { + editMode = true; + } + + BoundCompoundPropertyModel model = null; + if (editMode) { + /* + * This ensures that the model object is re-loaded as part + * of the form submission workflow before form binding and + * avoids hibernate lazy loading issues during the whole + * update transaction. + */ + LoadableDetachableModel itemModel = new LoadableDetachableModel() { + protected Object load() { + logger.debug("attaching existing item " + item.getId()); + return getJtrac().loadItem(item.getId()); + } + }; + model = new BoundCompoundPropertyModel(itemModel); + } else { + model = new BoundCompoundPropertyModel(item); + } + setModel(model); + + /* + * =================================================== + * Summary + * =================================================== + */ + final TextField summaryField = new TextField("summary"); + summaryField.setRequired(true); + summaryField.add(new ErrorHighlighter()); + summaryField.setOutputMarkupId(true); + add(summaryField); + add(new HeaderContributor(new IHeaderContributor() { + public void renderHead(IHeaderResponse response) { + response.renderOnLoadJavascript("document.getElementById('" + + summaryField.getMarkupId() + "').focus()"); + } + })); + + /* + * =================================================== + * Delete button + * =================================================== + */ + Button delete = new Button("delete") { + @Override + public void onSubmit() { + String heading = localize("item_delete.confirm"); + String warning = localize("item_delete.line2"); + String line1 = localize("item_delete.line1"); + ConfirmPage confirm = new ConfirmPage(ItemFormPage.this, heading, warning, new String[] { line1 }) { + public void onConfirm() { + // avoid lazy init problem + getJtrac().removeItem(getJtrac().loadItem(item.getId())); + ItemSearch itemSearch = JtracSession.get().getItemSearch(); + if (itemSearch != null) { + setResponsePage(new ItemListPage(itemSearch)); + } else { + setResponsePage(DashboardPage.class); + } + } + }; + setResponsePage(confirm); + } + }; + + delete.setDefaultFormProcessing(false); + add(delete); + if (!editMode) { + delete.setVisible(false); + } + + /* + * =================================================== + * Detail + * =================================================== + */ + add(new TextArea("detail").setRequired(true).add(new ErrorHighlighter())); + + /* + * =================================================== + * Custom fields + * =================================================== + */ + if (editMode) { + add(new CustomFieldsFormPanel("fields", model, item.getSpace()).setRenderBodyOnly(true)); + } else { + add(new CustomFieldsFormPanel("fields", model, item, getPrincipal()).setRenderBodyOnly(true)); + } + + /* + * Hide some components if editing item + */ + WebMarkupContainer hideAssignedTo = new WebMarkupContainer("hideAssignedTo"); + WebMarkupContainer hideNotifyList = new WebMarkupContainer("hideNotifyList"); + WebMarkupContainer hideEditReason = new WebMarkupContainer("hideEditReason"); + add(hideAssignedTo); + add(hideNotifyList); + add(hideEditReason); + if (editMode) { + hideAssignedTo.setVisible(false); + hideNotifyList.setVisible(false); + hideEditReason.add(new TextArea("editReason").setRequired(true).add(new ErrorHighlighter())); + } else { + hideEditReason.setVisible(false); + + /* + * =================================================== + * Assigned to + * =================================================== + */ + Space space = item.getSpace(); + List<UserSpaceRole> userSpaceRoles = getJtrac().findUserRolesForSpace(space.getId()); + List<User> assignable = UserUtils.filterUsersAbleToTransitionFrom(userSpaceRoles, space, State.OPEN); + DropDownChoice choice = new DropDownChoice("assignedTo", assignable, new IChoiceRenderer() { + public Object getDisplayValue(Object o) { + return ((User) o).getName(); + } + + public String getIdValue(Object o, int i) { + return ((User) o).getId() + ""; + } + }); + + choice.setNullValid(true); + choice.setRequired(true); + WebMarkupContainer border = new WebMarkupContainer("border"); + border.add(choice); + border.add(new ErrorHighlighter(choice)); + hideAssignedTo.add(border); + + /* + * =================================================== + * Notify list + * =================================================== + */ + List<ItemUser> choices = UserUtils.convertToItemUserList(userSpaceRoles); + ListMultipleChoice itemUsers = new JtracCheckBoxMultipleChoice("itemUsers", choices, + new IChoiceRenderer() { + public Object getDisplayValue(Object o) { + return ((ItemUser) o).getUser().getName(); + } + + public String getIdValue(Object o, int i) { + return ((ItemUser) o).getUser().getId() + ""; + } + }, true); + hideNotifyList.add(itemUsers); + + /* + * =================================================== + * Attachment + * =================================================== + */ + hideNotifyList.add(fileUploadField); + setMaxSize(Bytes.megabytes(getJtrac().getAttachmentMaxSizeInMb())); + } + + /* + * =================================================== + * Send notifications + * =================================================== + */ + add(new CheckBox("sendNotifications")); + + /* + * =================================================== + * Cancel + * =================================================== + */ + add(new Link("cancel") { + public void onClick() { + setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); + } + }.setVisible(editMode && JtracSession.get().getItemSearch() != null)); + } + + /* (non-Javadoc) + * @see org.apache.wicket.markup.html.form.Form#validate() + */ + @Override + protected void validate() { + filter.reset(); + Item item = (Item) getModelObject(); + if (editMode && item.getVersion() != version) { + /* + * User must have used back button after edit + */ + error(localize("item_form.error.version")); + } + super.validate(); + } + + /* (non-Javadoc) + * @see org.apache.wicket.markup.html.form.Form#onSubmit() + */ + @Override + protected void onSubmit() { + final FileUpload fileUpload = fileUploadField.getFileUpload(); + Item item = (Item) getModelObject(); + User user = getPrincipal(); + if (editMode) { + getJtrac().updateItem(item, user); + } else { + item.setLoggedBy(user); + item.setStatus(State.OPEN); + getJtrac().storeItem(item, fileUpload); + } + + /* + * On creating an item, clear any search filter (especially + * the related item) from session. + */ + JtracSession.get().setItemSearch(null); + setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); + } + + } // end inner class ItemForm +} \ No newline at end of file Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java 2021-10-06 08:41:39 UTC (rev 1398) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java 2021-10-06 12:47:21 UTC (rev 1399) @@ -226,7 +226,10 @@ final ColumnHeading ch = (ColumnHeading) listItem.getModelObject(); Link headingLink = new Link("heading") { public void onClick() { - doSort(ch.getNameText()); + // hack: it looks like a link, but clicking it does nothing + if (! ch.getNameText().equals("lastChanged")) { + doSort(ch.getNameText()); + } } }; listItem.add(headingLink); @@ -251,7 +254,7 @@ protected void populateItem(ListItem listItem) { // cast to AbstactItem - show history may be == true final AbstractItem item = (AbstractItem) listItem.getModelObject(); - + if (selectedItemId == item.getId()) { listItem.add(new SimpleAttributeModifier("class", "selected")); } else if(listItem.getIndex() % 2 == 1) { @@ -259,7 +262,7 @@ } final boolean showHistory = itemSearch.isShowHistory(); - + ListView fieldValues = new ListView("columns", columnHeadings) { protected void populateItem(ListItem listItem) { ColumnHeading ch = (ColumnHeading) listItem.getModelObject(); @@ -319,12 +322,17 @@ value = new PropertyModel(item, "assignedTo.name"); break; case TIME_STAMP: - if (item instanceof History) { + value = new Model(DateUtils.formatTimeStamp(item.getTimeStamp())); + break; + case LAST_CHANGED: + if (item instanceof Item) { + History history = ((Item) item).getLatestHistory(); + if (history == null) + value = new Model(DateUtils.formatTimeStamp(item.getTimeStamp())); + else + value = new Model(DateUtils.formatTimeStamp(((Item) item).getLatestHistory().getTimeStamp())); + } else { value = new Model(DateUtils.formatTimeStamp(item.getTimeStamp())); - } else { - if (item instanceof Item) { - value = new Model(DateUtils.formatTimeStamp( ((Item)item).getLatestHistory().getTimeStamp())); - } } break; case SPACE: Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewFormPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewFormPanel.java 2021-10-06 08:41:39 UTC (rev 1398) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewFormPanel.java 2021-10-06 12:47:21 UTC (rev 1399) @@ -1,198 +1,200 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.History; -import info.jtrac.domain.Item; -import info.jtrac.domain.ItemSearch; -import info.jtrac.domain.ItemUser; -import info.jtrac.domain.Space; -import info.jtrac.domain.State; -import info.jtrac.domain.User; -import info.jtrac.domain.UserSpaceRole; -import info.jtrac.util.UserUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.apache.wicket.PageParameters; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.form.CheckBox; -import org.apache.wicket.markup.html.form.DropDownChoice; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.FormComponent; -import org.apache.wicket.markup.html.form.IChoiceRenderer; -import org.apache.wicket.markup.html.form.ListMultipleChoice; -import org.apache.wicket.markup.html.form.TextArea; -import org.apache.wicket.markup.html.form.upload.FileUpload; -import org.apache.wicket.markup.html.form.upload.FileUploadField; -import org.apache.wicket.markup.html.form.validation.AbstractFormValidator; -import org.apache.wicket.markup.html.panel.FeedbackPanel; -import org.apache.wicket.model.BoundCompoundPropertyModel; -import org.apache.wicket.util.lang.Bytes; - -/** - * Form to update history for item - */ -public class ItemViewFormPanel extends BasePanel { - - private JtracFeedbackMessageFilter filter; - private ItemSearch itemSearch; - - public ItemViewFormPanel(String id, Item item, ItemSearch itemSearch) { - super(id); - this.itemSearch = itemSearch; - FeedbackPanel feedback = new FeedbackPanel("feedback"); - filter = new JtracFeedbackMessageFilter(); - feedback.setFilter(filter); - add(feedback); - add(new ItemViewForm("form", item)); - } - - /** - * wicket form - */ - private class ItemViewForm extends Form { - - private FileUploadField fileUploadField; - private long itemId; - private DropDownChoice assignedToChoice; - private DropDownChoice statusChoice; - - public ItemViewForm(String id, final Item item) { - super(id); - setMultiPart(true); - this.itemId = item.getId(); - final History history = new History(); - history.setItemUsers(item.getItemUsers()); - final BoundCompoundPropertyModel model = new BoundCompoundPropertyModel(history); - setModel(model); - add(new TextArea("comment").setRequired(true).add(new ErrorHighlighter())); - // custom fields =================================================== - User user = getPrincipal(); - add(new CustomFieldsFormPanel("fields", model, item, user)); - // ================================================================= - final Space space = item.getSpace(); - final List<UserSpaceRole> userSpaceRoles = getJtrac().findUserRolesForSpace(space.getId()); - // assigned to ===================================================== - final WebMarkupContainer border = new WebMarkupContainer("border"); - border.setOutputMarkupId(true); - final WebMarkupContainer hide = new WebMarkupContainer("hide"); - border.add(hide); - final List<User> emptyList = new ArrayList<User>(0); // will be populated over Ajax - assignedToChoice = new DropDownChoice("assignedTo", emptyList, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((User) o).getName(); - } - public String getIdValue(Object o, int i) { - return ((User) o).getId() + ""; - } - }); - assignedToChoice.setOutputMarkupId(true); - assignedToChoice.setVisible(false); - assignedToChoice.setNullValid(true); - border.add(new ErrorHighlighter(assignedToChoice)); - border.add(assignedToChoice); - add(border); - // status ========================================================== - final Map<Integer, String> statesMap = item.getPermittedTransitions(user); - List<Integer> states = new ArrayList(statesMap.keySet()); - statusChoice = new IndicatingDropDownChoice("status", states, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return statesMap.get(o... [truncated message content] |
From: <udi...@us...> - 2021-10-07 15:01:32
|
Revision: 1400 http://sourceforge.net/p/j-trac/code/1400 Author: udittmer Date: 2021-10-07 15:01:29 +0000 (Thu, 07 Oct 2021) Log Message: ----------- fix issue with YUI calendar, fix issue with searching by timestamp when using pretty dates Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java trunk/jtrac/src/main/java/info/jtrac/domain/ItemSearch.java trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemSearchFormPanel.java Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-10-06 12:47:21 UTC (rev 1399) +++ trunk/jtrac/pom.xml 2021-10-07 15:01:29 UTC (rev 1400) @@ -347,8 +347,9 @@ <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-extensions</artifactId> - <version>1.3.7</version> + <version>1.3.4</version> <!-- + 1.3.7 has bug with the YUI Calendar <version>1.4.23</version> <version>1.5.16</version> --> Modified: trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java 2021-10-06 12:47:21 UTC (rev 1399) +++ trunk/jtrac/src/main/java/info/jtrac/domain/ColumnHeading.java 2021-10-07 15:01:29 UTC (rev 1400) @@ -144,7 +144,7 @@ || name == STATUS; } } - + public static List<ColumnHeading> getColumnHeadings(Space s) { List<ColumnHeading> list = new ArrayList<ColumnHeading>(); list.add(new ColumnHeading(ID)); @@ -158,9 +158,9 @@ } list.add(new ColumnHeading(TIME_STAMP)); list.add(new ColumnHeading(LAST_CHANGED)); - return list; + return list; } - + public static List<ColumnHeading> getColumnHeadings() { List<ColumnHeading> list = new ArrayList<ColumnHeading>(); list.add(new ColumnHeading(ID)); @@ -171,8 +171,8 @@ list.add(new ColumnHeading(ASSIGNED_TO)); list.add(new ColumnHeading(TIME_STAMP)); list.add(new ColumnHeading(LAST_CHANGED)); - return list; - } + return list; + } public List<Expression> getValidFilterExpressions() { return processor.getValidFilterExpressions(); Modified: trunk/jtrac/src/main/java/info/jtrac/domain/ItemSearch.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/ItemSearch.java 2021-10-06 12:47:21 UTC (rev 1399) +++ trunk/jtrac/src/main/java/info/jtrac/domain/ItemSearch.java 2021-10-07 15:01:29 UTC (rev 1400) @@ -321,7 +321,7 @@ ch.getFilterCriteria().setExpression(FilterCriteria.Expression.IN); ch.getFilterCriteria().setValues(getSingletonList(i)); } - + public List<ColumnHeading> getColumnHeadingsToRender() { List<ColumnHeading> list = new ArrayList<ColumnHeading>(columnHeadings.size()); for(ColumnHeading ch : columnHeadings) { @@ -331,7 +331,17 @@ } return list; } - + + public List<ColumnHeading> getColumnHeadingsToSearch() { + List<ColumnHeading> list = new ArrayList<ColumnHeading>(columnHeadings.size()); + for (ColumnHeading ch : columnHeadings) { + if (! ch.getNameText().equals("lastChanged")) { + list.add(ch); + } + } + return list; + } + //========================================================================== public boolean isBatchMode() { Modified: trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java 2021-10-06 12:47:21 UTC (rev 1399) +++ trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java 2021-10-07 15:01:29 UTC (rev 1400) @@ -59,9 +59,10 @@ public static String format (Date date) { return date == null ? "" - : (showPretty() - ? getPrettyTime().format(date) - : dateFormat.format(date)); + : dateFormat.format(date); +// : (showPretty() +// ? getPrettyTime().format(date) +// : dateFormat.format(date)); } public static String formatTimeStamp (Date date) { Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemSearchFormPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemSearchFormPanel.java 2021-10-06 12:47:21 UTC (rev 1399) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemSearchFormPanel.java 2021-10-07 15:01:29 UTC (rev 1400) @@ -1,200 +1,200 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.Jtrac; -import info.jtrac.domain.ColumnHeading; -import info.jtrac.domain.FilterCriteria.Expression; -import info.jtrac.domain.Item; -import info.jtrac.domain.ItemRefId; -import info.jtrac.domain.ItemSearch; -import info.jtrac.domain.Space; -import info.jtrac.domain.User; -import info.jtrac.exception.InvalidRefIdException; -import java.util.Arrays; -import java.util.List; -import org.apache.wicket.Component; -import org.apache.wicket.PageParameters; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.Button; -import org.apache.wicket.markup.html.form.CheckBox; -import org.apache.wicket.markup.html.form.DropDownChoice; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.IChoiceRenderer; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.markup.html.list.ListItem; -import org.apache.wicket.markup.html.list.ListView; -import org.apache.wicket.markup.html.panel.FeedbackPanel; -import org.apache.wicket.model.CompoundPropertyModel; -import org.apache.wicket.model.PropertyModel; - -/** - * item search form panel - */ -public class ItemSearchFormPanel extends BasePanel { - - private ItemSearch itemSearch; - private boolean expandAll; - - public ItemSearchFormPanel(String id, User user) { - super(id); - this.itemSearch = new ItemSearch(user); - addComponents(); - } - - public ItemSearchFormPanel(String id) { - super(id); - Space s = getCurrentSpace(); - if(s != null) { - this.itemSearch = new ItemSearch(s); - } else { - this.itemSearch = new ItemSearch(getPrincipal()); - } - addComponents(); - } - - public ItemSearchFormPanel(String id, ItemSearch itemSearch) { - super(id); - this.itemSearch = itemSearch; - addComponents(); - } - - private void addComponents() { - final Form form = new Form("form"); - add(form); - form.add(new FeedbackPanel("feedback")); - form.setModel(new CompoundPropertyModel(itemSearch)); - List<Integer> sizes = Arrays.asList(new Integer[] {5, 10, 15, 25, 50, 100, -1}); - DropDownChoice pageSizeChoice = new DropDownChoice("pageSize", sizes, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - return ((Integer) o) == -1 ? localize("item_search_form.noLimit") : o.toString(); - } - public String getIdValue(Object o, int i) { - return o.toString(); - } - }); - form.add(pageSizeChoice); - form.add(new CheckBox("showHistory")); - form.add(new Button("search") { - @Override - public void onSubmit() { - String refId = itemSearch.getRefId(); - if(refId != null) { - if(getCurrentSpace() != null) { - // user can save typing by entering the refId number without the space prefixCode - try { - long id = Long.parseLong(refId); - refId = getCurrentSpace().getPrefixCode() + "-" + id; - } catch(Exception e) { - // oops that didn't work, continue - } - } - try { - new ItemRefId(refId); - } catch(InvalidRefIdException e) { - form.error(localize("item_search_form.error.refId.invalid")); - return; - } - Item item = getJtrac().loadItemByRefId(refId); - if(item == null) { - form.error(localize("item_search_form.error.refId.notFound")); - return; - } - JtracSession.get().setItemSearch(itemSearch); - setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); - return; - } - String searchText = itemSearch.getSearchText(); - if(searchText != null) { - if(!getJtrac().validateTextSearchQuery(searchText)) { - form.error(localize("item_search_form.error.summary.invalid")); - return; - } - } - setResponsePage(ItemListPage.class, itemSearch.getAsQueryString()); - } - }); - form.add(new Link("expandAll") { - public void onClick() { - expandAll = true; - } - @Override - public boolean isVisible() { - return !expandAll; - } - }); - form.add(new ListView("columns", itemSearch.getColumnHeadings()) { - protected void populateItem(final ListItem listItem) { - final ColumnHeading ch = (ColumnHeading) listItem.getModelObject(); - String label = ch.isField() ? ch.getLabel() : localize("item_list." + ch.getName()); - listItem.add(new Label("columnName", label)); - listItem.add(new CheckBox("visible", new PropertyModel(ch, "visible"))); - List<Expression> validExpressions = ch.getValidFilterExpressions(); - DropDownChoice expressionChoice = new IndicatingDropDownChoice("expression", validExpressions, new IChoiceRenderer() { - public Object getDisplayValue(Object o) { - String key = ((Expression) o).getKey(); - return localize("item_filter." + key); - } - public String getIdValue(Object o, int i) { - return ((Expression) o).getKey(); - } - }); - // always pre-select "equal to" for filter criteria on ID - if(ch.getName() == ColumnHeading.Name.ID) { - ch.getFilterCriteria().setExpression(Expression.EQ); - } - if(expandAll && ch.getFilterCriteria().getExpression() == null) { - ch.getFilterCriteria().setExpression(validExpressions.get(0)); - } - expressionChoice.setModel(new PropertyModel(ch.getFilterCriteria(), "expression")); - expressionChoice.setNullValid(true); - listItem.add(expressionChoice); - Component fragParent = null; - fragParent = getFilterUiFragment(ch); - fragParent.setOutputMarkupId(true); - listItem.add(fragParent); - expressionChoice.add(new AjaxFormComponentUpdatingBehavior("onChange") { - protected void onUpdate(AjaxRequestTarget target) { - if(!ch.getFilterCriteria().requiresUiFragmentUpdate()) { - return; - } - Component fragment = getFilterUiFragment(ch); - fragment.setOutputMarkupId(true); - listItem.replace(fragment); - target.addComponent(fragment); - target.appendJavascript("document.getElementById('" + fragment.getMarkupId() + "').focus()"); - } - }); - } - }); - } - - private Component getFilterUiFragment(ColumnHeading ch) { - if(ch.getFilterCriteria().getExpression() == null) { - return new WebMarkupContainer("fragParent"); - } - User user = JtracSession.get().getUser(); - // the space could be null also - Space space = JtracSession.get().getCurrentSpace(); - Jtrac jtrac = JtracApplication.get().getJtrac(); - return ch.getFilterUiFragment(this, user, space, jtrac); - } - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.Jtrac; +import info.jtrac.domain.ColumnHeading; +import info.jtrac.domain.FilterCriteria.Expression; +import info.jtrac.domain.Item; +import info.jtrac.domain.ItemRefId; +import info.jtrac.domain.ItemSearch; +import info.jtrac.domain.Space; +import info.jtrac.domain.User; +import info.jtrac.exception.InvalidRefIdException; +import java.util.Arrays; +import java.util.List; +import org.apache.wicket.Component; +import org.apache.wicket.PageParameters; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.markup.html.panel.FeedbackPanel; +import org.apache.wicket.model.CompoundPropertyModel; +import org.apache.wicket.model.PropertyModel; + +/** + * item search form panel + */ +public class ItemSearchFormPanel extends BasePanel { + + private ItemSearch itemSearch; + private boolean expandAll; + + public ItemSearchFormPanel(String id, User user) { + super(id); + this.itemSearch = new ItemSearch(user); + addComponents(); + } + + public ItemSearchFormPanel(String id) { + super(id); + Space s = getCurrentSpace(); + if(s != null) { + this.itemSearch = new ItemSearch(s); + } else { + this.itemSearch = new ItemSearch(getPrincipal()); + } + addComponents(); + } + + public ItemSearchFormPanel(String id, ItemSearch itemSearch) { + super(id); + this.itemSearch = itemSearch; + addComponents(); + } + + private void addComponents() { + final Form form = new Form("form"); + add(form); + form.add(new FeedbackPanel("feedback")); + form.setModel(new CompoundPropertyModel(itemSearch)); + List<Integer> sizes = Arrays.asList(new Integer[] {5, 10, 15, 25, 50, 100, -1}); + DropDownChoice pageSizeChoice = new DropDownChoice("pageSize", sizes, new IChoiceRenderer() { + public Object getDisplayValue(Object o) { + return ((Integer) o) == -1 ? localize("item_search_form.noLimit") : o.toString(); + } + public String getIdValue(Object o, int i) { + return o.toString(); + } + }); + form.add(pageSizeChoice); + form.add(new CheckBox("showHistory")); + form.add(new Button("search") { + @Override + public void onSubmit() { + String refId = itemSearch.getRefId(); + if(refId != null) { + if(getCurrentSpace() != null) { + // user can save typing by entering the refId number without the space prefixCode + try { + long id = Long.parseLong(refId); + refId = getCurrentSpace().getPrefixCode() + "-" + id; + } catch(Exception e) { + // oops that didn't work, continue + } + } + try { + new ItemRefId(refId); + } catch(InvalidRefIdException e) { + form.error(localize("item_search_form.error.refId.invalid")); + return; + } + Item item = getJtrac().loadItemByRefId(refId); + if(item == null) { + form.error(localize("item_search_form.error.refId.notFound")); + return; + } + JtracSession.get().setItemSearch(itemSearch); + setResponsePage(ItemViewPage.class, new PageParameters("0=" + item.getRefId())); + return; + } + String searchText = itemSearch.getSearchText(); + if(searchText != null) { + if(!getJtrac().validateTextSearchQuery(searchText)) { + form.error(localize("item_search_form.error.summary.invalid")); + return; + } + } + setResponsePage(ItemListPage.class, itemSearch.getAsQueryString()); + } + }); + form.add(new Link("expandAll") { + public void onClick() { + expandAll = true; + } + @Override + public boolean isVisible() { + return !expandAll; + } + }); + form.add(new ListView("columns", itemSearch.getColumnHeadingsToSearch()) { + protected void populateItem(final ListItem listItem) { + final ColumnHeading ch = (ColumnHeading) listItem.getModelObject(); + String label = ch.isField() ? ch.getLabel() : localize("item_list." + ch.getName()); + listItem.add(new Label("columnName", label)); + listItem.add(new CheckBox("visible", new PropertyModel(ch, "visible"))); + List<Expression> validExpressions = ch.getValidFilterExpressions(); + DropDownChoice expressionChoice = new IndicatingDropDownChoice("expression", validExpressions, new IChoiceRenderer() { + public Object getDisplayValue(Object o) { + String key = ((Expression) o).getKey(); + return localize("item_filter." + key); + } + public String getIdValue(Object o, int i) { + return ((Expression) o).getKey(); + } + }); + // always pre-select "equal to" for filter criteria on ID + if(ch.getName() == ColumnHeading.Name.ID) { + ch.getFilterCriteria().setExpression(Expression.EQ); + } + if(expandAll && ch.getFilterCriteria().getExpression() == null) { + ch.getFilterCriteria().setExpression(validExpressions.get(0)); + } + expressionChoice.setModel(new PropertyModel(ch.getFilterCriteria(), "expression")); + expressionChoice.setNullValid(true); + listItem.add(expressionChoice); + Component fragParent = null; + fragParent = getFilterUiFragment(ch); + fragParent.setOutputMarkupId(true); + listItem.add(fragParent); + expressionChoice.add(new AjaxFormComponentUpdatingBehavior("onChange") { + protected void onUpdate(AjaxRequestTarget target) { + if(!ch.getFilterCriteria().requiresUiFragmentUpdate()) { + return; + } + Component fragment = getFilterUiFragment(ch); + fragment.setOutputMarkupId(true); + listItem.replace(fragment); + target.addComponent(fragment); + target.appendJavascript("document.getElementById('" + fragment.getMarkupId() + "').focus()"); + } + }); + } + }); + } + + private Component getFilterUiFragment(ColumnHeading ch) { + if(ch.getFilterCriteria().getExpression() == null) { + return new WebMarkupContainer("fragParent"); + } + User user = JtracSession.get().getUser(); + // the space could be null also + Space space = JtracSession.get().getCurrentSpace(); + Jtrac jtrac = JtracApplication.get().getJtrac(); + return ch.getFilterUiFragment(this, user, space, jtrac); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-10-26 15:22:38
|
Revision: 1402 http://sourceforge.net/p/j-trac/code/1402 Author: udittmer Date: 2021-10-26 15:22:35 +0000 (Tue, 26 Oct 2021) Log Message: ----------- instead of just auto-linking URLs, enable Markdown syntax Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/config/JtracConfigurer.java trunk/jtrac/src/main/java/info/jtrac/domain/Config.java trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java trunk/jtrac/src/main/java/info/jtrac/web/RestMultiActionController.java trunk/jtrac/src/main/java/info/jtrac/wicket/BasePanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigListPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewPanel.java trunk/jtrac/src/main/resources/messages.properties trunk/jtrac/src/main/resources/messages_de.properties trunk/jtrac/src/main/resources/messages_en.properties Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/pom.xml 2021-10-26 15:22:35 UTC (rev 1402) @@ -430,6 +430,26 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.commonmark</groupId> + <artifactId>commonmark</artifactId> + <version>0.18.0</version> + </dependency> + <dependency> + <groupId>org.commonmark</groupId> + <artifactId>commonmark-ext-gfm-strikethrough</artifactId> + <version>0.18.0</version> + </dependency> + <dependency> + <groupId>org.commonmark</groupId> + <artifactId>commonmark-ext-ins</artifactId> + <version>0.18.0</version> + </dependency> + <dependency> + <groupId>org.commonmark</groupId> + <artifactId>commonmark-ext-autolink</artifactId> + <version>0.18.0</version> + </dependency> <!-- <dependency> <groupId>org.openqa.selenium.client-drivers</groupId> Modified: trunk/jtrac/src/main/java/info/jtrac/config/JtracConfigurer.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/config/JtracConfigurer.java 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/java/info/jtrac/config/JtracConfigurer.java 2021-10-26 15:22:35 UTC (rev 1402) @@ -1,243 +1,243 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.config; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FilenameFilter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.Writer; -import java.util.Properties; -import javax.servlet.ServletContext; -import org.springframework.beans.factory.BeanCreationException; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.FileSystemResource; -import org.springframework.web.context.ServletContextAware; - -/** - * <p> - * Custom extension of the Spring PropertyPlaceholderConfigurer that - * sets up the jtrac.home System property (creates if required) and also creates - * a default jtrac.properties file for HSQLDB - useful for those who want - * to quickly evaluate JTrac. Just dropping the war into a servlet container - * would work without the need to even configure a datasource. - * </p> - * <p> - * This class would effectively do nothing if a <code>jtrac.properties</code> file exists in jtrac.home - * </p> - * <ol> - * <li>A "jtrac.home" property is looked for in <code>/WEB-INF/classes/jtrac-init.properties</code></li> - * <li>if not found, then a <code>jtrac.home</code> system property is checked for</li> - * <li>then a servlet context init-parameter called <code>jtrac.home</code> is looked for</li> - * <li>last resort, a <code>.jtrac</code> folder is created in the <code>user.home</code> and used as <code>jtrac.home</code></li> - * </ol> - * - * <p> - * Other tasks - * </p> - * <ul> - * <li>initialize the "test" query for checking idle database connections</li> - * <li>initialize list of available locales based on the properties files available</li> - * </ul> - * - * <p> - * Also playing an important role during startup are the following factory beans: - * </p> - * <ul> - * <li>DataSourceFactoryBean:</li> - * <ul> - * <li>switches between embedded HSQLDB or Apache DBCP (connection pool)</li> - * <li>performs graceful shutdown of database if embedded HSQLDB</li> - * </ul> - * <li>ProviderManagerFactoryBean</li> - * <ul> - * <li>conditionally includes LDAP authentication if requested</li> - * </ul> - * </ul> - * - * <p> - * Note that later on during startup, the HibernateJtracDao would check if - * database tables exist, and if they don't, would proceed to create them. - * </p> - */ - -public class JtracConfigurer extends PropertyPlaceholderConfigurer implements ServletContextAware { - - private ServletContext servletContext; - - public void setServletContext(ServletContext servletContext) { - this.servletContext = servletContext; - } - - @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { - // do our custom configuration before spring gets a chance to - try { - configureJtrac(); - } catch(Exception e) { - throw new BeanCreationException("JtracConfigurer failed", e); - } - super.postProcessBeanFactory(beanFactory); - } - - private void configureJtrac() throws Exception { - String jtracHome = null; - ClassPathResource jtracInitResource = new ClassPathResource("jtrac-init.properties"); - // jtrac-init.properties assumed to exist - Properties props = loadProps(jtracInitResource.getFile()); - logger.info("found 'jtrac-init.properties' on classpath, processing..."); - jtracHome = props.getProperty("jtrac.home"); - if (jtracHome != null) { - logger.info("'jtrac.home' property initialized from 'jtrac-init.properties' as '" + jtracHome + "'"); - } - //====================================================================== - FilenameFilter ff = new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.startsWith("messages_") && name.endsWith(".properties"); - } - }; - File[] messagePropsFiles = jtracInitResource.getFile().getParentFile().listFiles(ff); - String locales = "en"; - for(File f : messagePropsFiles) { - int endIndex = f.getName().indexOf('.'); - String localeCode = f.getName().substring(9, endIndex); - locales += "," + localeCode; - } - logger.info("locales available configured are '" + locales + "'"); - props.setProperty("jtrac.locales", locales); - //====================================================================== - if (jtracHome == null) { - logger.info("valid 'jtrac.home' property not available in 'jtrac-init.properties', trying system properties."); - jtracHome = System.getProperty("jtrac.home"); - if (jtracHome != null) { - logger.info("'jtrac.home' property initialized from system properties as '" + jtracHome + "'"); - } - } - if (jtracHome == null) { - logger.info("valid 'jtrac.home' property not available in system properties, trying servlet init paramters."); - jtracHome = servletContext.getInitParameter("jtrac.home"); - if (jtracHome != null) { - logger.info("Servlet init parameter 'jtrac.home' exists: '" + jtracHome + "'"); - } - } - if (jtracHome == null) { - jtracHome = System.getProperty("user.home") + "/.jtrac"; - logger.warn("Servlet init paramter 'jtrac.home' does not exist. Will use 'user.home' directory '" + jtracHome + "'"); - } - //====================================================================== - File homeFile = new File(jtracHome); - if (!homeFile.exists()) { - homeFile.mkdir(); - logger.info("directory does not exist, created '" + homeFile.getPath() + "'"); - if (!homeFile.exists()) { - String message = "invalid path '" + homeFile.getAbsolutePath() + "', try creating this directory first. Aborting."; - logger.error(message); - throw new Exception(message); - } - } else { - logger.info("directory already exists: '" + homeFile.getPath() + "'"); - } - props.setProperty("jtrac.home", homeFile.getAbsolutePath()); - //====================================================================== - File attachmentsFile = new File(jtracHome + "/attachments"); - if (!attachmentsFile.exists()) { - attachmentsFile.mkdir(); - logger.info("directory does not exist, created '" + attachmentsFile.getPath() + "'"); - } else { - logger.info("directory already exists: '" + attachmentsFile.getPath() + "'"); - } - File indexesFile = new File(jtracHome + "/indexes"); - if (!indexesFile.exists()) { - indexesFile.mkdir(); - logger.info("directory does not exist, created '" + indexesFile.getPath() + "'"); - } else { - logger.info("directory already exists: '" + indexesFile.getPath() + "'"); - } - //====================================================================== - File propsFile = new File(homeFile.getPath() + "/jtrac.properties"); - if (!propsFile.exists()) { - propsFile.createNewFile(); - logger.info("properties file does not exist, created '" + propsFile.getPath() + "'"); - OutputStream os = new FileOutputStream(propsFile); - Writer out = new PrintWriter(os); - try { - out.write("database.driver=org.hsqldb.jdbcDriver\n"); - out.write("database.url=jdbc:hsqldb:file:${jtrac.home}/db/jtrac\n"); - out.write("database.username=sa\n"); - out.write("database.password=\n"); - out.write("hibernate.dialect=org.hibernate.dialect.HSQLDialect\n"); - out.write("hibernate.show_sql=false\n"); - } finally { - out.close(); - os.close(); - } - logger.info("HSQLDB will be used. Finished creating '" + propsFile.getPath() + "'"); - } else { - logger.info("'jtrac.properties' file exists: '" + propsFile.getPath() + "'"); - } - //====================================================================== - String version = "0.0.0"; - String timestamp = "0000"; - ClassPathResource versionResource = new ClassPathResource("jtrac-version.properties"); - if(versionResource.exists()) { - logger.info("found 'jtrac-version.properties' on classpath, processing..."); - Properties versionProps = loadProps(versionResource.getFile()); - version = versionProps.getProperty("version"); - timestamp = versionProps.getProperty("timestamp"); - } else { - logger.info("did not find 'jtrac-version.properties' on classpath"); - } - logger.info("jtrac.version = '" + version + "'"); - logger.info("jtrac.timestamp = '" + timestamp + "'"); - props.setProperty("jtrac.version", version); - props.setProperty("jtrac.timestamp", timestamp); - - /* - * TODO: A better way (default value) to check the database should be used for Apache DBCP. - * The current "SELECT...FROM DUAL" only works on Oracle (and MySQL). - * Other databases also support "SELECT 1+1" as query - * (e.g. PostgreSQL, Hypersonic 2 (H2), MySQL, etc.). - */ - props.setProperty("database.validationQuery", "SELECT 1 FROM DUAL"); - props.setProperty("ldap.url", ""); - props.setProperty("ldap.activeDirectoryDomain", ""); - props.setProperty("ldap.searchBase", ""); - props.setProperty("database.datasource.jndiname", ""); - // set default properties that can be overridden by user if required - setProperties(props); - // finally set the property that spring is expecting, manually - FileSystemResource fsr = new FileSystemResource(propsFile); - setLocation(fsr); - } - - private Properties loadProps(File file) throws Exception { - InputStream is = null; - Properties props = new Properties(); - try { - is = new FileInputStream(file); - props.load(is); - } finally { - is.close(); - } - return props; - } -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.config; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.Writer; +import java.util.Properties; +import javax.servlet.ServletContext; +import org.springframework.beans.factory.BeanCreationException; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.FileSystemResource; +import org.springframework.web.context.ServletContextAware; + +/** + * <p> + * Custom extension of the Spring PropertyPlaceholderConfigurer that + * sets up the jtrac.home System property (creates if required) and also creates + * a default jtrac.properties file for HSQLDB - useful for those who want + * to quickly evaluate JTrac. Just dropping the war into a servlet container + * would work without the need to even configure a datasource. + * </p> + * <p> + * This class would effectively do nothing if a <code>jtrac.properties</code> file exists in jtrac.home + * </p> + * <ol> + * <li>A "jtrac.home" property is looked for in <code>/WEB-INF/classes/jtrac-init.properties</code></li> + * <li>if not found, then a <code>jtrac.home</code> system property is checked for</li> + * <li>then a servlet context init-parameter called <code>jtrac.home</code> is looked for</li> + * <li>last resort, a <code>.jtrac</code> folder is created in the <code>user.home</code> and used as <code>jtrac.home</code></li> + * </ol> + * + * <p> + * Other tasks + * </p> + * <ul> + * <li>initialize the "test" query for checking idle database connections</li> + * <li>initialize list of available locales based on the properties files available</li> + * </ul> + * + * <p> + * Also playing an important role during startup are the following factory beans: + * </p> + * <ul> + * <li>DataSourceFactoryBean:</li> + * <ul> + * <li>switches between embedded HSQLDB or Apache DBCP (connection pool)</li> + * <li>performs graceful shutdown of database if embedded HSQLDB</li> + * </ul> + * <li>ProviderManagerFactoryBean</li> + * <ul> + * <li>conditionally includes LDAP authentication if requested</li> + * </ul> + * </ul> + * + * <p> + * Note that later on during startup, the HibernateJtracDao would check if + * database tables exist, and if they don't, would proceed to create them. + * </p> + */ + +public class JtracConfigurer extends PropertyPlaceholderConfigurer implements ServletContextAware { + + private ServletContext servletContext; + + public void setServletContext(ServletContext servletContext) { + this.servletContext = servletContext; + } + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { + // do our custom configuration before spring gets a chance to + try { + configureJtrac(); + } catch(Exception e) { + throw new BeanCreationException("JtracConfigurer failed", e); + } + super.postProcessBeanFactory(beanFactory); + } + + private void configureJtrac() throws Exception { + String jtracHome = null; + ClassPathResource jtracInitResource = new ClassPathResource("jtrac-init.properties"); + // jtrac-init.properties assumed to exist + Properties props = loadProps(jtracInitResource.getFile()); + logger.info("found 'jtrac-init.properties' on classpath, processing..."); + jtracHome = props.getProperty("jtrac.home"); + if (jtracHome != null) { + logger.info("'jtrac.home' property initialized from 'jtrac-init.properties' as '" + jtracHome + "'"); + } + //====================================================================== + FilenameFilter ff = new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.startsWith("messages_") && name.endsWith(".properties"); + } + }; + File[] messagePropsFiles = jtracInitResource.getFile().getParentFile().listFiles(ff); + String locales = "en"; + for(File f : messagePropsFiles) { + int endIndex = f.getName().indexOf('.'); + String localeCode = f.getName().substring(9, endIndex); + locales += "," + localeCode; + } + logger.info("locales available configured are '" + locales + "'"); + props.setProperty("jtrac.locales", locales); + //====================================================================== + if (jtracHome == null) { + logger.info("valid 'jtrac.home' property not available in 'jtrac-init.properties', trying system properties."); + jtracHome = System.getProperty("jtrac.home"); + if (jtracHome != null) { + logger.info("'jtrac.home' property initialized from system properties as '" + jtracHome + "'"); + } + } + if (jtracHome == null) { + logger.info("valid 'jtrac.home' property not available in system properties, trying servlet init parameters."); + jtracHome = servletContext.getInitParameter("jtrac.home"); + if (jtracHome != null) { + logger.info("Servlet init parameter 'jtrac.home' exists: '" + jtracHome + "'"); + } + } + if (jtracHome == null) { + jtracHome = System.getProperty("user.home") + "/.jtrac"; + logger.warn("Servlet init parameter 'jtrac.home' does not exist. Will use 'user.home' directory '" + jtracHome + "'"); + } + //====================================================================== + File homeFile = new File(jtracHome); + if (!homeFile.exists()) { + homeFile.mkdir(); + logger.info("directory does not exist, created '" + homeFile.getPath() + "'"); + if (!homeFile.exists()) { + String message = "invalid path '" + homeFile.getAbsolutePath() + "', try creating this directory first. Aborting."; + logger.error(message); + throw new Exception(message); + } + } else { + logger.info("directory already exists: '" + homeFile.getPath() + "'"); + } + props.setProperty("jtrac.home", homeFile.getAbsolutePath()); + //====================================================================== + File attachmentsFile = new File(jtracHome + "/attachments"); + if (!attachmentsFile.exists()) { + attachmentsFile.mkdir(); + logger.info("directory does not exist, created '" + attachmentsFile.getPath() + "'"); + } else { + logger.info("directory already exists: '" + attachmentsFile.getPath() + "'"); + } + File indexesFile = new File(jtracHome + "/indexes"); + if (!indexesFile.exists()) { + indexesFile.mkdir(); + logger.info("directory does not exist, created '" + indexesFile.getPath() + "'"); + } else { + logger.info("directory already exists: '" + indexesFile.getPath() + "'"); + } + //====================================================================== + File propsFile = new File(homeFile.getPath() + "/jtrac.properties"); + if (!propsFile.exists()) { + propsFile.createNewFile(); + logger.info("properties file does not exist, created '" + propsFile.getPath() + "'"); + OutputStream os = new FileOutputStream(propsFile); + Writer out = new PrintWriter(os); + try { + out.write("database.driver=org.hsqldb.jdbcDriver\n"); + out.write("database.url=jdbc:hsqldb:file:${jtrac.home}/db/jtrac\n"); + out.write("database.username=sa\n"); + out.write("database.password=\n"); + out.write("hibernate.dialect=org.hibernate.dialect.HSQLDialect\n"); + out.write("hibernate.show_sql=false\n"); + } finally { + out.close(); + os.close(); + } + logger.info("HSQLDB will be used. Finished creating '" + propsFile.getPath() + "'"); + } else { + logger.info("'jtrac.properties' file exists: '" + propsFile.getPath() + "'"); + } + //====================================================================== + String version = "0.0.0"; + String timestamp = "0000"; + ClassPathResource versionResource = new ClassPathResource("jtrac-version.properties"); + if(versionResource.exists()) { + logger.info("found 'jtrac-version.properties' on classpath, processing..."); + Properties versionProps = loadProps(versionResource.getFile()); + version = versionProps.getProperty("version"); + timestamp = versionProps.getProperty("timestamp"); + } else { + logger.info("did not find 'jtrac-version.properties' on classpath"); + } + logger.info("jtrac.version = '" + version + "'"); + logger.info("jtrac.timestamp = '" + timestamp + "'"); + props.setProperty("jtrac.version", version); + props.setProperty("jtrac.timestamp", timestamp); + + /* + * TODO: A better way (default value) to check the database should be used for Apache DBCP. + * The current "SELECT...FROM DUAL" only works on Oracle (and MySQL). + * Other databases also support "SELECT 1+1" as query + * (e.g. PostgreSQL, Hypersonic 2 (H2), MySQL, etc.). + */ + props.setProperty("database.validationQuery", "SELECT 1 FROM DUAL"); + props.setProperty("ldap.url", ""); + props.setProperty("ldap.activeDirectoryDomain", ""); + props.setProperty("ldap.searchBase", ""); + props.setProperty("database.datasource.jndiname", ""); + // set default properties that can be overridden by user if required + setProperties(props); + // finally set the property that spring is expecting, manually + FileSystemResource fsr = new FileSystemResource(propsFile); + setLocation(fsr); + } + + private Properties loadProps(File file) throws Exception { + InputStream is = null; + Properties props = new Properties(); + try { + is = new FileInputStream(file); + props.load(is); + } finally { + is.close(); + } + return props; + } +} Modified: trunk/jtrac/src/main/java/info/jtrac/domain/Config.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-10-26 15:22:35 UTC (rev 1402) @@ -58,7 +58,7 @@ PARAMS.add("attachment.maxsize"); PARAMS.add("pwd.minLength"); PARAMS.add("time.pretty"); - PARAMS.add("urls.autolink"); + PARAMS.add("markdown.enabled"); PARAMS.add("attachments.openNewWindow"); PARAMS.add("items.search.num"); } Modified: trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2021-10-26 15:22:35 UTC (rev 1402) @@ -26,23 +26,33 @@ import info.jtrac.domain.Space; import info.jtrac.domain.User; import info.jtrac.exception.JtracSecurityException; + import java.io.BufferedReader; import java.io.StringReader; import java.io.Writer; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; +import java.util.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.apache.wicket.PageParameters; + import org.dom4j.Element; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.springframework.context.MessageSource; import org.springframework.web.servlet.support.RequestContextUtils; import org.springframework.web.util.HtmlUtils; +import org.commonmark.Extension; +import org.commonmark.node.*; +import org.commonmark.parser.Parser; +import org.commonmark.renderer.html.HtmlRenderer; +import org.commonmark.ext.autolink.AutolinkExtension; +import org.commonmark.ext.gfm.strikethrough.StrikethroughExtension; +import org.commonmark.ext.ins.InsExtension; + /** * Utilities to convert an Item into HTML etc. * The getAsHtml() routine is used to diplay an item - within a tag lib for JSP @@ -54,6 +64,19 @@ public static final String URL_PATTERN = "http(s?)://[:\\p{L}\\p{Digit}\\.\\-_\\/=#\\?%]+"; + private static Parser parser; + + private static HtmlRenderer renderer; + + static { + Set<Extension> extensions = new HashSet<>(); + extensions.add(AutolinkExtension.create()); + extensions.add(StrikethroughExtension.create()); + extensions.add(InsExtension.create()); + parser = Parser.builder().extensions(extensions).build(); + renderer = HtmlRenderer.builder().extensions(extensions).sanitizeUrls(true).build(); + } + /** * does HTML escaping, converts tabs to spaces and converts leading * spaces (for each multi-line) to as many ' ' sequences as required @@ -93,11 +116,13 @@ return sb.toString().replaceAll("\t", " "); } - public static String htmlizeUrls (String text) { + public static String renderMarkdown (String text) { if (text == null) { return null; } else { - return text.replaceAll(URL_PATTERN, "<a href='$0' target='_blank'>$0</a>"); + Node document = parser.parse(text); + return renderer.render(document); +// return text.replaceAll(URL_PATTERN, "<a href='$0' target='_blank'>$0</a>"); } } @@ -108,11 +133,11 @@ return "???item_view." + key + "???"; } } - + public static String getAsHtml(Item item, MessageSource messageSource, Locale locale) { return getAsHtml(item, null, null, messageSource, locale); } - + public static String getAsHtml(Item item, HttpServletRequest request, HttpServletResponse response) { Locale locale = RequestContextUtils.getLocale(request); MessageSource messageSource = RequestContextUtils.getWebApplicationContext(request); Modified: trunk/jtrac/src/main/java/info/jtrac/web/RestMultiActionController.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/web/RestMultiActionController.java 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/java/info/jtrac/web/RestMultiActionController.java 2021-10-26 15:22:35 UTC (rev 1402) @@ -1,221 +1,220 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.web; - -import info.jtrac.domain.Item; -import info.jtrac.domain.ItemSearch; -import info.jtrac.domain.Space; -import info.jtrac.domain.User; -import info.jtrac.exception.InvalidRefIdException; -import info.jtrac.util.ItemUtils; -import info.jtrac.util.XmlUtils; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.util.List; -import java.util.StringTokenizer; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.commons.codec.binary.Base64; -import org.apache.wicket.PageParameters; -import org.apache.wicket.protocol.http.RequestUtils; -import org.apache.wicket.util.value.ValueMap; -import org.dom4j.Document; -import org.dom4j.Element; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.multiaction.MethodNameResolver; -import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; - -/** - * Spring MultiActionController that handles REST requests - * returns XML messages - */ -public class RestMultiActionController extends AbstractMultiActionController { - - /** - * custom MethodNameResolver is configured that checks the value of an expected - * paramter called "method" in the request and formats the value that may be - * in the form of "namespace.subnamespace.action" into "namespaceSubnamespaceAction" - * or more like a java method name - */ - public RestMultiActionController() { - setMethodNameResolver(new MethodNameResolver() { - public String getHandlerMethodName(HttpServletRequest request) throws NoSuchRequestHandlingMethodException { - String temp = request.getParameter("method"); - if (temp == null) { - return null; - } - StringBuffer sb = new StringBuffer(); - for(int i = 0; i < temp.length(); i++) { - char c = temp.charAt(i); - if (c == '.') { - i++; - c = temp.charAt(i); - sb.append(Character.toUpperCase(c)); - } else { - sb.append(c); - } - } - return sb.toString(); - } - }); - } - - /** - * override Spring template method as a crude interceptor - * here we are doing HTTP basic authentication TODO better security - */ - @Override - protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { - if(!authenticate(request)) { - String title = "Basic realm=\"JTrac Remote API\""; - response.setHeader("WWW-Authenticate", title); - response.setStatus(401); - return null; - } else { - return super.handleRequestInternal(request, response); - } - } - - private boolean authenticate(HttpServletRequest request) { - String authHeader = request.getHeader("Authorization"); - logger.debug("auth header: " + authHeader); - if (authHeader == null) { - return false; - } - StringTokenizer st = new StringTokenizer(authHeader); - if (st.hasMoreTokens()) { - String basic = st.nextToken(); - if (basic.equalsIgnoreCase("Basic")) { - String credentials = st.nextToken(); - Base64 decoder = new Base64(); - String userPass = new String(decoder.decode(credentials.getBytes())); - int p = userPass.indexOf(":"); - if (p == -1) { - return false; - } - String loginName = userPass.substring(0, p); - String password = userPass.substring(p + 1); - User user = jtrac.loadUser(loginName); - if(user == null) { - return false; - } - String encoded = jtrac.encodeClearText(password); - if(user.getPassword().equals(encoded)) { - request.setAttribute("user", user); - return true; - } - } - } - return false; - } - - private void writeXml(Document document, HttpServletResponse response) throws Exception { - writeXml(document.getRootElement(), response); - } - - private void writeXml(Element element, HttpServletResponse response) throws Exception { - initXmlResponse(response); - element.write(response.getWriter()); - } - - private void initXmlResponse(HttpServletResponse response) { - applyCacheSeconds(response, 0, true); - response.setContentType("text/xml"); - } - - private String getContent(HttpServletRequest request) throws Exception { - InputStream is = request.getInputStream(); - int ch; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - while ((ch = is.read()) != -1) { - baos.write((byte) ch); - } - return new String(baos.toByteArray()); - } - - //============================ REQUEST HANDLERS ============================ - - public void versionGet(HttpServletRequest request, HttpServletResponse response) throws Exception { - Document d = XmlUtils.getNewDocument("version"); - Element root = d.getRootElement(); - root.addAttribute("number", jtrac.getReleaseVersion()); - root.addAttribute("timestamp", jtrac.getReleaseTimestamp()); - writeXml(d, response); - } - - public void itemGet(HttpServletRequest request, HttpServletResponse response) throws Exception { - String refId = request.getParameter("refId"); - Item item = null; - try { - item = jtrac.loadItemByRefId(refId); - } catch (InvalidRefIdException e) { - // TODO - } - // TODO if item == null - if (item == null) { - return; - } - Element e = ItemUtils.getAsXml(item); - writeXml(e, response); - } - - public void itemPut(HttpServletRequest request, HttpServletResponse response) throws Exception { - logger.debug(getContent(request)); - Document d = XmlUtils.getNewDocument("success"); - Element root = d.getRootElement(); - root.addElement("refId").addText("FOOBAR-123"); - writeXml(d, response); - } - - public void spaceUsersGet(HttpServletRequest request, HttpServletResponse response) throws Exception { - String prefixCode = request.getParameter("prefixCode"); - Space space = jtrac.loadSpace(prefixCode); - Document d = XmlUtils.getNewDocument("users"); - Element root = d.getRootElement(); - root.addAttribute("prefixCode", prefixCode); - List<User> users = jtrac.findUsersForSpace(space.getId()); - for(User user : users) { - root.addElement("user").addAttribute("loginName", user.getLoginName()).addText(user.getName()); - } - writeXml(d, response); - } - - public void itemSearchGet(HttpServletRequest request, HttpServletResponse response) throws Exception { - String queryString = request.getQueryString(); - logger.debug("parsing queryString: " + queryString); - ValueMap map = new ValueMap(); - RequestUtils.decodeParameters(queryString, map); - logger.debug("decoded: " + map); - User user = (User) request.getAttribute("user"); - PageParameters params = new PageParameters(map); - ItemSearch itemSearch = ItemUtils.getItemSearch(user, params, jtrac); - initXmlResponse(response); - ItemUtils.writeAsXml(itemSearch, jtrac, response.getWriter()); - } - - public void itemAllGet(HttpServletRequest request, HttpServletResponse response) throws Exception { - // GOD mode! - User user = (User) request.getAttribute("user"); - if(!user.isSuperUser()) { - // TODO error code - return; - } - initXmlResponse(response); - ItemUtils.writeAsXml(jtrac, response.getWriter()); - } - -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.web; + +import info.jtrac.domain.Item; +import info.jtrac.domain.ItemSearch; +import info.jtrac.domain.Space; +import info.jtrac.domain.User; +import info.jtrac.exception.InvalidRefIdException; +import info.jtrac.util.ItemUtils; +import info.jtrac.util.XmlUtils; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.List; +import java.util.StringTokenizer; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.codec.binary.Base64; +import org.apache.wicket.PageParameters; +import org.apache.wicket.protocol.http.RequestUtils; +import org.apache.wicket.util.value.ValueMap; +import org.dom4j.Document; +import org.dom4j.Element; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.multiaction.MethodNameResolver; +import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; + +/** + * Spring MultiActionController that handles REST requests + * returns XML messages + */ +public class RestMultiActionController extends AbstractMultiActionController { + + /** + * custom MethodNameResolver is configured that checks the value of an expected parameter + * called "method" in the request and formats the value that may be in the form of + * "namespace.subnamespace.action" into "namespaceSubnamespaceAction" or more like a Java method name + */ + public RestMultiActionController() { + setMethodNameResolver(new MethodNameResolver() { + public String getHandlerMethodName(HttpServletRequest request) throws NoSuchRequestHandlingMethodException { + String temp = request.getParameter("method"); + if (temp == null) { + return null; + } + StringBuffer sb = new StringBuffer(); + for(int i = 0; i < temp.length(); i++) { + char c = temp.charAt(i); + if (c == '.') { + i++; + c = temp.charAt(i); + sb.append(Character.toUpperCase(c)); + } else { + sb.append(c); + } + } + return sb.toString(); + } + }); + } + + /** + * override Spring template method as a crude interceptor + * here we are doing HTTP basic authentication TODO better security + */ + @Override + protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { + if(!authenticate(request)) { + String title = "Basic realm=\"JTrac Remote API\""; + response.setHeader("WWW-Authenticate", title); + response.setStatus(401); + return null; + } else { + return super.handleRequestInternal(request, response); + } + } + + private boolean authenticate(HttpServletRequest request) { + String authHeader = request.getHeader("Authorization"); + logger.debug("auth header: " + authHeader); + if (authHeader == null) { + return false; + } + StringTokenizer st = new StringTokenizer(authHeader); + if (st.hasMoreTokens()) { + String basic = st.nextToken(); + if (basic.equalsIgnoreCase("Basic")) { + String credentials = st.nextToken(); + Base64 decoder = new Base64(); + String userPass = new String(decoder.decode(credentials.getBytes())); + int p = userPass.indexOf(":"); + if (p == -1) { + return false; + } + String loginName = userPass.substring(0, p); + String password = userPass.substring(p + 1); + User user = jtrac.loadUser(loginName); + if(user == null) { + return false; + } + String encoded = jtrac.encodeClearText(password); + if(user.getPassword().equals(encoded)) { + request.setAttribute("user", user); + return true; + } + } + } + return false; + } + + private void writeXml(Document document, HttpServletResponse response) throws Exception { + writeXml(document.getRootElement(), response); + } + + private void writeXml(Element element, HttpServletResponse response) throws Exception { + initXmlResponse(response); + element.write(response.getWriter()); + } + + private void initXmlResponse(HttpServletResponse response) { + applyCacheSeconds(response, 0, true); + response.setContentType("text/xml"); + } + + private String getContent(HttpServletRequest request) throws Exception { + InputStream is = request.getInputStream(); + int ch; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + while ((ch = is.read()) != -1) { + baos.write((byte) ch); + } + return new String(baos.toByteArray()); + } + + //============================ REQUEST HANDLERS ============================ + + public void versionGet(HttpServletRequest request, HttpServletResponse response) throws Exception { + Document d = XmlUtils.getNewDocument("version"); + Element root = d.getRootElement(); + root.addAttribute("number", jtrac.getReleaseVersion()); + root.addAttribute("timestamp", jtrac.getReleaseTimestamp()); + writeXml(d, response); + } + + public void itemGet(HttpServletRequest request, HttpServletResponse response) throws Exception { + String refId = request.getParameter("refId"); + Item item = null; + try { + item = jtrac.loadItemByRefId(refId); + } catch (InvalidRefIdException e) { + // TODO + } + // TODO if item == null + if (item == null) { + return; + } + Element e = ItemUtils.getAsXml(item); + writeXml(e, response); + } + + public void itemPut(HttpServletRequest request, HttpServletResponse response) throws Exception { + logger.debug(getContent(request)); + Document d = XmlUtils.getNewDocument("success"); + Element root = d.getRootElement(); + root.addElement("refId").addText("FOOBAR-123"); + writeXml(d, response); + } + + public void spaceUsersGet(HttpServletRequest request, HttpServletResponse response) throws Exception { + String prefixCode = request.getParameter("prefixCode"); + Space space = jtrac.loadSpace(prefixCode); + Document d = XmlUtils.getNewDocument("users"); + Element root = d.getRootElement(); + root.addAttribute("prefixCode", prefixCode); + List<User> users = jtrac.findUsersForSpace(space.getId()); + for(User user : users) { + root.addElement("user").addAttribute("loginName", user.getLoginName()).addText(user.getName()); + } + writeXml(d, response); + } + + public void itemSearchGet(HttpServletRequest request, HttpServletResponse response) throws Exception { + String queryString = request.getQueryString(); + logger.debug("parsing queryString: " + queryString); + ValueMap map = new ValueMap(); + RequestUtils.decodeParameters(queryString, map); + logger.debug("decoded: " + map); + User user = (User) request.getAttribute("user"); + PageParameters params = new PageParameters(map); + ItemSearch itemSearch = ItemUtils.getItemSearch(user, params, jtrac); + initXmlResponse(response); + ItemUtils.writeAsXml(itemSearch, jtrac, response.getWriter()); + } + + public void itemAllGet(HttpServletRequest request, HttpServletResponse response) throws Exception { + // GOD mode! + User user = (User) request.getAttribute("user"); + if(!user.isSuperUser()) { + // TODO error code + return; + } + initXmlResponse(response); + ItemUtils.writeAsXml(jtrac, response.getWriter()); + } + +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/BasePanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/BasePanel.java 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/BasePanel.java 2021-10-26 15:22:35 UTC (rev 1402) @@ -66,10 +66,10 @@ return m.getString(); } - protected boolean autoLinkUrls() { - String autoLink = getJtrac().loadConfig("urls.autolink"); - if (StringUtils.hasText(autoLink)) { - return autoLink.trim().equalsIgnoreCase("true"); + protected boolean markdown() { + String markdown = getJtrac().loadConfig("markdown.enabled"); + if (StringUtils.hasText(markdown)) { + return markdown.trim().equalsIgnoreCase("true"); } else { return false; } Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigListPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigListPage.java 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigListPage.java 2021-10-26 15:22:35 UTC (rev 1402) @@ -26,6 +26,8 @@ import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; +import org.springframework.util.StringUtils; + /** * This class is responsible to list all configuration parameters. * It also declares which edit forms will be called to modify the configuration parameters. @@ -59,7 +61,10 @@ // Password value to be edited // obscure the password, but give an indication of its length - listItem.add(new Label("value", new String(new char[value.length()]).replaceAll("\0", "*"))); + if (StringUtils.hasText(value)) + listItem.add(new Label("value", new String(new char[value.length()]).replaceAll("\0", "*"))); + else + listItem.add(new Label("value", "")); listItem.add(new Link("link") { public void onClick() { Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.java 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.java 2021-10-26 15:22:35 UTC (rev 1402) @@ -1,66 +1,75 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import java.util.Map; - -import org.apache.wicket.AttributeModifier; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.image.Image; -import org.apache.wicket.model.AbstractReadOnlyModel; - - -/** - * header navigation - */ -public class IndividualHeadPanel extends BasePanel { - - /** - * Default serialVersionID. - */ - private static final long serialVersionUID = 1L; - - /** - * Constructor. - */ - public IndividualHeadPanel() { - super("individuel"); - - final Map<String, String> configMap = getJtrac().loadAllConfig(); - Image img= new Image( "icon"); - img.add(new AttributeModifier("src", true, new AbstractReadOnlyModel() { - private static final long serialVersionUID = 1L; - public final Object getObject() { - // based on some condition return the image source - String urlbase = configMap.get("jtrac.url.base"); - String url = configMap.get("jtrac.header.picture"); - if ((url == null) ||("".equals(url))) - return urlbase + "/resources/jtrac-logo.gif"; - else - return url; - } - })); - add(img); - String message = configMap.get("jtrac.header.text"); - if ((message == null) ||("".equals(message))) - add(new Label("message", "JTrac - Open Source Issue Tracking System")); - else if ((message != null) && ("no".equals(message))) - add(new Label("message", "")); - else - add(new Label("message", message)); - } -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import java.util.Map; + +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.image.Image; +import org.apache.wicket.model.AbstractReadOnlyModel; + +import org.springframework.util.StringUtils; + +/** + * header navigation + */ + +public class IndividualHeadPanel extends BasePanel { + + /** + * Default serialVersionID. + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + */ + public IndividualHeadPanel() { + super("individuel"); + + final Map<String, String> configMap = getJtrac().loadAllConfig(); + + Image img = new Image("icon"); + img.add(new AttributeModifier("src", true, new AbstractReadOnlyModel() { + @Override + public final Object getObject() { + // based on some condition return the image source + String url = configMap.get("jtrac.header.picture"); + if (StringUtils.hasText(url)) { + return url; + } else { + String urlbase = configMap.get("jtrac.url.base"); + if (! urlbase.endsWith("/")) { + // some servers, especially Jetty, can't handle multiple slashes + urlbase = urlbase + "/"; + } + return urlbase + "resources/jtrac-logo.gif"; + } + } + })); + add(img); + + String message = configMap.get("jtrac.header.text"); + if (! StringUtils.hasText(message)) + add(new Label("message", "JTrac - Open Source Issue Tracking System")); + else if ((message != null) && ("no".equals(message))) + add(new Label("message", "")); + else + add(new Label("message", message)); + } +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewPanel.java 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewPanel.java 2021-10-26 15:22:35 UTC (rev 1402) @@ -25,9 +25,11 @@ import info.jtrac.domain.ItemSearch; import info.jtrac.util.DateUtils; import info.jtrac.util.ItemUtils; + import java.util.ArrayList; import java.util.List; import java.util.Map; + import org.apache.wicket.PageParameters; import org.apache.wicket.behavior.SimpleAttributeModifier; import org.apache.wicket.markup.html.WebMarkupContainer; @@ -188,8 +190,8 @@ add(new Label("assignedTo", new PropertyModel(item, "assignedTo.name"))); add(new Label("summary", new PropertyModel(item, "summary"))); String text = ItemUtils.fixWhiteSpace(item.getDetail()); - if (autoLinkUrls()) { - text = ItemUtils.htmlizeUrls(text); + if (markdown()) { + text = ItemUtils.renderMarkdown(text); } add(new Label("detail", text).setEscapeModelStrings(false)); @@ -242,8 +244,8 @@ WebMarkupContainer comment = new WebMarkupContainer("comment"); comment.add(new AttachmentLinkPanel("attachment", h.getAttachment())); String text = ItemUtils.fixWhiteSpace(h.getComment()); - if (autoLinkUrls()) { - text = ItemUtils.htmlizeUrls(text); + if (markdown()) { + text = ItemUtils.renderMarkdown(text); } comment.add(new Label("comment", text).setEscapeModelStrings(false)); listItem.add(comment); Modified: trunk/jtrac/src/main/resources/messages.properties =================================================================== --- trunk/jtrac/src/main/resources/messages.properties 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/resources/messages.properties 2021-10-26 15:22:35 UTC (rev 1402) @@ -204,8 +204,9 @@ config.attachment.maxsize = Maximum size in MB of file-attachments. (default 5 MB) Use -1 for no-limit config.pwd.minLength = Minimal length of passwords (default is 8) config.time.pretty = Show relative timestamps as on Github, Twitter and Facebook (set to true, default is false) -config.urls.autolink = Auto-link URLs in tickets and comments (set to true, default is false) +config.markdown.enabled = Support Markdown Syntax for text display (set to true, default is false) config.attachments.openNewWindow = Open text and image attachments in a new tab/window, rather than downloading them +config.items.search.num = Number of entries per page (default is 25) # config_list (config_form does not have any extra messages) config_list.configurationSettings = Configuration Settings Modified: trunk/jtrac/src/main/resources/messages_de.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_de.properties 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/resources/messages_de.properties 2021-10-26 15:22:35 UTC (rev 1402) @@ -205,7 +205,7 @@ config.attachment.maxsize = Maximalgr\u00F6\u00DFe f\u00FCr Anlagen in MB, "-1" f\u00FCr Kein-Limit (Default 5) config.pwd.minLength = Minimale L\u00e4nge von Passw\u00f6rtern (Default 8) config.time.pretty = Relative Zeiten anzeigen wie auf Github, Twitter und Facebook (auf true setzen, Default ist false) -config.urls.autolink = URLs in Tickets und Kommentaren automatisch verlinken (auf true setzen, Default ist false) +config.markdown.enabled = Fliesstext als Markdown anzeigen (auf true setzen, Default ist false) config.attachments.openNewWindow = Text- und Bild-Anh\u00e4nge in neuem Fenster \u00f6ffnen statt sie herunterzuladen config.items.search.num = Anzahl der Eintr\u00f6ge pro Seite (Default 25) Modified: trunk/jtrac/src/main/resources/messages_en.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_en.properties 2021-10-15 13:20:11 UTC (rev 1401) +++ trunk/jtrac/src/main/resources/messages_en.properties 2021-10-26 15:22:35 UTC (rev 1402) @@ -205,7 +205,7 @@ config.attachment.maxsize = Maximum size in MB of file-attachments. (default 5 MB) Use -1 for no-limit config.pwd.minLength = Minimal length of passwords (default is 8) config.time.pretty = Show relative timestamps as on Github, Twitter and Facebook (set to true, default is false) -config.urls.autolink = Auto-link URLs in tickets and comments (set to true, default is false) +config.markdown.enabled = Support Markdown Syntax for text display (set to true, default is false) config.attachments.openNewWindow = Open text and image attachments in a new tab/window, rather than downloading them config.items.search.num = Number of entries per page (default is 25) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-10-27 08:20:06
|
Revision: 1403 http://sourceforge.net/p/j-trac/code/1403 Author: udittmer Date: 2021-10-27 08:20:04 +0000 (Wed, 27 Oct 2021) Log Message: ----------- finalize Markdown support Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java trunk/jtrac/src/main/java/info/jtrac/wicket/BasePanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewPanel.java Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-10-26 15:22:35 UTC (rev 1402) +++ trunk/jtrac/pom.xml 2021-10-27 08:20:04 UTC (rev 1403) @@ -4,7 +4,7 @@ <groupId>info.jtrac</groupId> <artifactId>jtrac</artifactId> <packaging>war</packaging> - <version>2.2.0-b2</version> + <version>2.2.0-b3</version> <name>JTrac</name> <description> JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields Modified: trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2021-10-26 15:22:35 UTC (rev 1402) +++ trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2021-10-27 08:20:04 UTC (rev 1403) @@ -26,6 +26,7 @@ import info.jtrac.domain.Space; import info.jtrac.domain.User; import info.jtrac.exception.JtracSecurityException; +import info.jtrac.wicket.JtracApplication; import java.io.BufferedReader; import java.io.StringReader; @@ -48,7 +49,7 @@ import org.commonmark.Extension; import org.commonmark.node.*; import org.commonmark.parser.Parser; -import org.commonmark.renderer.html.HtmlRenderer; +import org.commonmark.renderer.html.*; import org.commonmark.ext.autolink.AutolinkExtension; import org.commonmark.ext.gfm.strikethrough.StrikethroughExtension; import org.commonmark.ext.ins.InsExtension; @@ -73,8 +74,27 @@ extensions.add(AutolinkExtension.create()); extensions.add(StrikethroughExtension.create()); extensions.add(InsExtension.create()); - parser = Parser.builder().extensions(extensions).build(); - renderer = HtmlRenderer.builder().extensions(extensions).sanitizeUrls(true).build(); + parser = Parser.builder() + .extensions(extensions) + .build(); + renderer = HtmlRenderer.builder() + .extensions(extensions) + .attributeProviderFactory(new AttributeProviderFactory() { + @Override + public AttributeProvider create (AttributeProviderContext context) { + return new AttributeProvider() { + @Override + public void setAttributes (Node node, String tagName, Map<String, String> attributes) { + // if (tagName.equals("a")) would probably work as well + if (node instanceof Link) { + attributes.put("target", "_blank"); + } + } + }; + } + }) + .sanitizeUrls(true) + .build(); } /** @@ -114,15 +134,22 @@ throw new RuntimeException(e); } return sb.toString().replaceAll("\t", " "); - } + } public static String renderMarkdown (String text) { if (text == null) { return null; } else { - Node document = parser.parse(text); - return renderer.render(document); -// return text.replaceAll(URL_PATTERN, "<a href='$0' target='_blank'>$0</a>"); + String markdown = JtracApplication.get().getJtrac().loadConfig("markdown.enabled"); + if (markdown!=null && markdown.equalsIgnoreCase("true")) { + // apply markdown + Node document = parser.parse(text); + return renderer.render(document); + } else { + // at least auto-link URLs + text = fixWhiteSpace(text); + return text.replaceAll(URL_PATTERN, "<a href='$0' target='_blank'>$0</a>"); + } } } @@ -144,17 +171,15 @@ return getAsHtml(item, request, response, messageSource, locale); } - private static String getAsHtml(Item item, HttpServletRequest request, HttpServletResponse response, - MessageSource ms, Locale loc) { - + private static String getAsHtml (Item item, HttpServletRequest request, HttpServletResponse response, MessageSource ms, Locale loc) { boolean isWeb = request != null && response != null; - + String tableStyle = " class='jtrac'"; String tdStyle = ""; String thStyle = ""; String altStyle = " class='alt'"; String labelStyle = " class='label'"; - + if (!isWeb) { // inline CSS so that HTML mail works across most mail-reader clients String tdCommonStyle = "border: 1px solid black"; Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/BasePanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/BasePanel.java 2021-10-26 15:22:35 UTC (rev 1402) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/BasePanel.java 2021-10-27 08:20:04 UTC (rev 1403) @@ -65,13 +65,4 @@ m.setLocalizer(getLocalizer()); return m.getString(); } - - protected boolean markdown() { - String markdown = getJtrac().loadConfig("markdown.enabled"); - if (StringUtils.hasText(markdown)) { - return markdown.trim().equalsIgnoreCase("true"); - } else { - return false; - } - } } Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewPanel.java 2021-10-26 15:22:35 UTC (rev 1402) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemViewPanel.java 2021-10-27 08:20:04 UTC (rev 1403) @@ -189,10 +189,8 @@ add(new Label("loggedBy", new PropertyModel(item, "loggedBy.name"))); add(new Label("assignedTo", new PropertyModel(item, "assignedTo.name"))); add(new Label("summary", new PropertyModel(item, "summary"))); - String text = ItemUtils.fixWhiteSpace(item.getDetail()); - if (markdown()) { - text = ItemUtils.renderMarkdown(text); - } + String text = item.getDetail(); + text = ItemUtils.renderMarkdown(text); add(new Label("detail", text).setEscapeModelStrings(false)); final SimpleAttributeModifier sam = new SimpleAttributeModifier("class", "alt"); @@ -243,13 +241,11 @@ WebMarkupContainer comment = new WebMarkupContainer("comment"); comment.add(new AttachmentLinkPanel("attachment", h.getAttachment())); - String text = ItemUtils.fixWhiteSpace(h.getComment()); - if (markdown()) { - text = ItemUtils.renderMarkdown(text); - } + String text = h.getComment(); + text = ItemUtils.renderMarkdown(text); comment.add(new Label("comment", text).setEscapeModelStrings(false)); listItem.add(comment); - + listItem.add(new Label("timeStamp", DateUtils.formatTimeStamp(h.getTimeStamp()))); listItem.add(new ListView("fields", editable) { /* (non-Javadoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-11-08 10:36:37
|
Revision: 1406 http://sourceforge.net/p/j-trac/code/1406 Author: udittmer Date: 2021-11-08 10:36:34 +0000 (Mon, 08 Nov 2021) Log Message: ----------- use HikariCP instead of Apache DBCP; boolean settings have a switch UI instead of a text field Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/main/java/info/jtrac/config/DataSourceFactoryBean.java trunk/jtrac/src/main/java/info/jtrac/config/JtracConfigurer.java trunk/jtrac/src/main/java/info/jtrac/domain/Config.java trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java trunk/jtrac/src/main/java/info/jtrac/wicket/AttachmentLinkPanel.java trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/StoredSearchFormPage.java trunk/jtrac/src/main/resources/messages.properties trunk/jtrac/src/main/resources/messages_de.properties trunk/jtrac/src/main/resources/messages_en.properties trunk/jtrac/src/main/webapp/WEB-INF/applicationContext.xml Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/pom.xml 2021-11-08 10:36:34 UTC (rev 1406) @@ -406,18 +406,12 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>com.zaxxer</groupId> + <artifactId>HikariCP</artifactId> + <version>4.0.3</version> + </dependency> <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - <version>1.4</version> - <exclusions> - <exclusion> - <groupId>xml-apis</groupId> - <artifactId>xml-apis</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache</artifactId> <version>1.7.2</version> Modified: trunk/jtrac/src/main/java/info/jtrac/config/DataSourceFactoryBean.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/config/DataSourceFactoryBean.java 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/config/DataSourceFactoryBean.java 2021-11-08 10:36:34 UTC (rev 1406) @@ -1,241 +1,225 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.config; - -import java.sql.Connection; -import java.sql.Statement; -import javax.sql.DataSource; -import org.apache.commons.dbcp.BasicDataSource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.FactoryBean; -import org.springframework.jdbc.datasource.SingleConnectionDataSource; -import org.springframework.jndi.JndiObjectFactoryBean; -import org.springframework.util.StringUtils; - -/** - * <p> - * This class implements the Spring frameworks - * {@link org.springframework.beans.factory.FactoryBean} as well as the - * {@link org.springframework.beans.factory.DisposableBean} to conditionally - * create the correct <code>DataSource</code> object to access the database. - * </p> - * - * Supported data sources are: - * <ul> - * <li><a href="http://hsqldb.org/">HSQLDB (embedded)</a></li> - * <li><a href="http://commons.apache.org/dbcp/">Apache DBCP</a></li> - * <li>Java Naming and Directory Interface (JNDI); supported by most JDBC - * database drivers</li> - * </ul> - */ -public class DataSourceFactoryBean implements FactoryBean, DisposableBean { - /** - * Logger object - */ - private final Logger logger = LoggerFactory.getLogger(getClass()); - - /** - * DB driver class name - */ - private String driverClassName; - - /** - * DB url - */ - private String url; - - /** - * DB user - */ - private String username; - - /** - * DB password - */ - private String password; - - /** - * DB queries used to check if the database can be accessed - */ - private String validationQuery; - - /** - * DB JNDI data source name - */ - private String dataSourceJndiName; - - /** - * DB JNDI data source object - */ - private DataSource dataSource; - - /** - * This method allows to store the name of the DB driver class. - * - * @param driverClassName The name of the DB driver class. - */ - public void setDriverClassName(String driverClassName) { - this.driverClassName = driverClassName; - } - - /** - * This method allows to store the DB url. - * - * @param url The DB url. - */ - public void setUrl(String url) { - this.url = url; - } - - /** - * This method allows to store the DB user. - * - * @param username The DB user. - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * This method allows to store the DB password. - * - * @param password The DB password. - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * This method allows to store the SQL query string used to check if - * the DB connection is working. - * - * @param validationQuery The SQL query used to validate if the DB - * connection is working. - */ - public void setValidationQuery(String validationQuery) { - this.validationQuery = validationQuery; - } - - /** - * This method allows to store the JNDI data source name. - * - * @param dataSourceJndiName The JNDI data source name. - */ - public void setDataSourceJndiName(String dataSourceJndiName) { - this.dataSourceJndiName = dataSourceJndiName; - } - - /** - * This method returns the dataSource object used for the DB access. - * - * @throws Exception - * @see org.springframework.beans.factory.FactoryBean#getObject() - */ - public Object getObject() throws Exception { - if(StringUtils.hasText(dataSourceJndiName)) { - logger.info("JNDI datasource requested, looking up datasource from JNDI name: '" + dataSourceJndiName + "'"); - JndiObjectFactoryBean factoryBean = new JndiObjectFactoryBean(); - factoryBean.setJndiName(dataSourceJndiName); - - // "java:comp/env/" will be prefixed if the JNDI name doesn't already have it - factoryBean.setResourceRef(true); - - // This step actually does the JNDI lookup - try { - factoryBean.afterPropertiesSet(); - } catch(Exception e) { - logger.error("datasource init from JNDI failed : " + e); - logger.error("aborting application startup"); - throw new RuntimeException(e); - } // end try..catch - - dataSource = (DataSource) factoryBean.getObject(); - } else if(url.startsWith("jdbc:hsqldb:file")) { - logger.info("embedded HSQLDB mode detected, switching on spring single connection data source"); - SingleConnectionDataSource ds = new SingleConnectionDataSource(); - ds.setUrl(url); - ds.setDriverClassName(driverClassName); - ds.setUsername(username); - ds.setPassword(password); - ds.setSuppressClose(true); - dataSource = ds; - } else { - logger.info("Not using embedded HSQLDB or JNDI datasource, switching on Apache DBCP data source connection pooling"); - BasicDataSource ds = new BasicDataSource(); - ds.setUrl(url); - ds.setDriverClassName(driverClassName); - ds.setUsername(username); - ds.setPassword(password); - ds.setValidationQuery(validationQuery); - ds.setTestOnBorrow(false); - ds.setTestWhileIdle(true); - ds.setTimeBetweenEvictionRunsMillis(600000); - dataSource = ds; - } // end if..else - - return dataSource; - } - - /** - * This method returns the class name of the DataSource object which can be - * used to determine which data source implementation is currently used. - * - * @return Returns the class name <code>Object.class</code> of the - * DataSource object. - * @see org.springframework.beans.factory.FactoryBean#getObjectType() - */ - public Class getObjectType() { - return DataSource.class; - } - - /** - * This method returns if the factory is implemented as Singleton. - * - * @return Returns if the factory is implemented as Singleton or not. - * @see org.springframework.beans.factory.FactoryBean#isSingleton() - */ - public boolean isSingleton() { - return true; - } - - /** - * This method is called to clean up the references when the object is - * destroyed. - * - * @throws Exception - * @see org.springframework.beans.factory.DisposableBean#destroy() - */ - public void destroy() throws Exception { - if(dataSource instanceof SingleConnectionDataSource) { - logger.info("attempting to shut down embedded HSQLDB database"); - Connection con = dataSource.getConnection(); - Statement stmt = con.createStatement(); - stmt.executeUpdate("SHUTDOWN"); - stmt.close(); - con.close(); - logger.info("embedded HSQLDB database shut down successfully"); - } else if (dataSource instanceof BasicDataSource){ - logger.info("attempting to close Apache DBCP data source"); - ((BasicDataSource) dataSource).close(); - logger.info("Apache DBCP data source closed successfully"); - } else { - logger.info("context shutting down for JNDI datasource"); - } // end if..else - } -} +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.config; + +import java.sql.Connection; +import java.sql.Statement; +import javax.sql.DataSource; + +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.jdbc.datasource.SingleConnectionDataSource; +import org.springframework.jndi.JndiObjectFactoryBean; +import org.springframework.util.StringUtils; + +/** + * <p> + * This class implements the Spring frameworks + * {@link org.springframework.beans.factory.FactoryBean} as well as the + * {@link org.springframework.beans.factory.DisposableBean} to conditionally + * create the correct <code>DataSource</code> object to access the database. + * </p> + * + * Supported data sources are: + * <ul> + * <li><a href="http://hsqldb.org/">HSQLDB (embedded)</a></li> + * <li><a href="https://github.com/brettwooldridge/HikariCP">HikariCP</a></li> + * <li>Java Naming and Directory Interface (JNDI); supported by most JDBC database drivers</li> + * </ul> + */ +public class DataSourceFactoryBean implements FactoryBean, DisposableBean { + /** + * Logger object + */ + private final Logger logger = LoggerFactory.getLogger(getClass()); + + /** + * DB driver class name + */ + private String driverClassName; + + /** + * DB url + */ + private String url; + + /** + * DB user + */ + private String username; + + /** + * DB password + */ + private String password; + + /** + * DB JNDI data source name + */ + private String dataSourceJndiName; + + /** + * DB JNDI data source object + */ + private DataSource dataSource; + + /** + * This method allows to store the name of the DB driver class. + * + * @param driverClassName The name of the DB driver class. + */ + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + /** + * This method allows to store the DB url. + * + * @param url The DB url. + */ + public void setUrl(String url) { + this.url = url; + } + + /** + * This method allows to store the DB user. + * + * @param username The DB user. + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * This method allows to store the DB password. + * + * @param password The DB password. + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * This method allows to store the JNDI data source name. + * + * @param dataSourceJndiName The JNDI data source name. + */ + public void setDataSourceJndiName(String dataSourceJndiName) { + this.dataSourceJndiName = dataSourceJndiName; + } + + /** + * This method returns the dataSource object used for the DB access. + * + * @throws Exception + * @see org.springframework.beans.factory.FactoryBean#getObject() + */ + public Object getObject() throws Exception { + if(StringUtils.hasText(dataSourceJndiName)) { + logger.info("JNDI datasource requested, looking up datasource from JNDI name: '" + dataSourceJndiName + "'"); + JndiObjectFactoryBean factoryBean = new JndiObjectFactoryBean(); + factoryBean.setJndiName(dataSourceJndiName); + + // "java:comp/env/" will be prefixed if the JNDI name doesn't already have it + factoryBean.setResourceRef(true); + + // This step actually does the JNDI lookup + try { + factoryBean.afterPropertiesSet(); + } catch(Exception e) { + logger.error("datasource init from JNDI failed : " + e); + logger.error("aborting application startup"); + throw new RuntimeException(e); + } // end try..catch + + dataSource = (DataSource) factoryBean.getObject(); + } else if(url.startsWith("jdbc:hsqldb:file")) { + logger.info("embedded HSQLDB mode detected, using Spring single connection data source"); + SingleConnectionDataSource ds = new SingleConnectionDataSource(); + ds.setUrl(url); + ds.setDriverClassName(driverClassName); + ds.setUsername(username); + ds.setPassword(password); + ds.setSuppressClose(true); + dataSource = ds; + } else { + logger.info("Not using embedded HSQLDB or JNDI datasource, using HikariCP connection pool"); + + HikariConfig config = new HikariConfig(); + config.setDriverClassName(driverClassName); + config.setJdbcUrl(url); + config.setUsername(username); + config.setPassword(password); + config.setKeepaliveTime(300000l); // 5 minutes + + dataSource = new HikariDataSource(config); + } // end if..else + + return dataSource; + } + + /** + * This method returns the class name of the DataSource object which can be + * used to determine which data source implementation is currently used. + * + * @return Returns the class name <code>Object.class</code> of the DataSource object. + * @see org.springframework.beans.factory.FactoryBean#getObjectType() + */ + public Class getObjectType() { + return DataSource.class; + } + + /** + * This method returns if the factory is implemented as Singleton. + * + * @return Returns if the factory is implemented as Singleton or not. + * @see org.springframework.beans.factory.FactoryBean#isSingleton() + */ + public boolean isSingleton() { + return true; + } + + /** + * This method is called to clean up the references when the object is destroyed. + * + * @throws Exception + * @see org.springframework.beans.factory.DisposableBean#destroy() + */ + public void destroy() throws Exception { + if(dataSource instanceof SingleConnectionDataSource) { + logger.info("attempting to shut down embedded HSQLDB database"); + Connection con = dataSource.getConnection(); + Statement stmt = con.createStatement(); + stmt.executeUpdate("SHUTDOWN"); + stmt.close(); + con.close(); + logger.info("embedded HSQLDB database shut down successfully"); + } else if (dataSource instanceof HikariDataSource){ + logger.info("attempting to close HikariCP data source"); + ((HikariDataSource) dataSource).close(); + logger.info("HikariCP data source closed successfully"); + } else { + logger.info("context shutting down for JNDI datasource"); + } // end if..else + } +} Modified: trunk/jtrac/src/main/java/info/jtrac/config/JtracConfigurer.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/config/JtracConfigurer.java 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/config/JtracConfigurer.java 2021-11-08 10:36:34 UTC (rev 1406) @@ -65,7 +65,7 @@ * <ul> * <li>DataSourceFactoryBean:</li> * <ul> - * <li>switches between embedded HSQLDB or Apache DBCP (connection pool)</li> + * <li>switches between embedded HSQLDB or HikariCP (connection pool)</li> * <li>performs graceful shutdown of database if embedded HSQLDB</li> * </ul> * <li>ProviderManagerFactoryBean</li> @@ -210,14 +210,7 @@ logger.info("jtrac.timestamp = '" + timestamp + "'"); props.setProperty("jtrac.version", version); props.setProperty("jtrac.timestamp", timestamp); - - /* - * TODO: A better way (default value) to check the database should be used for Apache DBCP. - * The current "SELECT...FROM DUAL" only works on Oracle (and MySQL). - * Other databases also support "SELECT 1+1" as query - * (e.g. PostgreSQL, Hypersonic 2 (H2), MySQL, etc.). - */ - props.setProperty("database.validationQuery", "SELECT 1 FROM DUAL"); + props.setProperty("ldap.url", ""); props.setProperty("ldap.activeDirectoryDomain", ""); props.setProperty("ldap.searchBase", ""); Modified: trunk/jtrac/src/main/java/info/jtrac/domain/Config.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/domain/Config.java 2021-11-08 10:36:34 UTC (rev 1406) @@ -31,7 +31,8 @@ private String value; private static final Set<String> PARAMS; - + private static final Set<String> BOOLEAN_PARAMS; + // set up a static set of valid config key names static { PARAMS = new LinkedHashSet<String>(); @@ -61,12 +62,24 @@ PARAMS.add("markdown.enabled"); PARAMS.add("attachments.openNewWindow"); PARAMS.add("items.search.num"); + + BOOLEAN_PARAMS = new LinkedHashSet<String>(); + BOOLEAN_PARAMS.add("mail.server.starttls.enable"); + BOOLEAN_PARAMS.add("mail.server.ssl.enable"); + BOOLEAN_PARAMS.add("jtrac.edit.item"); + BOOLEAN_PARAMS.add("time.pretty"); + BOOLEAN_PARAMS.add("markdown.enabled"); + BOOLEAN_PARAMS.add("attachments.openNewWindow"); } public static Set<String> getParams() { return PARAMS; } - + + public static boolean isBoolean (String param) { + return BOOLEAN_PARAMS.contains(param); + } + public Config() { // zero arg constructor } @@ -75,7 +88,7 @@ this.param = param; this.value = value; } - + public boolean isMailConfig() { return param.startsWith("mail.") || param.startsWith("jtrac.url."); } @@ -91,7 +104,11 @@ public boolean isLocaleConfig() { return param.startsWith("locale."); } - + + public boolean isBoolean() { + return BOOLEAN_PARAMS.contains(param); + } + //========================================================================== public String getParam() { Modified: trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/util/DateUtils.java 2021-11-08 10:36:34 UTC (rev 1406) @@ -43,7 +43,7 @@ if (StringUtils.hasText(pretty)) { return pretty.trim().equalsIgnoreCase("true"); } else { - return false; + return true; } } Modified: trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2021-11-08 10:36:34 UTC (rev 1406) @@ -141,7 +141,7 @@ return null; } else { String markdown = JtracApplication.get().getJtrac().loadConfig("markdown.enabled"); - if (markdown!=null && markdown.equalsIgnoreCase("true")) { + if (markdown==null || markdown.equalsIgnoreCase("true")) { // apply markdown Node document = parser.parse(text); return renderer.render(document); Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/AttachmentLinkPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/AttachmentLinkPanel.java 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/AttachmentLinkPanel.java 2021-11-08 10:36:34 UTC (rev 1406) @@ -116,7 +116,7 @@ if (StringUtils.hasText(openNewWindow)) { return openNewWindow.trim().equalsIgnoreCase("true"); } else { - return false; + return true; } } } Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html 2021-11-08 10:36:34 UTC (rev 1406) @@ -7,7 +7,10 @@ <tr> <td wicket:id="param" class="label"></td> <td> - <input wicket:id="value"/> + <input wicket:id="value" id="valueField"/> + <div class="switch" style="margin-left: auto; margin-right: auto;"></div> + </td> + <td> <input type="submit" wicket:message="value:submit"/> </td> </tr> @@ -17,4 +20,4 @@ </form> </wicket:extend> </body> -</html> \ No newline at end of file +</html> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.java 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.java 2021-11-08 10:36:34 UTC (rev 1406) @@ -1,85 +1,106 @@ -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package info.jtrac.wicket; - -import info.jtrac.domain.Config; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.BoundCompoundPropertyModel; - -/** - * config value edit form - */ -public class ConfigFormPage extends BasePage { - /** - * Constructor - * - * @param param - * @param value - */ - public ConfigFormPage(String param, String value) { - add(new ConfigForm("form", param, value)); - } - - /** - * wicket form - */ - private class ConfigForm extends Form { - - private String param; - - private String value; - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public ConfigForm(String id, final String param, final String value) { - - super(id); - - this.param = param; - this.value = value; - - final BoundCompoundPropertyModel model = new BoundCompoundPropertyModel(this); - setModel(model); - - add(new Label("heading", localize("config." + param))); - add(new Label("param", param)); - add(new TextField("value")); - - // cancel ========================================================== - add(new Link("cancel") { - public void onClick() { - setResponsePage(new ConfigListPage(param)); - } - }); - } - - @Override - protected void onSubmit() { - getJtrac().storeConfig(new Config(param, value)); - setResponsePage(new ConfigListPage(param)); - } - } -} \ No newline at end of file +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import info.jtrac.domain.Config; + +import org.apache.wicket.behavior.HeaderContributor; +import org.apache.wicket.markup.html.IHeaderContributor; +import org.apache.wicket.markup.html.IHeaderResponse; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.HiddenField; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.BoundCompoundPropertyModel; + +/** + * config value edit form + */ +public class ConfigFormPage extends BasePage { + /** + * Constructor + * + * @param param + * @param value + */ + public ConfigFormPage(String param, String value) { + add(new ConfigForm("form", param, value)); + } + + /** + * wicket form + */ + private class ConfigForm extends Form { + + private String param; + private String value; + private boolean isBoolean; + + public String getValue() { return value; } + public void setValue (String value) { this.value = value; } + + public ConfigForm(String id, final String param, final String value) { + super(id); + + this.param = param; + this.value = value; + this.isBoolean = Config.isBoolean(param); + + // boolean settings use a JavaScript switch instead of a text field + if (isBoolean) { + add(HeaderContributor.forJavaScript("resources/jquery-3.6.0.min.js")); + add(HeaderContributor.forJavaScript("resources/jquery.enhanced-switch.js")); + add(HeaderContributor.forCss("resources/jquery.enhanced-switch-pingpong.css")); + add(new HeaderContributor(new IHeaderContributor() { + public void renderHead(IHeaderResponse response) { + String js = "$('.switch').enhancedSwitch();\n" + + ((value!=null && value.equals("true")) ? "$('.switch').enhancedSwitch('setTrue');\n" : "") + + "$('#valueField').hide();\n" + + "$('.switch').click(function() {\n" + + " var selectedSwitch = $(this);\n" + + " selectedSwitch.enhancedSwitch('toggle');\n" + + " //console.log(selectedSwitch.enhancedSwitch('state'));\n" + + " $('#valueField').val(selectedSwitch.enhancedSwitch('state'));\n" + + "});"; + response.renderOnDomReadyJavascript(js); + } + })); + } + + final BoundCompoundPropertyModel model = new BoundCompoundPropertyModel(this); + setModel(model); + + add(new Label("heading", localize("config." + param))); + add(new Label("param", param)); + add(new TextField("value")); + + // cancel ========================================================== + add(new Link("cancel") { + public void onClick() { + setResponsePage(new ConfigListPage(param)); + } + }); + } + + @Override + protected void onSubmit() { + getJtrac().storeConfig(new Config(param, value)); + setResponsePage(new ConfigListPage(param)); + } + } +} Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/StoredSearchFormPage.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/StoredSearchFormPage.java 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/StoredSearchFormPage.java 2021-11-08 10:36:34 UTC (rev 1406) @@ -8,8 +8,6 @@ import org.apache.wicket.model.BoundCompoundPropertyModel; import org.apache.wicket.markup.html.form.Button; - - /** * Created by ncrappe on 8/09/2015. */ @@ -121,9 +119,6 @@ idLink = this.idSearchLink; } - System.out.println("idLink:"+String.valueOf(idLink)); - - getJtrac().storeStoredSearch(new StoredSearch(idLink, name, query)); setResponsePage(new StoredSearchListPage(name)); } @@ -131,7 +126,5 @@ public void setId(long idSearchLink) { this.idSearchLink = idSearchLink; } - - } -} \ No newline at end of file +} Modified: trunk/jtrac/src/main/resources/messages.properties =================================================================== --- trunk/jtrac/src/main/resources/messages.properties 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/resources/messages.properties 2021-11-08 10:36:34 UTC (rev 1406) @@ -205,9 +205,9 @@ config.session.timeout = Time in minutes after which user session expires (default 30 minutes) config.attachment.maxsize = Maximum size in MB of file-attachments. (default 5 MB) Use -1 for no-limit config.pwd.minLength = Minimal length of passwords (default is 8) -config.time.pretty = Show relative timestamps as on Github, Twitter and Facebook (set to true, default is false) -config.markdown.enabled = Support Markdown Syntax for text display (set to true, default is false) -config.attachments.openNewWindow = Open text and image attachments in a new tab/window, rather than downloading them +config.time.pretty = Show relative timestamps as on Github, Twitter and Facebook (default is true) +config.markdown.enabled = Support Markdown Syntax for text display (default is true) +config.attachments.openNewWindow = Open text and image attachments in a new tab/window, rather than downloading them (default is true) config.items.search.num = Number of entries per page (default is 25) # config_list (config_form does not have any extra messages) Modified: trunk/jtrac/src/main/resources/messages_de.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_de.properties 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/resources/messages_de.properties 2021-11-08 10:36:34 UTC (rev 1406) @@ -205,9 +205,9 @@ config.session.timeout = Session Timeout in Minuten (Default 30 Minuten) config.attachment.maxsize = Maximalgr\u00F6\u00DFe f\u00FCr Anlagen in MB, "-1" f\u00FCr Kein-Limit (Default 5) config.pwd.minLength = Minimale L\u00e4nge von Passw\u00f6rtern (Default 8) -config.time.pretty = Relative Zeiten anzeigen wie auf Github, Twitter und Facebook (auf true setzen, Default ist false) -config.markdown.enabled = Fliesstext als Markdown anzeigen (auf true setzen, Default ist false) -config.attachments.openNewWindow = Text- und Bild-Anh\u00e4nge in neuem Fenster \u00f6ffnen statt sie herunterzuladen +config.time.pretty = Relative Zeiten anzeigen wie auf Github, Twitter und Facebook (Default ist true) +config.markdown.enabled = Fliesstext als Markdown anzeigen (Default ist true) +config.attachments.openNewWindow = Text- und Bild-Anh\u00e4nge in neuem Fenster \u00f6ffnen statt sie herunterzuladen (Default ist true) config.items.search.num = Anzahl der Eintr\u00f6ge pro Seite (Default 25) # config_list (config_form does not have any extra messages) Modified: trunk/jtrac/src/main/resources/messages_en.properties =================================================================== --- trunk/jtrac/src/main/resources/messages_en.properties 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/resources/messages_en.properties 2021-11-08 10:36:34 UTC (rev 1406) @@ -205,9 +205,9 @@ config.session.timeout = Time in minutes after which user session expires (default 30 minutes) config.attachment.maxsize = Maximum size in MB of file-attachments. (default 5 MB) Use -1 for no-limit config.pwd.minLength = Minimal length of passwords (default is 8) -config.time.pretty = Show relative timestamps as on Github, Twitter and Facebook (set to true, default is false) -config.markdown.enabled = Support Markdown Syntax for text display (set to true, default is false) -config.attachments.openNewWindow = Open text and image attachments in a new tab/window, rather than downloading them +config.time.pretty = Show relative timestamps as on Github, Twitter and Facebook (default is true) +config.markdown.enabled = Support Markdown Syntax for text display (default is true) +config.attachments.openNewWindow = Open text and image attachments in a new tab/window, rather than downloading them (default is true) config.items.search.num = Number of entries per page (default is 25) # config_list (config_form does not have any extra messages) Modified: trunk/jtrac/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- trunk/jtrac/src/main/webapp/WEB-INF/applicationContext.xml 2021-10-27 15:57:10 UTC (rev 1405) +++ trunk/jtrac/src/main/webapp/WEB-INF/applicationContext.xml 2021-11-08 10:36:34 UTC (rev 1406) @@ -49,13 +49,12 @@ </bean> <!-- custom factory bean that uses spring single connection data source if embedded - HSQLDB is being used, else Apache DBCP with connection pooling --> + HSQLDB is being used, else HikariCP connection pool --> <bean id="dataSource" class="info.jtrac.config.DataSourceFactoryBean"> <property name="driverClassName" value="${database.driver}"/> <property name="url" value="${database.url}"/> <property name="username" value="${database.username}"/> <property name="password" value="${database.password}"/> - <property name="validationQuery" value="${database.validationQuery}"/> <property name="dataSourceJndiName" value="${database.datasource.jndiname}"/> </bean> @@ -103,4 +102,4 @@ </property> </bean> -</beans> \ No newline at end of file +</beans> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-11-09 09:20:21
|
Revision: 1408 http://sourceforge.net/p/j-trac/code/1408 Author: udittmer Date: 2021-11-09 09:20:17 +0000 (Tue, 09 Nov 2021) Log Message: ----------- user HTML number inputs in settings; start updating documentation Modified Paths: -------------- trunk/jtrac/doc/src/index.xml trunk/jtrac/src/main/java/info/jtrac/domain/Config.java trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.java trunk/jtrac/src/main/java/info/jtrac/wicket/CustomFieldsFormPanel.java Added Paths: ----------- trunk/jtrac/src/main/java/org/ trunk/jtrac/src/main/java/org/apache/ trunk/jtrac/src/main/java/org/apache/wicket/ trunk/jtrac/src/main/java/org/apache/wicket/markup/ trunk/jtrac/src/main/java/org/apache/wicket/markup/html/ trunk/jtrac/src/main/java/org/apache/wicket/markup/html/form/ trunk/jtrac/src/main/java/org/apache/wicket/markup/html/form/DateField.java trunk/jtrac/src/main/java/org/apache/wicket/markup/html/form/NumberField.java Modified: trunk/jtrac/doc/src/index.xml =================================================================== --- trunk/jtrac/doc/src/index.xml 2021-11-08 13:03:51 UTC (rev 1407) +++ trunk/jtrac/doc/src/index.xml 2021-11-09 09:20:17 UTC (rev 1408) @@ -1,1910 +1,1905 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" -"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - ---> - -<book> - <bookinfo> - <title>JTrac</title> - <subtitle>User / Developer Guide</subtitle> - <releaseinfo>2.2.0</releaseinfo> - <authorgroup> - <author> - <firstname>Peter</firstname> - <surname>Thomas</surname> - </author> - <author> - <firstname>Manfred</firstname> - <surname>Wolff</surname> - </author> - </authorgroup> - </bookinfo> - - <toc/> - - <preface id="preface"> - <title>Preface</title> - <para> - This document is a reference guide for <ulink url="http://jtrac.info">JTrac</ulink> - - the generic issue tracking web-application. This document is not only a user-guide - but can also serve as a reference for developers interested in contributing to JTrac. - </para> - <para> - This documentation has been generated using the DocBook configuration - used by the <ulink url="http://www.springframework.org">Spring</ulink> development team. - This particular simplified DocBook helper package was originally developed by Chris Bauer of the - <ulink url="http://www.hibernate.org">Hibernate</ulink> project. Thanks go out to all those who - perfected this very handy approach. - </para> - </preface> - - <chapter id="introduction"> - <title>Introduction</title> - <sect1 id="introduction-about"> - <title>About</title> - <para> - JTrac is a generic issue-tracking web-application that can be easily customized by adding - custom fields and drop-downs. Features include customizable workflow, field level permissions, - e-mail integration, file attachments and a detailed history view. - </para> - <para> - JTrac was created after the author felt that he could write a much better alternative to a - commercial defect tracking tool that he was having to use. Development started in 2004. - JTrac is ideal for issue tracking or bug-tracking, but it has been designed to be generic - and you can define custom fields to track almost anything you need. - </para> - <para> - JTrac development used to be hosted at <ulink url="https://jtrac.dev.java.net"/> but moved to SourceForge - in early 2006. The older working version was based on Spring MVC, Spring JDBC and MS Access and is not being - maintained any more. JTrac 2.0 uses Java 5.0 features and was completely re-written to use - <ulink url="http://www.hibernate.org/">Hibernate</ulink> for persistence and the - <ulink url="http://www.acegisecurity.org/">Acegi Security</ulink> framework for Spring. The presentation - layer for version 2.0 was mainly using - <ulink url="http://opensource.atlassian.com/confluence/spring/display/WEBFLOW/Home">Spring WebFlow</ulink> - but as of early 2007 (version 2.1.0 onwards) JTrac - <ulink url="http://ptrthomas.wordpress.com/2007/03/02/wicket-impressions-moving-from-spring-mvc-webflow/">switched to </ulink> - using the <ulink url="http://wicket.apache.org/">Apache Wicket</ulink> framework. - </para> - <para> - JTrac is extremely easy to install and the only pre-requisite is a Java 5 (or higher) Runtime Environment. - You can be up and running in seconds because JTrac comes bundled with a small-footprint web-application - server called <ulink url="http://jetty.mortbay.org/">Jetty</ulink> and an embedded database called - <ulink url="http://www.hsqldb.org/">HSQLDB</ulink>. Please refer to the - <link linkend="installation">installation</link> section of this documentation for details. - You can also choose to drop the WAR file into an application server of your choice and start using JTrac right away. - </para> - </sect1> - - <sect1 id="introduction-releasenotes"> - <title>Release Notes: Version 2.1.0</title> - <para> - There are no database changes between version 2.0 and 2.1.0. Instructions on how to upgrade are - available in the "<link linkend="upgrading">upgrading</link>" section of this document. The bundled - Jetty web-app server has been upgraded from version 6.0.2 to 6.1.1 but it is not mandatory that you - upgrade. - </para> - </sect1> - - <sect1 id="introduction-releasenotes-2_2"> - <title>Release Notes: Version 2.2.0</title> - <para> - There are no database changes between version 2.1.0 and 2.2.0. Instructions on how to upgrade are - available in the "<link linkend="upgrading">upgrading</link>" section of this document. - </para> - <para> - There where some minor changes and bugfixes: - <itemizedlist> - <listitem> - <para>It is possible to configure an individual header and an individual logo for your own JTrac.</para> - </listitem> - <listitem> - <para>Errors that were occured because of missing language ressources are fixed.</para> - </listitem> - <listitem> - <para>Some email-issues e.g. sending duplicate mails are fixed.</para> - </listitem> - </itemizedlist> - For details see the <ulink url="https://sourceforge.net/projects/j-trac/">different tracker at - the sourceforge website.</ulink> - </para> - </sect1> - </chapter> - - <chapter id="features"> - <title>Features</title> - <para> - JTrac has all the features that you would expect from a standard issue-tracking application such as - support for file-attachments and e-mail integration. JTrac offers powerful customization options, - especially in the areas of workflow and field-level permissions and compares well to even - commercial tools. - </para> - <sect1 id="features-easytoinstall"> - <title>Easy to Install</title> - <para> - One of the useful features of JTrac is that it is distributed with an embedded web-application server - (<ulink url="http://jetty.mortbay.org/">Jetty</ulink>) that has a very small footprint. - If you have Java 5 installed you can be up and running after downloading and extracting JTrac - by - simply using the provided start and stop scripts. JTrac scans its environment on startup and if a - configured database is not detected, <ulink url="http://www.hsqldb.org/">HSQLDB</ulink> is used by - default. - </para> - <para> - If you already have a web-application server that you wish to use (such as - <ulink url="http://tomcat.apache.org/">Tomcat</ulink>), you can just drop in the WAR file - provided and sign on into the application straight-away. - </para> - <para> - You can refer the <link linkend="installation">installation</link> section of this document for - more details. JTrac uses <ulink url="http://www.hibernate.org">Hibernate</ulink> and so it can - use any database <ulink url="http://www.hibernate.org/80.html">supported by Hibernate.</ulink> - </para> - </sect1> - <sect1 id="features-customfields"> - <title>Custom Fields</title> - <para> - JTrac can be used to effectively track various kinds of things such as Bugs, Action Items and Tasks. - You can easily add the following types of custom fields to a tracker Project (Space): - <itemizedlist> - <listitem> - <para>Drop Down List</para> - </listitem> - <listitem> - <para>Free Text Field</para> - </listitem> - <listitem> - <para>Date Picker</para> - </listitem> - <listitem> - <para>(Decimal) Number</para> - </listitem> - </itemizedlist> - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/custom-fields.png"/> - </imageobject> - <caption> - <para>Setting up custom fields for a project</para> - </caption> - </mediaobject> - </para> - <para> - There is a limit to how many custom fields of each type that you can configure for a Space. - These limits have been set after careful consideration and would very rarely fail to suffice. - They are as follows: Drop Down - 10, Free Text - 5, Numeric - 3, Date/Time - 3. - </para> - <para> - The screenshot below shows how creating a new item would look like for the typical - project (space) where 'Severity', 'Module', 'Type' and 'Priority' have been defined - as custom fields. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/item-create.png"/> - </imageobject> - <caption> - <para>Creating a new item</para> - </caption> - </mediaobject> - </para> - </sect1> - <sect1 id="features-customworkflow"> - <title>Custom Workflow</title> - <para> - Each tracker project that you create can have a different workflow. JTrac allows for - complete customization of the tracker-item lifecycle, right down to the names of - each intermediate state. It is possible to create very sophisticated workflows and a visual - "map" of the workflow being edited is displayed below the state-transition toggle-buttons - to make it easier to manage. - </para> - <para> - The default workflow shown below is ideal if you simply want to track issues with just - two states - Open and Closed. However, with just a few mouse clicks, you can turn this into - a complex workflow involving multiple states. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/custom-workflow-before.png"/> - </imageobject> - <caption> - <para>Default workflow - before customization</para> - </caption> - </mediaobject> - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/custom-workflow-after.png"/> - </imageobject> - <caption> - <para>Example of a workflow - after customization</para> - </caption> - </mediaobject> - </para> - <para> - You can even configure whether or not changing of values is permitted given the current state - within the workflow - and that too at a field-level. This flexibility allows for some - interesting possibilities. For example, assume that you want to maintain a "percentage complete" - field that can be updated at any time during the life-cycle of an item. The screenshot below - demonstrates how you can set up a drop down field called "% Complete": - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/percent-complete-field.png"/> - </imageobject> - <caption> - <para>Setting up of a drop down custom field called "% Complete"</para> - </caption> - </mediaobject> - </para> - <para> - Then when customizing the roles and field-level permissions, all you need to do is specify that - the "% Complete" field is editable even when the status is "Open". - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/percent-complete-roles.png"/> - </imageobject> - <caption> - <para>Making a custom field editable when updating an item (after new item has been created)</para> - </caption> - </mediaobject> - </para> - <para> - This results in the "% Complete" field being available for updating whenever anyone views an item - with a status of "Open". Notice also how the "% Complete" field is added as a column to the "History" - section so that the complete history of changes to this custom field can be viewed. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/percent-complete-history.png"/> - </imageobject> - <caption> - <para>Example of a custom field that can be updated even when status is "Open"</para> - </caption> - </mediaobject> - </para> - </sect1> - <sect1 id="features-history"> - <title>Detailed History View</title> - <para> - JTrac provides a very detailed history view that completely captures all comments or status - changes for an item. The history can be seen when viewing an item as shown above. - </para> - </sect1> - <sect1 id="features-attachments"> - <title>Attachments Support</title> - <para> - You can upload file attachments at the time of creating of an item or as many times - as required after an item has been created. - </para> - </sect1> - <sect1 id="features-customroles"> - <title>Custom Roles</title> - <para> - JTrac customization does not stop at workflow - you can also define different roles for each tracker - project that you set up. This allows for power and flexibility. For example you could enforce that - a "DEVELOPER" role can only mark "Assigned" items as "Fixed" and that only a "TESTER" role has the - power to mark a "Fixed" item as "Closed". You can even disallow selected roles from being able to - create new items. JTrac gives you complete control over the workflow and you can easily tweak it - to fit your existing process rather than the other way around. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/custom-roles.png"/> - </imageobject> - <caption> - <para>Example of workflow where each role has clearly defined responsibilities.</para> - </caption> - </mediaobject> - </para> - <para> - In the example above, the roles highlighted in red on the visual "map" of the workflow being edited - mean that at these points in the workflow - a user with the given role can assign only to other roles. - So in this case, the TESTER can assign a New item only to a DEVELOPER role and not another TESTER. - And when an item is in the "Assigned" state, a DEVELOPER can only assign to a TESTER when changing the - status to "Fixed" or "Rejected". - </para> - <para> - Field-level permissions can be mapped to roles which allows for even more flexibility. - For example, you can set a project up so that only a "MANAGER" can change the "Severity" level - after a bug is submitted. JTrac makes it possible for you to define very complex workflows, complete - with both Status and Role dependent field-level permissions, and you can do all this within a - single admin screen. - </para> - </sect1> - <sect1 id="features-search"> - <title>Search Custom Fields</title> - <para> - The intuitive search screen (shown below) allows for easy execution of common queries such as - find all items "logged by" or "assigned to" a user (or users). JTrac allows for filtering even - on custom fields. - </para> - <para> - You can navigate back to the search setup screen from the search results screen and have the - search parameters still active. This is useful when trying to tweak complex queries by - trial and error. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/search.png"/> - </imageobject> - <caption> - <para>The search screen - which allows filtering on custom fields</para> - </caption> - </mediaobject> - </para> - </sect1> - <sect1 id="features-dashboard"> - <title>Dashboard</title> - <para> - The default view when you log into JTrac is a very handy dashboard view that provides the most - frequently used statistics at a glance. You can click on any of the numbers to immediately bring up - the search results view listing the items matched. For example, clicking on the count of items - "Logged By Me" would immediately display the list of items initiated by the currently logged in user. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/dashboard.png"/> - </imageobject> - <caption> - <para>Statistics at a glance and search results available with just one click</para> - </caption> - </mediaobject> - </para> - <para> - For each Space, you can also drill-down to a finer level of detail by clicking on the right-arrow - 'expand' icon. This expands the dashboard rows so that you can see a break-up of item counts, not only by - whether 'logged by me' / 'assigned to me' - but against the custom workflow states defined for - the Space as well. Again, it is possible to directly navigate to the items by clicking on the dashboard numbers. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/dashboard-expanded.png"/> - </imageobject> - <caption> - <para>Expanded statistics for a Space showing counts by workflow status</para> - </caption> - </mediaobject> - </para> - </sect1> - <sect1 id="features-searchall"> - <title>Search Across All Projects</title> - <para> - In addition to be able to search within a single space (project) JTrac allows for searching across - all (or a sub set of) projects that a user is mapped to. For example, in the screenshot of the - dashboard above, there are two projects. The "SEARCH" link at the top of the page (as well as the "search" - link on the "totals" row) would bring up the search wizard that can search across all (or a subset of) - the spaces assigned to the currently logged in user. - </para> - </sect1> - <sect1 id="features-textsearch"> - <title>Full Text Search</title> - <para> - The summary and even the detailed descriptions of items are indexed and can be searched. - Note that if you are upgrading or migrating databases, you may need to "re-index" which - is an option available to admin users. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/full-text-search.png"/> - </imageobject> - <caption> - <para>Lucene powered full text search with wildcard support</para> - </caption> - </mediaobject> - </para> - </sect1> - <sect1 id="features-excel"> - <title>Export to Excel</title> - <para> - JTrac is able to export the results of any search (or all items in a Space) as an Excel Sheet. - The link for this appears at the top right of the search results screen. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/excel-link.png"/> - </imageobject> - <caption> - <para>Download search results as an excel sheet</para> - </caption> - </mediaobject> - </para> - <para> - One the data is in a spreadsheet, it is very easy to analyze data and do things - like creating pivot-tables and charts. Many users use the 'export to Excel' feature - to fulfil custom reporting requirements. - </para> - </sect1> - <sect1 id="features-navigation"> - <title>Simple Navigation</title> - <para> - Most users will use only five screens in JTrac: Dashboard, Create, View, Search and Results. - Navigation has been designed with usability and simplicity in mind. A screenshot of the - search results screen is shown below. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/search-results.png"/> - </imageobject> - <caption> - <para>The search results screen</para> - </caption> - </mediaobject> - </para> - </sect1> - <sect1 id="features-related"> - <title>Cross Referencing of Items</title> - <para> - You can establish bi-directional links between items. For example you can mark an item as - being a "duplicate of" another item. You can easily navigate to related items (and back) when - viewing any particular item. - </para> - <para> - The option to add related items is available when viewing an item after it is created. - The navigation is designed so that you have the option to execute a search before selecting an - item to cross-reference. - </para> - </sect1> - <sect1 id="features-guest"> - <title>Read-Only Access</title> - <para> - When setting up a Space you can define whether this space can be viewed by users without - having to log-in. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/guest-allowed.png"/> - </imageobject> - <caption> - <para>Specify if read-only anonymous access is allowed per-space</para> - </caption> - </mediaobject> - </para> - </sect1> - <sect1 id="features-email"> - <title>E-mail Integration</title> - <para> - All status changes for an item will trigger e-mail notifications by default. - You can choose to add multiple users into a "notify list" at the time of raising a new item - or updating the history for an item. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/notify-list.png"/> - </imageobject> - <caption> - <para>Add multiple users to a "notify list" while creating or updating an item</para> - </caption> - </mediaobject> - </para> - <para> - The e-mail content is very nicely formatted HTML and is laid out in the same way as how the screen looks - within JTrac when viewing an item. Users do not need to get used to a different or possibly - less pleasing format such as plain-text. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/email-notification.png"/> - </imageobject> - <caption> - <para>Example of an e-mail sent by JTrac</para> - </caption> - </mediaobject> - </para> - <para> - Admin users can configure the SMTP / e-mail server that JTrac should use in the - "<link linkend="installation-settings">Manage Settings</link>" page. - This page can be accessed from the "OPTIONS" menu. JTrac also can handle an e-mail server that requires - authentication or even a secure connection over HTTPS. - </para> - </sect1> - <sect1 id="features-i18n"> - <title>Multi-Language Support</title> - <para> - JTrac has complete internationalization support and you can change the user interface language instantly - by editing your user-profile. Adding a translation is very easy and does not require any - Java development expertise. See <link linkend="dev-translating">this section</link> of the developer - guide for more details and please consider contributing translations to the JTrac project. - </para> - <para> - JTrac has already been translated into the following languages: - </para> - <para> - <itemizedlist> - <listitem> - <para> - Arabic - ar - </para> - </listitem> - <listitem> - <para> - Czech - cs - </para> - </listitem> - <listitem> - <para> - German - de - </para> - </listitem> - <listitem> - <para> - Greek - el - </para> - </listitem> - <listitem> - <para> - Spanish - es - </para> - </listitem> - <listitem> - <para> - Spanish (Argentina) - es_AR - </para> - </listitem> - <listitem> - <para> - Spanish (Mexico) - es_MX - </para> - </listitem> - <listitem> - <para> - French - fr - </para> - </listitem> - <listitem> - <para> - Hungarian - hu - </para> - </listitem> - <listitem> - <para> - Italian - it - </para> - </listitem> - <listitem> - <para> - Japanese - ja - </para> - </listitem> - <listitem> - <para> - Korean - ko - </para> - </listitem> - <listitem> - <para> - Dutch - nl - </para> - </listitem> - <listitem> - <para> - Polish - pl - </para> - </listitem> - <listitem> - <para> - Portugese (Brazil) - pt_BR - </para> - </listitem> - <listitem> - <para> - Russian - ru - </para> - </listitem> - <listitem> - <para> - Russian - ru - </para> - </listitem> - <listitem> - <para> - Slovenian - sl - </para> - </listitem> - <listitem> - <para> - Swedish - sv - </para> - </listitem> - <listitem> - <para> - Chinese (China) - zh_CN - </para> - </listitem> - <listitem> - <para> - Chinese (Taiwan) - zh_TW - </para> - </listitem> - </itemizedlist> - </para> - </sect1> - <sect1 id="features-ldap"> - <title>LDAP / CAS authentication support</title> - <para> - JTrac has built-in support for authenticating user credentials against an LDAP or Active Directory server. - Please refer the <link linkend="installation-ldap">LDAP section</link> of the installation guide for more details. - </para> - <para> - JTrac also has support for integrating with a - <ulink url="http://www.ja-sig.org/products/cas/">Central Authentication Service</ulink> (CAS) installation. - The install guide has more details on - <link linkend="installation-cas">how to configure single sign-on using CAS</link>. - </para> - </sect1> - </chapter> - - <chapter id="installation"> - <title>Installation</title> - <sect1 id="installation-prerequisites"> - <title>Prerequisites</title> - <para> - All you require in order to start using JTrac is Java 5 (or higher). Only a JRE (Java Runtime Environment) - is required and not the full-blown JDK (Java Development Kit). - </para> - <para> - There is a good chance that Java is already installed on your system and you can verify whether it is ready - to run JTrac by opening a command prompt and typing the following command: - </para> - <para> - <programlisting> - -java -version - </programlisting> - </para> - <para> - If the system responds with a java version that is 1.5 or greater, you are ready to download and run JTrac. - </para> - <para> - You can download Java from here: <ulink url="http://www.java.com/download"/>. - </para> - </sect1> - <sect1 id="installation-quick"> - <title>Quick Installation</title> - <para> - Once you have Java you can start using JTrac right away because you do not need to configure a web-application - server or a database. JTrac embeds both of these (<ulink url="http://jetty.mortbay.org/">Jetty</ulink> and - <ulink url="http://www.hsqldb.org/">HSQLDB</ulink>) to make it easy for you to evaluate JTrac. - </para> - <para> - <itemizedlist> - <listitem> - <para> - First, download the latest release from - <ulink url="http://sourceforge.net/project/showfiles.php?group_id=162983&package_id=184104"> - the JTrac downloads area</ulink> - </para> - </listitem> - <listitem> - <para>Extract the zip file into a directory of your choice</para> - </listitem> - <listitem> - <para> - Double-click or run "start.bat" to start JTrac - </para> - </listitem> - <listitem> - <para>Point your web-browser to <ulink url="http://localhost/jtrac"/></para> - </listitem> - <listitem> - <para>Sign on with the user name "admin" and password "admin"</para> - </listitem> - <listitem> - <para>Start using JTrac</para> - </listitem> - </itemizedlist> - </para> - <para> - You can use the "stop.bat" script to stop the application. The "start.bat" file configures the - Jetty server to use port 80 which you can easily change by editing "start.bat". You may need to do this - if for example JTrac does not start because a web-server (like Apache or IIS) is already running on port 80. - </para> - <para> - Remote users should be able to access JTrac over the network by using the machine name instead of "localhost" - in the URL shown above. If there is a problem, it could be due to a firewall running on the machine where JTrac - is installed - and you may have to reconfigure things so that for example "java.exe" is not blocked. - </para> - <sect2 id="installation-quick-linux"> - <title>Notes for Linux / Unix users</title> - <para> - If you are not on Windows, you may want to rename the start and stop *.bat files to e.g. *.sh for Linux - (*.bat is reported to work for Ubuntu). The commands within the batch files will work unchanged as long as - Java has been installed correctly i.e. "java" is in the PATH and it is the expected 1.5 or greater version. - You may need to do things like apply executable permissions to the batch files on Linux, e.g. "chmod +x *.bat". - And also - unless you have "root" permissions, you may face problems starting services on port 80 etc. - </para> - <para> - You can also read this forum thread for more details: <ulink url="http://sourceforge.net/forum/forum.php?thread_id=1971135&forum_id=552477">link</ulink> - </para> - </sect2> - <sect2 id="installation-quick-othernotes"> - <title>Security and Backup</title> - <para> - For security reasons, it is best that you change the default "admin" password after installing - JTrac, especially if you are going to make the application accessible on a public-facing web-site - over the internet. - </para> - <para> - JTrac by default will use a "data" directory that will be automatically created - within the root folder "jtrac". The data directory will contain the files needed by HSQLDB - (the embedded database) as well as hold uploaded attachments. When using JTrac in production, - this is the location that you should consider <link linkend="installation-backup">backing-up</link> - on a regular basis. - </para> - </sect2> - </sect1> - <sect1 id="installation-settings"> - <title>Settings</title> - <para> - For e-mail notifications to work, an SMTP server needs to be configured in JTrac. - Users who have the ADMIN role will be able to access the JTrac configuration settings - screen from a link on the "OPTIONS" screen. Note that you will need to provide values - for the "mail.from" and the "jtrac.url.base" properties also, for things like the hyperlinks - within e-mail to work properly. JTrac also supports mail servers that require authentication - or secure connections using SSL. You can refer the descriptions of the available configuration - property settings available from the settings screen as shown below. - </para> - <para> - If you have trouble getting e-mail to work, one of the things to watch out for is whether - there is any firewall blocking the communication between JTrac and the mail server - for example - you may have a firewall runnning on the machine where JTrac is installed. It is very common - for mail servers to be configured to prevent mail-relay requests from unknown applications or - IP addresses so you may need to check with your mail server administrator. - </para> - <para> - <mediaobject> - <imageobject role="html"> - <imagedata align="center" fileref="../images/settings.png"/> - </imageobject> - <caption> - <para>The JTrac settings screen where you can configure an e-mail / SMTP server</para> - </caption> - </mediaobject> - </para> - <para> - JTrac also can lookup and use a JNDI mail session (javax.mail.Session) if required. If you - provide a JNDI name, JTrac will ignore the SMTP server details provided. - </para> - - <para> - JTrac provides also other settings for an individual Headline (jtrac.header.text) and an - individual logo on the right side (jtrac.header.text). If no logo is set the original - JTrac logo is shown. If the jtrac.edit.item configuration item is set to true people may - edit their own items while no change is happens (editable item up to the first history entry). - Admins are always able to change the original item text. - </para> - - </sect1> - <sect1 id="installation-war"> - <title>Using only the WAR file</title> - <para> - JTrac is designed so that you can be up and running by just deploying the WAR file into your - existing web-application server. Note that you need a servlet 2.4 compliant container. - For example, if you have <ulink url="http://tomcat.apache.org/">Apache Tomcat</ulink> 5.5.X, - you can either copy the WAR file into the [tomcat.home]/webapps folder or choose to upload - the WAR file through the Tomcat console. - </para> - <para> - JTrac saves database information and uploaded attachments into a directory on the server. - This directory is logically called the "jtrac.home". When you do a "quick-install" of JTrac - by just deploying the WAR file, JTrac creates a ".jtrac" folder in the user home folder and - uses that location as the home directory. This is great for quickly evaluating JTrac but - when you actually use JTrac in production you should configure the JTrac home directory as - a location that can easily be backed-up for example. - </para> - </sect1> - <sect1 id="installation-custom"> - <title>Custom Installation</title> - <para> - To customize the location of "jtrac.home" you have the following three options. On startup, JTrac tries to - detect the value of "jtrac.home", and checks the following configuration options in the order listed below. - </para> - <sect2 id="installation-custom-initprops"> - <title>Edit the "jtrac-init.properties" file</title> - <para> - If you explode (unzip) the WAR file, you can edit the /WEB-INF/classes/jtrac-init.properties file - and customize the location of "jtrac.home". Note that you can choose to deploy JTrac as an exploded-war - and it is not mandatory that you re-package (zip) the WAR file after editing "jtrac-init.properties". - </para> - </sect2> - <sect2 id="installation-custom-servletparams"> - <title>Set a Servlet context parameter</title> - <para> - For example you can specify the jtrac.home using the Tomcat administration console or as - follows using a <Context> parameter. - </para> - <para> - <programlisting> - <![CDATA[ -<Context docBase="${catalina.home}/jtrac/jtrac.war"> - <Parameter name="jtrac.home" value="C:/data/jtrac_home"/> -</Context> ]]> - </programlisting> - </para> - </sect2> - <sect2 id="installation-custom-systemparams"> - <title>Set a System / JVM parameter</title> - <para> - If you can easily set a system property called "jtrac.home" within the environment of your - application server then you don't need to edit the WAR file. Please look at the contents of "start.bat" - to see an example of how the appropriate JVM (Java Virtual Machine) parameters can be set when deploying JTrac. - For example, if you are using <ulink url="http://tomcat.apache.org/">Apache Tomcat</ulink> 5.5.X, you can - set an environment variable called JAVA_OPTS before invoking the startup script (startup.bat / startup.sh). - Here is an example for Tomcat 5.5.X on Windows: - </para> - <para> - <programlisting> - -set JAVA_OPTS=-Djtrac.home=C:/data/jtrac_home -Dfile.encoding=UTF-8 - </programlisting> - </para> - <para> - If "jtrac.home" has not been configured in any of the above ways, JTrac will create a folder called - ".jtrac" in the user home directory and proceed to use that as "jtrac.home". - </para> - </sect2> - </sect1> - <sect1 id="installation-database"> - <title>Using a different database such as MySQL</title> - <para> - You can configure the database that JTrac uses by editing the "jtrac.properties" file that JTrac expects - within the "jtrac.home" folder. Note that if JTrac does not find a "jtrac.properties" file in the - expected location, JTrac creates a fresh one which is pre-configured for HSQLDB. The default contents of - this file are as follows: - </para> - <para> - <programlisting> - -database.driver=org.hsqldb.jdbcDriver -database.url=jdbc:hsqldb:file:${jtrac.home}/db/jtrac -database.username=sa -database.password= -hibernate.dialect=org.hibernate.dialect.HSQLDialect -hibernate.show_sql=false - </programlisting> - </para> - <para> - You can edit the values above to match the settings of a database that you wish to use. - Please refer to your database JDBC driver documentation for the values needed for - the driver and URL. You can look up the Hibernate dialect corresponding to your database type - from <ulink url="http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html#configuration-optional-dialects">this list</ulink>. - When using a custom database such as MySQL, you have to create an empty database before starting JTrac. - When JTrac starts, it will connect to the configured database and create the schema (database tables) - if not already present. - </para> - <para> - If you edit the "jtrac.properties" file, ensure that there are no trailing spaces in the entries shown above - (especially when cutting and pasting from somewhere). This can save you a lot of frustration! - </para> - <para> - Don't forget to make the database driver available for the web-application. If you are using the bundled - Jetty web-app server, this is as simple as placing the jar file in the "lib" folder along with the - jetty jar files. If you are using Tomcat, you can either place the jar file under "shared/lib" or within - the "/WEB-INF/lib" folder of the "jtrac" (exploded) WAR itself. - </para> - <para> - Given below is a sample jtrac.properties file for MySQL. It assumes that you have created a new database - called "jtrac". Using the default "root" user is obviously not advisable from a security point of view - and you should try and have a separate user for the database used by JTrac. - <programlisting> - -database.driver=com.mysql.jdbc.Driver -database.url=jdbc:mysql://localhost/jtrac -database.username=root -database.password= -hibernate.dialect=org.hibernate.dialect.MySQLDialect -hibernate.show_sql=false - </programlisting> - </para> - <para> - For MySQL, do not use the "autoReconnect=true" parameter in the MySQL URL, this is - <ulink url="http://dev.mysql.com/doc/connector/j/en/connector-j-usagenotes-j2ee.html#connector-j-usagenotes-tomcat">not recommended</ulink> - by the MySQL team. The <ulink url="http://jakarta.apache.org/commons/dbcp/">Apache DBCP</ulink> - connection pool used internally by JTrac is configured to refresh stale database connections. - </para> - <para> - You should also ensure that the database default character-set encoding is set correctly for - your requirements and UTF-8 is normally recommended. When setting up a fresh JTrac installation - on a non-default database such as MySQL, it is best that you do a small test by creating an item with - say Japanese or Chinese text in the summary or description. Verify that special characters - display correctly when viewing the item. Also check if e-mail notifications look okay as well. - </para> - <para> - If your database default character set is not what is expected you can consider setting it - explicitly for the database to be used by JTrac. For example if using MySQL, you can create the - database specifying the character set to be used like this: - <programlisting> - -create database jtrac charset utf8; - </programlisting> - And then you can force the encoding used by database connections in the JDBC URL. This is - how the corresponding line in "jtrac.properties" will look like: - <programlisting> - -database.url=jdbc:mysql://localhost/jtrac?useEncoding=true&characterEncoding=utf8 - </programlisting> - </para> - <para> - The default query to test idle database connections is "SELECT 1". This has been reported - to not work for databases such as Derby and Progress because they consider this invalid SQL. You can - customize the validation query by adding a "database.validationQuery" property in "jtrac.properties. - If you set the validation query to an empty string, this effectively disables the periodic testing of - idle database connections that Apache DBCP performs. - </para> - </sect1> - <sect1 id="installation-jndi-datasource"> - <title>Using a JNDI Datasource</title> - <para> - You can provide a JNDI datasource name as an additional property called "database.datasource.jndiname" - in the "jtrac.properties" file. JTrac will ignore the other database properties in this case. - </para> - </sect1> - <sect1 id="installation-ldap"> - <title>Configuring LDAP Authentication</title> - <para> - A couple of extra entries in "jtrac.properties" are required in order to configure LDAP authentication. - JTrac will attempt LDAP authentication if an "ldap.url" config entry is present. - </para> - <para> - <programlisting> - -ldap.url=ldap://myldaphost -ldap.searchBase=DC=foo,DC=bar,DC=org - </programlisting> - </para> - <para> - The following additional entry is recommended if you are using Active Directory. This switches on an - LDAP optimization that is specific to Active Directory. - </para> - <para> - <programlisting> - -ldap.activeDirectoryDomain=MYDOMAIN - </programlisting> - </para> - <para> - The benefit of LDAP authentication is that users can sign-on to JTrac by using their existing LDAP credentials - (username and password). At the moment, LDAP support is limited to authentication and not authorization. - Users still have to be created by an administrator and mapped to the relevant Spaces using the JTrac - administration screens before they can start using JTrac. - </para> - </sect1> - <sect1 id="installation-cas"> - <title>Integrating with CAS for Single Sign On</title> - <para> - In order to integrate JTrac with <ulink url="http://www.ja-sig.org/products/cas/">CAS</ulink> - you have to edit a couple of XML files within the "WEB-INF" folder ('web.xml' and 'applicationContext-acegi-cas.xml'). - The changes that you need to make are described below. - </para> - <sect2 id="installation-cas-webxml"> - <title>Changes to web.xml</title> - <para> - <itemizedlist> - <listitem> - <para> - Change "applicationContext-acegi.xml" to "applicationContext-acegi-cas.xml". - This appears towards the start of the file in the 'contextConfigLocation' context-param. - </para> - </listitem> - <listitem> - <para> - Uncomment the filter and filter-mapping XML for the 'acegi' FilterToBeanProxy - </para> - </listitem> - <listitem> - <para> - Uncomment the servlet and servlet-mapping XML for the 'casProxy' ProxyTicketReceptor. - You should also uncomment the associated context-param called 'edu.yale.its.tp.cas.proxyUrl' - and customize the value for your environment. - </para> - </listitem> - </itemizedlist> - </para> - </sect2> - <sect2 id="installation-cas-appcontext"> - <title>Changes to applicationContext-acegi-cas.xml</title> - <para> - In the XML corresponding to bean id "casProxyTicketValidator" - edit the following - property values to suit your environment: - </para> - <para> - <itemizedlist> - <listitem> - <para> - casValidate - </para> - </listitem> - <listitem> - <para> - proxyCallbackUrl - </para> - </listitem> - <listitem> - <para> - trustStore - </para> - </listitem> - <listitem> - <para> - loginUrl - </para> - </listitem> - <listitem> - <para> - logoutUrl - </para> - </listitem> - </itemizedlist> - </para> - <para> - For more details and troubleshooting, you can refer to the - <ulink url="http://www.acegisecurity.org/guide/springsecurity.html#cas-client">Acegi documentation on CAS integration</ulink>. - </para> - </sect2> - </sect1> - <sect1 id="installation-windowsservice"> - <title>Installing as a Windows Service</title> - <para> - Note that this approach can reportedly apply to other operating systems. If you have been able to do - this successfully on Linux or Mac environments, please consider contributing some documentation on this. - </para> - <para> - If you choose to use the bundled <ulink url="http://jetty.mortbay.org/">Jetty</ulink> web-application - server, you can easily install JTrac as a Windows service so that it can start automatically when - the host machine is switched on. One of the big advantages of this is that the console window will be invisible - and will run in the background. You can therefore avoid the possibility of the Jetty server getting - terminated because somebody decided to close "that pesky DOS Window that gets in the way". Having JTrac - start automatically... [truncated message content] |
From: <udi...@us...> - 2021-11-10 12:09:59
|
Revision: 1413 http://sourceforge.net/p/j-trac/code/1413 Author: udittmer Date: 2021-11-10 12:09:56 +0000 (Wed, 10 Nov 2021) Log Message: ----------- finetuning; resurrect doc build system Modified Paths: -------------- trunk/jtrac/doc/build.xml trunk/jtrac/doc/src/index.xml trunk/jtrac/doc/styles/fopdf.xsl trunk/jtrac/doc/styles/html.xsl trunk/jtrac/doc/styles/html_chunk.xsl trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java Modified: trunk/jtrac/doc/build.xml =================================================================== --- trunk/jtrac/doc/build.xml 2021-11-10 09:37:33 UTC (rev 1412) +++ trunk/jtrac/doc/build.xml 2021-11-10 12:09:56 UTC (rev 1413) @@ -1,83 +1,83 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project name="jtrac-doc" basedir=".." default="doc"> - - <property name="doc.src.dir" value="doc"/> - <property name="dist.doc.dir" value="target/site/doc"/> - - <target name="doc" depends="clean, doc-html, doc-html-single, doc-pdf"/> - - <target name="clean"> - <delete includeemptydirs="true" failonerror="false"> - <fileset dir="${dist.doc.dir}"/> - </delete> - </target> - - <target name="copy-images"> - <mkdir dir="${dist.doc.dir}/images"/> - <copy todir="${dist.doc.dir}/images"> - <fileset dir="${doc.src.dir}/src/images"/> - </copy> - <mkdir dir="${dist.doc.dir}/styles"/> - <copy todir="${dist.doc.dir}/styles"> - <fileset dir="${doc.src.dir}/styles" includes="*.css"/> - </copy> - </target> - - <target name="doc-pdf" depends="copy-images"> - <mkdir dir="${dist.doc.dir}/pdf"/> - <java classname="com.icl.saxon.StyleSheet" fork="true"> - <classpath> - <fileset dir="${doc.src.dir}/lib"> - <include name="**/*.jar"/> - </fileset> - </classpath> - <jvmarg value="-Xmx256M"/> - <arg value="-o"/> - <arg value="${dist.doc.dir}/pdf/docbook_fop.tmp"/> - <arg value="${doc.src.dir}/src/index.xml"/> - <arg value="${doc.src.dir}/styles/fopdf.xsl"/> - </java> - <java classname="org.apache.fop.apps.Fop" fork="true" maxmemory="256m"> - <classpath> - <fileset dir="${doc.src.dir}/lib"> - <include name="**/*.jar"/> - </fileset> - </classpath> - <arg value="${dist.doc.dir}/pdf/docbook_fop.tmp"/> - <arg value="${dist.doc.dir}/pdf/jtrac-doc.pdf"/> - </java> - <delete file="${dist.doc.dir}/pdf/docbook_fop.tmp"/> - </target> - - <target name="doc-html" depends="copy-images"> - <mkdir dir="${dist.doc.dir}/html"/> - <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${dist.doc.dir}/html"> - <classpath> - <fileset dir="${doc.src.dir}/lib"> - <include name="**/*.jar"/> - </fileset> - </classpath> - <jvmarg value="-Xmx256M"/> - <arg value="${basedir}/${doc.src.dir}/src/index.xml"/> - <arg value="${basedir}/${doc.src.dir}/styles/html_chunk.xsl"/> - </java> - </target> - - <target name="doc-html-single" depends="copy-images"> - <mkdir dir="${dist.doc.dir}/html-single"/> - <java classname="com.icl.saxon.StyleSheet" fork="true"> - <classpath> - <fileset dir="${doc.src.dir}/lib"> - <include name="**/*.jar"/> - </fileset> - </classpath> - <jvmarg value="-Xmx256M"/> - <arg value="-o"/> - <arg value="${dist.doc.dir}/html-single/index.html"/> - <arg value="${doc.src.dir}/src/index.xml"/> - <arg value="${doc.src.dir}/styles/html.xsl"/> - </java> - </target> - -</project> \ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?> + +<project name="jtrac-doc" basedir=".." default="doc"> + + <property name="doc.src.dir" value="doc"/> + <property name="dist.doc.dir" value="target/site/doc"/> + + <target name="doc" depends="clean, doc-html, doc-html-single, doc-pdf"/> + + <target name="clean"> + <delete includeemptydirs="true" failonerror="false"> + <fileset dir="${dist.doc.dir}"/> + </delete> + </target> + + <target name="copy-images"> + <mkdir dir="${dist.doc.dir}/images"/> + <copy todir="${dist.doc.dir}/images"> + <fileset dir="${doc.src.dir}/src/images"/> + </copy> + <mkdir dir="${dist.doc.dir}/styles"/> + <copy todir="${dist.doc.dir}/styles"> + <fileset dir="${doc.src.dir}/styles" includes="*.css"/> + </copy> + </target> + + <target name="doc-pdf" depends="copy-images"> + <mkdir dir="${dist.doc.dir}/pdf"/> + <java classname="com.icl.saxon.StyleSheet" fork="true"> + <classpath> + <fileset dir="${doc.src.dir}/lib"> + <include name="**/*.jar"/> + </fileset> + </classpath> + <jvmarg value="-Xmx256M"/> + <arg value="-o"/> + <arg value="${dist.doc.dir}/pdf/docbook_fop.tmp"/> + <arg value="${doc.src.dir}/src/index.xml"/> + <arg value="${doc.src.dir}/styles/fopdf.xsl"/> + </java> + <java classname="org.apache.fop.cli.Main" fork="true" maxmemory="256m"> + <classpath> + <fileset dir="${doc.src.dir}/lib"> + <include name="**/*.jar"/> + </fileset> + </classpath> + <arg value="${dist.doc.dir}/pdf/docbook_fop.tmp"/> + <arg value="${dist.doc.dir}/pdf/jtrac-doc.pdf"/> + </java> + <delete file="${dist.doc.dir}/pdf/docbook_fop.tmp"/> + </target> + + <target name="doc-html" depends="copy-images"> + <mkdir dir="${dist.doc.dir}/html"/> + <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${dist.doc.dir}/html"> + <classpath> + <fileset dir="${doc.src.dir}/lib"> + <include name="**/*.jar"/> + </fileset> + </classpath> + <jvmarg value="-Xmx256M"/> + <arg value="${basedir}/${doc.src.dir}/src/index.xml"/> + <arg value="${basedir}/${doc.src.dir}/styles/html_chunk.xsl"/> + </java> + </target> + + <target name="doc-html-single" depends="copy-images"> + <mkdir dir="${dist.doc.dir}/html-single"/> + <java classname="com.icl.saxon.StyleSheet" fork="true"> + <classpath> + <fileset dir="${doc.src.dir}/lib"> + <include name="**/*.jar"/> + </fileset> + </classpath> + <jvmarg value="-Xmx256M"/> + <arg value="-o"/> + <arg value="${dist.doc.dir}/html-single/index.html"/> + <arg value="${doc.src.dir}/src/index.xml"/> + <arg value="${doc.src.dir}/styles/html.xsl"/> + </java> + </target> + +</project> Modified: trunk/jtrac/doc/src/index.xml =================================================================== --- trunk/jtrac/doc/src/index.xml 2021-11-10 09:37:33 UTC (rev 1412) +++ trunk/jtrac/doc/src/index.xml 2021-11-10 12:09:56 UTC (rev 1413) @@ -18,7 +18,7 @@ <surname>Thomas</surname> </author> <author> - <firstname>Ul</firstname> + <firstname>Ulf</firstname> <surname>Dittmer</surname> </author> </authorgroup> @@ -68,9 +68,11 @@ but as of early 2007 (version 2.1.0 onwards) JTrac <ulink url="https://ptrthomas.wordpress.com/2007/03/02/wicket-impressions-moving-from-spring-mvc-webflow/">switched to </ulink> using the <ulink url="https://wicket.apache.org/">Apache Wicket</ulink> framework. + After being dormant for a long time, JTrac development picked up again in 2021, and a new version 2.2 was + released that moved the Java baseline to Java 8. </para> <para> - JTrac is extremely easy to install and the only pre-requisite is a Java 6 (or higher) Runtime Environment. + JTrac is extremely easy to install and the only pre-requisite is a Java 8 (or higher) Runtime Environment. You can be up and running in seconds because JTrac comes bundled with a small-footprint web-application server called <ulink url="https://www.eclipse.org/jetty/">Jetty</ulink> and an embedded database called <ulink url="https://www.hsqldb.org/">HSQLDB</ulink>. Please refer to the @@ -125,7 +127,7 @@ <para> One of the useful features of JTrac is that it is distributed with an embedded web-application server (<ulink url="https://www.eclipse.org/jetty/">Jetty</ulink>) that has a very small footprint. - If you have Java 5 installed you can be up and running after downloading and extracting JTrac - by + If you have Java 8 installed you can be up and running after downloading and extracting JTrac - by simply using the provided start and stop scripts. JTrac scans its environment on startup and if a configured database is not detected, <ulink url="https://www.hsqldb.org/">HSQLDB</ulink> is used by default. </para> Modified: trunk/jtrac/doc/styles/fopdf.xsl =================================================================== --- trunk/jtrac/doc/styles/fopdf.xsl 2021-11-10 09:37:33 UTC (rev 1412) +++ trunk/jtrac/doc/styles/fopdf.xsl 2021-11-10 12:09:56 UTC (rev 1413) @@ -15,7 +15,7 @@ --> <!DOCTYPE xsl:stylesheet [ - <!ENTITY db_xsl_path "../lib/docbook-xsl/"> + <!ENTITY db_xsl_path "http://docbook.sourceforge.net/release/xsl/current/"> <!ENTITY admon_gfx_path "../images/admons/"> <!ENTITY copyright "©"> ]> Modified: trunk/jtrac/doc/styles/html.xsl =================================================================== --- trunk/jtrac/doc/styles/html.xsl 2021-11-10 09:37:33 UTC (rev 1412) +++ trunk/jtrac/doc/styles/html.xsl 2021-11-10 12:09:56 UTC (rev 1413) @@ -14,7 +14,7 @@ --> <!DOCTYPE xsl:stylesheet [ - <!ENTITY db_xsl_path "../lib/docbook-xsl/"> + <!ENTITY db_xsl_path "http://docbook.sourceforge.net/release/xsl/current/"> <!ENTITY callout_gfx_path "../images/callouts/"> <!ENTITY admon_gfx_path "../images/admons/"> ]> Modified: trunk/jtrac/doc/styles/html_chunk.xsl =================================================================== --- trunk/jtrac/doc/styles/html_chunk.xsl 2021-11-10 09:37:33 UTC (rev 1412) +++ trunk/jtrac/doc/styles/html_chunk.xsl 2021-11-10 12:09:56 UTC (rev 1413) @@ -15,7 +15,7 @@ --> <!DOCTYPE xsl:stylesheet [ - <!ENTITY db_xsl_path "../lib/docbook-xsl/"> + <!ENTITY db_xsl_path "http://docbook.sourceforge.net/release/xsl/current/"> <!ENTITY callout_gfx_path "../images/callouts/"> <!ENTITY admon_gfx_path "../images/admons/"> ]> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html 2021-11-10 09:37:33 UTC (rev 1412) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ConfigFormPage.html 2021-11-10 12:09:56 UTC (rev 1413) @@ -16,7 +16,7 @@ <a href="#" wicket:id="cancel"><img src="resources/cancel.gif" class="nav-link"/><wicket:message key="cancel"/></a> </form> <wicket:fragment wicket:id="textField"><input wicket:id="value"/></wicket:fragment> - <wicket:fragment wicket:id="numberField"><input type="number" min="0" wicket:id="value"/></wicket:fragment> + <wicket:fragment wicket:id="numberField"><input type="number" min="0" size="8" wicket:id="value"/></wicket:fragment> <wicket:fragment wicket:id="booleanField"><input type="hidden" wicket:id="value" id="valueField"/><div class="switch"></div></wicket:fragment> </wicket:extend> </body> Modified: trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java 2021-11-10 09:37:33 UTC (rev 1412) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java 2021-11-10 12:09:56 UTC (rev 1413) @@ -230,7 +230,7 @@ } }; if (ch.getNameText().equals("lastChanged")) { - // TODO: we can't sort by that column + // TODO: we can't sort by that column, so don't make it look like a link headingLink.add(new SimpleAttributeModifier("onclick", "")); } listItem.add(headingLink); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-11-19 11:13:48
|
Revision: 1417 http://sourceforge.net/p/j-trac/code/1417 Author: udittmer Date: 2021-11-19 11:13:45 +0000 (Fri, 19 Nov 2021) Log Message: ----------- clean up test cases Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/test/java/info/jtrac/JtracTest.java trunk/jtrac/src/test/java/info/jtrac/lucene/IndexSearcherTest.java Removed Paths: ------------- trunk/jtrac/src/test/java/info/jtrac/selenium/ trunk/jtrac/src/test/java/info/jtrac/wicket/ Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-11-19 08:25:43 UTC (rev 1416) +++ trunk/jtrac/pom.xml 2021-11-19 11:13:45 UTC (rev 1417) @@ -4,7 +4,7 @@ <groupId>info.jtrac</groupId> <artifactId>jtrac</artifactId> <packaging>war</packaging> - <version>2.2.0-b3</version> + <version>2.2.0</version> <name>JTrac</name> <description> JTrac is a generic issue-tracking web-application that can be easily customized by adding custom fields @@ -57,23 +57,6 @@ </developer> </developers> - <repositories> - <repository> - <id>openqa.org</id> - <name>selenium snapshot</name> - <url>https://repo.spring.io/plugins-release/</url> - <!-- - <url>http://maven.geomajas.org/</url> - <url>https://maven.onehippo.com/maven2/</url> - --> - <snapshots> - <enabled>true</enabled> - <updatePolicy>always</updatePolicy> - <checksumPolicy>warn</checksumPolicy> - </snapshots> - </repository> - </repositories> - <dependencies> <dependency> <groupId>junit</groupId> @@ -112,6 +95,10 @@ <exclusions> <exclusion> <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> <artifactId>spring-remoting</artifactId> </exclusion> <exclusion> @@ -441,20 +428,6 @@ <artifactId>commonmark-ext-autolink</artifactId> <version>0.18.0</version> </dependency> - <!-- - <dependency> - <groupId>org.openqa.selenium.client-drivers</groupId> - <artifactId>selenium-java-client-driver</artifactId> - <version>0.9.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.openqa.selenium.server</groupId> - <artifactId>selenium-server</artifactId> - <version>0.9.2</version> - <scope>test</scope> - </dependency> - --> </dependencies> <build> @@ -509,7 +482,7 @@ <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> - <version>9.4.43.v20210629</version> + <version>9.4.44.v20210927</version> <configuration> <systemProperties> <systemProperty> @@ -525,7 +498,6 @@ <version>2.22.2</version> <configuration> <excludes> - <exclude>info/jtrac/selenium/**</exclude> <exclude>info/jtrac/test/**</exclude> </excludes> </configuration> Modified: trunk/jtrac/src/test/java/info/jtrac/JtracTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/JtracTest.java 2021-11-19 08:25:43 UTC (rev 1416) +++ trunk/jtrac/src/test/java/info/jtrac/JtracTest.java 2021-11-19 11:13:45 UTC (rev 1417) @@ -1,415 +1,407 @@ -package info.jtrac; - -import info.jtrac.domain.Config; -import info.jtrac.domain.Counts; -import info.jtrac.domain.CountsHolder; -import info.jtrac.domain.Field; -import info.jtrac.domain.Item; -import info.jtrac.domain.ItemItem; -import info.jtrac.domain.ItemUser; -import info.jtrac.domain.Metadata; -import info.jtrac.domain.Space; -import info.jtrac.domain.User; -import info.jtrac.domain.State; -import info.jtrac.domain.UserSpaceRole; -import info.jtrac.util.ItemUtils; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.acegisecurity.GrantedAuthority; -import org.acegisecurity.userdetails.UserDetails; - -/** - * JUnit test cases for the business implementation as well as the DAO - * Tests assume that a database is available, and with HSQLDB around this is not - * an issue. - */ -public class JtracTest extends JtracTestBase { - - public JtracTest(String name) { - super(name); - } - - private Space getSpace() { - Space space = new Space(); - space.setPrefixCode("TEST"); - space.setName("Test Space"); - return space; - } - - private Metadata getMetadata() { - Metadata metadata = new Metadata(); - String xmlString = "<metadata><fields>" - + "<field name='cusInt01' label='Test Label'/>" - + "<field name='cusInt02' label='Test Label 2'/>" - + "</fields></metadata>"; - metadata.setXmlString(xmlString); - return metadata; - } - - private void cleanDatabase() { - jdbcTemplate.execute("delete from user_space_roles where id > 1"); - deleteFromTables(new String[] { - "history", - "items", - "spaces", - "metadata", - "space_sequence" - }); - jdbcTemplate.execute("delete from users where id > 1"); - } - - //========================================================================== - - public void testGeneratedPasswordIsAlwaysDifferent() { - String p1 = jtrac.generatePassword(); - String p2 = jtrac.generatePassword(); - assertTrue(!p1.equals(p2)); - } - - public void testEncodeClearTextPassword() { - assertEquals("21232f297a57a5a743894a0e4a801fc3", jtrac.encodeClearText("admin")); - } - - public void testMetadataInsertAndLoad() { - Metadata m1 = getMetadata(); - jtrac.storeMetadata(m1); - assertTrue(m1.getId() > 0); - Metadata m2 = jtrac.loadMetadata(m1.getId()); - assertTrue(m2 != null); - Map<Field.Name, Field> fields = m2.getFields(); - assertTrue(fields.size() == 2); - } - - public void testUserInsertAndLoad() { - User user = new User(); - user.setLoginName("test"); - user.setEmail("te...@jt..."); - jtrac.storeUser(user); - User user1 = jtrac.loadUser("test"); - assertTrue(user1.getEmail().equals("te...@jt...")); - User user2 = dao.findUsersByEmail("te...@jt...").get(0); - assertTrue(user2.getLoginName().equals("test")); - } - - public void testUserSpaceRolesInsert() { - Space space = getSpace(); - Metadata metadata = getMetadata(); - - space.setMetadata(metadata); - jtrac.storeSpace(space); - - User user = new User(); - user.setLoginName("test"); - - user.addSpaceWithRole(space, "ROLE_TEST"); - jtrac.storeUser(user); - - User u1 = jtrac.loadUser("test"); - - GrantedAuthority[] gas = u1.getAuthorities(); - assertEquals(1, gas.length); - assertEquals("ROLE_TEST:TEST", gas[0].getAuthority()); - - List<UserSpaceRole> userSpaceRoles = jtrac.findUserRolesForSpace(space.getId()); - assertEquals(1, userSpaceRoles.size()); - UserSpaceRole usr = userSpaceRoles.get(0); - assertEquals("test", usr.getUser().getLoginName()); - assertEquals("ROLE_TEST", usr.getRoleKey()); - - List<User> users = jtrac.findUsersForUser(u1); - assertEquals(1, users.size()); - - List<User> users2 = jtrac.findUsersForSpace(space.getId()); - assertEquals(1, users2.size()); - - } - - public void testConfigStoreAndLoad() { - Config config = new Config("testParam", "testValue"); - jtrac.storeConfig(config); - String value = jtrac.loadConfig("testParam"); - assertEquals("testValue", value); - } - - public void testStoreAndLoadUserWithAdminRole() { - User user = new User(); - user.setLoginName("test"); - user.addSpaceWithRole(null, "ROLE_ADMIN"); - jtrac.storeUser(user); - - UserDetails ud = jtrac.loadUserByUsername("test"); - - Set<String> set = new HashSet<String>(); - for (GrantedAuthority ga : ud.getAuthorities()) { - set.add(ga.getAuthority()); - } - - assertEquals(1, set.size()); - assertTrue(set.contains("ROLE_ADMIN")); - - } - - public void testDefaultAdminUserHasAdminRole() { - UserDetails ud = jtrac.loadUserByUsername("admin"); - Set<String> set = new HashSet<String>(); - for (GrantedAuthority ga : ud.getAuthorities()) { - set.add(ga.getAuthority()); - } - assertEquals(1, set.size()); - assertTrue(set.contains("ROLE_ADMIN")); - } - - public void testItemInsertAndCounts() { - Space s = getSpace(); - jtrac.storeSpace(s); - User u = new User(); - u.setLoginName("test"); - u.addSpaceWithRole(s, "DEFAULT"); - jtrac.storeUser(u); - Item i = new Item(); - i.setSpace(s); - i.setAssignedTo(u); - i.setLoggedBy(u); - i.setStatus(State.CLOSED); - jtrac.storeItem(i, null); - assertEquals(1, i.getSequenceNum()); - - CountsHolder ch = jtrac.loadCountsForUser(u); - assertEquals(1, ch.getTotalAssignedToMe()); - assertEquals(1, ch.getTotalLoggedByMe()); - assertEquals(1, ch.getTotalTotal()); - - Counts c = ch.getCounts().get(s.getId()); - assertEquals(1, c.getLoggedByMe()); - assertEquals(1, c.getAssignedToMe()); - assertEquals(1, c.getTotal()); - } - - public void testRemoveSpaceRoleDoesNotOrphanDatabaseRecord() { - Space space = getSpace(); - jtrac.storeSpace(space); - long spaceId = space.getId(); - User user = new User(); - user.setLoginName("test"); - user.addSpaceWithRole(space, "ROLE_ADMIN"); - jtrac.storeUser(user); - long id = jdbcTemplate.queryForLong("select id from user_space_roles where space_id = " + spaceId); - UserSpaceRole usr = jtrac.loadUserSpaceRole(id); - assertEquals(spaceId, usr.getSpace().getId()); - jtrac.removeUserSpaceRole(usr); - setComplete(); - endTransaction(); - assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where space_id = " + spaceId)); - cleanDatabase(); - } - - public void testFindSpacesWhereGuestAllowed() { - Space space = getSpace(); - space.setGuestAllowed(true); - jtrac.storeSpace(space); - assertEquals(1, jtrac.findSpacesWhereGuestAllowed().size()); - } - - public void testRenameSpaceRole() { - Space space = getSpace(); - jtrac.storeSpace(space); - User u = new User(); - u.setLoginName("test"); - u.addSpaceWithRole(space, "DEFAULT"); - jtrac.storeUser(u); - assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'")); - jtrac.bulkUpdateRenameSpaceRole(space, "DEFAULT", "NEWDEFAULT"); - assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'")); - assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'NEWDEFAULT'")); - } - - public void testGetItemAsHtmlDoesNotThrowException() { - Config config = new Config("mail.server.host", "dummyhost"); - jtrac.storeConfig(config); - // now email sending is switched on - Space s = getSpace(); - jtrac.storeSpace(s); - User u = new User(); - u.setLoginName("test"); - u.setName("Test User"); - u.setEmail("test"); - u.addSpaceWithRole(s, "DEFAULT"); - jtrac.storeUser(u); - Item i = new Item(); - i.setSpace(s); - i.setAssignedTo(u); - i.setLoggedBy(u); - i.setStatus(State.CLOSED); - // next step will internally try to render item as Html for sending e-mail - jtrac.storeItem(i, null); - String rendered = ItemUtils.getAsXml(i).asXML(); - assertTrue(rendered.contains("<item refId=\"TEST-")); - } - - public void testDeleteItemThatHasRelatedItems() { - Space s = getSpace(); - jtrac.storeSpace(s); - User u = new User(); - u.setLoginName("test"); - u.setEmail("dummy"); - u.addSpaceWithRole(s, "DEFAULT"); - jtrac.storeUser(u); - //======================== - Item i0 = new Item(); - i0.setSpace(s); - i0.setAssignedTo(u); - i0.setLoggedBy(u); - i0.setStatus(State.CLOSED); - jtrac.storeItem(i0, null); - //======================= - Item i1 = new Item(); - i1.setSpace(s); - i1.setAssignedTo(u); - i1.setLoggedBy(u); - i1.setStatus(State.CLOSED); - i1.addRelated(i0, ItemItem.DEPENDS_ON); - jtrac.storeItem(i1, null); - //======================== - Item i2 = new Item(); - i2.setSpace(s); - i2.setAssignedTo(u); - i2.setLoggedBy(u); - i2.setStatus(State.CLOSED); - i2.addRelated(i1, ItemItem.DUPLICATE_OF); - jtrac.storeItem(i2, null); - assertEquals(3, jtrac.loadCountOfHistoryInvolvingUser(u)); - // can we remove i1? - Item temp = jtrac.loadItem(i1.getId()); - jtrac.removeItem(temp); - } - - public void testDeletingUserDeletesItemUsersAlso() { - Space s = getSpace(); - jtrac.storeSpace(s); - User u = new User(); - u.setLoginName("test"); - u.setEmail("dummy"); - u.addSpaceWithRole(s, "DEFAULT"); - jtrac.storeUser(u); - //======================== - Item i = new Item(); - i.setSpace(s); - i.setAssignedTo(u); - i.setLoggedBy(u); - i.setStatus(State.CLOSED); - //======================== - // another user to "watch" this item - User w = new User(); - w.setLoginName("test1"); - w.setEmail("dummy"); - w.addSpaceWithRole(s, "DEFAULT"); - jtrac.storeUser(w); - ItemUser iu = new ItemUser(w); - Set<ItemUser> ius = new HashSet<ItemUser>(); - ius.add(iu); - i.setItemUsers(ius); - //======================== - jtrac.storeItem(i, null); - setComplete(); - endTransaction(); - - startNewTransaction(); - jtrac.removeUser(w); - setComplete(); - endTransaction(); - - startNewTransaction(); - Item dummyItem = jtrac.loadItem(i.getId()); - assertEquals(0, dummyItem.getItemUsers().size()); - - cleanDatabase(); - - } - - public void testLogicToFindNotUsersAndSpacesNotAllocated() { - - cleanDatabase(); - - Space s1 = getSpace(); - Metadata m1 = getMetadata(); - m1.initRoles(); - s1.setMetadata(m1); - jtrac.storeSpace(s1); - - Space s2 = getSpace(); - s2.setPrefixCode("TEST2"); - Metadata m2 = getMetadata(); - m2.initRoles(); - s2.setMetadata(m2); - jtrac.storeSpace(s2); - - User u1 = new User(); - u1.setLoginName("test"); - - u1.addSpaceWithRole(s1, "DEFAULT"); - jtrac.storeUser(u1); - - List<Space> list = jtrac.findSpacesNotFullyAllocatedToUser(u1.getId()); - assertEquals(2, list.size()); - - jtrac.storeUserSpaceRole(u1, s1, "ROLE_ADMIN"); - - List<Space> list2 = jtrac.findSpacesNotFullyAllocatedToUser(u1.getId()); - assertEquals(1, list2.size()); - - User u2 = new User(); - u2.setLoginName("test2"); - jtrac.storeUser(u2); - - List<User> list3 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); - // admin user exists also - assertEquals(2, list3.size()); - - jtrac.storeUserSpaceRole(u2, s1, "DEFAULT"); - - List<User> list4 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); - logger.info(list4); - assertEquals(2, list4.size()); - - - jtrac.storeUserSpaceRole(u2, s1, "ROLE_ADMIN"); - - List<User> list5 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); - assertEquals(1, list5.size()); - - } - - public void testFindSuperUsers() { - - List<User> list1 = dao.findSuperUsers(); - assertEquals(1, list1.size()); - assertEquals("admin", list1.get(0).getLoginName()); - - User u1 = new User(); - u1.setLoginName("test2"); - jtrac.storeUser(u1); - - jtrac.storeUserSpaceRole(u1, null, "ROLE_ADMIN"); - - List<User> list2 = dao.findSuperUsers(); - assertEquals(2, list2.size()); - - } - - public void testLoadSpaceRolesMapForUser() { - - User u1 = new User(); - u1.setLoginName("test2"); - jtrac.storeUser(u1); - - jtrac.storeUserSpaceRole(u1, null, "ROLE_ADMIN"); - - Map<Long, List<UserSpaceRole>> map = jtrac.loadSpaceRolesMapForUser(u1.getId()); - assertEquals(1, map.size()); - - } - -} +package info.jtrac; + +import info.jtrac.domain.Config; +import info.jtrac.domain.Counts; +import info.jtrac.domain.CountsHolder; +import info.jtrac.domain.Field; +import info.jtrac.domain.Item; +import info.jtrac.domain.ItemItem; +import info.jtrac.domain.ItemUser; +import info.jtrac.domain.Metadata; +import info.jtrac.domain.Space; +import info.jtrac.domain.User; +import info.jtrac.domain.State; +import info.jtrac.domain.UserSpaceRole; +import info.jtrac.util.ItemUtils; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.acegisecurity.GrantedAuthority; +import org.acegisecurity.userdetails.UserDetails; + +/** + * JUnit test cases for the business implementation as well as the DAO + * Tests assume that a database is available, and with HSQLDB around this is not an issue. + */ +public class JtracTest extends JtracTestBase { + + public JtracTest(String name) { + super(name); + } + + private Space getSpace() { + Space space = new Space(); + space.setPrefixCode("TEST"); + space.setName("Test Space"); + return space; + } + + private Metadata getMetadata() { + Metadata metadata = new Metadata(); + String xmlString = "<metadata><fields>" + + "<field name='cusInt01' label='Test Label'/>" + + "<field name='cusInt02' label='Test Label 2'/>" + + "</fields></metadata>"; + metadata.setXmlString(xmlString); + return metadata; + } + + private void cleanDatabase() { + jdbcTemplate.execute("delete from user_space_roles where id > 1"); + deleteFromTables(new String[] { + "history", + "items", + "spaces", + "metadata", + "space_sequence" + }); + jdbcTemplate.execute("delete from users where id > 1"); + } + + //========================================================================== + + public void testGeneratedPasswordIsAlwaysDifferent() { + String p1 = jtrac.generatePassword(); + String p2 = jtrac.generatePassword(); + assertTrue(!p1.equals(p2)); + } + + public void testEncodeClearTextPassword() { + assertEquals("21232f297a57a5a743894a0e4a801fc3", jtrac.encodeClearText("admin")); + } + + public void testMetadataInsertAndLoad() { + Metadata m1 = getMetadata(); + jtrac.storeMetadata(m1); + assertTrue(m1.getId() > 0); + Metadata m2 = jtrac.loadMetadata(m1.getId()); + assertTrue(m2 != null); + Map<Field.Name, Field> fields = m2.getFields(); + assertTrue(fields.size() == 2); + } + + public void testUserInsertAndLoad() { + User user = new User(); + user.setLoginName("test"); + user.setEmail("te...@jt..."); + jtrac.storeUser(user); + User user1 = jtrac.loadUser("test"); + assertTrue(user1.getEmail().equals("te...@jt...")); + User user2 = dao.findUsersByEmail("te...@jt...").get(0); + assertTrue(user2.getLoginName().equals("test")); + } + + public void testUserSpaceRolesInsert() { + Space space = getSpace(); + Metadata metadata = getMetadata(); + + space.setMetadata(metadata); + jtrac.storeSpace(space); + + User user = new User(); + user.setLoginName("test"); + + user.addSpaceWithRole(space, "ROLE_TEST"); + jtrac.storeUser(user); + + User u1 = jtrac.loadUser("test"); + + GrantedAuthority[] gas = u1.getAuthorities(); + assertEquals(1, gas.length); + assertEquals("ROLE_TEST:TEST", gas[0].getAuthority()); + + List<UserSpaceRole> userSpaceRoles = jtrac.findUserRolesForSpace(space.getId()); + assertEquals(1, userSpaceRoles.size()); + UserSpaceRole usr = userSpaceRoles.get(0); + assertEquals("test", usr.getUser().getLoginName()); + assertEquals("ROLE_TEST", usr.getRoleKey()); + + List<User> users = jtrac.findUsersForUser(u1); + assertEquals(1, users.size()); + + List<User> users2 = jtrac.findUsersForSpace(space.getId()); + assertEquals(1, users2.size()); + } + + public void testConfigStoreAndLoad() { + Config config = new Config("testParam", "testValue"); + jtrac.storeConfig(config); + String value = jtrac.loadConfig("testParam"); + assertEquals("testValue", value); + } + + public void testStoreAndLoadUserWithAdminRole() { + User user = new User(); + user.setLoginName("test"); + user.addSpaceWithRole(null, "ROLE_ADMIN"); + jtrac.storeUser(user); + + UserDetails ud = jtrac.loadUserByUsername("test"); + + Set<String> set = new HashSet<String>(); + for (GrantedAuthority ga : ud.getAuthorities()) { + set.add(ga.getAuthority()); + } + + assertEquals(1, set.size()); + assertTrue(set.contains("ROLE_ADMIN")); + } + + public void testDefaultAdminUserHasAdminRole() { + UserDetails ud = jtrac.loadUserByUsername("admin"); + Set<String> set = new HashSet<String>(); + for (GrantedAuthority ga : ud.getAuthorities()) { + set.add(ga.getAuthority()); + } + assertEquals(1, set.size()); + assertTrue(set.contains("ROLE_ADMIN")); + } + + public void testItemInsertAndCounts() { + Space s = getSpace(); + jtrac.storeSpace(s); + User u = new User(); + u.setLoginName("test"); + u.addSpaceWithRole(s, "DEFAULT"); + jtrac.storeUser(u); + Item i = new Item(); + i.setSpace(s); + i.setAssignedTo(u); + i.setLoggedBy(u); + i.setStatus(State.CLOSED); + jtrac.storeItem(i, null); + assertEquals(1, i.getSequenceNum()); + + CountsHolder ch = jtrac.loadCountsForUser(u); + assertEquals(1, ch.getTotalAssignedToMe()); + assertEquals(1, ch.getTotalLoggedByMe()); + assertEquals(1, ch.getTotalTotal()); + + Counts c = ch.getCounts().get(s.getId()); + assertEquals(1, c.getLoggedByMe()); + assertEquals(1, c.getAssignedToMe()); + assertEquals(1, c.getTotal()); + } + + public void testRemoveSpaceRoleDoesNotOrphanDatabaseRecord() { + Space space = getSpace(); + jtrac.storeSpace(space); + long spaceId = space.getId(); + User user = new User(); + user.setLoginName("test"); + user.addSpaceWithRole(space, "ROLE_ADMIN"); + jtrac.storeUser(user); + long id = jdbcTemplate.queryForLong("select id from user_space_roles where space_id = " + spaceId); + UserSpaceRole usr = jtrac.loadUserSpaceRole(id); + assertEquals(spaceId, usr.getSpace().getId()); + jtrac.removeUserSpaceRole(usr); + setComplete(); + endTransaction(); + assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where space_id = " + spaceId)); + cleanDatabase(); + } + + public void testFindSpacesWhereGuestAllowed() { + Space space = getSpace(); + space.setGuestAllowed(true); + jtrac.storeSpace(space); + assertEquals(1, jtrac.findSpacesWhereGuestAllowed().size()); + } + + public void testRenameSpaceRole() { + Space space = getSpace(); + jtrac.storeSpace(space); + User u = new User(); + u.setLoginName("test"); + u.addSpaceWithRole(space, "DEFAULT"); + jtrac.storeUser(u); + assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'")); + jtrac.bulkUpdateRenameSpaceRole(space, "DEFAULT", "NEWDEFAULT"); + assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'")); + assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'NEWDEFAULT'")); + } + + public void testGetItemAsHtmlDoesNotThrowException() { + Config config = new Config("mail.server.host", "dummyhost"); + jtrac.storeConfig(config); + // now email sending is switched on + Space s = getSpace(); + jtrac.storeSpace(s); + User u = new User(); + u.setLoginName("test"); + u.setName("Test User"); + u.setEmail("test"); + u.addSpaceWithRole(s, "DEFAULT"); + jtrac.storeUser(u); + Item i = new Item(); + i.setSpace(s); + i.setAssignedTo(u); + i.setLoggedBy(u); + i.setStatus(State.CLOSED); + // next step will internally try to render item as Html for sending e-mail + jtrac.storeItem(i, null); + String rendered = ItemUtils.getAsXml(i).asXML(); + assertTrue(rendered.contains("<item refId=\"TEST-")); + } + + public void testDeleteItemThatHasRelatedItems() { + Space s = getSpace(); + jtrac.storeSpace(s); + User u = new User(); + u.setLoginName("test"); + u.setEmail("dummy"); + u.addSpaceWithRole(s, "DEFAULT"); + jtrac.storeUser(u); + //======================== + Item i0 = new Item(); + i0.setSpace(s); + i0.setAssignedTo(u); + i0.setLoggedBy(u); + i0.setStatus(State.CLOSED); + jtrac.storeItem(i0, null); + //======================= + Item i1 = new Item(); + i1.setSpace(s); + i1.setAssignedTo(u); + i1.setLoggedBy(u); + i1.setStatus(State.CLOSED); + i1.addRelated(i0, ItemItem.DEPENDS_ON); + jtrac.storeItem(i1, null); + //======================== + Item i2 = new Item(); + i2.setSpace(s); + i2.setAssignedTo(u); + i2.setLoggedBy(u); + i2.setStatus(State.CLOSED); + i2.addRelated(i1, ItemItem.DUPLICATE_OF); + jtrac.storeItem(i2, null); + assertEquals(3, jtrac.loadCountOfHistoryInvolvingUser(u)); + // can we remove i1? + Item temp = jtrac.loadItem(i1.getId()); + jtrac.removeItem(temp); + } + + public void testDeletingUserDeletesItemUsersAlso() { + Space s = getSpace(); + jtrac.storeSpace(s); + User u = new User(); + u.setLoginName("test"); + u.setEmail("dummy"); + u.addSpaceWithRole(s, "DEFAULT"); + jtrac.storeUser(u); + //======================== + Item i = new Item(); + i.setSpace(s); + i.setAssignedTo(u); + i.setLoggedBy(u); + i.setStatus(State.CLOSED); + //======================== + // another user to "watch" this item + User w = new User(); + w.setLoginName("test1"); + w.setEmail("dummy"); + w.addSpaceWithRole(s, "DEFAULT"); + jtrac.storeUser(w); + ItemUser iu = new ItemUser(w); + Set<ItemUser> ius = new HashSet<ItemUser>(); + ius.add(iu); + i.setItemUsers(ius); + //======================== + jtrac.storeItem(i, null); + setComplete(); + endTransaction(); + + startNewTransaction(); + jtrac.removeUser(w); + setComplete(); + endTransaction(); + + startNewTransaction(); + Item dummyItem = jtrac.loadItem(i.getId()); + assertEquals(0, dummyItem.getItemUsers().size()); + + cleanDatabase(); + } + + public void testLogicToFindNotUsersAndSpacesNotAllocated() { + cleanDatabase(); + + Space s1 = getSpace(); + Metadata m1 = getMetadata(); + m1.initRoles(); + s1.setMetadata(m1); + jtrac.storeSpace(s1); + + Space s2 = getSpace(); + s2.setPrefixCode("TEST2"); + Metadata m2 = getMetadata(); + m2.initRoles(); + s2.setMetadata(m2); + jtrac.storeSpace(s2); + + User u1 = new User(); + u1.setLoginName("test"); + + u1.addSpaceWithRole(s1, "DEFAULT"); + jtrac.storeUser(u1); + + List<Space> list = jtrac.findSpacesNotFullyAllocatedToUser(u1.getId()); + assertEquals(2, list.size()); + + jtrac.storeUserSpaceRole(u1, s1, "ROLE_ADMIN"); + + List<Space> list2 = jtrac.findSpacesNotFullyAllocatedToUser(u1.getId()); + assertEquals(1, list2.size()); + + User u2 = new User(); + u2.setLoginName("test2"); + jtrac.storeUser(u2); + + List<User> list3 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); + // admin user exists also + assertEquals(2, list3.size()); + + jtrac.storeUserSpaceRole(u2, s1, "DEFAULT"); + + List<User> list4 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); + logger.info(list4); + assertEquals(2, list4.size()); + + + jtrac.storeUserSpaceRole(u2, s1, "ROLE_ADMIN"); + + List<User> list5 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); + assertEquals(1, list5.size()); + } + + public void testFindSuperUsers() { + + List<User> list1 = dao.findSuperUsers(); + assertEquals(1, list1.size()); + assertEquals("admin", list1.get(0).getLoginName()); + + User u1 = new User(); + u1.setLoginName("test2"); + jtrac.storeUser(u1); + + jtrac.storeUserSpaceRole(u1, null, "ROLE_ADMIN"); + + List<User> list2 = dao.findSuperUsers(); + assertEquals(2, list2.size()); + } + + public void testLoadSpaceRolesMapForUser() { + + User u1 = new User(); + u1.setLoginName("test2"); + jtrac.storeUser(u1); + + jtrac.storeUserSpaceRole(u1, null, "ROLE_ADMIN"); + + Map<Long, List<UserSpaceRole>> map = jtrac.loadSpaceRolesMapForUser(u1.getId()); + assertEquals(1, map.size()); + } + +} Modified: trunk/jtrac/src/test/java/info/jtrac/lucene/IndexSearcherTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/lucene/IndexSearcherTest.java 2021-11-19 08:25:43 UTC (rev 1416) +++ trunk/jtrac/src/test/java/info/jtrac/lucene/IndexSearcherTest.java 2021-11-19 11:13:45 UTC (rev 1417) @@ -1,60 +1,60 @@ -package info.jtrac.lucene; - -import info.jtrac.domain.Item; -import java.io.File; -import java.util.List; -import junit.framework.TestCase; -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.FileSystemXmlApplicationContext; - -public class IndexSearcherTest extends TestCase { - - private ApplicationContext context; - - @Override - public void setUp() { - File home = new File("target/home"); - if (!home.exists()) { - home.mkdir(); - } - File file = new File("target/home/indexes"); - if (!file.exists()) { - file.mkdir(); - } else { - for (File f : file.listFiles()) { - f.delete(); - } - } - System.setProperty("jtrac.home", home.getAbsolutePath()); - context = new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/applicationContext-lucene.xml"); - } - - public void testFindItemIdsBySearchingWithinSummaryAndDetailFields() throws Exception { - Item item = new Item(); - item.setId(1); - item.setSummary("this is a test summary"); - item.setDetail("the quick brown fox jumped over the lazy dogs"); - Indexer indexer = (Indexer) context.getBean("indexer"); - indexer.index(item); - IndexSearcher searcher = (IndexSearcher) context.getBean("indexSearcher"); - List list = searcher.findItemIdsContainingText("lazy"); - assertEquals(1, list.size()); - list = searcher.findItemIdsContainingText("foo"); - assertEquals(0, list.size()); - list = searcher.findItemIdsContainingText("summary"); - assertEquals(1, list.size()); - } - - public void testIfUmlautsCanBeIndexedAndSearchedFor() { - Item item = new Item(); - item.setId(1); - item.setSummary("this does not contain an umlaut"); - item.setDetail("there is an umlaut right here --> \xFCmlaut"); - Indexer indexer = (Indexer) context.getBean("indexer"); - indexer.index(item); - IndexSearcher searcher = (IndexSearcher) context.getBean("indexSearcher"); - List list = searcher.findItemIdsContainingText("\xFCmlaut"); - assertEquals(1, list.size()); - } - -} +package info.jtrac.lucene; + +import info.jtrac.domain.Item; +import java.io.File; +import java.util.List; +import junit.framework.TestCase; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.FileSystemXmlApplicationContext; + +public class IndexSearcherTest extends TestCase { + + private ApplicationContext context; + + @Override + public void setUp() { + File home = new File("target/home"); + if (!home.exists()) { + home.mkdir(); + } + File file = new File("target/home/indexes"); + if (!file.exists()) { + file.mkdir(); + } else { + for (File f : file.listFiles()) { + f.delete(); + } + } + System.setProperty("jtrac.home", home.getAbsolutePath()); + context = new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/applicationContext-lucene.xml"); + } + + public void testFindItemIdsBySearchingWithinSummaryAndDetailFields() throws Exception { + Item item = new Item(); + item.setId(1); + item.setSummary("this is a test summary"); + item.setDetail("the quick brown fox jumped over the lazy dogs"); + Indexer indexer = (Indexer) context.getBean("indexer"); + indexer.index(item); + IndexSearcher searcher = (IndexSearcher) context.getBean("indexSearcher"); + List list = searcher.findItemIdsContainingText("lazy"); + assertEquals(1, list.size()); + list = searcher.findItemIdsContainingText("foo"); + assertEquals(0, list.size()); + list = searcher.findItemIdsContainingText("summary"); + assertEquals(1, list.size()); + } + + public void testIfUmlautsCanBeIndexedAndSearchedFor() { + Item item = new Item(); + item.setId(1); + item.setSummary("this does not contain an umlaut"); + item.setDetail("there is an umlaut right here --> \u00fcmlaut"); + Indexer indexer = (Indexer) context.getBean("indexer"); + indexer.index(item); + IndexSearcher searcher = (IndexSearcher) context.getBean("indexSearcher"); + List list = searcher.findItemIdsContainingText("\u00fcmlaut"); + assertEquals(1, list.size()); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-11-22 13:24:21
|
Revision: 1418 http://sourceforge.net/p/j-trac/code/1418 Author: udittmer Date: 2021-11-22 13:24:18 +0000 (Mon, 22 Nov 2021) Log Message: ----------- move unit tests to JUnit 4, add HtmlUnit test in lieu of the deleted Selenium test Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/test/java/info/jtrac/JtracTest.java trunk/jtrac/src/test/java/info/jtrac/JtracTestBase.java trunk/jtrac/src/test/java/info/jtrac/domain/CountsTest.java trunk/jtrac/src/test/java/info/jtrac/domain/ExcelFileTest.java trunk/jtrac/src/test/java/info/jtrac/domain/FieldTest.java trunk/jtrac/src/test/java/info/jtrac/domain/ItemTest.java trunk/jtrac/src/test/java/info/jtrac/domain/MetadataTest.java trunk/jtrac/src/test/java/info/jtrac/domain/RoleTest.java trunk/jtrac/src/test/java/info/jtrac/domain/UserTest.java trunk/jtrac/src/test/java/info/jtrac/lucene/IndexSearcherTest.java trunk/jtrac/src/test/java/info/jtrac/svn/SvnTest.java trunk/jtrac/src/test/java/info/jtrac/util/ItemUtilsTest.java trunk/jtrac/src/test/java/info/jtrac/util/JtracConfigurerTest.java trunk/jtrac/src/test/java/info/jtrac/util/ValidationUtilsTest.java trunk/jtrac/src/test/java/info/jtrac/util/XmlUtilsTest.java Added Paths: ----------- trunk/jtrac/src/test/java/info/jtrac/htmlunit/ trunk/jtrac/src/test/java/info/jtrac/htmlunit/BasicTest.java Removed Paths: ------------- trunk/jtrac/src/test/java/info/jtrac/test/ Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/pom.xml 2021-11-22 13:24:18 UTC (rev 1418) @@ -64,6 +64,12 @@ <version>4.13.2</version> <scope>test</scope> </dependency> + <dependency> + <groupId>net.sourceforge.htmlunit</groupId> + <artifactId>htmlunit</artifactId> + <version>2.55.0</version> + <scope>test</scope> + </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> @@ -474,7 +480,7 @@ <goal>testCompile</goal> </goals> <configuration> - <skip>true</skip> + <skip>false</skip> </configuration> </execution> </executions> @@ -495,10 +501,11 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.22.2</version> + <version>3.0.0-M5</version> <configuration> <excludes> <exclude>info/jtrac/test/**</exclude> + <exclude>info/jtrac/JtracTest</exclude> </excludes> </configuration> </plugin> Modified: trunk/jtrac/src/test/java/info/jtrac/JtracTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/JtracTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/JtracTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -13,6 +13,7 @@ import info.jtrac.domain.State; import info.jtrac.domain.UserSpaceRole; import info.jtrac.util.ItemUtils; + import java.util.HashSet; import java.util.List; import java.util.Map; @@ -21,6 +22,8 @@ import org.acegisecurity.GrantedAuthority; import org.acegisecurity.userdetails.UserDetails; +import org.junit.*; + /** * JUnit test cases for the business implementation as well as the DAO * Tests assume that a database is available, and with HSQLDB around this is not an issue. @@ -62,26 +65,30 @@ //========================================================================== + @Test public void testGeneratedPasswordIsAlwaysDifferent() { String p1 = jtrac.generatePassword(); String p2 = jtrac.generatePassword(); - assertTrue(!p1.equals(p2)); + Assert.assertTrue(!p1.equals(p2)); } + @Test public void testEncodeClearTextPassword() { - assertEquals("21232f297a57a5a743894a0e4a801fc3", jtrac.encodeClearText("admin")); + Assert.assertEquals("21232f297a57a5a743894a0e4a801fc3", jtrac.encodeClearText("admin")); } + @Test public void testMetadataInsertAndLoad() { Metadata m1 = getMetadata(); jtrac.storeMetadata(m1); - assertTrue(m1.getId() > 0); + Assert.assertTrue(m1.getId() > 0); Metadata m2 = jtrac.loadMetadata(m1.getId()); - assertTrue(m2 != null); + Assert.assertTrue(m2 != null); Map<Field.Name, Field> fields = m2.getFields(); - assertTrue(fields.size() == 2); + Assert.assertTrue(fields.size() == 2); } + @Test public void testUserInsertAndLoad() { User user = new User(); user.setLoginName("test"); @@ -88,11 +95,12 @@ user.setEmail("te...@jt..."); jtrac.storeUser(user); User user1 = jtrac.loadUser("test"); - assertTrue(user1.getEmail().equals("te...@jt...")); + Assert.assertTrue(user1.getEmail().equals("te...@jt...")); User user2 = dao.findUsersByEmail("te...@jt...").get(0); - assertTrue(user2.getLoginName().equals("test")); + Assert.assertTrue(user2.getLoginName().equals("test")); } + @Test public void testUserSpaceRolesInsert() { Space space = getSpace(); Metadata metadata = getMetadata(); @@ -109,29 +117,31 @@ User u1 = jtrac.loadUser("test"); GrantedAuthority[] gas = u1.getAuthorities(); - assertEquals(1, gas.length); - assertEquals("ROLE_TEST:TEST", gas[0].getAuthority()); + Assert.assertEquals(1, gas.length); + Assert.assertEquals("ROLE_TEST:TEST", gas[0].getAuthority()); List<UserSpaceRole> userSpaceRoles = jtrac.findUserRolesForSpace(space.getId()); - assertEquals(1, userSpaceRoles.size()); + Assert.assertEquals(1, userSpaceRoles.size()); UserSpaceRole usr = userSpaceRoles.get(0); - assertEquals("test", usr.getUser().getLoginName()); - assertEquals("ROLE_TEST", usr.getRoleKey()); + Assert.assertEquals("test", usr.getUser().getLoginName()); + Assert.assertEquals("ROLE_TEST", usr.getRoleKey()); List<User> users = jtrac.findUsersForUser(u1); - assertEquals(1, users.size()); + Assert.assertEquals(1, users.size()); List<User> users2 = jtrac.findUsersForSpace(space.getId()); - assertEquals(1, users2.size()); + Assert.assertEquals(1, users2.size()); } + @Test public void testConfigStoreAndLoad() { Config config = new Config("testParam", "testValue"); jtrac.storeConfig(config); String value = jtrac.loadConfig("testParam"); - assertEquals("testValue", value); + Assert.assertEquals("testValue", value); } + @Test public void testStoreAndLoadUserWithAdminRole() { User user = new User(); user.setLoginName("test"); @@ -145,10 +155,11 @@ set.add(ga.getAuthority()); } - assertEquals(1, set.size()); - assertTrue(set.contains("ROLE_ADMIN")); + Assert.assertEquals(1, set.size()); + Assert.assertTrue(set.contains("ROLE_ADMIN")); } + @Test public void testDefaultAdminUserHasAdminRole() { UserDetails ud = jtrac.loadUserByUsername("admin"); Set<String> set = new HashSet<String>(); @@ -155,10 +166,11 @@ for (GrantedAuthority ga : ud.getAuthorities()) { set.add(ga.getAuthority()); } - assertEquals(1, set.size()); - assertTrue(set.contains("ROLE_ADMIN")); + Assert.assertEquals(1, set.size()); + Assert.assertTrue(set.contains("ROLE_ADMIN")); } + @Test public void testItemInsertAndCounts() { Space s = getSpace(); jtrac.storeSpace(s); @@ -172,19 +184,20 @@ i.setLoggedBy(u); i.setStatus(State.CLOSED); jtrac.storeItem(i, null); - assertEquals(1, i.getSequenceNum()); + Assert.assertEquals(1, i.getSequenceNum()); CountsHolder ch = jtrac.loadCountsForUser(u); - assertEquals(1, ch.getTotalAssignedToMe()); - assertEquals(1, ch.getTotalLoggedByMe()); - assertEquals(1, ch.getTotalTotal()); + Assert.assertEquals(1, ch.getTotalAssignedToMe()); + Assert.assertEquals(1, ch.getTotalLoggedByMe()); + Assert.assertEquals(1, ch.getTotalTotal()); Counts c = ch.getCounts().get(s.getId()); - assertEquals(1, c.getLoggedByMe()); - assertEquals(1, c.getAssignedToMe()); - assertEquals(1, c.getTotal()); + Assert.assertEquals(1, c.getLoggedByMe()); + Assert.assertEquals(1, c.getAssignedToMe()); + Assert.assertEquals(1, c.getTotal()); } + @Test public void testRemoveSpaceRoleDoesNotOrphanDatabaseRecord() { Space space = getSpace(); jtrac.storeSpace(space); @@ -195,21 +208,23 @@ jtrac.storeUser(user); long id = jdbcTemplate.queryForLong("select id from user_space_roles where space_id = " + spaceId); UserSpaceRole usr = jtrac.loadUserSpaceRole(id); - assertEquals(spaceId, usr.getSpace().getId()); + Assert.assertEquals(spaceId, usr.getSpace().getId()); jtrac.removeUserSpaceRole(usr); setComplete(); endTransaction(); - assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where space_id = " + spaceId)); + Assert.assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where space_id = " + spaceId)); cleanDatabase(); } + @Test public void testFindSpacesWhereGuestAllowed() { Space space = getSpace(); space.setGuestAllowed(true); jtrac.storeSpace(space); - assertEquals(1, jtrac.findSpacesWhereGuestAllowed().size()); + Assert.assertEquals(1, jtrac.findSpacesWhereGuestAllowed().size()); } + @Test public void testRenameSpaceRole() { Space space = getSpace(); jtrac.storeSpace(space); @@ -217,12 +232,13 @@ u.setLoginName("test"); u.addSpaceWithRole(space, "DEFAULT"); jtrac.storeUser(u); - assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'")); + Assert.assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'")); jtrac.bulkUpdateRenameSpaceRole(space, "DEFAULT", "NEWDEFAULT"); - assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'")); - assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'NEWDEFAULT'")); + Assert.assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'")); + Assert.assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'NEWDEFAULT'")); } + @Test public void testGetItemAsHtmlDoesNotThrowException() { Config config = new Config("mail.server.host", "dummyhost"); jtrac.storeConfig(config); @@ -243,9 +259,10 @@ // next step will internally try to render item as Html for sending e-mail jtrac.storeItem(i, null); String rendered = ItemUtils.getAsXml(i).asXML(); - assertTrue(rendered.contains("<item refId=\"TEST-")); + Assert.assertTrue(rendered.contains("<item refId=\"TEST-")); } + @Test public void testDeleteItemThatHasRelatedItems() { Space s = getSpace(); jtrac.storeSpace(s); @@ -277,12 +294,13 @@ i2.setStatus(State.CLOSED); i2.addRelated(i1, ItemItem.DUPLICATE_OF); jtrac.storeItem(i2, null); - assertEquals(3, jtrac.loadCountOfHistoryInvolvingUser(u)); + Assert.assertEquals(3, jtrac.loadCountOfHistoryInvolvingUser(u)); // can we remove i1? Item temp = jtrac.loadItem(i1.getId()); jtrac.removeItem(temp); } + @Test public void testDeletingUserDeletesItemUsersAlso() { Space s = getSpace(); jtrac.storeSpace(s); @@ -320,11 +338,12 @@ startNewTransaction(); Item dummyItem = jtrac.loadItem(i.getId()); - assertEquals(0, dummyItem.getItemUsers().size()); + Assert.assertEquals(0, dummyItem.getItemUsers().size()); cleanDatabase(); } + @Test public void testLogicToFindNotUsersAndSpacesNotAllocated() { cleanDatabase(); @@ -348,12 +367,12 @@ jtrac.storeUser(u1); List<Space> list = jtrac.findSpacesNotFullyAllocatedToUser(u1.getId()); - assertEquals(2, list.size()); + Assert.assertEquals(2, list.size()); jtrac.storeUserSpaceRole(u1, s1, "ROLE_ADMIN"); List<Space> list2 = jtrac.findSpacesNotFullyAllocatedToUser(u1.getId()); - assertEquals(1, list2.size()); + Assert.assertEquals(1, list2.size()); User u2 = new User(); u2.setLoginName("test2"); @@ -361,26 +380,25 @@ List<User> list3 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); // admin user exists also - assertEquals(2, list3.size()); + Assert.assertEquals(2, list3.size()); jtrac.storeUserSpaceRole(u2, s1, "DEFAULT"); List<User> list4 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); logger.info(list4); - assertEquals(2, list4.size()); + Assert.assertEquals(2, list4.size()); - jtrac.storeUserSpaceRole(u2, s1, "ROLE_ADMIN"); List<User> list5 = jtrac.findUsersNotFullyAllocatedToSpace(s1.getId()); - assertEquals(1, list5.size()); + Assert.assertEquals(1, list5.size()); } + @Test public void testFindSuperUsers() { - List<User> list1 = dao.findSuperUsers(); - assertEquals(1, list1.size()); - assertEquals("admin", list1.get(0).getLoginName()); + Assert.assertEquals(1, list1.size()); + Assert.assertEquals("admin", list1.get(0).getLoginName()); User u1 = new User(); u1.setLoginName("test2"); @@ -389,11 +407,11 @@ jtrac.storeUserSpaceRole(u1, null, "ROLE_ADMIN"); List<User> list2 = dao.findSuperUsers(); - assertEquals(2, list2.size()); + Assert.assertEquals(2, list2.size()); } + @Test public void testLoadSpaceRolesMapForUser() { - User u1 = new User(); u1.setLoginName("test2"); jtrac.storeUser(u1); @@ -401,7 +419,6 @@ jtrac.storeUserSpaceRole(u1, null, "ROLE_ADMIN"); Map<Long, List<UserSpaceRole>> map = jtrac.loadSpaceRolesMapForUser(u1.getId()); - assertEquals(1, map.size()); + Assert.assertEquals(1, map.size()); } - } Modified: trunk/jtrac/src/test/java/info/jtrac/JtracTestBase.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/JtracTestBase.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/JtracTestBase.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,38 +1,38 @@ -package info.jtrac; - -import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; - -/** - * base class for tests that can test either the service layer or dao or both - * using the Spring JUnit helper class with the long name, ensures that - * the applicationContext is only built once - */ -public abstract class JtracTestBase extends AbstractTransactionalDataSourceSpringContextTests { - - protected Jtrac jtrac; - protected JtracDao dao; - - public JtracTestBase(String name) { - super(name); - } - - // magically autowired by Spring JUnit support - public void setDao(JtracDao dao) { - this.dao = dao; - } - - // magically autowired by Spring JUnit support - public void setJtrac(Jtrac jtrac) { - this.jtrac = jtrac; - } - - @Override - protected String[] getConfigLocations() { - System.setProperty("jtrac.home", "target/home"); - return new String[] { - "file:src/main/webapp/WEB-INF/applicationContext.xml", - "file:src/main/webapp/WEB-INF/applicationContext-lucene.xml" - }; - } - -} +package info.jtrac; + +import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; + +/** + * base class for tests that can test either the service layer or dao or both + * using the Spring JUnit helper class with the long name, ensures that + * the applicationContext is only built once + */ +public abstract class JtracTestBase extends AbstractTransactionalDataSourceSpringContextTests { + + protected Jtrac jtrac; + protected JtracDao dao; + + public JtracTestBase(String name) { + super(name); + } + + // magically autowired by Spring JUnit support + public void setDao(JtracDao dao) { + this.dao = dao; + } + + // magically autowired by Spring JUnit support + public void setJtrac(Jtrac jtrac) { + this.jtrac = jtrac; + } + + @Override + protected String[] getConfigLocations() { + System.setProperty("jtrac.home", "target/home"); + return new String[] { + "file:src/main/webapp/WEB-INF/applicationContext.xml", + "file:src/main/webapp/WEB-INF/applicationContext-lucene.xml" + }; + } + +} Modified: trunk/jtrac/src/test/java/info/jtrac/domain/CountsTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/domain/CountsTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/domain/CountsTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,15 +1,17 @@ -package info.jtrac.domain; - -import java.util.HashMap; -import java.util.Map; -import junit.framework.TestCase; - -public class CountsTest extends TestCase { - - public void testCountsLogic() { - Counts c = new Counts(false); - c.add(Counts.ASSIGNED_TO_ME, 1, 5); - assertEquals(0, c.getTotal()); - assertEquals(5, c.getAssignedToMe()); - } -} +package info.jtrac.domain; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.*; + +public class CountsTest { + + @Test + public void testCountsLogic() { + Counts c = new Counts(false); + c.add(Counts.ASSIGNED_TO_ME, 1, 5); + Assert.assertEquals(0, c.getTotal()); + Assert.assertEquals(5, c.getAssignedToMe()); + } +} Modified: trunk/jtrac/src/test/java/info/jtrac/domain/ExcelFileTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/domain/ExcelFileTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/domain/ExcelFileTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,10 +1,12 @@ package info.jtrac.domain; import java.io.FileInputStream; -import junit.framework.TestCase; -public class ExcelFileTest extends TestCase { +import org.junit.*; + +public class ExcelFileTest { + @Test public void testLoadFile() throws Exception { // ExcelFile ef = new ExcelFile(new FileInputStream("src/test/resources/data.xls")); } Modified: trunk/jtrac/src/test/java/info/jtrac/domain/FieldTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/domain/FieldTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/domain/FieldTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -2,49 +2,56 @@ import info.jtrac.domain.Field; import info.jtrac.util.XmlUtils; -import junit.framework.TestCase; + +import org.junit.*; + import org.dom4j.Document; import org.dom4j.Element; -public class FieldTest extends TestCase { +public class FieldTest { + @Test public void testSetValidName() { Field field = new Field(); field.setName("cusInt01"); - assertEquals(field.getName().toString(), "cusInt01"); + Assert.assertEquals(field.getName().toString(), "cusInt01"); } + @Test public void testSetInValidNameFails() { Field field = new Field(); try { field.setName("foo"); - fail("How did we set an invalid name?"); + Assert.fail("How did we set an invalid name?"); } catch (Exception e) { // expected } } + @Test public void testConstructFromXml() { Document d = XmlUtils.parse("<field name='cusInt01' label='Test Label'/>"); Field field = new Field(d.getRootElement()); - assertEquals("cusInt01", field.getName().toString()); - assertEquals("Test Label", field.getLabel()); - assertEquals(field.isOptional(), false); + Assert.assertEquals("cusInt01", field.getName().toString()); + Assert.assertEquals("Test Label", field.getLabel()); + Assert.assertEquals(field.isOptional(), false); } + @Test public void testConstructFromXmlWithOptionalAttribute() { Document d = XmlUtils.parse("<field name='cusInt01' label='Test Label' optional='true'/>"); Field field = new Field(d.getRootElement()); - assertTrue(field.isOptional()); + Assert.assertTrue(field.isOptional()); } + @Test public void testGetAsXml() { Field field = new Field(); field.setName("cusInt01"); field.setLabel("Test Label"); Element e = field.getAsElement(); - assertEquals("cusInt01", e.attributeValue("name")); - assertEquals("Test Label", e.attributeValue("label")); + Assert.assertEquals("cusInt01", e.attributeValue("name")); + Assert.assertEquals("Test Label", e.attributeValue("label")); } } Modified: trunk/jtrac/src/test/java/info/jtrac/domain/ItemTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/domain/ItemTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/domain/ItemTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,14 +1,16 @@ package info.jtrac.domain; import info.jtrac.domain.Item; -import junit.framework.TestCase; -public class ItemTest extends TestCase { +import org.junit.*; +public class ItemTest { + + @Test public void testSetAndGetForCustomInteger() { Item item = new Item(); item.setCusInt01(5); - assertEquals(item.getCusInt01().intValue(), 5); + Assert.assertEquals(item.getCusInt01().intValue(), 5); } } Modified: trunk/jtrac/src/test/java/info/jtrac/domain/MetadataTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/domain/MetadataTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/domain/MetadataTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -5,9 +5,10 @@ import java.util.Map; import java.util.Set; -import junit.framework.TestCase; -public class MetadataTest extends TestCase { +import org.junit.*; + +public class MetadataTest { private Metadata getMetadata() { Metadata metadata = new Metadata(); @@ -19,23 +20,26 @@ return metadata; } + @Test public void testGetFieldByName() { Metadata m = getMetadata(); Field f = m.getField("cusInt01"); - assertEquals("Test Label", f.getLabel()); + Assert.assertEquals("Test Label", f.getLabel()); } + @Test public void testGetFieldsFromXml() { Metadata m = getMetadata(); Map<Field.Name, Field> fields = m.getFields(); - assertTrue(fields.size() == 2); + Assert.assertTrue(fields.size() == 2); Field[] fa = fields.values().toArray(new Field[0]); - assertEquals("cusInt01", fa[0].getName() + ""); - assertEquals("Test Label", fa[0].getLabel()); - assertEquals("cusInt02", fa[1].getName() + ""); - assertEquals("Test Label 2", fa[1].getLabel()); + Assert.assertEquals("cusInt01", fa[0].getName() + ""); + Assert.assertEquals("Test Label", fa[0].getLabel()); + Assert.assertEquals("cusInt02", fa[1].getName() + ""); + Assert.assertEquals("Test Label 2", fa[1].getLabel()); } + @Test public void testMetadataInheritance() { Metadata m1 = getMetadata(); Metadata m2 = new Metadata(); @@ -46,27 +50,29 @@ m2.setXmlString(xmlString); m2.setParent(m1); Map<Field.Name, Field> fields = m2.getFields(); - assertEquals(fields.size(), 4); + Assert.assertEquals(fields.size(), 4); Set<Field.Name> names = m2.getUnusedFieldNames(); - assertEquals(names.contains(Field.Name.CUS_INT_01), false); - assertEquals(names.contains(Field.Name.CUS_INT_04), false); - assertEquals(names.size(), Field.Name.values().length - 4); + Assert.assertEquals(names.contains(Field.Name.CUS_INT_01), false); + Assert.assertEquals(names.contains(Field.Name.CUS_INT_04), false); + Assert.assertEquals(names.size(), Field.Name.values().length - 4); } + @Test public void testInitRolesThenAddRolesAndStates() { Metadata m = new Metadata(); m.initRoles(); - assertEquals("New, Open and Closed available by default", 3, m.getStateCount()); - assertEquals("DEFAULT available by default", 1, m.getRoleCount()); + Assert.assertEquals("New, Open and Closed available by default", 3, m.getStateCount()); + Assert.assertEquals("DEFAULT available by default", 1, m.getRoleCount()); Field f = new Field(Field.Name.CUS_INT_01); m.add(f); - assertEquals(1, m.getFieldCount()); - assertEquals("New", m.getStatusValue(0)); - assertEquals("Open", m.getStatusValue(1)); - assertEquals("Closed", m.getStatusValue(99)); - assertEquals("", m.getStatusValue(50)); + Assert.assertEquals(1, m.getFieldCount()); + Assert.assertEquals("New", m.getStatusValue(0)); + Assert.assertEquals("Open", m.getStatusValue(1)); + Assert.assertEquals("Closed", m.getStatusValue(99)); + Assert.assertEquals("", m.getStatusValue(50)); } + @Test public void testGetEditableFields() { Metadata m = new Metadata(); m.initRoles(); @@ -74,17 +80,16 @@ m.add(f); // query for editable fields across all roles List<Field> fields = m.getEditableFields(); - assertEquals(0, fields.size()); + Assert.assertEquals(0, fields.size()); // query for editable fields for DEFAULT role and when status is OPEN fields = m.getEditableFields("DEFAULT", State.OPEN); - assertEquals(0, fields.size()); + Assert.assertEquals(0, fields.size()); // now make the field editable for given state and role m.switchMask(State.OPEN, "DEFAULT", "cusStr01"); // should now be editable when status is open fields = m.getEditableFields(); - assertEquals(1, fields.size()); + Assert.assertEquals(1, fields.size()); fields = m.getEditableFields("DEFAULT", State.OPEN); - assertEquals(1, fields.size()); - + Assert.assertEquals(1, fields.size()); } } Modified: trunk/jtrac/src/test/java/info/jtrac/domain/RoleTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/domain/RoleTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/domain/RoleTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,41 +1,44 @@ -package info.jtrac.domain; - -import info.jtrac.util.XmlUtils; - -import junit.framework.TestCase; -import org.dom4j.Document; - -public class RoleTest extends TestCase { - - public void testConstructFromXml() { - Document d = XmlUtils.parse("<role name='TESTER'>" + - "<state status='1'>" + - "<transition status='2'/>" + - "<transition status='3'/>" + - "<field name='cusInt01' mask='1'/>" + - "<field name='cusInt02' mask='2'/>" + - "</state>" + - "<state status='2'>" + - "<transition status='3'/>" + - "<field name='cusInt03' mask='1'/>" + - "<field name='cusInt04' mask='2'/>" + - "</state></role>"); - Role role = new Role(d.getRootElement()); - assertEquals("TESTER", role.getName()); - assertEquals(2, role.getStates().size()); - State s1 = role.getStates().get(1); - assertEquals(2, s1.getTransitions().size()); - assertTrue(s1.getTransitions().contains(2)); - assertTrue(s1.getTransitions().contains(3)); - assertEquals(2 , s1.getFields().size()); - assertEquals(new Integer(1), s1.getFields().get(Field.Name.CUS_INT_01)); - assertEquals(new Integer(2), s1.getFields().get(Field.Name.CUS_INT_02)); - } - - public void testForReservedRoleNames() { - assertTrue(Role.isReservedRoleKey("ROLE_ADMIN")); - assertTrue(Role.isReservedRoleKey("ROLE_GUEST")); - assertFalse(Role.isReservedRoleKey("ROLE_FOO")); - } - -} +package info.jtrac.domain; + +import info.jtrac.util.XmlUtils; + +import org.junit.*; + +import org.dom4j.Document; + +public class RoleTest { + + @Test + public void testConstructFromXml() { + Document d = XmlUtils.parse("<role name='TESTER'>" + + "<state status='1'>" + + "<transition status='2'/>" + + "<transition status='3'/>" + + "<field name='cusInt01' mask='1'/>" + + "<field name='cusInt02' mask='2'/>" + + "</state>" + + "<state status='2'>" + + "<transition status='3'/>" + + "<field name='cusInt03' mask='1'/>" + + "<field name='cusInt04' mask='2'/>" + + "</state></role>"); + Role role = new Role(d.getRootElement()); + Assert.assertEquals("TESTER", role.getName()); + Assert.assertEquals(2, role.getStates().size()); + State s1 = role.getStates().get(1); + Assert.assertEquals(2, s1.getTransitions().size()); + Assert.assertTrue(s1.getTransitions().contains(2)); + Assert.assertTrue(s1.getTransitions().contains(3)); + Assert.assertEquals(2 , s1.getFields().size()); + Assert.assertEquals(new Integer(1), s1.getFields().get(Field.Name.CUS_INT_01)); + Assert.assertEquals(new Integer(2), s1.getFields().get(Field.Name.CUS_INT_02)); + } + + @Test + public void testForReservedRoleNames() { + Assert.assertTrue(Role.isReservedRoleKey("ROLE_ADMIN")); + Assert.assertTrue(Role.isReservedRoleKey("ROLE_GUEST")); + Assert.assertFalse(Role.isReservedRoleKey("ROLE_FOO")); + } + +} Modified: trunk/jtrac/src/test/java/info/jtrac/domain/UserTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/domain/UserTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/domain/UserTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,17 +1,16 @@ package info.jtrac.domain; - import java.util.HashSet; import java.util.Set; -import junit.framework.TestCase; +import org.junit.*; import org.acegisecurity.GrantedAuthority; -public class UserTest extends TestCase { +public class UserTest { + @Test public void testGetAuthoritiesFromUserSpaceRoles() { - Space s1 = new Space(); s1.setPrefixCode("SPACE-ONE"); @@ -30,19 +29,19 @@ set.add(ga.getAuthority()); } - assertEquals(3, gas.length); + Assert.assertEquals(3, gas.length); - assertTrue(set.contains("ROLE_ONE-ONE:SPACE-ONE")); - assertTrue(set.contains("ROLE_ONE-TWO:SPACE-ONE")); - assertTrue(set.contains("ROLE_ADMIN")); - + Assert.assertTrue(set.contains("ROLE_ONE-ONE:SPACE-ONE")); + Assert.assertTrue(set.contains("ROLE_ONE-TWO:SPACE-ONE")); + Assert.assertTrue(set.contains("ROLE_ADMIN")); } + @Test public void testCheckIfAdminForAllSpaces() { User u = new User(); u.setLoginName("test"); u.addSpaceWithRole(null, "ROLE_ADMIN"); - assertTrue(u.isSuperUser()); + Assert.assertTrue(u.isSuperUser()); } } Added: trunk/jtrac/src/test/java/info/jtrac/htmlunit/BasicTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/htmlunit/BasicTest.java (rev 0) +++ trunk/jtrac/src/test/java/info/jtrac/htmlunit/BasicTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -0,0 +1,114 @@ +package info.jtrac.htmlunit; + +import java.io.IOException; + +import org.junit.*; +import org.junit.runners.MethodSorters; + +import com.gargoylesoftware.htmlunit.*; +import com.gargoylesoftware.htmlunit.html.*; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class BasicTest { + + private static WebClient webClient; + private static HtmlPage page; + + @BeforeClass + public static void init() throws Exception { + webClient = new WebClient(); + //webClient.getOptions().setThrowExceptionOnScriptError(false); + } + + @AfterClass + public static void close() throws Exception { + webClient.close(); + } + + @Test + public void test_A_GetLoginPage() throws IOException { + page = webClient.getPage("http://localhost:8888/app/login"); + WebAssert.assertTitleEquals(page, "JTrac Login"); + } + + @Test + public void test_B_SuccessfulLogin() throws IOException { + ((HtmlElement) page.getElementByName("loginName")).type("admin"); + ((HtmlElement) page.getElementByName("password")).type("admin"); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Submit']")).click(); + WebAssert.assertTextPresent(page, "DASHBOARD"); + } + + @Test + public void test_C_CreateNewSpaceAndAllocateAdmin() throws Exception { + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'OPTIONS']]")).click(); + WebAssert.assertTextPresent(page, "Options Menu"); + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'Manage Spaces']]")).click(); + WebAssert.assertTextPresent(page, "Space List"); + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'Create New Space']]")).click(); + WebAssert.assertTextPresent(page, "Space Details"); + ((HtmlElement) page.getElementByName("space.name")).type("Test Space"); + ((HtmlElement) page.getElementByName("space.prefixCode")).type("TEST"); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Next']")).click(); + WebAssert.assertTextPresent(page, "Custom Fields for Space:"); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Next']")).click(); + WebAssert.assertTextPresent(page, "Space Roles"); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Save']")).click(); + WebAssert.assertTextPresent(page, "Users Allocated To Space"); + ((HtmlCheckBoxInput) page.getFirstByXPath("//input[@name='roleAllocatePanel:checkGroup']")).click(); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Allocate']")).click(); + WebAssert.assertTextPresent(page, "Admin"); + } + + @Test + public void test_D_CreateNewItem() throws Exception { + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'DASHBOARD']]")).click(); + WebAssert.assertTextPresent(page, "Test Space"); + page = ((HtmlElement) page.getFirstByXPath("//img[@title='NEW']")).click(); + WebAssert.assertTextPresent(page, "Summary"); + ((HtmlElement) page.getElementByName("summary")).type("Test Summary"); + ((HtmlElement) page.getElementByName("detail")).type("Test Detail"); + ((HtmlSelect) page.getElementByName("hideAssignedTo:border:assignedTo")).getOptionByText("Admin").setSelected(true); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Submit']")).click(); + WebAssert.assertTextPresent(page, "TEST-1"); + } + + @Test + public void test_E_SearchAllContainsItem() throws Exception { + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'SEARCH']]")).click(); + WebAssert.assertTextPresent(page, "Show History"); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Search']")).click(); + WebAssert.assertTextPresent(page, "1 Record Found"); + page = ((HtmlElement) page.getFirstByXPath("//a[contains(@href, 'TEST-1')]")).click(); + WebAssert.assertTextPresent(page, "History"); + } + + @Test + public void test_F_UpdateHistoryForItem() throws Exception { + ((HtmlSelect) page.getElementByName("status")).setSelectedAttribute("Closed", true); + ((HtmlElement) page.getElementByName("comment")).type("Test Comment"); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Submit']")).click(); + WebAssert.assertTextPresent(page, "Test Comment"); + } + + @Test + public void test_G_CreateNewUser() throws Exception { + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'OPTIONS']]")).click(); + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'Manage Users']]")).click(); + WebAssert.assertTextPresent(page, "Users and allocated Spaces"); + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'Create New User']]")).click(); + WebAssert.assertTextPresent(page, "User Details"); + ((HtmlElement) page.getElementByName("user.loginName")).type("testuser"); + ((HtmlElement) page.getElementByName("user.name")).type("Test User"); + ((HtmlElement) page.getElementByName("user.email")).type("fo...@ba..."); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Submit']")).click(); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Search']")).click(); + WebAssert.assertTextPresent(page, "Test User"); + } + + @Test + public void test_H_Logout() throws Exception { + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'LOGOUT']]")).click(); + WebAssert.assertTextPresent(page, "Logout Successful"); + } +} Modified: trunk/jtrac/src/test/java/info/jtrac/lucene/IndexSearcherTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/lucene/IndexSearcherTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/lucene/IndexSearcherTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,17 +1,20 @@ package info.jtrac.lucene; import info.jtrac.domain.Item; + import java.io.File; import java.util.List; -import junit.framework.TestCase; + import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; -public class IndexSearcherTest extends TestCase { +import org.junit.*; +public class IndexSearcherTest { + private ApplicationContext context; - @Override + @Before public void setUp() { File home = new File("target/home"); if (!home.exists()) { @@ -29,6 +32,7 @@ context = new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/applicationContext-lucene.xml"); } + @Test public void testFindItemIdsBySearchingWithinSummaryAndDetailFields() throws Exception { Item item = new Item(); item.setId(1); @@ -38,13 +42,14 @@ indexer.index(item); IndexSearcher searcher = (IndexSearcher) context.getBean("indexSearcher"); List list = searcher.findItemIdsContainingText("lazy"); - assertEquals(1, list.size()); + Assert.assertEquals(1, list.size()); list = searcher.findItemIdsContainingText("foo"); - assertEquals(0, list.size()); + Assert.assertEquals(0, list.size()); list = searcher.findItemIdsContainingText("summary"); - assertEquals(1, list.size()); + Assert.assertEquals(1, list.size()); } + @Test public void testIfUmlautsCanBeIndexedAndSearchedFor() { Item item = new Item(); item.setId(1); @@ -54,7 +59,7 @@ indexer.index(item); IndexSearcher searcher = (IndexSearcher) context.getBean("indexSearcher"); List list = searcher.findItemIdsContainingText("\u00fcmlaut"); - assertEquals(1, list.size()); + Assert.assertEquals(1, list.size()); } } Modified: trunk/jtrac/src/test/java/info/jtrac/svn/SvnTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/svn/SvnTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/svn/SvnTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,66 +1,69 @@ -package info.jtrac.svn; - -import java.util.Collection; -import java.util.Iterator; -import junit.framework.TestCase; -import org.tmatesoft.svn.core.SVNDirEntry; -import org.tmatesoft.svn.core.SVNException; -import org.tmatesoft.svn.core.SVNNodeKind; -import org.tmatesoft.svn.core.SVNURL; -import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; -import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; -import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; -import org.tmatesoft.svn.core.io.SVNRepository; -import org.tmatesoft.svn.core.io.SVNRepositoryFactory; -import org.tmatesoft.svn.core.wc.SVNWCUtil; - -public class SvnTest extends TestCase { - - public void testNothing() { - - } - - /* - public void testSvn() throws Exception { - String url = "https://adms.satyam.com/svn/jtrac/trunk/jtrac"; - String name = "pt34469"; - String password = ""; - DAVRepositoryFactory.setup(); - SVNRepositoryFactoryImpl.setup(); - SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url)); - ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password); - repository.setAuthenticationManager(authManager); - SVNNodeKind nodeKind = repository.checkPath("", -1); - if (nodeKind == SVNNodeKind.NONE) { - System.err.println("There is no entry at '" + url + "'."); - System.exit(1); - } else if (nodeKind == SVNNodeKind.FILE) { - System.err.println("The entry at '" + url + "' is a file while a directory was expected."); - System.exit(1); - } - System.out.println("Repository Root: " + repository.getRepositoryRoot(true)); - System.out.println("Repository UUID: " + repository.getRepositoryUUID()); - listEntries(repository, ""); - long latestRevision = repository.getLatestRevision(); - System.out.println("Repository latest revision: " + latestRevision); - System.exit(0); - } - - private static void listEntries(SVNRepository repository, String path) throws SVNException { - - Collection entries = repository.getDir(path, -1, null, (Collection) null); - Iterator iterator = entries.iterator(); - while (iterator.hasNext()) { - SVNDirEntry entry = (SVNDirEntry) iterator.next(); - System.out.println("/" + (path.equals("") ? "" : path + "/") - + entry.getName() + " (author:" + entry.getAuthor() - + "; revision:" + entry.getRevision() + ")"); - if (entry.getKind() == SVNNodeKind.DIR) { - listEntries(repository, (path.equals("")) ? entry.getName() - : path + "/" + entry.getName()); - } - } - } - */ - -} +package info.jtrac.svn; + +import java.util.Collection; +import java.util.Iterator; + +import org.junit.Test; + +import org.tmatesoft.svn.core.SVNDirEntry; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.SVNNodeKind; +import org.tmatesoft.svn.core.SVNURL; +import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; +import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; +import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; +import org.tmatesoft.svn.core.io.SVNRepository; +import org.tmatesoft.svn.core.io.SVNRepositoryFactory; +import org.tmatesoft.svn.core.wc.SVNWCUtil; + +public class SvnTest { + + @Test + public void testNothing() { + + } + + /* + @Test + public void testSvn() throws Exception { + String url = "https://adms.satyam.com/svn/jtrac/trunk/jtrac"; + String name = "pt34469"; + String password = ""; + DAVRepositoryFactory.setup(); + SVNRepositoryFactoryImpl.setup(); + SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url)); + ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password); + repository.setAuthenticationManager(authManager); + SVNNodeKind nodeKind = repository.checkPath("", -1); + if (nodeKind == SVNNodeKind.NONE) { + System.err.println("There is no entry at '" + url + "'."); + System.exit(1); + } else if (nodeKind == SVNNodeKind.FILE) { + System.err.println("The entry at '" + url + "' is a file while a directory was expected."); + System.exit(1); + } + System.out.println("Repository Root: " + repository.getRepositoryRoot(true)); + System.out.println("Repository UUID: " + repository.getRepositoryUUID()); + listEntries(repository, ""); + long latestRevision = repository.getLatestRevision(); + System.out.println("Repository latest revision: " + latestRevision); + System.exit(0); + } + + private static void listEntries(SVNRepository repository, String path) throws SVNException { + + Collection entries = repository.getDir(path, -1, null, (Collection) null); + Iterator iterator = entries.iterator(); + while (iterator.hasNext()) { + SVNDirEntry entry = (SVNDirEntry) iterator.next(); + System.out.println("/" + (path.equals("") ? "" : path + "/") + + entry.getName() + " (author:" + entry.getAuthor() + + "; revision:" + entry.getRevision() + ")"); + if (entry.getKind() == SVNNodeKind.DIR) { + listEntries(repository, (path.equals("")) ? entry.getName() + : path + "/" + entry.getName()); + } + } + } + */ +} Modified: trunk/jtrac/src/test/java/info/jtrac/util/ItemUtilsTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/util/ItemUtilsTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/util/ItemUtilsTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,19 +1,20 @@ -package info.jtrac.util; - -import junit.framework.TestCase; - -public class ItemUtilsTest extends TestCase { - - public void testHtmlEscaping() { - assertEquals(" ", ItemUtils.fixWhiteSpace(" ")); - assertEquals(" ", ItemUtils.fixWhiteSpace(" \t")); - assertEquals("Hello World", ItemUtils.fixWhiteSpace("Hello World")); - assertEquals("", ItemUtils.fixWhiteSpace("")); - assertEquals("", ItemUtils.fixWhiteSpace(null)); - assertEquals("Hello<br/>World", ItemUtils.fixWhiteSpace("Hello\nWorld")); - assertEquals("Hello<br/> World", ItemUtils.fixWhiteSpace("Hello\n World")); - assertEquals("Hello<br/> World<br/> Everyone", ItemUtils.fixWhiteSpace("Hello\n World\n\tEveryone")); - assertEquals("Hello World", ItemUtils.fixWhiteSpace("Hello\tWorld")); - } - -} +package info.jtrac.util; + +import org.junit.*; + +public class ItemUtilsTest { + + @Test + public void testHtmlEscaping() { + Assert.assertEquals(" ", ItemUtils.fixWhiteSpace(" ")); + Assert.assertEquals(" ", ItemUtils.fixWhiteSpace(" \t")); + Assert.assertEquals("Hello World", ItemUtils.fixWhiteSpace("Hello World")); + Assert.assertEquals("", ItemUtils.fixWhiteSpace("")); + Assert.assertEquals("", ItemUtils.fixWhiteSpace(null)); + Assert.assertEquals("Hello<br/>World", ItemUtils.fixWhiteSpace("Hello\nWorld")); + Assert.assertEquals("Hello<br/> World", ItemUtils.fixWhiteSpace("Hello\n World")); + Assert.assertEquals("Hello<br/> World<br/> Everyone", ItemUtils.fixWhiteSpace("Hello\n World\n\tEveryone")); + Assert.assertEquals("Hello World", ItemUtils.fixWhiteSpace("Hello\tWorld")); + } + +} Modified: trunk/jtrac/src/test/java/info/jtrac/util/JtracConfigurerTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/util/JtracConfigurerTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/util/JtracConfigurerTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,9 +1,10 @@ package info.jtrac.util; -import junit.framework.TestCase; +import org.junit.*; -public class JtracConfigurerTest extends TestCase { +public class JtracConfigurerTest { + @Test public void testUserDir() throws Exception { // TODO } Modified: trunk/jtrac/src/test/java/info/jtrac/util/ValidationUtilsTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/util/ValidationUtilsTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/util/ValidationUtilsTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,52 +1,56 @@ package info.jtrac.util; -import junit.framework.TestCase; +import org.junit.*; -public class ValidationUtilsTest extends TestCase { +public class ValidationUtilsTest { + @Test public void testValidateSpaceKey() { - assertTrue(ValidationUtils.isValidSpaceKey("ABCD")); - assertTrue(ValidationUtils.isValidSpaceKey("AB123CD")); - assertFalse(ValidationUtils.isValidSpaceKey("ABCD-ABCD")); - assertFalse(ValidationUtils.isValidSpaceKey("AB CD")); + Assert.assertTrue(ValidationUtils.isValidSpaceKey("ABCD")); + Assert.assertTrue(ValidationUtils.isValidSpaceKey("AB123CD")); + Assert.assertFalse(ValidationUtils.isValidSpaceKey("ABCD-ABCD")); + Assert.assertFalse(ValidationUtils.isValidSpaceKey("AB CD")); } + @Test public void testValidateRoleKey() { - assertTrue(ValidationUtils.isValidRoleKey("ABCD")); - assertTrue(ValidationUtils.isValidRoleKey("AB123CD")); - assertFalse(ValidationUtils.isValidRoleKey("ABCD-ABCD")); - assertFalse(ValidationUtils.isValidRoleKey("ABcD_ABCD")); - assertFalse(ValidationUtils.isValidRoleKey("AB CD")); - assertTrue(ValidationUtils.isValidRoleKey("ABCD_EFG")); - assertFalse(ValidationUtils.isValidRoleKey("AB1CDE2_")); - assertFalse(ValidationUtils.isValidRoleKey("_ABCDEF")); - assertTrue(ValidationUtils.isValidRoleKey("1ABCD3_EFG2")); + Assert.assertTrue(ValidationUtils.isValidRoleKey("ABCD")); + Assert.assertTrue(ValidationUtils.isValidRoleKey("AB123CD")); + Assert.assertFalse(ValidationUtils.isValidRoleKey("ABCD-ABCD")); + Assert.assertFalse(ValidationUtils.isValidRoleKey("ABcD_ABCD")); + Assert.assertFalse(ValidationUtils.isValidRoleKey("AB CD")); + Assert.assertTrue(ValidationUtils.isValidRoleKey("ABCD_EFG")); + Assert.assertFalse(ValidationUtils.isValidRoleKey("AB1CDE2_")); + Assert.assertFalse(ValidationUtils.isValidRoleKey("_ABCDEF")); + Assert.assertTrue(ValidationUtils.isValidRoleKey("1ABCD3_EFG2")); } + @Test public void testValidateLoginName() { - assertTrue(ValidationUtils.isValidLoginName("abcd")); - assertTrue(ValidationUtils.isValidLoginName("abcd123")); - assertTrue(ValidationUtils.isValidLoginName("ab-cd")); - assertTrue(ValidationUtils.isValidLoginName("ab.cd")); - assertTrue(ValidationUtils.isValidLoginName("ab_cd")); - assertTrue(ValidationUtils.isValidLoginName("Ab-Cd")); - assertTrue(ValidationUtils.isValidLoginName("ab@cd")); - assertTrue(ValidationUtils.isValidLoginName("AB\\cd")); - assertTrue(ValidationUtils.isValidLoginName("AB\\ab...@de...")); - assertFalse(ValidationUtils.isValidLoginName("ab%cd")); - assertFalse(ValidationUtils.isValidLoginName("ab:cd")); - assertFalse(ValidationUtils.isValidLoginName("ab cd")); + Assert.assertTrue(ValidationUtils.isValidLoginName("abcd")); + Assert.assertTrue(ValidationUtils.isValidLoginName("abcd123")); + Assert.assertTrue(ValidationUtils.isValidLoginName("ab-cd")); + Assert.assertTrue(ValidationUtils.isValidLoginName("ab.cd")); + Assert.assertTrue(ValidationUtils.isValidLoginName("ab_cd")); + Assert.assertTrue(ValidationUtils.isValidLoginName("Ab-Cd")); + Assert.assertTrue(ValidationUtils.isValidLoginName("ab@cd")); + Assert.assertTrue(ValidationUtils.isValidLoginName("AB\\cd")); + Assert.assertTrue(ValidationUtils.isValidLoginName("AB\\ab...@de...")); + Assert.assertFalse(ValidationUtils.isValidLoginName("ab%cd")); + Assert.assertFalse(ValidationUtils.isValidLoginName("ab:cd")); + Assert.assertFalse(ValidationUtils.isValidLoginName("ab cd")); } + @Test public void testValidateStateName() { - assertTrue(ValidationUtils.isValidStateName("Abcd")); - assertTrue(ValidationUtils.isValidStateName("Abcd-Efgh")); - assertTrue(ValidationUtils.isValidStateName("Abcd-Efgh-Hijk")); - assertFalse(ValidationUtils.isValidStateName("AbcdEfgh")); - assertFalse(ValidationUtils.isValidStateName("Abcd123")); - assertFalse(ValidationUtils.isValidStateName("8bcd")); - assertFalse(ValidationUtils.isValidStateName("Ab-cd")); - assertFalse(ValidationUtils.isValidStateName("Ab cd")); + Assert.assertTrue(ValidationUtils.isValidStateName("Abcd")); + Assert.assertTrue(ValidationUtils.isValidStateName("Abcd-Efgh")); + Assert.assertTrue(ValidationUtils.isValidStateName("Abcd-Efgh-Hijk")); + Assert.assertFalse(ValidationUtils.isValidStateName("AbcdEfgh")); + Assert.assertFalse(ValidationUtils.isValidStateName("Abcd123")); + Assert.assertFalse(ValidationUtils.isValidStateName("8bcd")); + Assert.assertFalse(ValidationUtils.isValidStateName("Ab-cd")); + Assert.assertFalse(ValidationUtils.isValidStateName("Ab cd")); } } Modified: trunk/jtrac/src/test/java/info/jtrac/util/XmlUtilsTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/util/XmlUtilsTest.java 2021-11-19 11:13:45 UTC (rev 1417) +++ trunk/jtrac/src/test/java/info/jtrac/util/XmlUtilsTest.java 2021-11-22 13:24:18 UTC (rev 1418) @@ -1,31 +1,36 @@ package info.jtrac.util; import info.jtrac.util.XmlUtils; -import junit.framework.TestCase; + +import org.junit.*; + import org.dom4j.Document; -public class XmlUtilsTest extends TestCase { - +public class XmlUtilsTest { + + @Test public void testXmlStringParse() { String s = "<test/>"; Document d = XmlUtils.parse(s); - assertTrue(d.getRootElement().getName().equals("test")); + Assert.assertTrue(d.getRootElement().getName().equals("test")); } + @Test public void testBadXmlParseFails() { String s = "foo"; try { Document d = XmlUtils.parse(s); - fail("How did we parse invalid XML?"); + Assert.fail("How did we parse invalid XML?"); } catch (Exception e) { // expected } } + @Test public void testGetAsPrettyXml() { String s = "<root><node1><node2>data</node2></node1></root>"; String result = XmlUtils.getAsPrettyXml(s); - assertTrue(result.equals("<root>\n <node1>\n <node2>data</node2>\n </node1>\n</root>")); + Assert.assertTrue(result.equals("<root>\n <node1>\n <node2>data</node2>\n </node1>\n</root>")); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-11-22 15:17:48
|
Revision: 1419 http://sourceforge.net/p/j-trac/code/1419 Author: udittmer Date: 2021-11-22 15:17:45 +0000 (Mon, 22 Nov 2021) Log Message: ----------- added test for stored search links Modified Paths: -------------- trunk/jtrac/pom.xml trunk/jtrac/src/test/java/info/jtrac/htmlunit/BasicTest.java Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-11-22 13:24:18 UTC (rev 1418) +++ trunk/jtrac/pom.xml 2021-11-22 15:17:45 UTC (rev 1419) @@ -417,22 +417,22 @@ <dependency> <groupId>org.commonmark</groupId> <artifactId>commonmark</artifactId> - <version>0.18.0</version> + <version>${commonmark.version}</version> </dependency> <dependency> <groupId>org.commonmark</groupId> <artifactId>commonmark-ext-gfm-strikethrough</artifactId> - <version>0.18.0</version> + <version>${commonmark.version}</version> </dependency> <dependency> <groupId>org.commonmark</groupId> <artifactId>commonmark-ext-ins</artifactId> - <version>0.18.0</version> + <version>${commonmark.version}</version> </dependency> <dependency> <groupId>org.commonmark</groupId> <artifactId>commonmark-ext-autolink</artifactId> - <version>0.18.0</version> + <version>${commonmark.version}</version> </dependency> </dependencies> @@ -524,5 +524,6 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <timestamp>${maven.build.timestamp}</timestamp> <maven.build.timestamp.format>yyyy-MM-dd HH:mm z</maven.build.timestamp.format> + <commonmark.version>0.18.0</commonmark.version> </properties> </project> Modified: trunk/jtrac/src/test/java/info/jtrac/htmlunit/BasicTest.java =================================================================== --- trunk/jtrac/src/test/java/info/jtrac/htmlunit/BasicTest.java 2021-11-22 13:24:18 UTC (rev 1418) +++ trunk/jtrac/src/test/java/info/jtrac/htmlunit/BasicTest.java 2021-11-22 15:17:45 UTC (rev 1419) @@ -107,7 +107,29 @@ } @Test - public void test_H_Logout() throws Exception { + public void test_H_CreateStoredSearch() throws Exception { + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'OPTIONS']]")).click(); + WebAssert.assertTextPresent(page, "Options Menu"); + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'Configure Links']]")).click(); + WebAssert.assertTextPresent(page, "Links configuration"); + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'Create a new link']]")).click(); + WebAssert.assertTextPresent(page, "Link details"); + ((HtmlElement) page.getElementByName("name")).type("Test Link"); + ((HtmlElement) page.getElementByName("query")).type("http://localhost:8888/app/item/list?summary=like_test"); + page = ((HtmlElement) page.getFirstByXPath("//input[@value='Submit']")).click(); + WebAssert.assertTextPresent(page, "Test Link"); + } + + @Test + public void test_I_CheckStoredSearch() throws Exception { + page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'DASHBOARD']]")).click(); + WebAssert.assertTextPresent(page, "Test Link"); + page = ((HtmlElement) page.getFirstByXPath("//a[contains(@href, 'like_test')]")).click(); + WebAssert.assertTextPresent(page, "1 Record Found"); + } + + @Test + public void test_J_Logout() throws Exception { page = ((HtmlElement) page.getFirstByXPath("//a[text()[normalize-space(.) = 'LOGOUT']]")).click(); WebAssert.assertTextPresent(page, "Logout Successful"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <udi...@us...> - 2021-12-14 15:29:11
|
Revision: 1425 http://sourceforge.net/p/j-trac/code/1425 Author: udittmer Date: 2021-12-14 15:29:09 +0000 (Tue, 14 Dec 2021) Log Message: ----------- doc improvements, log4j dependency updated Modified Paths: -------------- trunk/jtrac/doc/src/index.xml trunk/jtrac/pom.xml Modified: trunk/jtrac/doc/src/index.xml =================================================================== --- trunk/jtrac/doc/src/index.xml 2021-12-14 09:53:14 UTC (rev 1424) +++ trunk/jtrac/doc/src/index.xml 2021-12-14 15:29:09 UTC (rev 1425) @@ -68,7 +68,7 @@ but as of early 2007 (version 2.1.0 onwards) JTrac <ulink url="https://ptrthomas.wordpress.com/2007/03/02/wicket-impressions-moving-from-spring-mvc-webflow/">switched to </ulink> using the <ulink url="https://wicket.apache.org/">Apache Wicket</ulink> framework. - After being dormant for a long time, JTrac development picked up again in 2021, and a new version 2.2 was + After being dormant for a long time, JTrac development picked up again in 2021, and a new version 2.2.0 was released that moved the Java baseline to Java 8. </para> <para> @@ -100,7 +100,7 @@ There where a number of new features, changes and bugfixes: <itemizedlist> <listitem> - <para>The details and comments fields support Markdown syntax.</para> + <para>The details and comments fields support <ulink url="https://commonmark.org/help/">Markdown</ulink> syntax.</para> </listitem> <listitem> <para>All dates and times can optionally be displayed in a "pretty" format like "10 minutes ago", "2 months ago" etc.</para> @@ -110,10 +110,10 @@ </listitem> <listitem> <para>The dashboard can be configured to show a number of links that are relevant to the project, - like saved searches ("All Open Tickets") or to other pages.</para> + like saved searches ("All Open and In-Progress Tickets") or to other pages.</para> </listitem> <listitem> - <para>Outgoing emails can be signed using DKIM.</para> + <para>Outgoing emails can be signed using <ulink url="https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail">DKIM</ulink>.</para> </listitem> <listitem> <para>More items can be configured at runtime under Options -> Manage Settings</para> @@ -127,9 +127,14 @@ <listitem> <para>Some email issues e.g. sending duplicate mails are fixed.</para> </listitem> + <listitem> + <para>Localizations into Ukrainian, Hungarian, Turkish, Arabic, Slovenian, Czech, Korean, Norwegian and Swedish have been added.</para> + </listitem> </itemizedlist> - For details see this <ulink url="https://sourceforge.net/p/j-trac/wiki/NewFeatures220">wiki page on SourceForge.</ulink> </para> + <para> + For details see this <ulink url="https://sourceforge.net/p/j-trac/wiki/NewFeatures220">wiki page</ulink> on SourceForge. + </para> </sect1> </chapter> Modified: trunk/jtrac/pom.xml =================================================================== --- trunk/jtrac/pom.xml 2021-12-14 09:53:14 UTC (rev 1424) +++ trunk/jtrac/pom.xml 2021-12-14 15:29:09 UTC (rev 1425) @@ -367,7 +367,7 @@ <!-- POI needs this, but pulls in 2.14.1, which is insecure --> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> - <version>2.15.0</version> + <version>2.16.0</version> </dependency> <dependency> <groupId>org.tmate</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |