You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(39) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(19) |
Feb
(150) |
Mar
(10) |
Apr
|
May
(8) |
Jun
(11) |
Jul
(27) |
Aug
(52) |
Sep
(35) |
Oct
(30) |
Nov
(18) |
Dec
(4) |
2008 |
Jan
(76) |
Feb
(121) |
Mar
(39) |
Apr
(55) |
May
(18) |
Jun
(49) |
Jul
(32) |
Aug
(4) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(33) |
2009 |
Jan
(19) |
Feb
(87) |
Mar
(69) |
Apr
(38) |
May
(47) |
Jun
(20) |
Jul
(5) |
Aug
(76) |
Sep
(145) |
Oct
(34) |
Nov
(8) |
Dec
(68) |
2010 |
Jan
(150) |
Feb
(379) |
Mar
(191) |
Apr
(100) |
May
(525) |
Jun
(269) |
Jul
(127) |
Aug
(190) |
Sep
(190) |
Oct
(29) |
Nov
(147) |
Dec
(83) |
2011 |
Jan
(188) |
Feb
(81) |
Mar
(43) |
Apr
(97) |
May
(63) |
Jun
(129) |
Jul
(17) |
Aug
(124) |
Sep
(6) |
Oct
(20) |
Nov
(67) |
Dec
(23) |
2012 |
Jan
(6) |
Feb
(14) |
Mar
(181) |
Apr
(64) |
May
(102) |
Jun
(47) |
Jul
(26) |
Aug
(3) |
Sep
(1) |
Oct
(14) |
Nov
(13) |
Dec
(23) |
2013 |
Jan
(4) |
Feb
(14) |
Mar
(18) |
Apr
(14) |
May
(27) |
Jun
(27) |
Jul
(5) |
Aug
(2) |
Sep
(74) |
Oct
(79) |
Nov
(21) |
Dec
(97) |
2014 |
Jan
(6) |
Feb
(3) |
Mar
(8) |
Apr
|
May
(5) |
Jun
|
Jul
(9) |
Aug
(6) |
Sep
(3) |
Oct
(10) |
Nov
(6) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fg...@us...> - 2011-08-08 13:01:08
|
Revision: 3603 http://openutils.svn.sourceforge.net/openutils/?rev=3603&view=rev Author: fgiust Date: 2011-08-08 13:00:58 +0000 (Mon, 08 Aug 2011) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlcriteria-3.3.3 Added Paths: ----------- tags/openutils-mgnlcriteria-3.3.3/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 13:00:42
|
Revision: 3602 http://openutils.svn.sourceforge.net/openutils/?rev=3602&view=rev Author: fgiust Date: 2011-08-08 13:00:33 +0000 (Mon, 08 Aug 2011) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlcriteria-3.3.3 Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2011-08-08 12:58:55 UTC (rev 3601) +++ trunk/openutils-mgnlcriteria/pom.xml 2011-08-08 13:00:33 UTC (rev 3602) @@ -1,5 +1,4 @@ -<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"> +<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> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -9,7 +8,7 @@ </parent> <artifactId>openutils-mgnlcriteria</artifactId> <name>Criteria API for Magnolia CMS</name> - <version>3.3.3-SNAPSHOT</version> + <version>3.3.3</version> <inceptionYear>2009</inceptionYear> <description>A Hibernate's Criteria-like API to programmatically generate JCR queries with Magnolia</description> <licenses> @@ -24,9 +23,9 @@ <url>http://jira.openmindlab.com/browse/CRIT</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlcriteria</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlcriteria</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlcriteria</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlcriteria-3.3.3</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlcriteria-3.3.3</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlcriteria-3.3.3</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 12:59:01
|
Revision: 3601 http://openutils.svn.sourceforge.net/openutils/?rev=3601&view=rev Author: fgiust Date: 2011-08-08 12:58:55 +0000 (Mon, 08 Aug 2011) Log Message: ----------- update dependencies Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2011-08-08 12:55:25 UTC (rev 3600) +++ trunk/openutils-mgnlcriteria/pom.xml 2011-08-08 12:58:55 UTC (rev 3601) @@ -1,4 +1,5 @@ -<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"> +<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> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -131,7 +132,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnlutils</artifactId> - <version>1.0.7</version> + <version>1.0.9</version> <scope>test</scope> <exclusions> <exclusion> @@ -166,8 +167,7 @@ <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.10</version> + <version>6.0.1</version> <scope>test</scope> <exclusions> <exclusion> @@ -178,7 +178,7 @@ </dependency> </dependencies> <properties> - <magnolia.version>4.4.1</magnolia.version> + <magnolia.version>4.4.4</magnolia.version> <jackrabbit.version>1.6.2</jackrabbit.version> <jcr.version>1.0</jcr.version> </properties> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 12:55:34
|
Revision: 3600 http://openutils.svn.sourceforge.net/openutils/?rev=3600&view=rev Author: fgiust Date: 2011-08-08 12:55:25 +0000 (Mon, 08 Aug 2011) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2011-08-08 12:55:13 UTC (rev 3599) +++ trunk/openutils-mgnlstripes/pom.xml 2011-08-08 12:55:25 UTC (rev 3600) @@ -12,7 +12,7 @@ <name>Stripes module for Magnolia CMS</name> <description>A Magnolia Module that let you use Stripes Framework inside Magnolia</description> <inceptionYear>2008</inceptionYear> - <version>4.1.3</version> + <version>4.1.4-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -25,9 +25,9 @@ <url>http://jira.openmindlab.com/browse/MGNLSTRIPES</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-4.1.3</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-4.1.3</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-4.1.3</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlstripes</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlstripes</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlstripes</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 12:55:19
|
Revision: 3599 http://openutils.svn.sourceforge.net/openutils/?rev=3599&view=rev Author: fgiust Date: 2011-08-08 12:55:13 +0000 (Mon, 08 Aug 2011) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlstripes-4.1.3 Added Paths: ----------- tags/openutils-mgnlstripes-4.1.3/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 12:54:56
|
Revision: 3598 http://openutils.svn.sourceforge.net/openutils/?rev=3598&view=rev Author: fgiust Date: 2011-08-08 12:54:50 +0000 (Mon, 08 Aug 2011) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlstripes-4.1.3 Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2011-08-08 12:53:59 UTC (rev 3597) +++ trunk/openutils-mgnlstripes/pom.xml 2011-08-08 12:54:50 UTC (rev 3598) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<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"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -13,7 +12,7 @@ <name>Stripes module for Magnolia CMS</name> <description>A Magnolia Module that let you use Stripes Framework inside Magnolia</description> <inceptionYear>2008</inceptionYear> - <version>4.1.3-SNAPSHOT</version> + <version>4.1.3</version> <licenses> <license> <name>GPLv3</name> @@ -26,9 +25,9 @@ <url>http://jira.openmindlab.com/browse/MGNLSTRIPES</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlstripes</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlstripes</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlstripes</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-4.1.3</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-4.1.3</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-4.1.3</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 12:54:08
|
Revision: 3597 http://openutils.svn.sourceforge.net/openutils/?rev=3597&view=rev Author: fgiust Date: 2011-08-08 12:53:59 +0000 (Mon, 08 Aug 2011) Log Message: ----------- useful formatter for Calendars Added Paths: ----------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/extra/ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/extra/CalendarFormatter.java Added: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/extra/CalendarFormatter.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/extra/CalendarFormatter.java (rev 0) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/extra/CalendarFormatter.java 2011-08-08 12:53:59 UTC (rev 3597) @@ -0,0 +1,149 @@ +/** + * + * Stripes module for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlstripes.html) + * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package it.openutils.magnoliastripes.extra; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import net.sourceforge.stripes.exception.StripesRuntimeException; +import net.sourceforge.stripes.format.Formatter; + + +/** + * Date formatter with support for Calendars. Copied from default Stripes DateFormatter. + * @author Danilo Ghirardelli + */ +public class CalendarFormatter implements Formatter<Calendar> +{ + + protected static final Map<String, Integer> NAMED_PATTERNS = new HashMap<String, Integer>(); + static + { + NAMED_PATTERNS.put("short", DateFormat.SHORT); + NAMED_PATTERNS.put("medium", DateFormat.MEDIUM); + NAMED_PATTERNS.put("long", DateFormat.LONG); + NAMED_PATTERNS.put("full", DateFormat.FULL); + } + + private String formatType; + + private String formatPattern; + + private Locale locale; + + private DateFormat format; + + @Override + public void setFormatType(String formatType) + { + this.formatType = formatType; + } + + public String getFormatType() + { + return formatType; + } + + @Override + public void setFormatPattern(String formatPattern) + { + this.formatPattern = formatPattern; + } + + public String getFormatPattern() + { + return formatPattern; + } + + @Override + public void setLocale(Locale locale) + { + this.locale = locale; + } + + public Locale getLocale() + { + return locale; + } + + /** + * Constructs the DateFormat used for formatting, based on the values passed to the various setter methods on the + * class. If the formatString is one of the named formats then a DateFormat instance is created of the specified + * type and format, otherwise a SimpleDateFormat is constructed using the pattern provided and the formatType is + * ignored. + */ + @Override + public void init() + { + // Default these values if they were not supplied + if (formatPattern == null) + { + formatPattern = "short"; + } + if (formatType == null) + { + formatType = "date"; + } + String lcFormatString = formatPattern.toLowerCase(); + String lcFormatType = formatType.toLowerCase(); + // Now figure out how to construct our date format for our locale + if (NAMED_PATTERNS.containsKey(lcFormatString)) + { + if (lcFormatType.equals("date")) + { + format = DateFormat.getDateInstance(NAMED_PATTERNS.get(lcFormatString), locale); + } + else if (lcFormatType.equals("datetime")) + { + format = DateFormat.getDateTimeInstance( + NAMED_PATTERNS.get(lcFormatString), + NAMED_PATTERNS.get(lcFormatString), + locale); + } + else if (lcFormatType.equals("time")) + { + format = DateFormat.getTimeInstance(NAMED_PATTERNS.get(lcFormatString), locale); + } + else + { + throw new StripesRuntimeException("Invalid formatType for Date: " + + formatType + + ". Allowed types are 'date', 'time' and 'datetime'."); + } + } + else + { + format = new SimpleDateFormat(formatPattern, locale); + } + } + + @Override + public String format(Calendar input) + { + if (input != null) + { + return this.format.format(input.getTime()); + } + return null; + } +} \ No newline at end of file Property changes on: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/extra/CalendarFormatter.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 12:46:56
|
Revision: 3596 http://openutils.svn.sourceforge.net/openutils/?rev=3596&view=rev Author: fgiust Date: 2011-08-08 12:46:50 +0000 (Mon, 08 Aug 2011) Log Message: ----------- update tasks/testng dependencies Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2011-08-08 12:44:20 UTC (rev 3595) +++ trunk/openutils-mgnlstripes/pom.xml 2011-08-08 12:46:50 UTC (rev 3596) @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<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"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -72,7 +73,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnltasks</artifactId> - <version>4.1.0</version> + <version>4.1.2</version> </dependency> <dependency> <groupId>javax.servlet</groupId> @@ -89,8 +90,7 @@ <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.7</version> + <version>6.0.1</version> <scope>test</scope> <exclusions> <exclusion> @@ -103,4 +103,4 @@ <properties> <magnolia.version>4.4.1</magnolia.version> </properties> -</project> +</project> \ 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: <fg...@us...> - 2011-08-08 12:44:27
|
Revision: 3595 http://openutils.svn.sourceforge.net/openutils/?rev=3595&view=rev Author: fgiust Date: 2011-08-08 12:44:20 +0000 (Mon, 08 Aug 2011) Log Message: ----------- MGNLSTRIPES-5 Mapped actions are lost on paragraph refresh. Modified Paths: -------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaAlternateMultipartWrapper.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/pages/StripesConfigurationPage.java trunk/openutils-mgnlstripes/src/main/resources/META-INF/magnolia/stripes.xml Added Paths: ----------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesAwareParagraphManager.java Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaAlternateMultipartWrapper.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaAlternateMultipartWrapper.java 2011-08-08 11:02:12 UTC (rev 3594) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaAlternateMultipartWrapper.java 2011-08-08 12:44:20 UTC (rev 3595) @@ -30,21 +30,28 @@ * Magnolia itself. * @author danilo ghirardelli * @version $Id$ + * @deprecated use MagnoliaMultipartWrapper */ -public class MagnoliaAlternateMultipartWrapper extends MagnoliaMultipartWrapper implements MultipartWrapper { +@Deprecated +public class MagnoliaAlternateMultipartWrapper extends MagnoliaMultipartWrapper implements MultipartWrapper +{ /** * {@inheritDoc} */ - public Enumeration<String> getParameterNames() { + public Enumeration<String> getParameterNames() + { // All params are already included in request - return new Enumeration<String>() { + return new Enumeration<String>() + { - public boolean hasMoreElements() { + public boolean hasMoreElements() + { return false; } - public String nextElement() { + public String nextElement() + { return null; } }; @@ -53,7 +60,8 @@ /** * {@inheritDoc} */ - public String[] getParameterValues(String name) { + public String[] getParameterValues(String name) + { // All params are already included in request return null; } Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2011-08-08 11:02:12 UTC (rev 3594) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2011-08-08 12:44:20 UTC (rev 3595) @@ -120,7 +120,6 @@ * @param name dialog name * @param binding Stripes action binding */ - @SuppressWarnings("unchecked") private void collectStripesParagraphs(String paragraphName, String dialogName, String binding) { Paragraph paragraph = new Paragraph(); @@ -138,7 +137,6 @@ ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); } - @SuppressWarnings("unchecked") public static void registerParagraphs() { for (Paragraph paragraph : paragraphs) Added: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesAwareParagraphManager.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesAwareParagraphManager.java (rev 0) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesAwareParagraphManager.java 2011-08-08 12:44:20 UTC (rev 3595) @@ -0,0 +1,40 @@ +/** + * + * Stripes module for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlstripes.html) + * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package it.openutils.magnoliastripes; + +import info.magnolia.module.templating.ParagraphManager; + + +/** + * Extended paragraph manager that reload atogenerated stripes paragraphs after a refresh. + * @author fgiust + * @version $Id$ + */ +public class StripesAwareParagraphManager extends ParagraphManager +{ + + @Override + public void onClear() + { + super.onClear(); + log.info("Reloading Stripes paragraphs"); + MgnlActionResolver.registerParagraphs(); + } +} Property changes on: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesAwareParagraphManager.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/pages/StripesConfigurationPage.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/pages/StripesConfigurationPage.java 2011-08-08 11:02:12 UTC (rev 3594) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/pages/StripesConfigurationPage.java 2011-08-08 12:44:20 UTC (rev 3595) @@ -76,7 +76,7 @@ public boolean isDialogConfigured(String paragraphName) { - Paragraph paragraph = (Paragraph) getParagraphManager().getParagraphs().get(paragraphName); + Paragraph paragraph = getParagraphManager().getParagraphs().get(paragraphName); if (paragraph != null) { String dialogName = paragraph.getDialog(); @@ -100,7 +100,7 @@ public String getDialogPath(String paragraphName) { - Paragraph paragraph = (Paragraph) getParagraphManager().getParagraphs().get(paragraphName); + Paragraph paragraph = getParagraphManager().getParagraphs().get(paragraphName); if (paragraph != null) { String dialogName = paragraph.getDialog(); Modified: trunk/openutils-mgnlstripes/src/main/resources/META-INF/magnolia/stripes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/META-INF/magnolia/stripes.xml 2011-08-08 11:02:12 UTC (rev 3594) +++ trunk/openutils-mgnlstripes/src/main/resources/META-INF/magnolia/stripes.xml 2011-08-08 12:44:20 UTC (rev 3595) @@ -7,10 +7,16 @@ <class>it.openutils.magnoliastripes.StripesModule</class> <versionHandler>it.openutils.magnoliastripes.setup.StripesModuleVersionHandler</versionHandler> <version>${project.version}</version> + <properties> + <property> + <name>info.magnolia.module.templating.ParagraphManager</name> + <value>it.openutils.magnoliastripes.StripesAwareParagraphManager</value> + </property> + </properties> <dependencies> <dependency> <name>adminInterface</name> - <version>3.0/*</version> + <version>4.0/*</version> </dependency> </dependencies> </module> \ 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: <hu...@op...> - 2011-08-08 11:45:44
|
See <https://hudson.openmindonline.it/job/openutils-mgnlcriteria/159/changes> |
From: <hu...@op...> - 2011-08-08 11:45:41
|
See <https://hudson.openmindonline.it/job/openutils-mgnlcriteria/net.sourceforge.openutils$openutils-mgnlcriteria/159/changes> |
From: <fg...@us...> - 2011-08-08 11:02:18
|
Revision: 3594 http://openutils.svn.sourceforge.net/openutils/?rev=3594&view=rev Author: fgiust Date: 2011-08-08 11:02:12 +0000 (Mon, 08 Aug 2011) Log Message: ----------- MGNLSTRIPES-4 Multipart form has request parameters "multiplied" Modified Paths: -------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java 2011-08-08 10:59:27 UTC (rev 3593) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java 2011-08-08 11:02:12 UTC (rev 3594) @@ -68,10 +68,24 @@ /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") public Enumeration<String> getParameterNames() { - return getForm().getParameterNames(); + // All params are already included in request + return new Enumeration<String>() + { + + @Override + public boolean hasMoreElements() + { + return false; + } + + @Override + public String nextElement() + { + return null; + } + }; } /** @@ -79,7 +93,8 @@ */ public String[] getParameterValues(String name) { - return getForm().getParameterValues(name); + // All params are already included in request + return null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 10:59:33
|
Revision: 3593 http://openutils.svn.sourceforge.net/openutils/?rev=3593&view=rev Author: fgiust Date: 2011-08-08 10:59:27 +0000 (Mon, 08 Aug 2011) Log Message: ----------- MGNLSTRIPES-9 Template renderer configuration not applied on first install. Modified Paths: -------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.modules.stripes.paragraph-renderers.stripes.xml trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.modules.stripes.template-renderers.stripes.xml Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2011-08-08 10:54:52 UTC (rev 3592) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2011-08-08 10:59:27 UTC (rev 3593) @@ -20,23 +20,16 @@ package it.openutils.magnoliastripes.setup; import info.magnolia.cms.beans.config.ContentRepository; -import info.magnolia.cms.core.Content; -import info.magnolia.cms.core.ItemType; import info.magnolia.module.DefaultModuleVersionHandler; import info.magnolia.module.InstallContext; import info.magnolia.module.delta.AddMimeMappingTask; import info.magnolia.module.delta.FilterOrderingTask; -import info.magnolia.module.delta.MoveAndRenamePropertyTask; -import info.magnolia.module.delta.PropertyExistsDelegateTask; import info.magnolia.module.delta.Task; -import info.magnolia.module.model.Version; import it.openutils.mgnltasks.CreateMissingPropertyTask; import java.util.List; -import javax.jcr.RepositoryException; - /** * @author fgiust * @version $Id: $ @@ -66,53 +59,6 @@ "stripes", new String[]{"context", "login", "uriSecurity", "multipartRequest" })); - // Didn't find a better way to get the current magnolia version... - Content coreModule; - try - { - coreModule = installContext - .getConfigHierarchyManager() - .getContent("/modules/core", false, ItemType.CONTENT); - if ((coreModule != null) && (coreModule.hasNodeData("version"))) - { - Version coreVersion = Version.parseVersion(coreModule.getNodeData("version").getString()); - // Any version from 4.4.0 onward need this patch. - if (coreVersion.isStrictlyAfter(Version.parseVersion(4, 3, 99))) - { - tasks.add(new PropertyExistsDelegateTask( - "Checking stripes renderer status", - "Checking stripes module template renderers status", - ContentRepository.CONFIG, - "/modules/stripes/template-renderers/stripes", - "class", - new MoveAndRenamePropertyTask( - "Moving strieps renderer \"class\" to \"renderer\"", - "/modules/stripes/template-renderers/stripes", - "class", - "/modules/stripes/template-renderers/stripes", - "renderer"))); - tasks.add(new PropertyExistsDelegateTask( - "Checking stripes renderer status", - "Checking stripes module template renderers status", - ContentRepository.CONFIG, - "/modules/stripes/template-renderers/stripes", - "name", - new MoveAndRenamePropertyTask( - "Moving strieps renderer \"name\" to \"type\"", - "/modules/stripes/template-renderers/stripes", - "name", - "/modules/stripes/template-renderers/stripes", - "type"))); - } - - } - } - catch (RepositoryException e) - { - - log.error("Unable to check the current magnolia version: {}", e.getMessage()); - } - return tasks; } } Modified: trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.modules.stripes.paragraph-renderers.stripes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.modules.stripes.paragraph-renderers.stripes.xml 2011-08-08 10:54:52 UTC (rev 3592) +++ trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.modules.stripes.paragraph-renderers.stripes.xml 2011-08-08 10:59:27 UTC (rev 3593) @@ -9,13 +9,25 @@ <sv:property sv:name="class" sv:type="String"> <sv:value>it.openutils.magnoliastripes.StripesRenderer</sv:value> </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> <sv:property sv:name="name" sv:type="String"> <sv:value>stripes</sv:value> </sv:property> + <sv:property sv:name="renderer" sv:type="String"> + <sv:value>it.openutils.magnoliastripes.StripesRenderer</sv:value> + </sv:property> + <sv:property sv:name="type" sv:type="String"> + <sv:value>stripes</sv:value> + </sv:property> <sv:node sv:name="MetaData"> <sv:property sv:name="jcr:primaryType" sv:type="Name"> <sv:value>mgnl:metaData</sv:value> </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> <sv:property sv:name="mgnl:activated" sv:type="Boolean"> <sv:value>false</sv:value> </sv:property> @@ -32,7 +44,7 @@ <sv:value>2007-07-23T22:39:14.178+01:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2007-07-23T22:39:40.986+01:00</sv:value> + <sv:value>2011-08-05T12:09:27.489+02:00</sv:value> </sv:property> </sv:node> </sv:node> Modified: trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.modules.stripes.template-renderers.stripes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.modules.stripes.template-renderers.stripes.xml 2011-08-08 10:54:52 UTC (rev 3592) +++ trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.modules.stripes.template-renderers.stripes.xml 2011-08-08 10:59:27 UTC (rev 3593) @@ -9,13 +9,25 @@ <sv:property sv:name="class" sv:type="String"> <sv:value>it.openutils.magnoliastripes.StripesRenderer</sv:value> </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> <sv:property sv:name="name" sv:type="String"> <sv:value>stripes</sv:value> </sv:property> + <sv:property sv:name="renderer" sv:type="String"> + <sv:value>it.openutils.magnoliastripes.StripesRenderer</sv:value> + </sv:property> + <sv:property sv:name="type" sv:type="String"> + <sv:value>stripes</sv:value> + </sv:property> <sv:node sv:name="MetaData"> <sv:property sv:name="jcr:primaryType" sv:type="Name"> <sv:value>mgnl:metaData</sv:value> </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> <sv:property sv:name="mgnl:activated" sv:type="Boolean"> <sv:value>false</sv:value> </sv:property> @@ -32,7 +44,7 @@ <sv:value>2007-07-23T22:39:14.178+01:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2007-07-23T22:39:40.986+01:00</sv:value> + <sv:value>2011-08-05T12:09:15.512+02:00</sv:value> </sv:property> </sv:node> </sv:node> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 10:54:58
|
Revision: 3592 http://openutils.svn.sourceforge.net/openutils/?rev=3592&view=rev Author: fgiust Date: 2011-08-08 10:54:52 +0000 (Mon, 08 Aug 2011) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlutils/pom.xml Modified: trunk/openutils-mgnlutils/pom.xml =================================================================== --- trunk/openutils-mgnlutils/pom.xml 2011-08-08 10:54:41 UTC (rev 3591) +++ trunk/openutils-mgnlutils/pom.xml 2011-08-08 10:54:52 UTC (rev 3592) @@ -9,7 +9,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlutils</artifactId> <name>Generic utilities for Magnolia CMS</name> - <version>1.0.9</version> + <version>1.0.10-SNAPSHOT</version> <inceptionYear>2009</inceptionYear> <description>A collection of Magnolia utilities and extensions</description> <url>http://www.openmindlab.com/lab/products/mgnlutils.html</url> @@ -24,9 +24,9 @@ </license> </licenses> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlutils-1.0.9</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlutils-1.0.9 </developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlutils-1.0.9</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlutils</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlutils </developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlutils</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 10:54:47
|
Revision: 3591 http://openutils.svn.sourceforge.net/openutils/?rev=3591&view=rev Author: fgiust Date: 2011-08-08 10:54:41 +0000 (Mon, 08 Aug 2011) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlutils-1.0.9 Added Paths: ----------- tags/openutils-mgnlutils-1.0.9/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 10:54:20
|
Revision: 3590 http://openutils.svn.sourceforge.net/openutils/?rev=3590&view=rev Author: fgiust Date: 2011-08-08 10:54:13 +0000 (Mon, 08 Aug 2011) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlutils-1.0.9 Modified Paths: -------------- trunk/openutils-mgnlutils/pom.xml Modified: trunk/openutils-mgnlutils/pom.xml =================================================================== --- trunk/openutils-mgnlutils/pom.xml 2011-08-08 10:53:51 UTC (rev 3589) +++ trunk/openutils-mgnlutils/pom.xml 2011-08-08 10:54:13 UTC (rev 3590) @@ -1,5 +1,4 @@ -<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 "> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -10,7 +9,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlutils</artifactId> <name>Generic utilities for Magnolia CMS</name> - <version>1.0.9-SNAPSHOT</version> + <version>1.0.9</version> <inceptionYear>2009</inceptionYear> <description>A collection of Magnolia utilities and extensions</description> <url>http://www.openmindlab.com/lab/products/mgnlutils.html</url> @@ -25,9 +24,9 @@ </license> </licenses> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlutils</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlutils </developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlutils</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlutils-1.0.9</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlutils-1.0.9 </developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlutils-1.0.9</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 10:53:57
|
Revision: 3589 http://openutils.svn.sourceforge.net/openutils/?rev=3589&view=rev Author: fgiust Date: 2011-08-08 10:53:51 +0000 (Mon, 08 Aug 2011) Log Message: ----------- update dependencies Modified Paths: -------------- trunk/openutils-mgnlutils/pom.xml Modified: trunk/openutils-mgnlutils/pom.xml =================================================================== --- trunk/openutils-mgnlutils/pom.xml 2011-08-08 10:49:18 UTC (rev 3588) +++ trunk/openutils-mgnlutils/pom.xml 2011-08-08 10:53:51 UTC (rev 3589) @@ -1,4 +1,5 @@ -<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 "> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -108,8 +109,7 @@ <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> + <version>6.0.1</version> <optional>true</optional><!-- this is not in test scope since the module also contains testng support classes --> <exclusions> <exclusion> @@ -144,6 +144,6 @@ </dependency> </dependencies> <properties> - <magnolia.version>4.4.1</magnolia.version> + <magnolia.version>4.4.4</magnolia.version> </properties> </project> \ 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: <fg...@us...> - 2011-08-08 10:49:24
|
Revision: 3588 http://openutils.svn.sourceforge.net/openutils/?rev=3588&view=rev Author: fgiust Date: 2011-08-08 10:49:18 +0000 (Mon, 08 Aug 2011) Log Message: ----------- a couple of useful EL functions Modified Paths: -------------- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld Modified: trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java =================================================================== --- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java 2011-08-08 10:42:46 UTC (rev 3587) +++ trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java 2011-08-08 10:49:18 UTC (rev 3588) @@ -935,4 +935,51 @@ return null; } + /** + * Returns the value of a page property, by iterating on active page ancestor till a value is found + * @param property property name + * @return property value + */ + public static String pagePropertyInherited(String property) + { + Content content = MgnlContext.getAggregationState().getMainContent(); + + try + { + while (content.getLevel() >= 1) + { + String value = content.getNodeData(property).getString(); + + if (!StringUtils.isEmpty(value)) + { + return value; + } + + content = content.getParent(); + } + } + catch (RepositoryException e) + { + log.warn(e.getClass().getName() + + " caught while reading property " + + property + + " from " + + MgnlContext.getAggregationState().getMainContent().getHandle()); + } + + return null; + } + + /** + * Sets the given content as the active page, calling MgnlContext.getAggregationState().setCurrentContent) + * @param content current content to set + */ + public static void setActivePage(Content content) + { + if (content != null) + { + MgnlContext.getAggregationState().setCurrentContent(content); + } + } + } Modified: trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld =================================================================== --- trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld 2011-08-08 10:42:46 UTC (rev 3587) +++ trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld 2011-08-08 10:49:18 UTC (rev 3588) @@ -326,6 +326,17 @@ <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.util.Map userProperties()</function-signature> </function> - + <function> + <name>pagePropertyInherited</name> + <description>Returns the value of a page property, by iterating on active page ancestor till a value is found</description> + <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> + <function-signature>java.lang.String pagePropertyInherited( java.lang.String)</function-signature> + </function> + <function> + <name>setActivePage</name> + <description>Sets the given content as the active page, calling MgnlContext.getAggregationState().setCurrentContent)</description> + <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> + <function-signature>void setActivePage(info.magnolia.cms.core.Content)</function-signature> + </function> <!-- please don't add new funtions without a meaningfull <description> --> </taglib> \ 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: <hu...@op...> - 2011-08-08 10:45:45
|
See <https://hudson.openmindonline.it/job/openutils-mgnlcriteria/158/changes> |
From: <hu...@op...> - 2011-08-08 10:45:42
|
See <https://hudson.openmindonline.it/job/openutils-mgnlcriteria/net.sourceforge.openutils$openutils-mgnlcriteria/158/changes> |
From: <fg...@us...> - 2011-08-08 10:42:53
|
Revision: 3587 http://openutils.svn.sourceforge.net/openutils/?rev=3587&view=rev Author: fgiust Date: 2011-08-08 10:42:46 +0000 (Mon, 08 Aug 2011) Log Message: ----------- MGNLUTILS-31 SafeMultivalueSaveHandler don't remove values when no value is sent Modified Paths: -------------- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/save/SafeMultiValueSaveHandler.java Modified: trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/save/SafeMultiValueSaveHandler.java =================================================================== --- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/save/SafeMultiValueSaveHandler.java 2011-08-08 10:32:03 UTC (rev 3586) +++ trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/save/SafeMultiValueSaveHandler.java 2011-08-08 10:42:46 UTC (rev 3587) @@ -72,6 +72,13 @@ getOrCreateAndSet(node, name, l.toArray(new Value[l.size()])); } } + else + { + if (node.hasNodeData(name)) + { + node.deleteNodeData(name); + } + } } public void save(Content parentNode, Content configNode, String name, MultipartForm form, int type, int valueType, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 10:32:09
|
Revision: 3586 http://openutils.svn.sourceforge.net/openutils/?rev=3586&view=rev Author: fgiust Date: 2011-08-08 10:32:03 +0000 (Mon, 08 Aug 2011) Log Message: ----------- CRIT-40 escaping of valid elements in base path Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2011-08-08 10:31:44 UTC (rev 3585) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2011-08-08 10:32:03 UTC (rev 3586) @@ -121,7 +121,8 @@ StringBuilder encodedPath = new StringBuilder(path.length()); - boolean inXpathCondition = false; + int inXpathCondition = 0; + boolean xpathWithFunction = false; // TODO maybe a more robust check is needed for (int i = 0; i < path.length(); ++i) @@ -132,11 +133,11 @@ { encodedPath.append("_x" + StringUtils.leftPad(Integer.toHexString(ch), 4, '0') + "_"); } - else if (!inXpathCondition && ch == ' ') + else if (inXpathCondition <= 0 && ch == ' ') { encodedPath.append("_x0020_"); } - else if (!inXpathCondition && ch == ',') + else if (inXpathCondition <= 0 && ch == ',') { encodedPath.append("_x002c_"); } @@ -145,12 +146,27 @@ if (ch == '[') { - inXpathCondition = true; + inXpathCondition++; } - else if (inXpathCondition && ch == ']') + else if (ch == '(') { - inXpathCondition = false; + // "(" is the beginning of an expression only when used with the element() function + // not really a clean check, actually... + if (encodedPath.indexOf("element") > 0) + { + inXpathCondition++; + xpathWithFunction = true; + } } + else if (inXpathCondition > 0 && ch == ']') + { + inXpathCondition--; + } + else if (inXpathCondition > 0 && xpathWithFunction && ch == ')') + { + inXpathCondition--; + xpathWithFunction = false; + } encodedPath.append(ch); } } Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java 2011-08-08 10:31:44 UTC (rev 3585) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java 2011-08-08 10:32:03 UTC (rev 3586) @@ -86,4 +86,56 @@ Assert.assertEquals("//site//*[( (@property='test') )] ", xpathExpression); } + + /** + * Test for CRIT-37 + */ + @Test + public void testEscapeComma() + { + Criteria criteria = JCRCriteriaFactory.createCriteria().setBasePath("/one/two/3three/fo,ur/"); + criteria.add(Restrictions.eq("@property", "test")); + String xpathExpression = criteria.toXpathExpression(); + + Assert.assertEquals(xpathExpression, "//one/two/_x0033_three/fo_x002c_ur//*[( (@property='test') )] "); + } + + /** + * Test for CRIT-40 + */ + @Test + public void testDontEscapeBasePathWithParenthesis() + { + Criteria criteria = JCRCriteriaFactory.createCriteria().setBasePath("/path/with(paren,thesis)/test"); + criteria.add(Restrictions.eq("@property", "test")); + String xpathExpression = criteria.toXpathExpression(); + + Assert.assertEquals(xpathExpression, "//path/with(paren_x002c_thesis)/test//*[( (@property='test') )] "); + } + + /** + * Test for CRIT-40 + */ + @Test + public void testDontEscapeExpressions() + { + Criteria criteria = JCRCriteriaFactory.createCriteria().setBasePath("/jcr:root///element(* , mgnl:media)"); + criteria.add(Restrictions.eq("@property", "test")); + String xpathExpression = criteria.toXpathExpression(); + + Assert.assertEquals(xpathExpression, "/jcr:root///element(* , mgnl:media)[( (@property='test') )] "); + } + + /** + * Test for CRIT-40 + */ + @Test + public void testDontEscapeExpressions2() + { + Criteria criteria = JCRCriteriaFactory.createCriteria().setBasePath("/jcr:root//*[@jcr:uuid='xxxx-xxxx']//*"); + criteria.add(Restrictions.eq("@property", "test")); + String xpathExpression = criteria.toXpathExpression(); + + Assert.assertEquals(xpathExpression, "/jcr:root//*[@jcr:uuid='xxxx-xxxx']//*[( (@property='test') )] "); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-08 10:31:52
|
Revision: 3585 http://openutils.svn.sourceforge.net/openutils/?rev=3585&view=rev Author: fgiust Date: 2011-08-08 10:31:44 +0000 (Mon, 08 Aug 2011) Log Message: ----------- CRIT-42 using DAY_OF_YER and HOUR_OF_DAY Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2011-08-08 09:32:08 UTC (rev 3584) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2011-08-08 10:31:44 UTC (rev 3585) @@ -375,7 +375,7 @@ private static Calendar getDayEnd(Calendar cal) { Calendar cal2 = getDayStart(cal); - cal2.add(Calendar.DATE, 1); + cal2.add(Calendar.DAY_OF_YEAR, 1); cal2.add(Calendar.MILLISECOND, -1); return cal2; } Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java 2011-08-08 09:32:08 UTC (rev 3584) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java 2011-08-08 10:31:44 UTC (rev 3585) @@ -92,18 +92,18 @@ Calendar begin = Calendar.getInstance(); begin.set(1999, Calendar.JANUARY, 1); - begin.set(Calendar.HOUR, 0); + begin.set(Calendar.HOUR_OF_DAY, 0); begin.set(Calendar.MINUTE, 0); begin.set(Calendar.SECOND, 0); begin.set(Calendar.MILLISECOND, 0); Calendar end = Calendar.getInstance(); end.set(2001, Calendar.DECEMBER, 31); - end.set(Calendar.HOUR, 0); + end.set(Calendar.HOUR_OF_DAY, 0); end.set(Calendar.MINUTE, 0); end.set(Calendar.SECOND, 0); end.set(Calendar.MILLISECOND, 0); end.add(Calendar.MILLISECOND, -1); - end.add(Calendar.DATE, 1); + end.add(Calendar.DAY_OF_YEAR, 1); String expectedStmt = "//pets//*" + "[((jcr:contains(@title, 'Lucky')) and (@petType='dog')" @@ -402,4 +402,5 @@ node = iterator.next(); Assert.assertEquals(node.getTitle(), "Leo"); } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@op...> - 2011-08-08 10:13:55
|
See <https://hudson.openmindonline.it/job/openutils-mgnlcriteria/157/> |
From: <fg...@us...> - 2011-08-08 09:32:15
|
Revision: 3584 http://openutils.svn.sourceforge.net/openutils/?rev=3584&view=rev Author: fgiust Date: 2011-08-08 09:32:08 +0000 (Mon, 08 Aug 2011) Log Message: ----------- CRIT-42 revised timezone handling Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BaseCriterion.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BaseCriterion.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BaseCriterion.java 2011-08-05 10:02:25 UTC (rev 3583) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BaseCriterion.java 2011-08-08 09:32:08 UTC (rev 3584) @@ -19,9 +19,6 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; -import java.text.SimpleDateFormat; -import java.util.Locale; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,13 +32,6 @@ { /** - * Date format used for date formatting. - */ - protected static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat( - "yyyy-MM-dd'T'HH:mm:ss.SSS", - Locale.ENGLISH); - - /** * Stable serialVersionUID */ private static final long serialVersionUID = 42L; Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java 2011-08-05 10:02:25 UTC (rev 3583) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java 2011-08-08 09:32:08 UTC (rev 3584) @@ -23,6 +23,7 @@ import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; /** @@ -73,28 +74,16 @@ { Calendar cal = (Calendar) lo; Calendar cal2 = (Calendar) hi; - String fmt; - String fmt2; - synchronized (DATE_FORMAT) - { - DATE_FORMAT.setCalendar(cal); - fmt = DATE_FORMAT.format(cal.getTime()); - DATE_FORMAT.setCalendar(cal2); - fmt2 = DATE_FORMAT.format(cal2.getTime()); - } - fragment.append(XS_DATETIME_FUNCTION + "('" - + fmt - + "+00:00" + + XPathTextUtils.toXsdDate(cal) + "') and " + propertyName + " <= " + XS_DATETIME_FUNCTION + "('" - + fmt2 - + "+00:00" + + XPathTextUtils.toXsdDate(cal2) + "') "); } else Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2011-08-05 10:02:25 UTC (rev 3583) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2011-08-08 09:32:08 UTC (rev 3584) @@ -21,7 +21,6 @@ import java.util.Calendar; import java.util.Collection; -import java.util.TimeZone; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; @@ -37,17 +36,6 @@ public final class Restrictions { - private static final Calendar MIDNIGHT_GMT; - - static - { - MIDNIGHT_GMT = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - MIDNIGHT_GMT.set(Calendar.HOUR_OF_DAY, 0); - MIDNIGHT_GMT.set(Calendar.MINUTE, 0); - MIDNIGHT_GMT.set(Calendar.SECOND, 0); - MIDNIGHT_GMT.set(Calendar.MILLISECOND, 0); - } - private Restrictions() { // cannot be instantiated @@ -378,7 +366,8 @@ private static Calendar getDayStart(Calendar cal) { - Calendar cal2 = (Calendar) MIDNIGHT_GMT.clone(); + Calendar cal2 = Calendar.getInstance(); + cal2.clear(); cal2.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)); return cal2; } @@ -386,7 +375,7 @@ private static Calendar getDayEnd(Calendar cal) { Calendar cal2 = getDayStart(cal); - cal2.add(Calendar.DAY_OF_YEAR, 1); + cal2.add(Calendar.DATE, 1); cal2.add(Calendar.MILLISECOND, -1); return cal2; } Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java 2011-08-05 10:02:25 UTC (rev 3583) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java 2011-08-08 09:32:08 UTC (rev 3584) @@ -23,6 +23,7 @@ import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; import org.apache.commons.lang.StringUtils; @@ -104,14 +105,8 @@ { fragment.append(propertyName).append(getOp()); Calendar cal = (Calendar) value; - String fmt; - synchronized (DATE_FORMAT) - { - DATE_FORMAT.setCalendar(cal); - fmt = DATE_FORMAT.format(cal.getTime()); - } - fragment.append(XS_DATETIME_FUNCTION + "('" + fmt + "+00:00" + "')) "); + fragment.append(XS_DATETIME_FUNCTION + "('" + XPathTextUtils.toXsdDate(cal) + "')) "); } else if (value != null) { Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2011-08-05 10:02:25 UTC (rev 3583) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2011-08-08 09:32:08 UTC (rev 3584) @@ -19,7 +19,12 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils; +import java.util.Calendar; +import java.util.Locale; +import java.util.TimeZone; + import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.time.FastDateFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,6 +40,14 @@ private static Logger log = LoggerFactory.getLogger(XPathTextUtils.class); + /** + * Date format used for date formatting. + */ + private static final FastDateFormat DATE_FORMAT = FastDateFormat.getInstance( + "yyyy-MM-dd'T'HH:mm:ss.SSSZ", + TimeZone.getDefault(), + Locale.ENGLISH); + private XPathTextUtils() { } @@ -144,4 +157,23 @@ log.debug("returning encoded path {}", encodedPath); return encodedPath.toString(); } + + /** + * Get a date in the XSD format "yyyy-MM-ddThh:mm:ss.SSS:+01:00" + * @param date input calendar + * @return XSD formatted date + */ + public static String toXsdDate(Calendar date) + { + if (date == null) + { + return null; + } + + String xsdDate = DATE_FORMAT.format(date); + int length = xsdDate.length(); + + return StringUtils.substring(xsdDate, 0, length - 2) + ":" + StringUtils.substring(xsdDate, length - 2, length); + } + } \ No newline at end of file Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java 2011-08-05 10:02:25 UTC (rev 3583) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java 2011-08-08 09:32:08 UTC (rev 3584) @@ -32,316 +32,374 @@ import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Order; import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; import org.apache.commons.lang.StringUtils; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; + /** * @author dschivo * @version $Id$ */ @RepositoryTestConfiguration(jackrabbitRepositoryConfig = "/crit-repository/jackrabbit-test-configuration.xml", repositoryConfig = "/crit-repository/test-repositories.xml", bootstrapFiles = "/crit-bootstrap/website.pets.xml") -public class CriteriaTest extends TestNgRepositoryTestcase { +public class CriteriaTest extends TestNgRepositoryTestcase +{ - /** - * {@inheritDoc} - */ - @Override - @BeforeClass - public void setUp() throws Exception { - super.setUp(); + /** + * {@inheritDoc} + */ + @Override + @BeforeClass + public void setUp() throws Exception + { + super.setUp(); - // Nodes in this workspace: - // - pets (title=Pets) - // --- cats (title=Cats) - // ----- 1 (title=Leo, petType=cat, birthDate=2000-09-07) - // ----- 7 (title=Samantha, petType=cat, birthDate=1995-09-04) - // ----- 8 (title=Max, petType=cat, birthDate=1995-09-04) - // ----- 13 (title=Sly, petType=cat, birthDate=2002-06-08) - // --- dogs (title=Dogs) - // ----- 3 (title=Rosy, petType=dog, birthDate=2001-04-17) - // ----- 4 (title=Jewel, petType=dog, birthDate=2000-03-07) - // ----- 10 (title=Mulligan, petType=dog, birthDate=1997-02-24) - // ----- 12 (title=Lucky, petType=dog, birthDate=2000-06-24) - // --- lizards (title=Lizards) - // ----- 5 (title=Iggy, petType=lizard, birthDate=2000-11-30) - // --- snakes (title=Snakes) - // ----- 6 (title=George, petType=snake, birthDate=2000-01-20) - // --- birds (title=Birds) - // ----- 9 (title=Lucky, petType=bird, birthDate=1999-08-06) - // ----- 11 (title=Freddy, petType=bird, birthDate=2000-03-09) - // --- hamsters (title=Hamsters) - // ----- 2 (title=Basil, petType=hamster, birthDate=2002-08-06) - MgnlContext.getHierarchyManager(ContentRepository.WEBSITE).save(); - } + // Nodes in this workspace: + // - pets (title=Pets) + // --- cats (title=Cats) + // ----- 1 (title=Leo, petType=cat, birthDate=2000-09-07) + // ----- 7 (title=Samantha, petType=cat, birthDate=1995-09-04) + // ----- 8 (title=Max, petType=cat, birthDate=1995-09-04) + // ----- 13 (title=Sly, petType=cat, birthDate=2002-06-08) + // --- dogs (title=Dogs) + // ----- 3 (title=Rosy, petType=dog, birthDate=2001-04-17) + // ----- 4 (title=Jewel, petType=dog, birthDate=2000-03-07) + // ----- 10 (title=Mulligan, petType=dog, birthDate=1997-02-24) + // ----- 12 (title=Lucky, petType=dog, birthDate=2000-06-24) + // --- lizards (title=Lizards) + // ----- 5 (title=Iggy, petType=lizard, birthDate=2000-11-30) + // --- snakes (title=Snakes) + // ----- 6 (title=George, petType=snake, birthDate=2000-01-20) + // --- birds (title=Birds) + // ----- 9 (title=Lucky, petType=bird, birthDate=1999-08-06) + // ----- 11 (title=Freddy, petType=bird, birthDate=2000-03-09) + // --- hamsters (title=Hamsters) + // ----- 2 (title=Basil, petType=hamster, birthDate=2002-08-06) + MgnlContext.getHierarchyManager(ContentRepository.WEBSITE).save(); + } - /** - * Tests the xpath query statement produced by a Criteria instance. - * - * @throws Exception - */ - @Test - public void testToXpathExpression() throws Exception { - Criteria criteria = toXpathExpressionJavadocExampleCriteria(); + /** + * Tests the xpath query statement produced by a Criteria instance. + * @throws Exception + */ + @Test + public void testToXpathExpression() throws Exception + { + Criteria criteria = toXpathExpressionJavadocExampleCriteria(); - String expectedStmt = "//pets//*" - + "[((jcr:contains(@title, 'Lucky')) and (@petType='dog')" - + " and (@birthDate >=xs:dateTime('1999-01-01T00:00:00.000+00:00')" - + " and @birthDate <=xs:dateTime('2001-12-31T23:59:59.999+00:00')))]" - + " order by @title descending"; - String actualStmt = criteria.toXpathExpression(); - Assert.assertEquals(StringUtils.remove(actualStmt, ' '), StringUtils - .remove(expectedStmt, ' ')); - } + Calendar begin = Calendar.getInstance(); + begin.set(1999, Calendar.JANUARY, 1); + begin.set(Calendar.HOUR, 0); + begin.set(Calendar.MINUTE, 0); + begin.set(Calendar.SECOND, 0); + begin.set(Calendar.MILLISECOND, 0); + Calendar end = Calendar.getInstance(); + end.set(2001, Calendar.DECEMBER, 31); + end.set(Calendar.HOUR, 0); + end.set(Calendar.MINUTE, 0); + end.set(Calendar.SECOND, 0); + end.set(Calendar.MILLISECOND, 0); + end.add(Calendar.MILLISECOND, -1); + end.add(Calendar.DATE, 1); - /** - * @throws Exception - */ - @Test - public void testExecuteTrivial() throws Exception { - HierarchyManager hm = MgnlContext - .getHierarchyManager(ContentRepository.WEBSITE); - Content node = hm.getContent("/pets"); - Assert.assertEquals(node.getTitle(), "Pets"); + String expectedStmt = "//pets//*" + + "[((jcr:contains(@title, 'Lucky')) and (@petType='dog')" + + " and (@birthDate >=xs:dateTime('" + + XPathTextUtils.toXsdDate(begin) + + "')" + + " and @birthDate <=xs:dateTime('" + + XPathTextUtils.toXsdDate(end) + + "')))]" + + " order by @title descending"; - Criteria criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/jcr:root/*").add( - Restrictions.eq("@jcr:primaryType", ItemType.CONTENT - .getSystemName())).add( - Restrictions.eq("@title", "Pets")); - AdvancedResult result = criteria.execute(); - ResultIterator<AdvancedResultItem> iterator = result.getItems(); - Assert.assertTrue(iterator.hasNext()); - Content resultNode = iterator.next(); - Assert.assertEquals(resultNode.getTitle(), "Pets"); - } + log.debug(expectedStmt); - /** - * Tests the query execution of a Criteria instance. - * - * @throws Exception - */ - @Test - public void testExecute() throws Exception { - Criteria criteria = toXpathExpressionJavadocExampleCriteria(); + // @birthDate >=xs:dateTime('1999-01-01T00:00:00.000+01:00') + // and + // @birthDate <=xs:dateTime('2001-12-31T23:59:59.999+01:00') - AdvancedResult result = criteria.execute(); - Assert.assertEquals(result.getTotalSize(), 1); + String actualStmt = criteria.toXpathExpression(); - ResultIterator<AdvancedResultItem> iterator = result.getItems(); - Assert.assertEquals(iterator.getSize(), 1); - Assert.assertEquals(iterator.next().getName(), "12"); - } + Assert.assertEquals(StringUtils.remove(actualStmt, ' '), StringUtils.remove(expectedStmt, ' ')); + } - /** - * @return - */ - private Criteria toXpathExpressionJavadocExampleCriteria() { - Calendar begin = Calendar.getInstance(); - begin.set(1999, Calendar.JANUARY, 1); - Calendar end = Calendar.getInstance(); - end.set(2001, Calendar.DECEMBER, 31); + /** + * @throws Exception + */ + @Test + public void testExecuteTrivial() throws Exception + { + HierarchyManager hm = MgnlContext.getHierarchyManager(ContentRepository.WEBSITE); + Content node = hm.getContent("/pets"); + Assert.assertEquals(node.getTitle(), "Pets"); - Criteria criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.contains("@title", "Lucky")).add( - Restrictions.eq("@petType", "dog")).add( - Restrictions.betweenDates("@birthDate", begin, end)).addOrder( - Order.desc("@title")); - return criteria; - } + Criteria criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/jcr:root/*") + .add(Restrictions.eq("@jcr:primaryType", ItemType.CONTENT.getSystemName())) + .add(Restrictions.eq("@title", "Pets")); + AdvancedResult result = criteria.execute(); + ResultIterator<AdvancedResultItem> iterator = result.getItems(); + Assert.assertTrue(iterator.hasNext()); + Content resultNode = iterator.next(); + Assert.assertEquals(resultNode.getTitle(), "Pets"); + } - /** - * Tests pagination of results. - * - * @throws Exception - */ - @Test - public void testSetFirstResultAndMaxResults() throws Exception { - Calendar begin = Calendar.getInstance(); - begin.set(1999, Calendar.JANUARY, 1); - Calendar end = Calendar.getInstance(); - end.set(2001, Calendar.DECEMBER, 31); + /** + * Tests the query execution of a Criteria instance. + * @throws Exception + */ + @Test + public void testExecute() throws Exception + { + Criteria criteria = toXpathExpressionJavadocExampleCriteria(); - Criteria criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.betweenDates("@birthDate", begin, end)).addOrder( - Order.asc("@birthDate")).setFirstResult(5).setMaxResults(5); + AdvancedResult result = criteria.execute(); + Assert.assertEquals(result.getTotalSize(), 1); - AdvancedResult result = criteria.execute(); - // first page: - // --- 9 (title=Lucky, petType=bird, birthDate=1999-08-06) - // --- 6 (title=George, petType=snake, birthDate=2000-01-20) - // --- 4 (title=Jewel, petType=dog, birthDate=2000-03-07) - // --- 11 (title=Freddy, petType=bird, birthDate=2000-03-09) - // --- 12 (title=Lucky, petType=dog, birthDate=2000-06-24) - // second page: - // --- 1 (title=Leo, petType=cat, birthDate=2000-09-07) - // --- 5 (title=Iggy, petType=lizard, birthDate=2000-11-30) - // --- 3 (title=Rosy, petType=dog, birthDate=2001-04-17) - Assert.assertEquals(result.getTotalSize(), 8); + ResultIterator<AdvancedResultItem> iterator = result.getItems(); + Assert.assertEquals(iterator.getSize(), 1); + Assert.assertEquals(iterator.next().getName(), "12"); + } - ResultIterator<AdvancedResultItem> iterator = result.getItems(); - Assert.assertEquals(iterator.getSize(), 3); - Assert.assertEquals(iterator.next().getName(), "1"); - Assert.assertEquals(iterator.next().getName(), "5"); - Assert.assertEquals(iterator.next().getName(), "3"); - } + /** + * @return + */ + private Criteria toXpathExpressionJavadocExampleCriteria() + { + Calendar begin = Calendar.getInstance(); + begin.set(1999, Calendar.JANUARY, 1); + Calendar end = Calendar.getInstance(); + end.set(2001, Calendar.DECEMBER, 31); - /** - * Tests pagination of results. - * - * @throws Exception - */ - @Test - public void testSetPaging() throws Exception { - Calendar begin = Calendar.getInstance(); - begin.set(1999, Calendar.JANUARY, 1); - Calendar end = Calendar.getInstance(); - end.set(2001, Calendar.DECEMBER, 31); + Criteria criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.contains("@title", "Lucky")) + .add(Restrictions.eq("@petType", "dog")) + .add(Restrictions.betweenDates("@birthDate", begin, end)) + .addOrder(Order.desc("@title")); + return criteria; + } - Criteria criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.betweenDates("@birthDate", begin, end)).addOrder( - Order.asc("@birthDate")).setPaging(5, 2); + /** + * Tests pagination of results. + * @throws Exception + */ + @Test + public void testSetFirstResultAndMaxResults() throws Exception + { + Calendar begin = Calendar.getInstance(); + begin.set(1999, Calendar.JANUARY, 1); + Calendar end = Calendar.getInstance(); + end.set(2001, Calendar.DECEMBER, 31); - AdvancedResult result = criteria.execute(); - // first page: - // --- 9 (title=Lucky, petType=bird, birthDate=1999-08-06) - // --- 6 (title=George, petType=snake, birthDate=2000-01-20) - // --- 4 (title=Jewel, petType=dog, birthDate=2000-03-07) - // --- 11 (title=Freddy, petType=bird, birthDate=2000-03-09) - // --- 12 (title=Lucky, petType=dog, birthDate=2000-06-24) - // second page: - // --- 1 (title=Leo, petType=cat, birthDate=2000-09-07) - // --- 5 (title=Iggy, petType=lizard, birthDate=2000-11-30) - // --- 3 (title=Rosy, petType=dog, birthDate=2001-04-17) - Assert.assertEquals(result.getTotalSize(), 8); + Criteria criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.betweenDates("@birthDate", begin, end)) + .addOrder(Order.asc("@birthDate")) + .setFirstResult(5) + .setMaxResults(5); - ResultIterator<AdvancedResultItem> iterator = result.getItems(); - Assert.assertEquals(iterator.getSize(), 3); - Assert.assertEquals(iterator.next().getName(), "1"); - Assert.assertEquals(iterator.next().getName(), "5"); - Assert.assertEquals(iterator.next().getName(), "3"); - } + AdvancedResult result = criteria.execute(); + // first page: + // --- 9 (title=Lucky, petType=bird, birthDate=1999-08-06) + // --- 6 (title=George, petType=snake, birthDate=2000-01-20) + // --- 4 (title=Jewel, petType=dog, birthDate=2000-03-07) + // --- 11 (title=Freddy, petType=bird, birthDate=2000-03-09) + // --- 12 (title=Lucky, petType=dog, birthDate=2000-06-24) + // second page: + // --- 1 (title=Leo, petType=cat, birthDate=2000-09-07) + // --- 5 (title=Iggy, petType=lizard, birthDate=2000-11-30) + // --- 3 (title=Rosy, petType=dog, birthDate=2001-04-17) + Assert.assertEquals(result.getTotalSize(), 8); - /** - * Tests ordering, both ascending and descending. - * - * @throws Exception - */ - @Test - public void testAddOrder() throws Exception { - Criteria criteria; - ResultIterator<AdvancedResultItem> iterator; - Calendar birthDate; + ResultIterator<AdvancedResultItem> iterator = result.getItems(); + Assert.assertEquals(iterator.getSize(), 3); + Assert.assertEquals(iterator.next().getName(), "1"); + Assert.assertEquals(iterator.next().getName(), "5"); + Assert.assertEquals(iterator.next().getName(), "3"); + } - // gets the oldest pet (ascending order) - criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.isNotNull("@petType")).addOrder( - Order.asc("@birthDate")); - iterator = criteria.execute().getItems(); - // ----- 7 (title=Samantha, petType=cat, birthDate=1995-09-04) - // ----- 8 (title=Max, petType=cat, birthDate=1995-09-04) - Assert.assertTrue(iterator.hasNext()); - birthDate = NodeDataUtil.getDate(iterator.next(), "birthDate", null); - Assert.assertEquals(birthDate.get(Calendar.YEAR), 1995); - Assert.assertEquals(birthDate.get(Calendar.MONTH) + 1, 9); - Assert.assertEquals(birthDate.get(Calendar.DAY_OF_MONTH), 4); + /** + * Tests pagination of results. + * @throws Exception + */ + @Test + public void testSetPaging() throws Exception + { + Calendar begin = Calendar.getInstance(); + begin.set(1999, Calendar.JANUARY, 1); + Calendar end = Calendar.getInstance(); + end.set(2001, Calendar.DECEMBER, 31); - // gets the youngest pet (descending order) - criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.isNotNull("@petType")).addOrder( - Order.desc("@birthDate")); - iterator = criteria.execute().getItems(); - // ----- 2 (title=Basil, petType=hamster, birthDate=2002-08-06) - Assert.assertTrue(iterator.hasNext()); - birthDate = NodeDataUtil.getDate(iterator.next(), "birthDate", null); - Assert.assertEquals(birthDate.get(Calendar.YEAR), 2002); - Assert.assertEquals(birthDate.get(Calendar.MONTH) + 1, 8); - Assert.assertEquals(birthDate.get(Calendar.DAY_OF_MONTH), 6); - } + Criteria criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.betweenDates("@birthDate", begin, end)) + .addOrder(Order.asc("@birthDate")) + .setPaging(5, 2); - /** - * Tests multiple ordering, playing on the fact that the two oldests pets - * are born on the same date but have different name. - * - * @throws Exception - */ - @Test - public void testAddOrderMultiple() throws Exception { - Criteria criteria; - ResultIterator<AdvancedResultItem> iterator; + AdvancedResult result = criteria.execute(); + // first page: + // --- 9 (title=Lucky, petType=bird, birthDate=1999-08-06) + // --- 6 (title=George, petType=snake, birthDate=2000-01-20) + // --- 4 (title=Jewel, petType=dog, birthDate=2000-03-07) + // --- 11 (title=Freddy, petType=bird, birthDate=2000-03-09) + // --- 12 (title=Lucky, petType=dog, birthDate=2000-06-24) + // second page: + // --- 1 (title=Leo, petType=cat, birthDate=2000-09-07) + // --- 5 (title=Iggy, petType=lizard, birthDate=2000-11-30) + // --- 3 (title=Rosy, petType=dog, birthDate=2001-04-17) + Assert.assertEquals(result.getTotalSize(), 8); - // order by @birthDate ascending, @title ascending - criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.isNotNull("@petType")).addOrder( - Order.asc("@birthDate")).addOrder(Order.asc("@title")); - iterator = criteria.execute().getItems(); - // ----- 8 (title=Max, petType=cat, birthDate=1995-09-04) - // ----- 7 (title=Samantha, petType=cat, birthDate=1995-09-04) - Assert.assertTrue(iterator.hasNext()); - Assert.assertEquals(iterator.next().getTitle(), "Max"); - Assert.assertTrue(iterator.hasNext()); - Assert.assertEquals(iterator.next().getTitle(), "Samantha"); + ResultIterator<AdvancedResultItem> iterator = result.getItems(); + Assert.assertEquals(iterator.getSize(), 3); + Assert.assertEquals(iterator.next().getName(), "1"); + Assert.assertEquals(iterator.next().getName(), "5"); + Assert.assertEquals(iterator.next().getName(), "3"); + } - // order by @birthDate ascending, @title descending - criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.isNotNull("@petType")).addOrder( - Order.asc("@birthDate")).addOrder(Order.desc("@title")); - iterator = criteria.execute().getItems(); - // ----- 7 (title=Samantha, petType=cat, birthDate=1995-09-04) - // ----- 8 (title=Max, petType=cat, birthDate=1995-09-04) - Assert.assertTrue(iterator.hasNext()); - Assert.assertEquals(iterator.next().getTitle(), "Samantha"); - Assert.assertTrue(iterator.hasNext()); - Assert.assertEquals(iterator.next().getTitle(), "Max"); - } + /** + * Tests ordering, both ascending and descending. + * @throws Exception + */ + @Test + public void testAddOrder() throws Exception + { + Criteria criteria; + ResultIterator<AdvancedResultItem> iterator; + Calendar birthDate; - @Test - public void testDateComparison() throws Exception { - Criteria criteria; - ResultIterator<AdvancedResultItem> iterator; - Content node; - Calendar date; + // gets the oldest pet (ascending order) + criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.isNotNull("@petType")) + .addOrder(Order.asc("@birthDate")); + iterator = criteria.execute().getItems(); + // ----- 7 (title=Samantha, petType=cat, birthDate=1995-09-04) + // ----- 8 (title=Max, petType=cat, birthDate=1995-09-04) + Assert.assertTrue(iterator.hasNext()); + birthDate = NodeDataUtil.getDate(iterator.next(), "birthDate", null); + Assert.assertEquals(birthDate.get(Calendar.YEAR), 1995); + Assert.assertEquals(birthDate.get(Calendar.MONTH) + 1, 9); + Assert.assertEquals(birthDate.get(Calendar.DAY_OF_MONTH), 4); - criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.isNotNull("@petType")).add( - Restrictions.eq("@title", "Leo")); - iterator = criteria.execute().getItems(); - Assert.assertTrue(iterator.hasNext()); - node = iterator.next(); - Assert.assertEquals(node.getTitle(), "Leo"); + // gets the youngest pet (descending order) + criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.isNotNull("@petType")) + .addOrder(Order.desc("@birthDate")); + iterator = criteria.execute().getItems(); + // ----- 2 (title=Basil, petType=hamster, birthDate=2002-08-06) + Assert.assertTrue(iterator.hasNext()); + birthDate = NodeDataUtil.getDate(iterator.next(), "birthDate", null); + Assert.assertEquals(birthDate.get(Calendar.YEAR), 2002); + Assert.assertEquals(birthDate.get(Calendar.MONTH) + 1, 8); + Assert.assertEquals(birthDate.get(Calendar.DAY_OF_MONTH), 6); + } - date = (Calendar) node.getMetaData().getCreationDate().clone(); - date.add(Calendar.DAY_OF_YEAR, 1); - criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.isNotNull("@petType")).add( - Restrictions.eq("@title", "Leo")); - criteria.add(Restrictions.lt("MetaData/@mgnl:creationdate", date)); - iterator = criteria.execute().getItems(); - Assert.assertTrue(iterator.hasNext()); - node = iterator.next(); - Assert.assertEquals(node.getTitle(), "Leo"); + /** + * Tests multiple ordering, playing on the fact that the two oldests pets are born on the same date but have + * different name. + * @throws Exception + */ + @Test + public void testAddOrderMultiple() throws Exception + { + Criteria criteria; + ResultIterator<AdvancedResultItem> iterator; - date = (Calendar) node.getMetaData().getCreationDate().clone(); - date.add(Calendar.HOUR, 1); - criteria = JCRCriteriaFactory.createCriteria().setWorkspace( - ContentRepository.WEBSITE).setBasePath("/pets").add( - Restrictions.isNotNull("@petType")).add( - Restrictions.eq("@title", "Leo")); - criteria.add(Restrictions.lt("MetaData/@mgnl:creationdate", date)); - iterator = criteria.execute().getItems(); - Assert.assertTrue(iterator.hasNext()); - node = iterator.next(); - Assert.assertEquals(node.getTitle(), "Leo"); - } + // order by @birthDate ascending, @title ascending + criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.isNotNull("@petType")) + .addOrder(Order.asc("@birthDate")) + .addOrder(Order.asc("@title")); + iterator = criteria.execute().getItems(); + // ----- 8 (title=Max, petType=cat, birthDate=1995-09-04) + // ----- 7 (title=Samantha, petType=cat, birthDate=1995-09-04) + Assert.assertTrue(iterator.hasNext()); + Assert.assertEquals(iterator.next().getTitle(), "Max"); + Assert.assertTrue(iterator.hasNext()); + Assert.assertEquals(iterator.next().getTitle(), "Samantha"); + + // order by @birthDate ascending, @title descending + criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.isNotNull("@petType")) + .addOrder(Order.asc("@birthDate")) + .addOrder(Order.desc("@title")); + iterator = criteria.execute().getItems(); + // ----- 7 (title=Samantha, petType=cat, birthDate=1995-09-04) + // ----- 8 (title=Max, petType=cat, birthDate=1995-09-04) + Assert.assertTrue(iterator.hasNext()); + Assert.assertEquals(iterator.next().getTitle(), "Samantha"); + Assert.assertTrue(iterator.hasNext()); + Assert.assertEquals(iterator.next().getTitle(), "Max"); + } + + @Test + public void testDateComparison() throws Exception + { + Criteria criteria; + ResultIterator<AdvancedResultItem> iterator; + Content node; + Calendar date; + + criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.isNotNull("@petType")) + .add(Restrictions.eq("@title", "Leo")); + iterator = criteria.execute().getItems(); + Assert.assertTrue(iterator.hasNext()); + node = iterator.next(); + Assert.assertEquals(node.getTitle(), "Leo"); + + date = (Calendar) node.getMetaData().getCreationDate().clone(); + date.add(Calendar.DAY_OF_YEAR, 1); + criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.isNotNull("@petType")) + .add(Restrictions.eq("@title", "Leo")); + criteria.add(Restrictions.lt("MetaData/@mgnl:creationdate", date)); + iterator = criteria.execute().getItems(); + Assert.assertTrue(iterator.hasNext()); + node = iterator.next(); + Assert.assertEquals(node.getTitle(), "Leo"); + + date = (Calendar) node.getMetaData().getCreationDate().clone(); + date.add(Calendar.HOUR, 1); + criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(ContentRepository.WEBSITE) + .setBasePath("/pets") + .add(Restrictions.isNotNull("@petType")) + .add(Restrictions.eq("@title", "Leo")); + criteria.add(Restrictions.lt("MetaData/@mgnl:creationdate", date)); + iterator = criteria.execute().getItems(); + Assert.assertTrue(iterator.hasNext()); + node = iterator.next(); + Assert.assertEquals(node.getTitle(), "Leo"); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |