Binary file server/lib/org/thymeleaf/extras/thymeleaf-joda-dialect/0.0.3/thymeleaf-joda-dialect-0.0.3.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/lib/org/thymeleaf/extras/thymeleaf-joda-dialect/0.0.3/thymeleaf-joda-dialect-0.0.3.pom Mon Nov 18 23:34:22 2013 +0100
@@ -0,0 +1,145 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.thymeleaf.extras</groupId>
+ <artifactId>thymeleaf-joda-dialect</artifactId>
+ <version>0.0.3</version>
+ <inceptionYear>2013</inceptionYear>
+ <contributors>
+ <contributor>
+ <name>Tom-Steve Watzke</name>
+ <email>ts.watzke@pitcom.de</email>
+ <roles>
+ <role>Project creator and Lead developer</role>
+ </roles>
+ </contributor>
+ <contributor>
+ <name>Dieter Hubau</name>
+ <email>dhubau@gmail.com</email>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ </contributor>
+ </contributors>
+ <description>Thymeleaf dialect for formatting Joda Time objects</description>
+
+ <properties>
+ <java-version>1.7</java-version>
+ <org.springframework-version>3.2.4.RELEASE</org.springframework-version>
+ <org.springsecurityframework-version>3.2.4.RELEASE</org.springsecurityframework-version>
+ <org.thymeleaf-version>2.1.1.RELEASE</org.thymeleaf-version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${org.springframework-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${org.springframework-version}</version>
+ </dependency>
+
+ <!-- thymeleaf html5 template resolver -->
+ <dependency>
+ <groupId>org.thymeleaf</groupId>
+ <artifactId>thymeleaf</artifactId>
+ <version>${org.thymeleaf-version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.thymeleaf</groupId>
+ <artifactId>thymeleaf-spring3</artifactId>
+ <version>${org.thymeleaf-version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.1</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${org.springframework-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat7-maven-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <id>deploy</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>${java-version}</source>
+ <target>${java-version}</target>
+ <compilerArgument>-Xlint:all</compilerArgument>
+ <showWarnings>true</showWarnings>
+ <showDeprecation>true</showDeprecation>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <repositories>
+ <!-- Necessary if using milestone builds of SpringSource products (as above) -->
+ <repository>
+ <id>spring-snapshot</id>
+ <name>Spring Maven SNAPSHOT Repository</name>
+ <url>http://repo.springsource.org/libs-snapshot</url>
+ </repository>
+ <!-- Required, as Spring JavaConfig has dependencies on released versions
+ of SpringSource products -->
+ <repository>
+ <id>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</id>
+ <url>http://repository.springsource.com/maven/bundles/release</url>
+ </repository>
+ <!-- Required, as Spring JavaConfig has dependencies on External OSGi bundles -->
+ <repository>
+ <id>SpringSource Enterprise Bundle Repository - External Bundle Releases</id>
+ <url>http://repository.springsource.com/maven/bundles/external</url>
+ </repository>
+ <repository>
+ <id>java.net</id>
+ <url>http://download.java.net/maven/2/</url>
+ </repository>
+ </repositories>
+</project>
--- a/server/pom.xml Fri Nov 15 09:34:41 2013 +0100
+++ b/server/pom.xml Mon Nov 18 23:34:22 2013 +0100
@@ -20,8 +20,9 @@
<jetty-plugin-version>8.1.13.v20130916</jetty-plugin-version>
<jetty-version>8.1.13.v20130916</jetty-version>
<junit-version>4.11</junit-version>
- <thymeleaf-version>2.1.0-beta2</thymeleaf-version>
- <thymeleaf-springsecurity-version>2.1.0-beta2</thymeleaf-springsecurity-version>
+ <thymeleaf-version>2.1.1.RELEASE</thymeleaf-version>
+ <thymeleaf-springsecurity-version>2.1.0.RELEASE</thymeleaf-springsecurity-version>
+ <thymeleaf-joda-dialect-version>0.0.3</thymeleaf-joda-dialect-version>
<cometd-version>2.7.0</cometd-version>
<jackson-version>2.2.3</jackson-version>
<joda-version>2.3</joda-version>
@@ -347,6 +348,11 @@
<version>${thymeleaf-springsecurity-version}</version>
</dependency>
<dependency>
+ <groupId>org.thymeleaf.extras</groupId>
+ <artifactId>thymeleaf-joda-dialect</artifactId>
+ <version>${thymeleaf-joda-dialect-version}</version>
+ </dependency>
+ <dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>${nekohtml-version}</version>
--- a/server/src/main/java/org/iri_research/renkan/forms/UserForm.java Fri Nov 15 09:34:41 2013 +0100
+++ b/server/src/main/java/org/iri_research/renkan/forms/UserForm.java Mon Nov 18 23:34:22 2013 +0100
@@ -7,7 +7,7 @@
import org.iri_research.renkan.models.User;
import org.iri_research.renkan.repositories.IRenkanRepository;
import org.iri_research.renkan.repositories.UsersRepository;
-import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
@@ -18,9 +18,9 @@
private String avatar;
@DateTimeFormat(iso = ISO.DATE)
- private DateTime credentialExpirationDate;
+ private LocalDate credentialExpirationDate;
@DateTimeFormat(iso = ISO.DATE)
- private DateTime expirationDate;
+ private LocalDate expirationDate;
private String email;
@@ -60,7 +60,7 @@
return avatar;
}
- public DateTime getCredentialExpirationDate() {
+ public LocalDate getCredentialExpirationDate() {
return credentialExpirationDate;
}
@@ -68,7 +68,7 @@
return email;
}
- public DateTime getExpirationDate() {
+ public LocalDate getExpirationDate() {
return expirationDate;
}
@@ -124,7 +124,7 @@
this.avatar = avatar;
}
- public void setCredentialExpirationDate(DateTime credentialExpirationDate) {
+ public void setCredentialExpirationDate(LocalDate credentialExpirationDate) {
this.credentialExpirationDate = credentialExpirationDate;
}
@@ -136,7 +136,7 @@
this.enabled = enabled;
}
- public void setExpirationDate(DateTime expirationDate) {
+ public void setExpirationDate(LocalDate expirationDate) {
this.expirationDate = expirationDate;
}
--- a/server/src/main/java/org/iri_research/renkan/models/User.java Fri Nov 15 09:34:41 2013 +0100
+++ b/server/src/main/java/org/iri_research/renkan/models/User.java Mon Nov 18 23:34:22 2013 +0100
@@ -5,7 +5,7 @@
import java.util.List;
import org.iri_research.renkan.Constants;
-import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.security.core.GrantedAuthority;
@@ -24,12 +24,12 @@
private String avatar;
@Field("credentials_expiration_date")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "GMT")
- private DateTime credentialExpirationDate;
+ private LocalDate credentialExpirationDate;
private String email;
private boolean enabled;
@Field("expiration_date")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone = "GMT")
- private DateTime expirationDate;
+ private LocalDate expirationDate;
private boolean locked;
private String password;
@Field("authorities")
@@ -66,7 +66,7 @@
return this.color;
}
- public DateTime getCredentialExpirationDate() {
+ public LocalDate getCredentialExpirationDate() {
return credentialExpirationDate;
}
@@ -74,7 +74,7 @@
return email;
}
- public DateTime getExpirationDate() {
+ public LocalDate getExpirationDate() {
return expirationDate;
}
@@ -102,7 +102,7 @@
@Override
public boolean isAccountNonExpired() {
return this.expirationDate == null
- || this.expirationDate.isAfterNow();
+ || this.expirationDate.isAfter(LocalDate.now());
}
@Override
@@ -113,7 +113,7 @@
@Override
public boolean isCredentialsNonExpired() {
return this.credentialExpirationDate == null
- || this.credentialExpirationDate.isAfterNow();
+ || this.credentialExpirationDate.isAfter(LocalDate.now());
}
@Override
@@ -129,7 +129,7 @@
this.avatar = avatar;
}
- public void setCredentialExpirationDate(DateTime credentialExpirationDate) {
+ public void setCredentialExpirationDate(LocalDate credentialExpirationDate) {
this.credentialExpirationDate = credentialExpirationDate;
}
@@ -141,7 +141,7 @@
this.enabled = enabled;
}
- public void setExpirationDate(DateTime expirationDate) {
+ public void setExpirationDate(LocalDate expirationDate) {
this.expirationDate = expirationDate;
}
--- a/server/src/main/webapp/WEB-INF/i18n/messages_en.properties Fri Nov 15 09:34:41 2013 +0100
+++ b/server/src/main/webapp/WEB-INF/i18n/messages_en.properties Mon Nov 18 23:34:22 2013 +0100
@@ -1,6 +1,6 @@
-date.format = yyyy/MM/dd HH:mm
-date.date.format = yyyy/MM/dd
+date.format = yyyy/dd/MM HH:mm
+date.date.format = yyyy/dd/MM
date.date.datePicker.format = yy/dd/mm
question.yes = yes
question.no = no
--- a/server/src/main/webapp/WEB-INF/templates/fragment/userForm.html Fri Nov 15 09:34:41 2013 +0100
+++ b/server/src/main/webapp/WEB-INF/templates/fragment/userForm.html Mon Nov 18 23:34:22 2013 +0100
@@ -43,7 +43,7 @@
var dateFormat = /*[[#{date.date.datePicker.format}]]*/"yy/mm/dd";
$.datepicker.setDefaults($.datepicker.regional[ "" ]);
$('.datepicker').each(function (i,elt) {
- var picker_options = $.extend({},$.datepicker.regional[regionalValue=="en"?"":regionalValue]);
+ var picker_options = $.extend({showButtonPanel: true},$.datepicker.regional[regionalValue=="en"?"":regionalValue]);
picker_options.dateFormat = dateFormat;
picker_options.altFormat = $.datepicker.ISO_8601;
var elt = $(elt);
@@ -110,13 +110,13 @@
<div>
<label for="credentialExpirationDate" th:text="#{renkanAdmin.form.credentialExpirationDate}">Credential expiration date: </label>
<input type="hidden" name="credentialExpirationDate" th:field="*{credentialExpirationDate}"/>
- <input type="date" id="credentialExpirationDate-disp" class="datepicker" value="01/01/1970" th:value="${user.credentialExpirationDate != null}?${#dates.format(user.credentialExpirationDate, #messages.msg('date.date.format'))}:''"/>
+ <input type="date" id="credentialExpirationDate-disp" class="datepicker" value="01/01/1970" th:value="${user.credentialExpirationDate != null}?${user.credentialExpirationDate.toString(#messages.msg('date.date.format'))}:''"/>
</div>
<div>
<label for="expirationDate" th:text="#{renkanAdmin.form.expirationDate}">Expiration date: </label>
<input type="hidden" name="expirationDate" th:field="*{expirationDate}" />
- <input type="date" id="expirationDate-disp" class="datepicker" value="01/01/1970" th:value="${user.expirationDate != null}?${#dates.format(user.expirationDate, #messages.msg('date.date.format'))}:''"/>
+ <input type="date" id="expirationDate-disp" class="datepicker" value="01/01/1970" th:value="${user.expirationDate != null}?${user.expirationDate.toString(#messages.msg('date.date.format'))}:''"/>
</div>
<div>
<label for="email" th:text="#{renkanAdmin.form.email}">Email: </label>
--- a/server/src/test/java/org/iri_research/renkan/test/controller/UsersAdminControllerTest.java Fri Nov 15 09:34:41 2013 +0100
+++ b/server/src/test/java/org/iri_research/renkan/test/controller/UsersAdminControllerTest.java Mon Nov 18 23:34:22 2013 +0100
@@ -14,6 +14,7 @@
import org.iri_research.renkan.repositories.SpacesRepository;
import org.iri_research.renkan.repositories.UsersRepository;
import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -83,8 +84,8 @@
user.setLocked(false);
user.setEnabled(true);
user.setAvatar("A pretty picture");
- user.setExpirationDate(new DateTime());
- user.setCredentialExpirationDate(new DateTime());
+ user.setExpirationDate(new LocalDate());
+ user.setCredentialExpirationDate(new LocalDate());
user.setEmail(String.format("user%d@mail.com", i));
user = usersRepository.save(user);
this.usersUuids.add(uuid);
@@ -198,7 +199,7 @@
.matches(
"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"));
Assert.assertTrue("password must match \"test\"", renkanPasswordEncoder.matches("test", user.getPassword()));
- Assert.assertEquals(new DateTime(2007, 11, 24, 0, 0, 0, 0), user.getExpirationDate());
+ Assert.assertEquals(new LocalDate(2007, 11, 24), user.getExpirationDate());
}
}
}