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...> - 2009-02-21 17:53:25
|
Revision: 1052 http://openutils.svn.sourceforge.net/openutils/?rev=1052&view=rev Author: fgiust Date: 2009-02-21 17:53:21 +0000 (Sat, 21 Feb 2009) Log Message: ----------- [maven-release-plugin] prepare release openutils-log4j-2.0.4 Modified Paths: -------------- trunk/openutils-log4j/pom.xml Modified: trunk/openutils-log4j/pom.xml =================================================================== --- trunk/openutils-log4j/pom.xml 2009-02-21 17:49:38 UTC (rev 1051) +++ trunk/openutils-log4j/pom.xml 2009-02-21 17:53:21 UTC (rev 1052) @@ -9,7 +9,7 @@ </parent> <artifactId>openutils-log4j</artifactId> <packaging>jar</packaging> - <version>2.0.4-SNAPSHOT</version> + <version>2.0.4</version> <name>openutils for Log4j</name> <description>openutils log4j extensions</description> <build> @@ -72,4 +72,10 @@ <scope>test</scope> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-log4j-2.0.4</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-log4j-2.0.4</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-log4j-2.0.4</url> + </scm> </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...> - 2009-02-21 17:49:46
|
Revision: 1051 http://openutils.svn.sourceforge.net/openutils/?rev=1051&view=rev Author: fgiust Date: 2009-02-21 17:49:38 +0000 (Sat, 21 Feb 2009) Log Message: ----------- ready for 2.0.4 Modified Paths: -------------- trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java trunk/openutils-log4j/src/site/changes/changes.xml Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java 2009-02-20 21:38:47 UTC (rev 1050) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java 2009-02-21 17:49:38 UTC (rev 1051) @@ -73,10 +73,12 @@ * <param name="ConversionPattern" value="%-5p %c %d{dd.MM.yyyy HH:mm:ss} -- %m%n" /> * <param name="Header" * value=" - * =================================== - * Myapp (production environment) - * Date: %d{dd.MM.yyyy HH:mm:ss} - * =================================== + * ===================================%n + * Myapp (production environment)%n + * Date: %d{dd.MM.yyyy HH:mm:ss}%n + * Url: %X{url}%n + * Number of occurrences: %o%n + * ===================================%n * " /> * </layout> * </appender> @@ -123,6 +125,8 @@ private Layout subjectLayout; + private Layout headerLayout; + private String smtpHost; private boolean locationInfo; @@ -204,6 +208,8 @@ event.getThreadName(); event.getNDC(); + event.getMDCCopy(); + if (locationInfo) { event.getLocationInformation(); @@ -348,17 +354,26 @@ MimeBodyPart part = new MimeBodyPart(); StringBuffer sbuf = new StringBuffer(); - String t = layout.getHeader(); - if (t != null) + + LoggingEvent event = lea.getLoggingEvent(); + + if (layout.getHeader() != null) { - t = StringUtils.replace(t, "%o", Integer.toString(lea.getCount())); - t = StringUtils.replace(t, "%n", Layout.LINE_SEP); - sbuf.append(t); - sbuf.append("\n"); + if (headerLayout == null) + { + String header = layout.getHeader(); + header = StringUtils.replace(header, "%o", "{number_of_occurrences}"); + headerLayout = new PatternLayout(header); + } + String t = headerLayout.format(event); + if (t != null) + { + t = StringUtils.replace(t, "{number_of_occurrences}", Integer.toString(lea.getCount())); + sbuf.append(t); + sbuf.append("\n"); + } } - LoggingEvent event = lea.getLoggingEvent(); - if (this.subjectLayout != null) { String subject = this.subjectLayout.format(event); @@ -387,7 +402,7 @@ } } } - t = layout.getFooter(); + String t = layout.getFooter(); if (t != null) { t = StringUtils.replace(t, "%n", Layout.LINE_SEP); @@ -462,8 +477,8 @@ } /** - * The <b>SMTPHost</b> option takes a string value which should be a the host name of the SMTP server that will - * send the e-mail message. + * The <b>SMTPHost</b> option takes a string value which should be a the host name of the SMTP server that will send + * the e-mail message. */ public void setSMTPHost(String smtpHost) { @@ -496,9 +511,9 @@ } /** - * The <b>EvaluatorClass</b> option takes a string value representing the name of the class implementing the {@link - * TriggeringEventEvaluator} interface. A corresponding object will be instantiated and assigned as the triggering - * event evaluator for the SMTPAppender. + * The <b>EvaluatorClass</b> option takes a string value representing the name of the class implementing the + * {@link TriggeringEventEvaluator} interface. A corresponding object will be instantiated and assigned as the + * triggering event evaluator for the SMTPAppender. */ public void setEvaluatorClass(String value) { @@ -517,10 +532,9 @@ } /** - * The <b>LocationInfo</b> option takes a boolean value. By default, it is set to false which means there will be - * no effort to extract the location information related to the event. As a result, the layout that formats the - * events as they are sent out in an e-mail is likely to place the wrong location information (if present in the - * format). + * The <b>LocationInfo</b> option takes a boolean value. By default, it is set to false which means there will be no + * effort to extract the location information related to the event. As a result, the layout that formats the events + * as they are sent out in an e-mail is likely to place the wrong location information (if present in the format). * <p> * Location information extraction is comparatively very slow and should be avoided unless performance is not a * concern. Modified: trunk/openutils-log4j/src/site/changes/changes.xml =================================================================== --- trunk/openutils-log4j/src/site/changes/changes.xml 2009-02-20 21:38:47 UTC (rev 1050) +++ trunk/openutils-log4j/src/site/changes/changes.xml 2009-02-21 17:49:38 UTC (rev 1051) @@ -8,6 +8,11 @@ <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> </properties> <body> + <release version="2.0.4" date="2009-02-21" description="2.0.4"> + <action type="add" dev="fgiust">Added support for using MDC in AlternateSMTPAppender</action> + <action type="add" dev="fgiust">AlternateSMTPAppender now handles the layour header as a + PatternLayout and not as a static String anymore.</action> + </release> <release version="2.0.3" date="2009-01-31" description="2.0.3"> <action type="update" dev="fgiust"> Updated log4j dependency to 1.2.15 with the necessary exclusion (1.2.15 brings in several optional/unwanted dependencies with maven)</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-20 23:23:20
|
Revision: 1050 http://openutils.svn.sourceforge.net/openutils/?rev=1050&view=rev Author: fgrilli Date: 2009-02-20 21:38:47 +0000 (Fri, 20 Feb 2009) Log Message: ----------- again javadoc Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2009-02-20 19:45:49 UTC (rev 1049) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2009-02-20 21:38:47 UTC (rev 1050) @@ -38,9 +38,9 @@ * <br> * @see JCRCriteriaFactory#createMgnlCriteria(String, info.magnolia.cms.core.search.QueryManager, String) * @see JCRCriteriaFactory#createMgnlCriteria(String, info.magnolia.cms.core.search.QueryManager, String, Class) + * @see JCRCriteriaFactory#createJCRCriteria(String, javax.jcr.query.QueryManager, String) * @see Restrictions * @see Order - * @see Criteria * @author Federico Grilli * @version $Id$ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-20 19:45:54
|
Revision: 1049 http://openutils.svn.sourceforge.net/openutils/?rev=1049&view=rev Author: fgrilli Date: 2009-02-20 19:45:49 +0000 (Fri, 20 Feb 2009) Log Message: ----------- improved javadoc and commented out methods Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.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 2009-02-20 19:28:38 UTC (rev 1048) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2009-02-20 19:45:49 UTC (rev 1049) @@ -1,6 +1,5 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; - import java.util.Calendar; import java.util.Collection; @@ -53,9 +52,9 @@ * <br> * <strong>Be warned when using <em>jcr:like</em> function, as it can be very slow.</strong> <br> * <br> - * The following account of why it is so, was taken <a href= + * The following account of why it is so, was taken from <a href= * "http://www.nabble.com/Explanation-and-solutions-of-some-Jackrabbit-queries-regarding-performance-td15028655.html" - * >here</a> <br> + * >us...@ja... mailing list</a> <br> * <em> * <ul> * <li>Question: My xpath is '//*[jcr:like(@propertyName, @@ -93,13 +92,12 @@ * <br> * <strong>Be warned when using <em>jcr:like</em> function, as it can be very slow.</strong> <br> * <br> - * The following account of why it is so, was taken <a href= + * The following account of why it is so, was taken from <a href= * "http://www.nabble.com/Explanation-and-solutions-of-some-Jackrabbit-queries-regarding-performance-td15028655.html" - * >here</a> <br> + * >us...@ja... mailing list</a> <br> * <em> * <ul> - * <li>Question: My xpath is '//*[jcr:like(@propertyName, - * '%somevalue%')]' and it takes minutes to complete. + * <li>Question: My xpath is '//*[jcr:like(@propertyName, '%somevalue%')]' and it takes minutes to complete. * * <li>Answer: a jcr:like with % will be translated to a WildcardQuery lucene * query. In order to prevent extremely slow WildcardQueries, a Wildcard @@ -223,6 +221,7 @@ * @param values - must be instances of either {@link String} or {@link Number} or {@link Calendar}. * @return Criterion */ + public static Criterion in(String nodeName, Collection values) { throw new UnsupportedOperationException(); @@ -285,11 +284,10 @@ * @param types * @return Criterion */ - public static Criterion xpathRestriction(String xpath, Object[] values) - { - throw new UnsupportedOperationException(); - // return new XPathCriterion(sql, values, types); - } + /* + * public static Criterion xpathRestriction(String xpath, Object[] values) { throw new + * UnsupportedOperationException(); // return new XPathCriterion(sql, values, types); } + */ /** * Apply a constraint expressed in xpath. @@ -298,24 +296,20 @@ * @param type * @return Criterion */ - public static Criterion xpathRestriction(String xpath, Object value) - { - throw new UnsupportedOperationException(); - // return new XPathCriterion(sql, new Object[] { value }, new Type[] { - // type } ); - } + /* + * public static Criterion xpathRestriction(String xpath, Object value) { throw new UnsupportedOperationException(); + * // return new XPathCriterion(sql, new Object[] { value }, new Type[] { // type } ); } + */ /** * Apply a constraint expressed in xpath. * @param xpath * @return Criterion */ - public static Criterion xpathRestriction(String xpath) - { - throw new UnsupportedOperationException(); - // return new XPathCriterion(sql, ArrayHelper.EMPTY_OBJECT_ARRAY, - // ArrayHelper.EMPTY_TYPE_ARRAY); - } + /* + * public static Criterion xpathRestriction(String xpath) { throw new UnsupportedOperationException(); // return new + * XPathCriterion(sql, ArrayHelper.EMPTY_OBJECT_ARRAY, // ArrayHelper.EMPTY_TYPE_ARRAY); } + */ /** * Group expressions together in a single conjunction (A and B and C...) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-20 19:28:47
|
Revision: 1048 http://openutils.svn.sourceforge.net/openutils/?rev=1048&view=rev Author: fgrilli Date: 2009-02-20 19:28:38 +0000 (Fri, 20 Feb 2009) Log Message: ----------- imporved javadoc and commented out method Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2009-02-20 17:43:14 UTC (rev 1047) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2009-02-20 19:28:38 UTC (rev 1048) @@ -28,13 +28,10 @@ * Order.desc("@jcr:score()")).list(); * </pre> * - * will be translated (if an xpath Criteria implementation is chosen) into the following xpath statement + * will be translated into the following xpath statement * * <pre> - * // dogs//*[((jcr:contains(@name, 'Nana')) and (@weight>10.0) and (@birthDate >= - * // xs:dateTime('2004-01-01T00:00:00.000+00:00') and @birthDate <= - * // xs:dateTime('2008-12-01T23:59:59.000+00:00')))] order by @jcr:score() - * // descending + * //dogs//*[((jcr:contains(@name, 'Nana')) and (@weight>10.0) and (@birthDate >=xs:dateTime('2004-01-01T00:00:00.000+00:00') and @birthDate <=xs:dateTime('2008-12-01T23:59:59.000+00:00')))] order by @jcr:score() descending * </pre> * * This API is blatantly inspired by and respectfully borrows code from Hibernate's Criteria API. <br> @@ -79,12 +76,13 @@ */ public Criteria setFirstResult(int firstResult); - /** + /* * Set a timeout for the underlying query. * @param timeout The timeout value to apply. * @return this (for method chaining) FIXME is it possible in JCR? - */ - public Criteria setTimeout(int timeout); + * + public Criteria setTimeout(int timeout); + */ /** * Get the results. <strong>The implementation should guarantee the caller that the returned Collection is never This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-20 17:43:20
|
Revision: 1047 http://openutils.svn.sourceforge.net/openutils/?rev=1047&view=rev Author: fgrilli Date: 2009-02-20 17:43:14 +0000 (Fri, 20 Feb 2009) Log Message: ----------- sharing project Added Paths: ----------- trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlcriteria/src/ trunk/openutils-mgnlcriteria/src/main/ trunk/openutils-mgnlcriteria/src/main/java/ trunk/openutils-mgnlcriteria/src/main/java/net/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/ 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/Conjunction.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.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/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/XPathSelect.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaWithLimitImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java trunk/openutils-mgnlcriteria/src/site/ trunk/openutils-mgnlcriteria/src/site/apt/ trunk/openutils-mgnlcriteria/src/site/apt/index.apt trunk/openutils-mgnlcriteria/src/site/apt/usage.apt trunk/openutils-mgnlcriteria/src/site/changes/ trunk/openutils-mgnlcriteria/src/site/site.xml trunk/openutils-mgnlcriteria/src/test/ trunk/openutils-mgnlcriteria/src/test/java/ Property Changed: ---------------- trunk/openutils-mgnlcriteria/ Property changes on: trunk/openutils-mgnlcriteria ___________________________________________________________________ Added: svn:ignore + .settings target .checkstyle .classpath .project Added: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml (rev 0) +++ trunk/openutils-mgnlcriteria/pom.xml 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,35 @@ +<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> + <artifactId>openutils</artifactId> + <version>10</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-mgnlcriteria</artifactId> + <name>openutils-mgnlcriteria</name> + <version>1.0-SNAPSHOT</version> + <description>A Hibernate's Criteria-like API to programmatically generate JCR queries with Magnolia</description> + <dependencies> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.6.3</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.5.0</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.5.0</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.4</version> + </dependency> + </dependencies> +</project> \ No newline at end of file Property changes on: trunk/openutils-mgnlcriteria/pom.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,95 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + + +import java.util.Collection; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Criterion; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Order; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions; + + +/** + * <tt>Criteria</tt> is a simplified API for retrieving JCR Nodes by composing <tt>Criterion</tt> objects. This is a + * very convenient approach for functionality like "search" screens where there is a variable number of conditions to be + * placed upon the result set.<br> + * The <tt>JCRCriteriaFactory</tt> is a factory for <tt>Criteria</tt>. <tt>Criterion</tt> instances are usually obtained + * via the factory methods on <tt>Restrictions</tt>. eg. + * + * <pre> + * Calendar begin = Calendar.getInstance(); + * begin.set(2004, 0, 1); + * Calendar end = Calendar.getInstance(); + * end.set(2008, 11, 1); + * + * Collection pets = JCRCriteriaFactory.createMgnlCriteria("//dogs//*", MgnlContext.getQueryManager("website"), "nt:base").add( + * Restrictions.contains("@name", "Nana")).add( + * Restrictions.gt("@weight", new Float(10))).add( + * Restrictions.between("@birthDate", begin, end).addOrder( + * Order.desc("@jcr:score()")).list(); + * </pre> + * + * will be translated (if an xpath Criteria implementation is chosen) into the following xpath statement + * + * <pre> + * // dogs//*[((jcr:contains(@name, 'Nana')) and (@weight>10.0) and (@birthDate >= + * // xs:dateTime('2004-01-01T00:00:00.000+00:00') and @birthDate <= + * // xs:dateTime('2008-12-01T23:59:59.000+00:00')))] order by @jcr:score() + * // descending + * </pre> + * + * This API is blatantly inspired by and respectfully borrows code from Hibernate's Criteria API. <br> + * <br> + * @see JCRCriteriaFactory#createMgnlCriteria(String, info.magnolia.cms.core.search.QueryManager, String) + * @see JCRCriteriaFactory#createMgnlCriteria(String, info.magnolia.cms.core.search.QueryManager, String, Class) + * @see Restrictions + * @see Order + * @see Criteria + * @author Federico Grilli + * @version $Id$ + */ +public interface Criteria +{ + + /** + * Add a {@link Criterion restriction} to constrain the results to be retrieved. + * @param criterion The {@link Criterion criterion} object representing the restriction to be applied. + * @return this (for method chaining) + */ + public Criteria add(Criterion criterion); + + /** + * Add an {@link Order ordering} to the result set. Only <strong>one Order criterion per query</strong> can be + * applied. Any Order added after the first one will be ignored. + * @param order The {@link Order order} object representing an ordering to be applied to the results. + * @return this (for method chaining) + */ + public Criteria addOrder(Order order); + + /** + * Set a limit upon the number of objects to be retrieved. + * @param maxResults the maximum number of results + * @return this (for method chaining) + */ + public Criteria setMaxResults(int maxResults); + + /** + * Set the first result to be retrieved. + * @param firstResult the first result to retrieve, numbered from <tt>0</tt> + * @return this (for method chaining) + */ + public Criteria setFirstResult(int firstResult); + + /** + * Set a timeout for the underlying query. + * @param timeout The timeout value to apply. + * @return this (for method chaining) FIXME is it possible in JCR? + */ + public Criteria setTimeout(int timeout); + + /** + * Get the results. <strong>The implementation should guarantee the caller that the returned Collection is never + * null</strong> + * @return The Collection of matched query results. + */ + public Collection< ? > list() throws JCRQueryException; +} \ No newline at end of file Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,58 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractMagnoliaCriteriaImpl; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaImpl; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaWithLimitImpl; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class JCRCriteriaFactory +{ + + /** + * A factory for Magnolia CMS specific Criteria implementation + * @param path String - the path in JCR repository to search for Nodes. This is the path which precedes the predicate + * @param queryManager - an instance of info.magnolia.cms.core.search.QueryManager + * @param itemType String - if not specified defaults to "mgnl:content" + * @return an instance of a concrete subclass of {@link AbstractMagnoliaCriteriaImpl} + * @see MagnoliaCriteriaImpl + * @see MagnoliaCriteriaWithLimitImpl + */ + public static Criteria createMgnlCriteria(String path, info.magnolia.cms.core.search.QueryManager queryManager, + String itemType) + { + return new MagnoliaCriteriaImpl(path, queryManager, itemType); + } + + /** + * A factory for Magnolia CMS specific Criteria implementation + * @param path String - the path in JCR repository to search for Nodes. This is the path which precedes the predicate + * @param queryManager - an instance of info.magnolia.cms.core.search.QueryManager + * @param itemType String - if not specified defaults to "mgnl:content" + * @param classType Class<?> - the list method of this implementation must return instances of this type + * @return an instance of a concrete subclass of {@link AbstractMagnoliaCriteriaImpl} + * @see MagnoliaCriteriaImpl + * @see MagnoliaCriteriaWithLimitImpl + */ + public static Criteria createMgnlCriteria(String path, info.magnolia.cms.core.search.QueryManager queryManager, + String itemType, Class< ? > classType) + { + return new MagnoliaCriteriaImpl(path, queryManager, itemType, classType); + } + + /** + * @param path String - the path in JCR repository to search for Nodes. This is the path which precedes the + * predicate + * @param queryManager - an instance of javax.jcr.query.QueryManager + * @param itemType String - depends on the implementation + * @return an instance of a JCR-specific implementation of {@link Criteria} + * @throws UnsupportedOperationException as it is not implemented yet + */ + public static Criteria createJCRCriteria(String path, javax.jcr.query.QueryManager queryManager, String itemType) + { + throw new UnsupportedOperationException(); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,63 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + + +import java.util.Iterator; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractCriteriaImpl; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractMagnoliaCriteriaImpl; + + +/** + * @author Federico Grilli + * @version $Id$ + */ +public class JCRMagnoliaCriteriaQueryTranslator +{ + + private final AbstractMagnoliaCriteriaImpl criteria; + + public JCRMagnoliaCriteriaQueryTranslator(final AbstractMagnoliaCriteriaImpl criteria) throws JCRQueryException + { + + this.criteria = criteria; + } + + public AbstractCriteriaImpl getRootCriteria() + { + return criteria; + } + + public String getPredicate() + { + StringBuilder condition = new StringBuilder(30); + Iterator<AbstractMagnoliaCriteriaImpl.CriterionEntry> criterionIterator = criteria.iterateExpressionEntries(); + while (criterionIterator.hasNext()) + { + AbstractMagnoliaCriteriaImpl.CriterionEntry entry = criterionIterator.next(); + String xpathString = entry.getCriterion().toXPathString(entry.getCriteria()); + condition.append(xpathString); + if (criterionIterator.hasNext()) + { + condition.append(" and "); + } + } + return condition.toString(); + } + + public String getOrderBy() + { + StringBuilder orderBy = new StringBuilder(30); + Iterator<AbstractMagnoliaCriteriaImpl.OrderEntry> criterionIterator = criteria.iterateOrderings(); + while (criterionIterator.hasNext()) + { + AbstractMagnoliaCriteriaImpl.OrderEntry oe = criterionIterator.next(); + orderBy.append(oe.getOrder().toXPathString(oe.getCriteria())); + break; + // ignore the rest + /* + * if ( criterionIterator.hasNext() ) { orderBy.append( ", " ); } + */ + } + return orderBy.toString(); + } +} \ No newline at end of file Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,31 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + +import org.apache.commons.lang.exception.NestableRuntimeException; + + +/** + * Runtime exception wrapper for jcr checked exceptions. + * @author fgrilli + * @version $Id$ + */ +public class JCRQueryException extends NestableRuntimeException +{ + + private static final long serialVersionUID = -8737641628360563743L; + + public JCRQueryException(String msg, Throwable cause) + { + super(msg, cause); + } + + public JCRQueryException(String msg) + { + super(msg); + } + + public JCRQueryException(Throwable cause) + { + super(cause); + } + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: 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 (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,87 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import java.util.Calendar; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + +/** + * @author fgrilli + * @version $Id$ + */ +public class BetweenExpression implements Criterion +{ + + private static final long serialVersionUID = 6686395240415024541L; + + private final String propertyName; + + private final Object lo; + + private final Object hi; + + protected BetweenExpression(String propertyName, Object lo, Object hi) + { + this.propertyName = propertyName; + this.lo = lo; + this.hi = hi; + } + + @Override + public String toString() + { + return propertyName + " between " + lo + " and " + hi; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(); + fragment.append(" (").append(propertyName).append(" >= "); + + if (lo instanceof String && hi instanceof String) + fragment.append("'" + lo + "' and " + propertyName + " <= '" + hi + "'"); + else if (lo instanceof Number && hi instanceof Number) + fragment.append(lo + " and " + propertyName + " <= " + hi); + else if (lo instanceof Calendar && hi instanceof Calendar) + { + Calendar cal = (Calendar) lo; + Calendar cal2 = (Calendar) hi; + StringBuilder date = new StringBuilder(); + date.append(XS_DATETIME_FUNCTION + "('"); + date + .append(cal.get(Calendar.YEAR)) + .append(HYPHEN) + .append( + cal.get(Calendar.MONTH) < MONTH_MAX + ? "0" + (cal.get(Calendar.MONTH) + 1) + : cal.get(Calendar.MONTH) + 1) + .append(HYPHEN) + .append( + cal.get(Calendar.DAY_OF_MONTH) < DAY_MAX ? "0" + cal.get(Calendar.DAY_OF_MONTH) : cal + .get(Calendar.DAY_OF_MONTH)); + date.append(MIDNIGHT); + date.append("') "); + + StringBuilder date2 = new StringBuilder(); + date2.append(XS_DATETIME_FUNCTION + "('"); + date2.append(cal2.get(Calendar.YEAR)).append(HYPHEN).append( + cal2.get(Calendar.MONTH) < MONTH_MAX + ? "0" + (cal2.get(Calendar.MONTH) + 1) + : cal2.get(Calendar.MONTH) + 1).append(HYPHEN).append( + cal2.get(Calendar.DAY_OF_MONTH) < DAY_MAX ? "0" + cal2.get(Calendar.DAY_OF_MONTH) : cal2 + .get(Calendar.DAY_OF_MONTH)); + date2.append(T235959); + date2.append("') "); + fragment.append(date.toString() + " and " + propertyName + " <= " + date2.toString()); + } + else + { + String msg = "values provided are not of the accepted types String, Number, Calendar"; + log.error(msg); + throw new IllegalArgumentException(msg); + } + fragment.append(")"); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,15 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +/** + * @author fgrilli + * @version $Id$ + */ +public class Conjunction extends Junction +{ + private static final long serialVersionUID = 7590346442271897522L; + + public Conjunction() + { + super("and"); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,61 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + + +import java.io.Serializable; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * An object-oriented representation of a query criterion that may be used as a restriction in a <tt>Criteria</tt> + * query. Built-in criterion types are provided by the <tt>Restrictions</tt> factory class. This interface might be + * implemented by application classes that define custom restriction criteria. + * @see Restrictions + * @see Criteria + * @author Federico Grilli + * @version $Id$ + */ +public interface Criterion extends Serializable +{ + + public static final Logger log = LoggerFactory.getLogger(Criterion.class); + + public static final String ATTRIBUTE_SELECTOR = "@"; + + public static final String JCR_PREFIX = "jcr:"; + + public static final String JCR_ROOT = "/jcr:root"; + + public static final String ALL_ELEMENTS = "//*"; + + public static final String ANY_PROPERTY = "."; + + public static final String XS_DATETIME_FUNCTION = "xs:dateTime"; + + public static final String MIDNIGHT = "T00:00:00.000+00:00"; + + public static final String T235959 = "T23:59:59.000+00:00"; + + public static final String NT_BASE = "nt:base"; + + public static final String NOT = " not("; + + public static final String HYPHEN = "-"; + + public static final int DAY_MAX = 10; + + public static final int MONTH_MAX = 9; + + /** + * Render the XPath fragment + * @param criteria + * @return String + * @throws JCRQueryException + */ + public String toXPathString(Criteria criteria) throws JCRQueryException; + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,15 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +/** + * @author Federico Grilli + * @version $Id$ + */ +public class Disjunction extends Junction +{ + private static final long serialVersionUID = 1573336261639362776L; + + protected Disjunction() + { + super("or"); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,35 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class IsNotNullExpression implements Criterion +{ + + private static final long serialVersionUID = -1955669039985775985L; + + protected static final String WHITESPACE = " "; + + private String nodeName; + + public IsNotNullExpression(String nodeName) + { + this.nodeName = nodeName; + } + + @Override + public String toString() + { + return nodeName; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + return WHITESPACE + nodeName + WHITESPACE; + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,36 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class IsNullExpression implements Criterion +{ + + private static final long serialVersionUID = -1600960388638847909L; + + private String nodeName; + + public IsNullExpression(String nodeName) + { + this.nodeName = nodeName; + } + + @Override + public String toString() + { + return nodeName; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(); + fragment.append(Criterion.NOT).append(nodeName).append(") "); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,49 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class JCRFunctionExpression implements Criterion +{ + + private static final long serialVersionUID = -5570839091762158385L; + + protected final String propertyName; + + protected final Object value; + + protected final String function; + + public JCRFunctionExpression(String propertyName, Object value, String function) + { + this.propertyName = propertyName; + this.value = value; + this.function = function; + } + + protected final String getFunction() + { + return function; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(); + fragment.append(" (" + function + "("); + fragment.append(propertyName); + fragment.append(", '" + value).append("') ) "); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } + + @Override + public String toString() + { + return propertyName + " " + function + " " + value; + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,72 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + +import org.apache.commons.lang.StringUtils; + + +/** + * A sequence of a logical expressions combined by some associative logical operator + * @author Federico Grilli + * @version $Id$ + */ +public class Junction implements Criterion +{ + + private static final long serialVersionUID = 4745761472724863693L; + + @SuppressWarnings("unchecked") + private final List criteria = new ArrayList(); + + private final String op; + + protected Junction(String op) + { + this.op = op; + } + + @SuppressWarnings("unchecked") + public Junction add(Criterion criterion) + { + criteria.add(criterion); + return this; + } + + public String getOp() + { + return op; + } + + @SuppressWarnings("unchecked") + public String toXPathString(Criteria crit) throws JCRQueryException + { + + if (criteria.size() == 0) + return ""; + + StringBuilder buffer = new StringBuilder().append('('); + Iterator iter = criteria.iterator(); + while (iter.hasNext()) + { + buffer.append(((Criterion) iter.next()).toXPathString(crit)); + if (iter.hasNext()) + buffer.append(' ').append(op).append(' '); + } + return buffer.append(')').toString(); + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + return '(' + StringUtils.join(criteria.iterator(), ' ' + op + ' ') + ')'; + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,36 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class LikeExpression extends JCRFunctionExpression +{ + + private static final long serialVersionUID = 1810624472706401714L; + + private MatchMode matchMode; + + public LikeExpression(String propertyName, Object value, String function, MatchMode matchMode) + { + super(propertyName, value, function); + if (matchMode == null) + throw new IllegalArgumentException("MatchMode can't be null"); + this.matchMode = matchMode; + } + + @Override + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(); + fragment.append(" (" + function + "("); + fragment.append(propertyName); + fragment.append(", '" + matchMode.toMatchString(value.toString()) + "') ) "); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,51 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * Superclass of binary logical expressions + * @author Federico Grilli + * @version $Id$ + */ +public class LogicalExpression implements Criterion +{ + + /** + * + */ + private static final long serialVersionUID = 4524284746715983618L; + + private final Criterion lhs; + + private final Criterion rhs; + + private final String op; + + protected LogicalExpression(Criterion lhs, Criterion rhs, String op) + { + this.lhs = lhs; + this.rhs = rhs; + this.op = op; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + + String fragment = '(' + lhs.toXPathString(criteria) + ' ' + getOp() + ' ' + rhs.toXPathString(criteria) + ')'; + log.debug("xpathString is {} ", fragment); + return fragment; + } + + public String getOp() + { + return op; + } + + @Override + public String toString() + { + return lhs.toString() + ' ' + getOp() + ' ' + rhs.toString(); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,85 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + + +/** + * Represents an strategy for matching strings using "like". + * @author Federico Grilli + */ +@SuppressWarnings("serial") +public abstract class MatchMode implements Serializable +{ + + private static final long serialVersionUID = -7446324572335777782L; + + private final String name; + + private static final Map<String, MatchMode> INSTANCES = new HashMap<String, MatchMode>(); + + protected MatchMode(String name) + { + this.name = name; + } + + public String toString() + { + return name; + } + + /** + * Match the start of the string to the pattern + */ + public static final MatchMode START = new MatchMode("START") + { + + public String toMatchString(String pattern) + { + return pattern + '%'; + } + }; + + /** + * Match the end of the string to the pattern + */ + public static final MatchMode END = new MatchMode("END") + { + + public String toMatchString(String pattern) + { + return '%' + pattern; + } + }; + + /** + * Match the pattern anywhere in the string + */ + public static final MatchMode ANYWHERE = new MatchMode("ANYWHERE") + { + + public String toMatchString(String pattern) + { + return '%' + pattern + '%'; + } + }; + + static + { + INSTANCES.put(END.name, END); + INSTANCES.put(START.name, START); + INSTANCES.put(ANYWHERE.name, ANYWHERE); + } + + private Object readResolve() + { + return INSTANCES.get(name); + } + + /** + * convert the pattern, by appending/prepending "%" + */ + public abstract String toMatchString(String pattern); + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,36 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class NotExpression implements Criterion +{ + + private static final long serialVersionUID = -5057676844499041929L; + + private Criterion expression; + + public NotExpression(Criterion expression) + { + this.expression = expression; + } + + @Override + public String toString() + { + return expression.toString(); + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(Criterion.NOT); + fragment.append(expression.toXPathString(criteria)).append(") "); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,68 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * Represents an order imposed upon a <tt>Criteria</tt> result set + * @author Federico Grilli + */ +public class Order implements Criterion +{ + + /** + * + */ + private static final long serialVersionUID = -1228583450961430360L; + + private boolean ascending; + + private String nodeName; + + @Override + public String toString() + { + return nodeName + ' ' + (ascending ? "ascending" : "descending"); + } + + /** + * Constructor for Order. + */ + protected Order(String nodeName, boolean ascending) + { + this.nodeName = nodeName; + this.ascending = ascending; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(" "); + fragment.append(nodeName); + fragment.append(ascending ? " ascending" : " descending"); + + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + + } + + /** + * Ascending order + * @param propertyName + * @return Order + */ + public static Order asc(String propertyName) + { + return new Order(propertyName, true); + } + + /** + * Descending order + * @param propertyName + * @return Order + */ + public static Order desc(String propertyName) + { + return new Order(propertyName, false); + } +} \ No newline at end of file Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: 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 (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2009-02-20 17:43:14 UTC (rev 1047) @@ -0,0 +1,337 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + + +import java.util.Calendar; +import java.util.Collection; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; + + +/** + * The <tt>criterion</tt> package may be used by applications as a framework for building new kinds of + * <tt>Criterion</tt>. However, it is intended that most applications will simply use the built-in criterion types via + * the static factory methods of this class. + * @see Criteria + * @author Federico Grilli + * @version $Id$ + */ +public class Restrictions +{ + + Restrictions() + { + // cannot be instantiated + } + + /** + * Apply an "equal" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression eq(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, "="); + } + + /** + * Apply a "not equal" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression ne(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, "!="); + } + + /** + * Apply a "like" constraint of type {@link MatchMode#ANYWHERE} to the named node <br> + * <br> + * <strong>Be warned when using <em>jcr:like</em> function, as it can be very slow.</strong> <br> + * <br> + * The following account of why it is so, was taken <a href= + * "http://www.nabble.com/Explanation-and-solutions-of-some-Jackrabbit-queries-regarding-performance-td15028655.html" + * >here</a> <br> + * <em> + * <ul> + * <li>Question: My xpath is '//*[jcr:like(@propertyName, + * '%somevalue%')]' and it takes minutes to complete. + * + * <li>Answer: a jcr:like with % will be translated to a WildcardQuery lucene + * query. In order to prevent extremely slow WildcardQueries, a Wildcard + * term should not start with one of the wildcards * or ?. So this is not a + * Jackrabbit implementation detail, but a general Lucene (and I think + * inverted indexes in general) issue [1] + * + * <li>Conclusion: Avoid % prefixes in jcr:like. Use jcr:contains when + * searching for a specific word. If jcr:contains is not suitable, you can + * work around the problem by creating a custom lucene analyzer for the + * specific propery (see IndexingConfiguration [2] at Index Analyzers). + * </ul> + * </em> + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number}. + * @return Criterion + */ + public static JCRFunctionExpression like(String nodeName, Object value) + { + return new LikeExpression( + nodeName, + XPathTextUtils.stringToJCRSearchExp(value.toString()), + " jcr:like", + MatchMode.ANYWHERE); + + } + + /** + * Apply a "like" constraint to the named node <br> + * <br> + * <strong>Be warned when using <em>jcr:like</em> function, as it can be very slow.</strong> <br> + * <br> + * The following account of why it is so, was taken <a href= + * "http://www.nabble.com/Explanation-and-solutions-of-some-Jackrabbit-queries-regarding-performance-td15028655.html" + * >here</a> <br> + * <em> + * <ul> + * <li>Question: My xpath is '//*[jcr:like(@propertyName, + * '%somevalue%')]' and it takes minutes to complete. + * + * <li>Answer: a jcr:like with % will be translated to a WildcardQuery lucene + * query. In order to prevent extremely slow WildcardQueries, a Wildcard + * term should not start with one of the wildcards * or ?. So this is not a + * Jackrabbit implementation detail, but a general Lucene (and I think + * inverted indexes in general) issue [1] + * + * <li>Conclusion: Avoid % prefixes in jcr:like. Use jcr:contains when + * searching for a specific word. If jcr:contains is not suitable, you can + * work around the problem by creating a custom lucene analyzer for the + * specific propery (see IndexingConfiguration [2] at Index Analyzers). + * </ul> + * </em> + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number}. + * @param matchMode - one of {@link MatchMode#START} or {@link MatchMode#END} or {@link MatchMode#ANYWHERE} + * @return Criterion + */ + public static JCRFunctionExpression like(String nodeName, Object value, MatchMode matchMode) + { + return new LikeExpression( + nodeName, + XPathTextUtils.stringToJCRSearchExp(value.toString()), + " jcr:like", + matchMode); + } + + /** + * Apply a "contains" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number}. + * @return Criterion + */ + public static JCRFunctionExpression contains(String nodeName, Object value) + { + return new JCRFunctionExpression( + nodeName, + XPathTextUtils.stringToJCRSearchExp(value.toString()), + " jcr:contains"); + } + + /** + * Apply a "greater than" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression gt(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, ">"); + } + + /** + * Apply a "less than" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression lt(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, "<"); + } + + /** + * Apply a "less than or equal" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression le(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, "<="); + } + + /** + * Apply a "greater than or equal" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression ge(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, ">="); + } + + /** + * Apply a "between" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param lo value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @param hi value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static Criterion between(String nodeName, Object lo, Object hi) + { + return new BetweenExpression(nodeName, lo, hi); + } + + /** + * Apply an "in" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param values - must be instances of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static Criterion in(String nodeName, Object[] values) + { + throw new UnsupportedOperationException(); + } + + /** + * Apply an "in" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param values - must be instances of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static Criterion in(String nodeName, Collection values) + { + throw new UnsupportedOperationException(); + } + + /** + * Apply an "is null" constraint to the named node + * @return Criterion + */ + public static Criterion isNull(String nodeName) + { + return new IsNullExpression(nodeName); + } + + /** + * Apply an "is not null" constraint to the named node + * @return Criterion + */ + public static Criterion isNotNull(String nodeName) + { + return new IsNotNullExpression(nodeName); + } + + /** + * Return the conjuction of two expressions + * @param lhs + * @param rhs + * @return Criterion + */ + public static LogicalExpression and(Criterion lhs, Criterion rhs) + { + return new LogicalExpression(lhs, rhs, "and"); + } + + /** + * Return the disjuction of two expressions + * @param lhs + * @param rhs + * @return Criterion + */ + public static LogicalExpression or(Criterion lhs, Criterion rhs) + { + return new LogicalExpression(lhs, rhs, "or"); + } + + /** + * Return the negation of an expression + * @param expression + * @return Criterion + */ + public static Criterion not(Criterion expression) + { + return new NotExpression(expression); + } + + /** + * Apply a constraint expressed in xpath. + * @param xpa... [truncated message content] |
From: <fg...@us...> - 2009-02-20 17:38:44
|
Revision: 1046 http://openutils.svn.sourceforge.net/openutils/?rev=1046&view=rev Author: fgrilli Date: 2009-02-20 17:38:41 +0000 (Fri, 20 Feb 2009) Log Message: ----------- Initial import. Added Paths: ----------- trunk/openutils-mgnlcriteria/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-20 17:21:38
|
Revision: 1045 http://openutils.svn.sourceforge.net/openutils/?rev=1045&view=rev Author: fgrilli Date: 2009-02-20 17:21:34 +0000 (Fri, 20 Feb 2009) Log Message: ----------- deleted project in wrong position Removed Paths: ------------- openutils-mgnlcriteria/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-20 17:19:19
|
Revision: 1044 http://openutils.svn.sourceforge.net/openutils/?rev=1044&view=rev Author: fgrilli Date: 2009-02-20 17:19:16 +0000 (Fri, 20 Feb 2009) Log Message: ----------- added openutils-mgnlcriteria module Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-02-20 17:17:10 UTC (rev 1043) +++ trunk/pom.xml 2009-02-20 17:19:16 UTC (rev 1044) @@ -256,6 +256,7 @@ <module>openutils-mgnlgroovy</module> <module>openutils-mgnlstruts11</module> <module>openutils-mgnlmedia</module> + <module>openutils-mgnlcriteria</module> <!-- <module>openutils-mgnlrating</module> --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-20 17:17:15
|
Revision: 1043 http://openutils.svn.sourceforge.net/openutils/?rev=1043&view=rev Author: fgrilli Date: 2009-02-20 17:17:10 +0000 (Fri, 20 Feb 2009) Log Message: ----------- sharing project Added Paths: ----------- openutils-mgnlcriteria/pom.xml openutils-mgnlcriteria/src/ openutils-mgnlcriteria/src/main/ openutils-mgnlcriteria/src/main/java/ openutils-mgnlcriteria/src/main/java/net/ openutils-mgnlcriteria/src/main/java/net/sourceforge/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/XPathSelect.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaImpl.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaWithLimitImpl.java openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java openutils-mgnlcriteria/src/site/ openutils-mgnlcriteria/src/site/apt/ openutils-mgnlcriteria/src/site/apt/index.apt openutils-mgnlcriteria/src/site/apt/usage.apt openutils-mgnlcriteria/src/site/changes/ openutils-mgnlcriteria/src/site/site.xml openutils-mgnlcriteria/src/test/ openutils-mgnlcriteria/src/test/java/ Property Changed: ---------------- openutils-mgnlcriteria/ Property changes on: openutils-mgnlcriteria ___________________________________________________________________ Added: svn:ignore + .settings target .checkstyle .classpath .project Added: openutils-mgnlcriteria/pom.xml =================================================================== --- openutils-mgnlcriteria/pom.xml (rev 0) +++ openutils-mgnlcriteria/pom.xml 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,35 @@ +<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> + <artifactId>openutils</artifactId> + <version>10</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-mgnlcriteria</artifactId> + <name>openutils-mgnlcriteria</name> + <version>1.0-SNAPSHOT</version> + <description>A Hibernate's Criteria-like API to programmatically generate JCR queries with Magnolia</description> + <dependencies> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.6.3</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.5.0</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.5.0</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.4</version> + </dependency> + </dependencies> +</project> \ No newline at end of file Property changes on: openutils-mgnlcriteria/pom.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,95 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + + +import java.util.Collection; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Criterion; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Order; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions; + + +/** + * <tt>Criteria</tt> is a simplified API for retrieving JCR Nodes by composing <tt>Criterion</tt> objects. This is a + * very convenient approach for functionality like "search" screens where there is a variable number of conditions to be + * placed upon the result set.<br> + * The <tt>JCRCriteriaFactory</tt> is a factory for <tt>Criteria</tt>. <tt>Criterion</tt> instances are usually obtained + * via the factory methods on <tt>Restrictions</tt>. eg. + * + * <pre> + * Calendar begin = Calendar.getInstance(); + * begin.set(2004, 0, 1); + * Calendar end = Calendar.getInstance(); + * end.set(2008, 11, 1); + * + * Collection pets = JCRCriteriaFactory.createMgnlCriteria("//dogs//*", MgnlContext.getQueryManager("website"), "nt:base").add( + * Restrictions.contains("@name", "Nana")).add( + * Restrictions.gt("@weight", new Float(10))).add( + * Restrictions.between("@birthDate", begin, end).addOrder( + * Order.desc("@jcr:score()")).list(); + * </pre> + * + * will be translated (if an xpath Criteria implementation is chosen) into the following xpath statement + * + * <pre> + * // dogs//*[((jcr:contains(@name, 'Nana')) and (@weight>10.0) and (@birthDate >= + * // xs:dateTime('2004-01-01T00:00:00.000+00:00') and @birthDate <= + * // xs:dateTime('2008-12-01T23:59:59.000+00:00')))] order by @jcr:score() + * // descending + * </pre> + * + * This API is blatantly inspired by and respectfully borrows code from Hibernate's Criteria API. <br> + * <br> + * @see JCRCriteriaFactory#createMgnlCriteria(String, info.magnolia.cms.core.search.QueryManager, String) + * @see JCRCriteriaFactory#createMgnlCriteria(String, info.magnolia.cms.core.search.QueryManager, String, Class) + * @see Restrictions + * @see Order + * @see Criteria + * @author Federico Grilli + * @version $Id$ + */ +public interface Criteria +{ + + /** + * Add a {@link Criterion restriction} to constrain the results to be retrieved. + * @param criterion The {@link Criterion criterion} object representing the restriction to be applied. + * @return this (for method chaining) + */ + public Criteria add(Criterion criterion); + + /** + * Add an {@link Order ordering} to the result set. Only <strong>one Order criterion per query</strong> can be + * applied. Any Order added after the first one will be ignored. + * @param order The {@link Order order} object representing an ordering to be applied to the results. + * @return this (for method chaining) + */ + public Criteria addOrder(Order order); + + /** + * Set a limit upon the number of objects to be retrieved. + * @param maxResults the maximum number of results + * @return this (for method chaining) + */ + public Criteria setMaxResults(int maxResults); + + /** + * Set the first result to be retrieved. + * @param firstResult the first result to retrieve, numbered from <tt>0</tt> + * @return this (for method chaining) + */ + public Criteria setFirstResult(int firstResult); + + /** + * Set a timeout for the underlying query. + * @param timeout The timeout value to apply. + * @return this (for method chaining) FIXME is it possible in JCR? + */ + public Criteria setTimeout(int timeout); + + /** + * Get the results. <strong>The implementation should guarantee the caller that the returned Collection is never + * null</strong> + * @return The Collection of matched query results. + */ + public Collection< ? > list() throws JCRQueryException; +} \ No newline at end of file Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,58 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractMagnoliaCriteriaImpl; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaImpl; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaWithLimitImpl; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class JCRCriteriaFactory +{ + + /** + * A factory for Magnolia CMS specific Criteria implementation + * @param path String - the path in JCR repository to search for Nodes. This is the path which precedes the predicate + * @param queryManager - an instance of info.magnolia.cms.core.search.QueryManager + * @param itemType String - if not specified defaults to "mgnl:content" + * @return an instance of a concrete subclass of {@link AbstractMagnoliaCriteriaImpl} + * @see MagnoliaCriteriaImpl + * @see MagnoliaCriteriaWithLimitImpl + */ + public static Criteria createMgnlCriteria(String path, info.magnolia.cms.core.search.QueryManager queryManager, + String itemType) + { + return new MagnoliaCriteriaImpl(path, queryManager, itemType); + } + + /** + * A factory for Magnolia CMS specific Criteria implementation + * @param path String - the path in JCR repository to search for Nodes. This is the path which precedes the predicate + * @param queryManager - an instance of info.magnolia.cms.core.search.QueryManager + * @param itemType String - if not specified defaults to "mgnl:content" + * @param classType Class<?> - the list method of this implementation must return instances of this type + * @return an instance of a concrete subclass of {@link AbstractMagnoliaCriteriaImpl} + * @see MagnoliaCriteriaImpl + * @see MagnoliaCriteriaWithLimitImpl + */ + public static Criteria createMgnlCriteria(String path, info.magnolia.cms.core.search.QueryManager queryManager, + String itemType, Class< ? > classType) + { + return new MagnoliaCriteriaImpl(path, queryManager, itemType, classType); + } + + /** + * @param path String - the path in JCR repository to search for Nodes. This is the path which precedes the + * predicate + * @param queryManager - an instance of javax.jcr.query.QueryManager + * @param itemType String - depends on the implementation + * @return an instance of a JCR-specific implementation of {@link Criteria} + * @throws UnsupportedOperationException as it is not implemented yet + */ + public static Criteria createJCRCriteria(String path, javax.jcr.query.QueryManager queryManager, String itemType) + { + throw new UnsupportedOperationException(); + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,63 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + + +import java.util.Iterator; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractCriteriaImpl; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractMagnoliaCriteriaImpl; + + +/** + * @author Federico Grilli + * @version $Id$ + */ +public class JCRMagnoliaCriteriaQueryTranslator +{ + + private final AbstractMagnoliaCriteriaImpl criteria; + + public JCRMagnoliaCriteriaQueryTranslator(final AbstractMagnoliaCriteriaImpl criteria) throws JCRQueryException + { + + this.criteria = criteria; + } + + public AbstractCriteriaImpl getRootCriteria() + { + return criteria; + } + + public String getPredicate() + { + StringBuilder condition = new StringBuilder(30); + Iterator<AbstractMagnoliaCriteriaImpl.CriterionEntry> criterionIterator = criteria.iterateExpressionEntries(); + while (criterionIterator.hasNext()) + { + AbstractMagnoliaCriteriaImpl.CriterionEntry entry = criterionIterator.next(); + String xpathString = entry.getCriterion().toXPathString(entry.getCriteria()); + condition.append(xpathString); + if (criterionIterator.hasNext()) + { + condition.append(" and "); + } + } + return condition.toString(); + } + + public String getOrderBy() + { + StringBuilder orderBy = new StringBuilder(30); + Iterator<AbstractMagnoliaCriteriaImpl.OrderEntry> criterionIterator = criteria.iterateOrderings(); + while (criterionIterator.hasNext()) + { + AbstractMagnoliaCriteriaImpl.OrderEntry oe = criterionIterator.next(); + orderBy.append(oe.getOrder().toXPathString(oe.getCriteria())); + break; + // ignore the rest + /* + * if ( criterionIterator.hasNext() ) { orderBy.append( ", " ); } + */ + } + return orderBy.toString(); + } +} \ No newline at end of file Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,31 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + +import org.apache.commons.lang.exception.NestableRuntimeException; + + +/** + * Runtime exception wrapper for jcr checked exceptions. + * @author fgrilli + * @version $Id$ + */ +public class JCRQueryException extends NestableRuntimeException +{ + + private static final long serialVersionUID = -8737641628360563743L; + + public JCRQueryException(String msg, Throwable cause) + { + super(msg, cause); + } + + public JCRQueryException(String msg) + { + super(msg); + } + + public JCRQueryException(Throwable cause) + { + super(cause); + } + +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,87 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import java.util.Calendar; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + +/** + * @author fgrilli + * @version $Id$ + */ +public class BetweenExpression implements Criterion +{ + + private static final long serialVersionUID = 6686395240415024541L; + + private final String propertyName; + + private final Object lo; + + private final Object hi; + + protected BetweenExpression(String propertyName, Object lo, Object hi) + { + this.propertyName = propertyName; + this.lo = lo; + this.hi = hi; + } + + @Override + public String toString() + { + return propertyName + " between " + lo + " and " + hi; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(); + fragment.append(" (").append(propertyName).append(" >= "); + + if (lo instanceof String && hi instanceof String) + fragment.append("'" + lo + "' and " + propertyName + " <= '" + hi + "'"); + else if (lo instanceof Number && hi instanceof Number) + fragment.append(lo + " and " + propertyName + " <= " + hi); + else if (lo instanceof Calendar && hi instanceof Calendar) + { + Calendar cal = (Calendar) lo; + Calendar cal2 = (Calendar) hi; + StringBuilder date = new StringBuilder(); + date.append(XS_DATETIME_FUNCTION + "('"); + date + .append(cal.get(Calendar.YEAR)) + .append(HYPHEN) + .append( + cal.get(Calendar.MONTH) < MONTH_MAX + ? "0" + (cal.get(Calendar.MONTH) + 1) + : cal.get(Calendar.MONTH) + 1) + .append(HYPHEN) + .append( + cal.get(Calendar.DAY_OF_MONTH) < DAY_MAX ? "0" + cal.get(Calendar.DAY_OF_MONTH) : cal + .get(Calendar.DAY_OF_MONTH)); + date.append(MIDNIGHT); + date.append("') "); + + StringBuilder date2 = new StringBuilder(); + date2.append(XS_DATETIME_FUNCTION + "('"); + date2.append(cal2.get(Calendar.YEAR)).append(HYPHEN).append( + cal2.get(Calendar.MONTH) < MONTH_MAX + ? "0" + (cal2.get(Calendar.MONTH) + 1) + : cal2.get(Calendar.MONTH) + 1).append(HYPHEN).append( + cal2.get(Calendar.DAY_OF_MONTH) < DAY_MAX ? "0" + cal2.get(Calendar.DAY_OF_MONTH) : cal2 + .get(Calendar.DAY_OF_MONTH)); + date2.append(T235959); + date2.append("') "); + fragment.append(date.toString() + " and " + propertyName + " <= " + date2.toString()); + } + else + { + String msg = "values provided are not of the accepted types String, Number, Calendar"; + log.error(msg); + throw new IllegalArgumentException(msg); + } + fragment.append(")"); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,15 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +/** + * @author fgrilli + * @version $Id$ + */ +public class Conjunction extends Junction +{ + private static final long serialVersionUID = 7590346442271897522L; + + public Conjunction() + { + super("and"); + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,61 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + + +import java.io.Serializable; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * An object-oriented representation of a query criterion that may be used as a restriction in a <tt>Criteria</tt> + * query. Built-in criterion types are provided by the <tt>Restrictions</tt> factory class. This interface might be + * implemented by application classes that define custom restriction criteria. + * @see Restrictions + * @see Criteria + * @author Federico Grilli + * @version $Id$ + */ +public interface Criterion extends Serializable +{ + + public static final Logger log = LoggerFactory.getLogger(Criterion.class); + + public static final String ATTRIBUTE_SELECTOR = "@"; + + public static final String JCR_PREFIX = "jcr:"; + + public static final String JCR_ROOT = "/jcr:root"; + + public static final String ALL_ELEMENTS = "//*"; + + public static final String ANY_PROPERTY = "."; + + public static final String XS_DATETIME_FUNCTION = "xs:dateTime"; + + public static final String MIDNIGHT = "T00:00:00.000+00:00"; + + public static final String T235959 = "T23:59:59.000+00:00"; + + public static final String NT_BASE = "nt:base"; + + public static final String NOT = " not("; + + public static final String HYPHEN = "-"; + + public static final int DAY_MAX = 10; + + public static final int MONTH_MAX = 9; + + /** + * Render the XPath fragment + * @param criteria + * @return String + * @throws JCRQueryException + */ + public String toXPathString(Criteria criteria) throws JCRQueryException; + +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,15 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +/** + * @author Federico Grilli + * @version $Id$ + */ +public class Disjunction extends Junction +{ + private static final long serialVersionUID = 1573336261639362776L; + + protected Disjunction() + { + super("or"); + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,35 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class IsNotNullExpression implements Criterion +{ + + private static final long serialVersionUID = -1955669039985775985L; + + protected static final String WHITESPACE = " "; + + private String nodeName; + + public IsNotNullExpression(String nodeName) + { + this.nodeName = nodeName; + } + + @Override + public String toString() + { + return nodeName; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + return WHITESPACE + nodeName + WHITESPACE; + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,36 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class IsNullExpression implements Criterion +{ + + private static final long serialVersionUID = -1600960388638847909L; + + private String nodeName; + + public IsNullExpression(String nodeName) + { + this.nodeName = nodeName; + } + + @Override + public String toString() + { + return nodeName; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(); + fragment.append(Criterion.NOT).append(nodeName).append(") "); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,49 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class JCRFunctionExpression implements Criterion +{ + + private static final long serialVersionUID = -5570839091762158385L; + + protected final String propertyName; + + protected final Object value; + + protected final String function; + + public JCRFunctionExpression(String propertyName, Object value, String function) + { + this.propertyName = propertyName; + this.value = value; + this.function = function; + } + + protected final String getFunction() + { + return function; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(); + fragment.append(" (" + function + "("); + fragment.append(propertyName); + fragment.append(", '" + value).append("') ) "); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } + + @Override + public String toString() + { + return propertyName + " " + function + " " + value; + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,72 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + +import org.apache.commons.lang.StringUtils; + + +/** + * A sequence of a logical expressions combined by some associative logical operator + * @author Federico Grilli + * @version $Id$ + */ +public class Junction implements Criterion +{ + + private static final long serialVersionUID = 4745761472724863693L; + + @SuppressWarnings("unchecked") + private final List criteria = new ArrayList(); + + private final String op; + + protected Junction(String op) + { + this.op = op; + } + + @SuppressWarnings("unchecked") + public Junction add(Criterion criterion) + { + criteria.add(criterion); + return this; + } + + public String getOp() + { + return op; + } + + @SuppressWarnings("unchecked") + public String toXPathString(Criteria crit) throws JCRQueryException + { + + if (criteria.size() == 0) + return ""; + + StringBuilder buffer = new StringBuilder().append('('); + Iterator iter = criteria.iterator(); + while (iter.hasNext()) + { + buffer.append(((Criterion) iter.next()).toXPathString(crit)); + if (iter.hasNext()) + buffer.append(' ').append(op).append(' '); + } + return buffer.append(')').toString(); + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + return '(' + StringUtils.join(criteria.iterator(), ' ' + op + ' ') + ')'; + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,36 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class LikeExpression extends JCRFunctionExpression +{ + + private static final long serialVersionUID = 1810624472706401714L; + + private MatchMode matchMode; + + public LikeExpression(String propertyName, Object value, String function, MatchMode matchMode) + { + super(propertyName, value, function); + if (matchMode == null) + throw new IllegalArgumentException("MatchMode can't be null"); + this.matchMode = matchMode; + } + + @Override + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(); + fragment.append(" (" + function + "("); + fragment.append(propertyName); + fragment.append(", '" + matchMode.toMatchString(value.toString()) + "') ) "); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,51 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * Superclass of binary logical expressions + * @author Federico Grilli + * @version $Id$ + */ +public class LogicalExpression implements Criterion +{ + + /** + * + */ + private static final long serialVersionUID = 4524284746715983618L; + + private final Criterion lhs; + + private final Criterion rhs; + + private final String op; + + protected LogicalExpression(Criterion lhs, Criterion rhs, String op) + { + this.lhs = lhs; + this.rhs = rhs; + this.op = op; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + + String fragment = '(' + lhs.toXPathString(criteria) + ' ' + getOp() + ' ' + rhs.toXPathString(criteria) + ')'; + log.debug("xpathString is {} ", fragment); + return fragment; + } + + public String getOp() + { + return op; + } + + @Override + public String toString() + { + return lhs.toString() + ' ' + getOp() + ' ' + rhs.toString(); + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,85 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + + +/** + * Represents an strategy for matching strings using "like". + * @author Federico Grilli + */ +@SuppressWarnings("serial") +public abstract class MatchMode implements Serializable +{ + + private static final long serialVersionUID = -7446324572335777782L; + + private final String name; + + private static final Map<String, MatchMode> INSTANCES = new HashMap<String, MatchMode>(); + + protected MatchMode(String name) + { + this.name = name; + } + + public String toString() + { + return name; + } + + /** + * Match the start of the string to the pattern + */ + public static final MatchMode START = new MatchMode("START") + { + + public String toMatchString(String pattern) + { + return pattern + '%'; + } + }; + + /** + * Match the end of the string to the pattern + */ + public static final MatchMode END = new MatchMode("END") + { + + public String toMatchString(String pattern) + { + return '%' + pattern; + } + }; + + /** + * Match the pattern anywhere in the string + */ + public static final MatchMode ANYWHERE = new MatchMode("ANYWHERE") + { + + public String toMatchString(String pattern) + { + return '%' + pattern + '%'; + } + }; + + static + { + INSTANCES.put(END.name, END); + INSTANCES.put(START.name, START); + INSTANCES.put(ANYWHERE.name, ANYWHERE); + } + + private Object readResolve() + { + return INSTANCES.get(name); + } + + /** + * convert the pattern, by appending/prepending "%" + */ + public abstract String toMatchString(String pattern); + +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,36 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * @author fgrilli + * @version $Id$ + */ +public class NotExpression implements Criterion +{ + + private static final long serialVersionUID = -5057676844499041929L; + + private Criterion expression; + + public NotExpression(Criterion expression) + { + this.expression = expression; + } + + @Override + public String toString() + { + return expression.toString(); + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(Criterion.NOT); + fragment.append(expression.toXPathString(criteria)).append(") "); + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + } +} Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,68 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + + +/** + * Represents an order imposed upon a <tt>Criteria</tt> result set + * @author Federico Grilli + */ +public class Order implements Criterion +{ + + /** + * + */ + private static final long serialVersionUID = -1228583450961430360L; + + private boolean ascending; + + private String nodeName; + + @Override + public String toString() + { + return nodeName + ' ' + (ascending ? "ascending" : "descending"); + } + + /** + * Constructor for Order. + */ + protected Order(String nodeName, boolean ascending) + { + this.nodeName = nodeName; + this.ascending = ascending; + } + + public String toXPathString(Criteria criteria) throws JCRQueryException + { + StringBuilder fragment = new StringBuilder(" "); + fragment.append(nodeName); + fragment.append(ascending ? " ascending" : " descending"); + + log.debug("xpathString is {} ", fragment); + return fragment.toString(); + + } + + /** + * Ascending order + * @param propertyName + * @return Order + */ + public static Order asc(String propertyName) + { + return new Order(propertyName, true); + } + + /** + * Descending order + * @param propertyName + * @return Order + */ + public static Order desc(String propertyName) + { + return new Order(propertyName, false); + } +} \ No newline at end of file Property changes on: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java =================================================================== --- openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java (rev 0) +++ openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2009-02-20 17:17:10 UTC (rev 1043) @@ -0,0 +1,337 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; + + +import java.util.Calendar; +import java.util.Collection; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; + + +/** + * The <tt>criterion</tt> package may be used by applications as a framework for building new kinds of + * <tt>Criterion</tt>. However, it is intended that most applications will simply use the built-in criterion types via + * the static factory methods of this class. + * @see Criteria + * @author Federico Grilli + * @version $Id$ + */ +public class Restrictions +{ + + Restrictions() + { + // cannot be instantiated + } + + /** + * Apply an "equal" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression eq(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, "="); + } + + /** + * Apply a "not equal" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression ne(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, "!="); + } + + /** + * Apply a "like" constraint of type {@link MatchMode#ANYWHERE} to the named node <br> + * <br> + * <strong>Be warned when using <em>jcr:like</em> function, as it can be very slow.</strong> <br> + * <br> + * The following account of why it is so, was taken <a href= + * "http://www.nabble.com/Explanation-and-solutions-of-some-Jackrabbit-queries-regarding-performance-td15028655.html" + * >here</a> <br> + * <em> + * <ul> + * <li>Question: My xpath is '//*[jcr:like(@propertyName, + * '%somevalue%')]' and it takes minutes to complete. + * + * <li>Answer: a jcr:like with % will be translated to a WildcardQuery lucene + * query. In order to prevent extremely slow WildcardQueries, a Wildcard + * term should not start with one of the wildcards * or ?. So this is not a + * Jackrabbit implementation detail, but a general Lucene (and I think + * inverted indexes in general) issue [1] + * + * <li>Conclusion: Avoid % prefixes in jcr:like. Use jcr:contains when + * searching for a specific word. If jcr:contains is not suitable, you can + * work around the problem by creating a custom lucene analyzer for the + * specific propery (see IndexingConfiguration [2] at Index Analyzers). + * </ul> + * </em> + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number}. + * @return Criterion + */ + public static JCRFunctionExpression like(String nodeName, Object value) + { + return new LikeExpression( + nodeName, + XPathTextUtils.stringToJCRSearchExp(value.toString()), + " jcr:like", + MatchMode.ANYWHERE); + + } + + /** + * Apply a "like" constraint to the named node <br> + * <br> + * <strong>Be warned when using <em>jcr:like</em> function, as it can be very slow.</strong> <br> + * <br> + * The following account of why it is so, was taken <a href= + * "http://www.nabble.com/Explanation-and-solutions-of-some-Jackrabbit-queries-regarding-performance-td15028655.html" + * >here</a> <br> + * <em> + * <ul> + * <li>Question: My xpath is '//*[jcr:like(@propertyName, + * '%somevalue%')]' and it takes minutes to complete. + * + * <li>Answer: a jcr:like with % will be translated to a WildcardQuery lucene + * query. In order to prevent extremely slow WildcardQueries, a Wildcard + * term should not start with one of the wildcards * or ?. So this is not a + * Jackrabbit implementation detail, but a general Lucene (and I think + * inverted indexes in general) issue [1] + * + * <li>Conclusion: Avoid % prefixes in jcr:like. Use jcr:contains when + * searching for a specific word. If jcr:contains is not suitable, you can + * work around the problem by creating a custom lucene analyzer for the + * specific propery (see IndexingConfiguration [2] at Index Analyzers). + * </ul> + * </em> + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number}. + * @param matchMode - one of {@link MatchMode#START} or {@link MatchMode#END} or {@link MatchMode#ANYWHERE} + * @return Criterion + */ + public static JCRFunctionExpression like(String nodeName, Object value, MatchMode matchMode) + { + return new LikeExpression( + nodeName, + XPathTextUtils.stringToJCRSearchExp(value.toString()), + " jcr:like", + matchMode); + } + + /** + * Apply a "contains" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number}. + * @return Criterion + */ + public static JCRFunctionExpression contains(String nodeName, Object value) + { + return new JCRFunctionExpression( + nodeName, + XPathTextUtils.stringToJCRSearchExp(value.toString()), + " jcr:contains"); + } + + /** + * Apply a "greater than" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression gt(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, ">"); + } + + /** + * Apply a "less than" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression lt(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, "<"); + } + + /** + * Apply a "less than or equal" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression le(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, "<="); + } + + /** + * Apply a "greater than or equal" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static SimpleExpression ge(String nodeName, Object value) + { + return new SimpleExpression(nodeName, value, ">="); + } + + /** + * Apply a "between" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param lo value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @param hi value - must be an instance of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static Criterion between(String nodeName, Object lo, Object hi) + { + return new BetweenExpression(nodeName, lo, hi); + } + + /** + * Apply an "in" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param values - must be instances of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static Criterion in(String nodeName, Object[] values) + { + throw new UnsupportedOperationException(); + } + + /** + * Apply an "in" constraint to the named node + * @param nodeName - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an + * attribute it must be preceded by the '@'character (eg. @nt:somenode) + * @param values - must be instances of either {@link String} or {@link Number} or {@link Calendar}. + * @return Criterion + */ + public static Criterion in(String nodeName, Collection values) + { + throw new UnsupportedOperationException(); + } + + /** + * Apply an "is null" constraint to the named node + * @return Criterion + */ + public static Criterion isNull(String nodeName) + { + return new IsNullExpression(nodeName); + } + + /** + * Apply an "is not null" constraint to the named node + * @return Criterion + */ + public static Criterion isNotNull(String nodeName) + { + return new IsNotNullExpression(nodeName); + } + + /** + * Return the conjuction of two expressions + * @param lhs + * @param rhs + * @return Criterion + */ + public static LogicalExpression and(Criterion lhs, Criterion rhs) + { + return new LogicalExpression(lhs, rhs, "and"); + } + + /** + * Return the disjuction of two expressions + * @param lhs + * @param rhs + * @return Criterion + */ + public static LogicalExpression or(Criterion lhs, Criterion rhs) + { + return new LogicalExpression(lhs, rhs, "or"); + } + + /** + * Return the negation of an expression + * @param expression + * @return Criterion + */ + public static Criterion not(Criterion expression) + { + return new NotExpression(expression); + } + + /** + * Apply a constraint expressed in xpath. + * @param xpath + * @param values + * @param types + * @return Criterion + */ + public static Criterion xpathRestriction(String xpath, Object[] values) + { + throw new UnsupportedOperationException(); + // return new XPathCriterion(sql, values, types); + } + + /** + * Apply a constraint expressed in xpath. + * @param xpath + * @param value + * @param type + * @return Criterion + */ + public static Criterion xpathRestriction(String xpath, Object value) + { + throw new UnsupportedOperationException(); + // return new XPathCriterion(sql, new Object[] { value }, new Type[] { + // type } ); + } + + /** + * Apply a constraint expressed in xpath. + ... [truncated message content] |
From: <fg...@us...> - 2009-02-20 17:12:44
|
Revision: 1042 http://openutils.svn.sourceforge.net/openutils/?rev=1042&view=rev Author: fgrilli Date: 2009-02-20 17:12:41 +0000 (Fri, 20 Feb 2009) Log Message: ----------- Initial import. Added Paths: ----------- openutils-mgnlcriteria/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-20 15:07:23
|
Revision: 1041 http://openutils.svn.sourceforge.net/openutils/?rev=1041&view=rev Author: fgrilli Date: 2009-02-20 15:07:14 +0000 (Fri, 20 Feb 2009) Log Message: ----------- added link to Magnolia Wiki with more info about this module Modified Paths: -------------- trunk/openutils-mgnlgroovy/src/site/apt/index.apt Modified: trunk/openutils-mgnlgroovy/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlgroovy/src/site/apt/index.apt 2009-02-19 20:14:40 UTC (rev 1040) +++ trunk/openutils-mgnlgroovy/src/site/apt/index.apt 2009-02-20 15:07:14 UTC (rev 1041) @@ -15,6 +15,7 @@ into magnolia. If you are installing it manually, please note that you will also need to install other dependencies, see the {{{dependencies.html}dependencies}} report for details +More info about this module can be found in the {{{http://wiki.magnolia-cms.com/display/WIKI/Magnolia+groovy+shell+module}Magnolia Community Wiki}} Released versions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-19 20:14:50
|
Revision: 1040 http://openutils.svn.sourceforge.net/openutils/?rev=1040&view=rev Author: fgrilli Date: 2009-02-19 20:14:40 +0000 (Thu, 19 Feb 2009) Log Message: ----------- added myself as developer so test my first commit on sf Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-02-19 13:35:39 UTC (rev 1039) +++ trunk/pom.xml 2009-02-19 20:14:40 UTC (rev 1040) @@ -78,6 +78,16 @@ </roles> <timezone>+1</timezone> </developer> + <developer> + <id>fgrilli</id> + <name>Federico Grilli</name> + <email>fed...@op...</email> + <organization>openmind</organization> + <roles> + <role>developer</role> + </roles> + <timezone>+1</timezone> + </developer> </developers> <prerequisites> <maven>2.0.9</maven> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-19 13:35:44
|
Revision: 1039 http://openutils.svn.sourceforge.net/openutils/?rev=1039&view=rev Author: fgiust Date: 2009-02-19 13:35:39 +0000 (Thu, 19 Feb 2009) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlstruts11/pom.xml Modified: trunk/openutils-mgnlstruts11/pom.xml =================================================================== --- trunk/openutils-mgnlstruts11/pom.xml 2009-02-19 13:35:31 UTC (rev 1038) +++ trunk/openutils-mgnlstruts11/pom.xml 2009-02-19 13:35:39 UTC (rev 1039) @@ -9,7 +9,7 @@ <artifactId>openutils-mgnlstruts11</artifactId> <packaging>jar</packaging> <name>openutils-mgnlstruts11</name> - <version>4.0-b1</version> + <version>4.0-b2-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -78,10 +78,4 @@ </exclusions> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstruts11-4.0-b1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstruts11-4.0-b1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstruts11-4.0-b1</url> - </scm> </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...> - 2009-02-19 13:35:38
|
Revision: 1038 http://openutils.svn.sourceforge.net/openutils/?rev=1038&view=rev Author: fgiust Date: 2009-02-19 13:35:31 +0000 (Thu, 19 Feb 2009) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlstruts11-4.0-b1 Added Paths: ----------- tags/openutils-mgnlstruts11-4.0-b1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-19 13:32:36
|
Revision: 1037 http://openutils.svn.sourceforge.net/openutils/?rev=1037&view=rev Author: fgiust Date: 2009-02-19 13:32:33 +0000 (Thu, 19 Feb 2009) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlstruts11-4.0-b1 Modified Paths: -------------- trunk/openutils-mgnlstruts11/pom.xml Modified: trunk/openutils-mgnlstruts11/pom.xml =================================================================== --- trunk/openutils-mgnlstruts11/pom.xml 2009-02-19 12:22:53 UTC (rev 1036) +++ trunk/openutils-mgnlstruts11/pom.xml 2009-02-19 13:32:33 UTC (rev 1037) @@ -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> @@ -10,7 +9,7 @@ <artifactId>openutils-mgnlstruts11</artifactId> <packaging>jar</packaging> <name>openutils-mgnlstruts11</name> - <version>4.0-SNAPSHOT</version> + <version>4.0-b1</version> <licenses> <license> <name>GPLv3</name> @@ -79,4 +78,10 @@ </exclusions> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstruts11-4.0-b1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstruts11-4.0-b1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstruts11-4.0-b1</url> + </scm> </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: <df...@us...> - 2009-02-19 13:24:29
|
Revision: 1034 http://openutils.svn.sourceforge.net/openutils/?rev=1034&view=rev Author: dfghi Date: 2009-02-19 12:07:29 +0000 (Thu, 19 Feb 2009) Log Message: ----------- Merge changes from a website development. Modified Paths: -------------- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlRequestProcessorHelper.java trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlStrutsUtils.java trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsRenderer.java trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/taglib/MgnlFormTag.java Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlRequestProcessorHelper.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlRequestProcessorHelper.java 2009-02-19 11:53:22 UTC (rev 1033) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlRequestProcessorHelper.java 2009-02-19 12:07:29 UTC (rev 1034) @@ -86,16 +86,34 @@ uri = forwardPath; } + // TODO da verificare + String urifornavigation; + if (!StringUtils.isEmpty(uri)) + { + urifornavigation = uri; + + if (!uri.endsWith(".jsp") && !uri.startsWith("/do")) + { + urifornavigation = "/do" + uri; + } + urifornavigation = request.getContextPath() + urifornavigation; + request.setAttribute(MgnlStrutsUtils.ATTRIBUTE_URIFORNAVIGATION, urifornavigation); + } + if (forward.getRedirect() && !uri.endsWith(".jsp")) { // @todo redirect in templates // only prepend context path for relative uri - if (uri.startsWith("/")) - { - uri = request.getContextPath() + uri; - } - response.sendRedirect(response.encodeRedirectURL(uri)); + // if (uri.startsWith("/")) { + // uri = request.getContextPath() + uri; + // } + // log.info("Redirecting to " + uri); + // + // response.sendRedirect(response.encodeRedirectURL(uri)); + // force includes instead of redirects + doInclude(uri, request, response); + } else { @@ -111,6 +129,8 @@ // needed for chained forwards, avoid loops! request.setAttribute(StrutsRenderer.PARAGRAPH_PATH, uri); + request.setAttribute("process_jsps", Boolean.TRUE); + // Unwrap the multipart request, if there is one. if (request instanceof MultipartRequestWrapper) { @@ -168,9 +188,8 @@ { getOut().write("Invalid path: " + path); } + return null; - return (null); - } private static WebContext getWebContext() Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlStrutsUtils.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlStrutsUtils.java 2009-02-19 11:53:22 UTC (rev 1033) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlStrutsUtils.java 2009-02-19 12:07:29 UTC (rev 1034) @@ -61,6 +61,16 @@ public static final String ATTRIBUTE_ORIGINALURI = "_originaluri"; /** + * + */ + public static final String ATTRIBUTE_URIFORNAVIGATION = "_urifornavigation"; + + /** + * + */ + public static final String ATTRIBUTE_STRUTSACTION = "_strutsaction"; + + /** * Logger. */ private static Logger log = LoggerFactory.getLogger(MgnlStrutsUtils.class); Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsRenderer.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsRenderer.java 2009-02-19 11:53:22 UTC (rev 1033) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsRenderer.java 2009-02-19 12:07:29 UTC (rev 1034) @@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang.StringUtils; import org.apache.struts.Globals; import org.apache.struts.action.ActionServlet; import org.apache.struts.action.RequestProcessor; @@ -77,6 +78,19 @@ String actionParameter = RequestFormUtil.getParameter(request, MgnlStrutsUtils.PARAMETER_MGNLACTION); + // TODO da verificare + String urifornavigation = actionParameter; + if (!StringUtils.isEmpty(urifornavigation)) + { + + if (!urifornavigation.startsWith("/do/")) + { + urifornavigation = "/do" + urifornavigation; + } + urifornavigation = request.getContextPath() + urifornavigation; + request.setAttribute(MgnlStrutsUtils.ATTRIBUTE_URIFORNAVIGATION, urifornavigation); + } + request.setAttribute(DontDispatchOnForwardAttributeVoter.DONT_DISPATCH_ON_FORWARD_ATTRIBUTE, Boolean.TRUE); // force magnolia multipart handler @@ -180,6 +194,7 @@ protected synchronized RequestProcessor getRequestProcessor(ModuleConfig config, ServletContext servletContext, ActionServlet dispatcher) throws ServletException { + return ((MgnlStrutsServlet) dispatcher).getRequestProcessor(config); } } Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/taglib/MgnlFormTag.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/taglib/MgnlFormTag.java 2009-02-19 11:53:22 UTC (rev 1033) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/taglib/MgnlFormTag.java 2009-02-19 12:07:29 UTC (rev 1034) @@ -83,13 +83,7 @@ if (pageUri != null) { results.append(pageUri); - - String anchor = actionUrl; - if (StringUtils.contains(anchor, "/")) - { - anchor = StringUtils.substringAfterLast(anchor, "/"); - } - results.append("#" + anchor); + results.append("#" + actionUrl); } results.append("\""); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-19 13:24:05
|
Revision: 1035 http://openutils.svn.sourceforge.net/openutils/?rev=1035&view=rev Author: fgiust Date: 2009-02-19 12:10:36 +0000 (Thu, 19 Feb 2009) Log Message: ----------- branch for magnolia 3.6.x Added Paths: ----------- branches/openutils-mgnlstruts11-3.6.x/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-02-19 13:23:11
|
Revision: 1032 http://openutils.svn.sourceforge.net/openutils/?rev=1032&view=rev Author: fgiust Date: 2009-02-19 11:51:21 +0000 (Thu, 19 Feb 2009) Log Message: ----------- eclipse formatter settings Added Paths: ----------- trunk/src/config/eclipse-formatter.xml Added: trunk/src/config/eclipse-formatter.xml =================================================================== --- trunk/src/config/eclipse-formatter.xml (rev 0) +++ trunk/src/config/eclipse-formatter.xml 2009-02-19 11:51:21 UTC (rev 1032) @@ -0,0 +1,267 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<profiles version="11"> +<profile kind="CodeFormatterProfile" name="project" version="11"> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> +<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/> +<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="48"/> +<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="48"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/> +<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/> +<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="52"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/> +<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> +</profile> +</profiles> Property changes on: trunk/src/config/eclipse-formatter.xml ___________________________________________________________________ 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...> - 2009-02-19 13:14:06
|
Revision: 1036 http://openutils.svn.sourceforge.net/openutils/?rev=1036&view=rev Author: fgiust Date: 2009-02-19 12:22:53 +0000 (Thu, 19 Feb 2009) Log Message: ----------- updated to magnolia 4.0-rc3 Modified Paths: -------------- trunk/openutils-mgnlstruts11/pom.xml trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/pages/StrutsConfigurationPage.java trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsParagraph.java trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsParagraphRegister.java trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsRenderer.java trunk/openutils-mgnlstruts11/src/main/resources/META-INF/magnolia/struts11.xml Modified: trunk/openutils-mgnlstruts11/pom.xml =================================================================== --- trunk/openutils-mgnlstruts11/pom.xml 2009-02-19 12:10:36 UTC (rev 1035) +++ trunk/openutils-mgnlstruts11/pom.xml 2009-02-19 12:22:53 UTC (rev 1036) @@ -10,7 +10,7 @@ <artifactId>openutils-mgnlstruts11</artifactId> <packaging>jar</packaging> <name>openutils-mgnlstruts11</name> - <version>1.0-SNAPSHOT</version> + <version>4.0-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -39,12 +39,12 @@ <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> - <version>3.6.3</version> + <version>4.0-rc3</version> </dependency> <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-module-admininterface</artifactId> - <version>3.6.3</version> + <version>4.0-rc3</version> </dependency> <dependency> <groupId>javax.servlet</groupId> Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/pages/StrutsConfigurationPage.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/pages/StrutsConfigurationPage.java 2009-02-19 12:10:36 UTC (rev 1035) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/pages/StrutsConfigurationPage.java 2009-02-19 12:22:53 UTC (rev 1036) @@ -17,13 +17,13 @@ */ package it.openutils.mgnlstruts11.pages; -import info.magnolia.cms.beans.config.ParagraphManager; import info.magnolia.cms.i18n.Messages; -import info.magnolia.cms.i18n.TemplateMessagesUtil; +import info.magnolia.cms.i18n.MessagesUtil; import info.magnolia.module.admininterface.DialogHandlerManager; import info.magnolia.module.admininterface.DialogMVCHandler; import info.magnolia.module.admininterface.InvalidDialogHandlerException; import info.magnolia.module.admininterface.TemplatedMVCHandler; +import info.magnolia.module.templating.ParagraphManager; import it.openutils.mgnlstruts11.render.StrutsParagraph; import it.openutils.mgnlstruts11.render.StrutsParagraphRegister; @@ -61,7 +61,10 @@ public Messages getMessages() { - return TemplateMessagesUtil.getMessages(); + // @todo review + return MessagesUtil.chain(new String[]{ + "info.magnolia.module.admininterface.messages_templating_custom", + "info.magnolia.module.admininterface.messages_templating" }); } public ParagraphManager getParagraphManager() Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsParagraph.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsParagraph.java 2009-02-19 12:10:36 UTC (rev 1035) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsParagraph.java 2009-02-19 12:22:53 UTC (rev 1036) @@ -17,7 +17,7 @@ */ package it.openutils.mgnlstruts11.render; -import info.magnolia.cms.beans.config.Paragraph; +import info.magnolia.module.templating.Paragraph; /** Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsParagraphRegister.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsParagraphRegister.java 2009-02-19 12:10:36 UTC (rev 1035) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsParagraphRegister.java 2009-02-19 12:22:53 UTC (rev 1036) @@ -17,8 +17,8 @@ */ package it.openutils.mgnlstruts11.render; -import info.magnolia.cms.beans.config.Paragraph; -import info.magnolia.cms.beans.config.ParagraphManager; +import info.magnolia.module.templating.Paragraph; +import info.magnolia.module.templating.ParagraphManager; import java.util.LinkedHashSet; import java.util.Set; Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsRenderer.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsRenderer.java 2009-02-19 12:10:36 UTC (rev 1035) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/render/StrutsRenderer.java 2009-02-19 12:22:53 UTC (rev 1036) @@ -17,12 +17,11 @@ */ package it.openutils.mgnlstruts11.render; -import info.magnolia.cms.beans.config.Paragraph; -import info.magnolia.cms.beans.runtime.ParagraphRenderer; import info.magnolia.cms.core.Content; -import info.magnolia.cms.util.RequestFormUtil; import info.magnolia.context.MgnlContext; import info.magnolia.context.WebContext; +import info.magnolia.module.templating.Paragraph; +import info.magnolia.module.templating.ParagraphRenderer; import info.magnolia.voting.voters.DontDispatchOnForwardAttributeVoter; import it.openutils.mgnlstruts11.process.MgnlMultipartRequestHandler; import it.openutils.mgnlstruts11.process.MgnlRequestProcessor; @@ -76,7 +75,7 @@ request.setAttribute(MgnlStrutsUtils.ATTRIBUTE_ORIGINALURI, wc.getContextPath() + wc.getAggregationState().getOriginalURI()); - String actionParameter = RequestFormUtil.getParameter(request, MgnlStrutsUtils.PARAMETER_MGNLACTION); + String actionParameter = MgnlContext.getParameter(MgnlStrutsUtils.PARAMETER_MGNLACTION); // TODO da verificare String urifornavigation = actionParameter; Modified: trunk/openutils-mgnlstruts11/src/main/resources/META-INF/magnolia/struts11.xml =================================================================== --- trunk/openutils-mgnlstruts11/src/main/resources/META-INF/magnolia/struts11.xml 2009-02-19 12:10:36 UTC (rev 1035) +++ trunk/openutils-mgnlstruts11/src/main/resources/META-INF/magnolia/struts11.xml 2009-02-19 12:22:53 UTC (rev 1036) @@ -9,15 +9,11 @@ <dependencies> <dependency> <name>adminInterface</name> - <version>3.6/*</version> + <version>4.0/*</version> </dependency> <dependency> <name>templating</name> - <version>3.6/*</version> + <version>4.0/*</version> </dependency> - <dependency> - <name>cache</name> - <version>3.6/*</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: <fg...@us...> - 2009-02-19 13:14:05
|
Revision: 1033 http://openutils.svn.sourceforge.net/openutils/?rev=1033&view=rev Author: fgiust Date: 2009-02-19 11:53:22 +0000 (Thu, 19 Feb 2009) Log Message: ----------- formatting Modified Paths: -------------- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlMultipartRequestHandler.java trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlRequestProcessorHelper.java Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlMultipartRequestHandler.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlMultipartRequestHandler.java 2009-02-19 11:51:21 UTC (rev 1032) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlMultipartRequestHandler.java 2009-02-19 11:53:22 UTC (rev 1033) @@ -28,10 +28,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.struts.Globals; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; -import org.apache.struts.config.ModuleConfig; import org.apache.struts.upload.FormFile; import org.apache.struts.upload.MultipartRequestHandler; Modified: trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlRequestProcessorHelper.java =================================================================== --- trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlRequestProcessorHelper.java 2009-02-19 11:51:21 UTC (rev 1032) +++ trunk/openutils-mgnlstruts11/src/main/java/it/openutils/mgnlstruts11/process/MgnlRequestProcessorHelper.java 2009-02-19 11:53:22 UTC (rev 1033) @@ -42,29 +42,31 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; + /** * @author fgiust - * @version $Id: MgnlRequestProcessorHelper.java 86 2008-11-04 08:37:44Z fgiust - * $ + * @version $Id$ */ -public class MgnlRequestProcessorHelper { +public class MgnlRequestProcessorHelper +{ /** * Logger. */ - private static Logger log = LoggerFactory - .getLogger(MgnlRequestProcessorHelper.class); + private static Logger log = LoggerFactory.getLogger(MgnlRequestProcessorHelper.class); - public static void doProcessForwardConfig(HttpServletRequest request, - HttpServletResponse response, ForwardConfig forward) - throws IOException, ServletException { + public static void doProcessForwardConfig(HttpServletRequest request, HttpServletResponse response, + ForwardConfig forward) throws IOException, ServletException + { log.info("processForwardConfig " + forward); - if (forward == null) { + if (forward == null) + { return; } - if (log.isDebugEnabled()) { + if (log.isDebugEnabled()) + { log.debug("processForwardConfig(" + forward + ")"); } @@ -74,70 +76,84 @@ // paths not starting with / should be passed through without any // processing // (ie. they're absolute) - if (forwardPath.startsWith("/")) { + if (forwardPath.startsWith("/")) + { uri = RequestUtils.forwardURL(request, forward); // get module - // relative uri - } else { + // relative uri + } + else + { uri = forwardPath; } - if (forward.getRedirect() && !uri.endsWith(".jsp")) { + if (forward.getRedirect() && !uri.endsWith(".jsp")) + { // @todo redirect in templates // only prepend context path for relative uri - if (uri.startsWith("/")) { + if (uri.startsWith("/")) + { uri = request.getContextPath() + uri; } response.sendRedirect(response.encodeRedirectURL(uri)); - } else { + } + else + { doInclude(uri, request, response); } } - public static void doInclude(String uri, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + public static void doInclude(String uri, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException + { // needed for chained forwards, avoid loops! request.setAttribute(StrutsRenderer.PARAGRAPH_PATH, uri); // Unwrap the multipart request, if there is one. - if (request instanceof MultipartRequestWrapper) { + if (request instanceof MultipartRequestWrapper) + { request = ((MultipartRequestWrapper) request).getRequest(); } - RequestDispatcher rd = getWebContext().getServletContext() - .getRequestDispatcher(uri); + RequestDispatcher rd = getWebContext().getServletContext().getRequestDispatcher(uri); getWebContext().include(uri, getOut()); } - public static ActionMapping doProcessMapping(HttpServletRequest request, - HttpServletResponse response, String path, ModuleConfig moduleConfig) - throws IOException { + public static ActionMapping doProcessMapping(HttpServletRequest request, HttpServletResponse response, String path, + ModuleConfig moduleConfig) throws IOException + { log.info("Process mapping " + path); // Is there a directly defined mapping for this path? ActionMapping mapping = (ActionMapping) moduleConfig.findActionConfig(path); - - if (mapping == null) { - // @todo This is almost a copy-paste of the end of RequestProcessor.processPath method, it should be refactored in a "simplify path" somewhere else. + + if (mapping == null) + { + // @todo This is almost a copy-paste of the end of RequestProcessor.processPath method, it should be + // refactored in a "simplify path" somewhere else. // This is a temporary patch to handle forwards correctly. - String retryPath = StringUtils.defaultString(StringUtils.substringAfterLast(StringUtils.substringBeforeLast(path, "."), "/")); + String retryPath = StringUtils.defaultString(StringUtils.substringAfterLast(StringUtils + .substringBeforeLast(path, "."), "/")); retryPath = retryPath.startsWith("/") ? retryPath : ("/" + retryPath); mapping = (ActionMapping) moduleConfig.findActionConfig(retryPath); } - if (mapping != null) { + if (mapping != null) + { request.setAttribute(Globals.MAPPING_KEY, mapping); return (mapping); } // Locate the mapping for unknown paths (if any) ActionConfig configs[] = moduleConfig.findActionConfigs(); - for (int i = 0; i < configs.length; i++) { - if (configs[i].getUnknown()) { + for (int i = 0; i < configs.length; i++) + { + if (configs[i].getUnknown()) + { mapping = (ActionMapping) configs[i]; request.setAttribute(Globals.MAPPING_KEY, mapping); return (mapping); @@ -148,7 +164,8 @@ log.error("Invalid path: " + path); // debug only on admin instances - if (ServerConfiguration.getInstance().isAdmin()) { + if (ServerConfiguration.getInstance().isAdmin()) + { getOut().write("Invalid path: " + path); } @@ -156,7 +173,8 @@ } - private static WebContext getWebContext() { + private static WebContext getWebContext() + { return ((WebContext) MgnlContext.getInstance()); } @@ -164,14 +182,18 @@ * @return * @throws IOException */ - private static Writer getOut() throws IOException { + private static Writer getOut() throws IOException + { Writer out = null; PageContext pageContext = getWebContext().getPageContext(); - if (pageContext != null) { + if (pageContext != null) + { out = pageContext.getOut(); - } else { + } + else + { out = getWebContext().getResponse().getWriter(); } return out; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2009-02-19 11:20:30
|
Revision: 1031 http://openutils.svn.sourceforge.net/openutils/?rev=1031&view=rev Author: molaschi Date: 2009-02-19 11:20:25 +0000 (Thu, 19 Feb 2009) Log Message: ----------- update player to v 4.3 Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/players/player.swf trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/players/yt.swf Modified: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/players/player.swf =================================================================== (Binary files differ) Modified: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/players/yt.swf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2009-02-19 11:07:02
|
Revision: 1030 http://openutils.svn.sourceforge.net/openutils/?rev=1030&view=rev Author: molaschi Date: 2009-02-19 11:06:58 +0000 (Thu, 19 Feb 2009) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- branches/openutils-mgnlmedia-3.6.x/pom.xml Modified: branches/openutils-mgnlmedia-3.6.x/pom.xml =================================================================== --- branches/openutils-mgnlmedia-3.6.x/pom.xml 2009-02-19 11:06:38 UTC (rev 1029) +++ branches/openutils-mgnlmedia-3.6.x/pom.xml 2009-02-19 11:06:58 UTC (rev 1030) @@ -9,7 +9,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlmedia</artifactId> <name>openutils-mgnlmedia</name> - <version>3.6.1</version> + <version>3.6.2-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -17,9 +17,9 @@ </license> </licenses> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-3.6.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-3.6.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlmedia-3.6.1</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/branches/openutils-mgnlmedia-3.6.x/</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/branches/openutils-mgnlmedia-3.6.x/</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/branches/openutils-mgnlmedia-3.6.x/</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2009-02-19 11:06:41
|
Revision: 1029 http://openutils.svn.sourceforge.net/openutils/?rev=1029&view=rev Author: molaschi Date: 2009-02-19 11:06:38 +0000 (Thu, 19 Feb 2009) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlmedia-3.6.1 Added Paths: ----------- tags/openutils-mgnlmedia-3.6.1/ tags/openutils-mgnlmedia-3.6.1/pom.xml tags/openutils-mgnlmedia-3.6.1/src/ Removed Paths: ------------- tags/openutils-mgnlmedia-3.6.1/pom.xml tags/openutils-mgnlmedia-3.6.1/src/ Property changes on: tags/openutils-mgnlmedia-3.6.1 ___________________________________________________________________ Added: subclipse:tags + 1007,openutils-mgnlmedia-3.6.x,/branches/openutils-mgnlmedia-3.6.x,branch Added: svn:ignore + .settings .checkstyle .classpath .project target test-output temp-testng-customsuite.xml svnmerge-commit-message.txt release.properties pom.xml.releaseBackup Added: svnmerge-integrated + /trunk/openutils-mgnlmedia:1-960,999-1000 Added: svn:mergeinfo + /trunk/openutils-mgnlmedia:999-1000 Deleted: tags/openutils-mgnlmedia-3.6.1/pom.xml =================================================================== --- branches/openutils-mgnlmedia-3.6.x/pom.xml 2009-02-19 11:05:08 UTC (rev 1027) +++ tags/openutils-mgnlmedia-3.6.1/pom.xml 2009-02-19 11:06:38 UTC (rev 1029) @@ -1,82 +0,0 @@ -<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</artifactId> - <version>10</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <packaging>jar</packaging> - <artifactId>openutils-mgnlmedia</artifactId> - <name>openutils-mgnlmedia</name> - <version>3.6.1-SNAPSHOT</version> - <licenses> - <license> - <name>GPLv3</name> - <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> - </license> - </licenses> - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/branches/openutils-mgnlmedia-3.6.x/</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/branches/openutils-mgnlmedia-3.6.x/</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/branches/openutils-mgnlmedia-3.6.x/</url> - </scm> - <build> - <resources> - <resource> - <filtering>false</filtering> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - <includes> - <include>META-INF/magnolia/*</include> - </includes> - </resource> - </resources> - </build> - <dependencies> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-core</artifactId> - <version>3.6.3</version> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-module-admininterface</artifactId> - <version>3.6.3</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-mgnltasks</artifactId> - <version>3.5.5</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-mgnlext</artifactId> - <version>2.1</version> - </dependency> - <dependency> - <groupId>com.drewnoakes</groupId> - <artifactId>metadata-extractor</artifactId> - <version>2.4.0-beta-1</version> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> -</project> \ No newline at end of file Copied: tags/openutils-mgnlmedia-3.6.1/pom.xml (from rev 1028, branches/openutils-mgnlmedia-3.6.x/pom.xml) =================================================================== --- tags/openutils-mgnlmedia-3.6.1/pom.xml (rev 0) +++ tags/openutils-mgnlmedia-3.6.1/pom.xml 2009-02-19 11:06:38 UTC (rev 1029) @@ -0,0 +1,82 @@ +<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</artifactId> + <version>10</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnlmedia</artifactId> + <name>openutils-mgnlmedia</name> + <version>3.6.1</version> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-3.6.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-3.6.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlmedia-3.6.1</url> + </scm> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.6.3</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>3.6.3</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnltasks</artifactId> + <version>3.5.5</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnlext</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>com.drewnoakes</groupId> + <artifactId>metadata-extractor</artifactId> + <version>2.4.0-beta-1</version> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> +</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: <mol...@us...> - 2009-02-19 11:06:17
|
Revision: 1028 http://openutils.svn.sourceforge.net/openutils/?rev=1028&view=rev Author: molaschi Date: 2009-02-19 11:06:13 +0000 (Thu, 19 Feb 2009) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlmedia-3.6.1 Modified Paths: -------------- branches/openutils-mgnlmedia-3.6.x/pom.xml Modified: branches/openutils-mgnlmedia-3.6.x/pom.xml =================================================================== --- branches/openutils-mgnlmedia-3.6.x/pom.xml 2009-02-19 11:05:08 UTC (rev 1027) +++ branches/openutils-mgnlmedia-3.6.x/pom.xml 2009-02-19 11:06:13 UTC (rev 1028) @@ -9,7 +9,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlmedia</artifactId> <name>openutils-mgnlmedia</name> - <version>3.6.1-SNAPSHOT</version> + <version>3.6.1</version> <licenses> <license> <name>GPLv3</name> @@ -17,9 +17,9 @@ </license> </licenses> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/branches/openutils-mgnlmedia-3.6.x/</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/branches/openutils-mgnlmedia-3.6.x/</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/branches/openutils-mgnlmedia-3.6.x/</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-3.6.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-3.6.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlmedia-3.6.1</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |