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-09-05 18:34:02
|
Revision: 1401 http://openutils.svn.sourceforge.net/openutils/?rev=1401&view=rev Author: fgiust Date: 2009-09-05 18:33:53 +0000 (Sat, 05 Sep 2009) Log Message: ----------- cleaned up for release Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml Added Paths: ----------- trunk/openutils-mgnlcriteria/src/main/assembly/ trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.xml trunk/openutils-mgnlcriteria/src/main/bundle/ trunk/openutils-mgnlcriteria/src/main/bundle/LICENSE.txt trunk/openutils-mgnlcriteria/src/main/bundle/README.txt Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2009-09-05 18:32:04 UTC (rev 1400) +++ trunk/openutils-mgnlcriteria/pom.xml 2009-09-05 18:33:53 UTC (rev 1401) @@ -10,11 +10,43 @@ <name>openutils-mgnlcriteria</name> <version>1.0.1-SNAPSHOT</version> <description>A Hibernate's Criteria-like API to programmatically generate JCR queries with Magnolia</description> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <url>http://lab.openmindonline.it/lab/products/mgnlcriteria.html</url> + <issueManagement> + <system>jira</system> + <url>http://lab.openmindonline.it/jira/browse/CRIT</url> + </issueManagement> + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>bundle</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + <configuration> + <descriptors> + <descriptor>${basedir}/src/main/assembly/assembly-bundle.xml</descriptor> + </descriptors> + </configuration> + </plugin> + </plugins> + </build> <dependencies> <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> - <version>4.0.1</version> + <version>4.1</version> </dependency> <dependency> <groupId>org.slf4j</groupId> Added: trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.xml =================================================================== --- trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.xml (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.xml 2009-09-05 18:33:53 UTC (rev 1401) @@ -0,0 +1,34 @@ +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"> + <id>bundle</id> + <formats> + <format>zip</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <filtered>true</filtered> + <outputDirectory>/</outputDirectory> + <lineEnding>crlf</lineEnding> + <directory>${basedir}/src/main/bundle</directory> + <includes> + <include>*</include> + </includes> + </fileSet> + <fileSet> + <directory>src/main/java/</directory> + <outputDirectory>/sources/</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + </fileSets> + <dependencySets> + <dependencySet> + <outputDirectory>bin</outputDirectory> + <includes> + <include>net.sourceforge.openutils:*</include> + </includes> + </dependencySet> + </dependencySets> +</assembly> \ No newline at end of file Property changes on: trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.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/bundle/LICENSE.txt =================================================================== --- trunk/openutils-mgnlcriteria/src/main/bundle/LICENSE.txt (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/bundle/LICENSE.txt 2009-09-05 18:33:53 UTC (rev 1401) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. Property changes on: trunk/openutils-mgnlcriteria/src/main/bundle/LICENSE.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/main/bundle/README.txt =================================================================== --- trunk/openutils-mgnlcriteria/src/main/bundle/README.txt (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/bundle/README.txt 2009-09-05 18:33:53 UTC (rev 1401) @@ -0,0 +1,63 @@ +=========================================================== + +${pom.name} ${pom.version} +by ${pom.organization.name} + +=========================================================== + +${pom.description} + +More information about this project can be found at: +${pom.url} + +Change log and known issues can be found at: +${pom.issueManagement.url} + +Source is available from the subversion repository at: +${pom.scm.url} + + +========================================= + USAGE +========================================= + +The preferred way to add ${pom.name} to your project is using maven. +You can declare the following dependency in your pom.xml: + + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>${pom.artifactId}</artifactId> + <version>${pom.version}</version> + <scope>test</scope> + </dependency> + +Alternatively, you can add the ${pom.artifactId} jar to the classpath +of your application. + +========================================= + LICENSE +========================================= + +Copyright Openmind http://www.openmindonline.it + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. + + + +========================================= + GENERAL LEGAL NOTICES +========================================= + +Magnolia is a registered trademark of Magnolia International Ltd. + Property changes on: trunk/openutils-mgnlcriteria/src/main/bundle/README.txt ___________________________________________________________________ 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...> - 2010-01-09 14:03:44
|
Revision: 1618 http://openutils.svn.sourceforge.net/openutils/?rev=1618&view=rev Author: fgiust Date: 2010-01-09 14:03:37 +0000 (Sat, 09 Jan 2010) Log Message: ----------- CRIT-4 Adds a public API to get the translated xpath statement + tests! Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml 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/criterion/Junction.java 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 Added Paths: ----------- trunk/openutils-mgnlcriteria/src/test/java/net/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-01-09 14:00:53 UTC (rev 1617) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-01-09 14:03:37 UTC (rev 1618) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -62,6 +63,12 @@ <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.7</version> + <scope>test</scope> + </dependency> </dependencies> <repositories> <repository> 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 2010-01-09 14:00:53 UTC (rev 1617) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2010-01-09 14:03:37 UTC (rev 1618) @@ -37,7 +37,7 @@ * begin.set(2004, Calendar.JANUARY, 1); * Calendar end = Calendar.getInstance(); * end.set(2008, Calendar.DECEMBER, 1); - * + * * Collection pets = JCRCriteriaFactory.createMgnlCriteria("//dogs//*", MgnlContext.getQueryManager("website"), "nt:base").add( * Restrictions.contains("@name", "Nana")).add( * Restrictions.gt("@weight", Float.valueOf(10))).add( @@ -76,11 +76,11 @@ * * Content nodes returned by the above query will be automatically converted to and populate instances of the * <code>Pet</code> type. Furthermore, you may want to have only a subset of the whole result set returned, much like in - * a MySQL limit clause. In this case, you will use the <code>JCRCriteriaFactory.createMgnlCriteriaWithLimit</code> factory method. - * For this to work, the underlying JCR repository implementation must support this feature (Jackrabbit 1.4+ does). Here - * is an example. + * a MySQL limit clause. In this case, you will use the <code>JCRCriteriaFactory.createMgnlCriteriaWithLimit</code> + * factory method. For this to work, the underlying JCR repository implementation must support this feature (Jackrabbit + * 1.4+ does). Here is an example. * - *<pre> + * <pre> * Collection<Pet> pets = JCRCriteriaFactory.createMgnlCriteriaWithLimit("//dogs//*", MgnlContext.getQueryManager("website"), "mgnl:content", Pet.class).add( * Restrictions.contains("@name", "Nana")).add( * Restrictions.gt("@weight", Float.valueOf(10))).add( @@ -92,16 +92,17 @@ * * Notice the <code>setFirstResult(int)</code> and <code>setMaxResults(int)</code> methods. Now calling * <code>list()</code> will return a subset of only five <code>Pet</code> objects, starting from the 6th item (counting - * starts from 0). If you dont specify these two calls, <code>list()</code> will behave as usual by returning the entire result set. - * If you only call <code>setMaxResults(int)</code>, the result set will be the subset of elements <code>[0, maxResults]</code> - * (firstResultValue is 0 by default). - * <br><br> - * A word of warning about implementations returned by <code>JCRCriteriaFactory</code>. They are <strong>NOT</strong> thread-safe, - * therefore client code wishing to use one of them as a shared global variable <strong>MUST</strong> coordinate access - * to it. These objects are actually meant to be instantiated and used within a method scope (e.g. a service method), - * where no concurrent issues arise. <br> + * starts from 0). If you dont specify these two calls, <code>list()</code> will behave as usual by returning the entire + * result set. If you only call <code>setMaxResults(int)</code>, the result set will be the subset of elements + * <code>[0, maxResults]</code> (firstResultValue is 0 by default). <br> * <br> - * This API was inspired by Hibernate's Criteria API. <br><br> + * A word of warning about implementations returned by <code>JCRCriteriaFactory</code>. They are <strong>NOT</strong> + * thread-safe, therefore client code wishing to use one of them as a shared global variable <strong>MUST</strong> + * coordinate access to it. These objects are actually meant to be instantiated and used within a method scope (e.g. a + * service method), where no concurrent issues arise. <br> + * <br> + * This API was inspired by 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 JCRCriteriaFactory#createMgnlCriteriaWithLimit(String, info.magnolia.cms.core.search.QueryManager, String) @@ -120,7 +121,7 @@ * @param criterion The {@link Criterion criterion} object representing the restriction to be applied. * @return this (for method chaining) */ - public Criteria add(Criterion criterion); + Criteria add(Criterion criterion); /** * Add an {@link Order ordering} to the result set. Only <strong>one Order criterion per query</strong> can be @@ -128,21 +129,21 @@ * @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); + 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); + 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); + Criteria setFirstResult(int firstResult); /* * Set a timeout for the underlying query. @@ -155,5 +156,11 @@ * null</strong> * @return The Collection of matched query results. */ - public Collection< ? > list() throws JCRQueryException; + Collection< ? > list() throws JCRQueryException; + + /** + * Returns the generated xpath expression + * @return the generated xpath expression + */ + String toXpathExpression(); } \ No newline at end of file Modified: 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 2010-01-09 14:00:53 UTC (rev 1617) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java 2010-01-09 14:03:37 UTC (rev 1618) @@ -65,15 +65,27 @@ { if (criteria.size() == 0) + { return ""; + } StringBuilder buffer = new StringBuilder().append('('); Iterator iter = criteria.iterator(); + + boolean isfirst = true; while (iter.hasNext()) { - buffer.append(((Criterion) iter.next()).toXPathString(crit)); - if (iter.hasNext()) - buffer.append(' ').append(op).append(' '); + String xPathString = ((Criterion) iter.next()).toXPathString(crit); + if (StringUtils.isNotBlank(xPathString)) + { + if (!isfirst && StringUtils.isNotBlank(xPathString)) + { + buffer.append(' ').append(op).append(" "); + } + buffer.append(xPathString); + isfirst = false; + } + } return buffer.append(')').toString(); } Modified: 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/AbstractCriteriaImpl.java 2010-01-09 14:00:53 UTC (rev 1617) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java 2010-01-09 14:03:37 UTC (rev 1618) @@ -205,4 +205,5 @@ return order.toString(); } } + } \ No newline at end of file Modified: 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/AbstractMagnoliaCriteriaImpl.java 2010-01-09 14:00:53 UTC (rev 1617) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java 2010-01-09 14:03:37 UTC (rev 1618) @@ -21,6 +21,8 @@ import info.magnolia.cms.core.Content; import info.magnolia.cms.core.ItemType; import info.magnolia.cms.core.search.QueryManager; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRMagnoliaCriteriaQueryTranslator; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.XPathSelect; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; import org.apache.commons.lang.StringUtils; @@ -59,4 +61,18 @@ // defaults to info.magnolia.cms.core.Content this.classType = classType == null ? Content.class : classType; } + + /** + * @return + */ + public String toXpathExpression() + { + JCRMagnoliaCriteriaQueryTranslator translator = new JCRMagnoliaCriteriaQueryTranslator(this); + XPathSelect statement = new XPathSelect(); + statement.setRoot(this.path); + statement.setPredicate(translator.getPredicate()); + statement.setOrderByClause(translator.getOrderBy()); + String stmt = statement.toStatementString(); + return stmt; + } } \ No newline at end of file Added: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java 2010-01-09 14:03:37 UTC (rev 1618) @@ -0,0 +1,71 @@ +/** + * + * Copyright Openmind http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; + +import junit.framework.Assert; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRCriteriaFactory; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Junction; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions; + +import org.junit.Test; + + +/** + * @author fgiust + * @version $Id$ + */ +public class MagnoliaCriteriaTest +{ + + @Test + public void testSimple() + { + Criteria criteria = JCRCriteriaFactory.createMgnlCriteria("//site//*", null, "mgnl:content"); + + Junction conjunction = Restrictions.conjunction(); + criteria.add(conjunction); + conjunction.add(Restrictions.eq("@property", "test")); + conjunction.add(Restrictions.eq("@anotherproperty", "anothertest")); + + String xpathExpression = criteria.toXpathExpression(); + Assert.assertEquals( + "//site//*[(( (@property='test') and (@anotherproperty='anothertest') ) )] ", + xpathExpression); + + } + + /** + * Test for CRIT-3 + */ + @Test + public void testEmptyConjuntion() + { + Criteria criteria = JCRCriteriaFactory.createMgnlCriteria("//site//*", null, "mgnl:content"); + + criteria.add(Restrictions.eq("@property", "test")); + + Junction conjunction = Restrictions.conjunction(); + criteria.add(conjunction); + + String xpathExpression = criteria.toXpathExpression(); + Assert.assertEquals("//site//*[( (@property='test') )] ", xpathExpression); + + } +} Property changes on: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-01-09 14:09:10
|
Revision: 1619 http://openutils.svn.sourceforge.net/openutils/?rev=1619&view=rev Author: fgiust Date: 2010-01-09 14:09:02 +0000 (Sat, 09 Jan 2010) Log Message: ----------- updating license headers Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlcriteria/src/main/etc/header.txt 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/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/InExpression.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/XPathSelect.java 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/XPathTextUtils.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java Added Paths: ----------- trunk/openutils-mgnlcriteria/src/main/etc/ Removed Paths: ------------- trunk/openutils-mgnlcriteria/src/etc/ Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-01-09 14:09:02 UTC (rev 1619) @@ -7,8 +7,9 @@ <version>1.1</version> </parent> <artifactId>openutils-mgnlcriteria</artifactId> - <name>openutils-mgnlcriteria</name> + <name>Magnolia Criteria API</name> <version>1.0.3-SNAPSHOT</version> + <inceptionYear>2009</inceptionYear> <description>A Hibernate's Criteria-like API to programmatically generate JCR queries with Magnolia</description> <licenses> <license> @@ -40,6 +41,30 @@ </descriptors> </configuration> </plugin> + <plugin> + <groupId>com.mycila.maven-license-plugin</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>1.5.0</version> + <configuration> + <header>src/main/etc/header.txt</header> + <includes> + <include>src/**/*.java</include> + </includes> + <properties> + <year>${project.inceptionYear} - 2010</year> + <name>${project.name}</name> + <description>${project.description}</description> + <url>${project.url}</url> + </properties> + </configuration> + <executions> + <execution> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build> <dependencies> Modified: trunk/openutils-mgnlcriteria/src/main/etc/header.txt =================================================================== --- trunk/openutils-mgnlcriteria/src/etc/header.txt 2010-01-09 10:36:17 UTC (rev 1616) +++ trunk/openutils-mgnlcriteria/src/main/etc/header.txt 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,5 +1,6 @@ - Copyright Openmind http://www.openmindonline.it +${name} (${url}) +Copyright (C)${year}, Openmind S.r.l. http://www.openmindonline.it This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,4 +14,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. - \ No newline at end of file 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query; import java.util.Collection; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaImpl; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query; import java.util.Iterator; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query; import org.apache.commons.lang.exception.NestableRuntimeException; Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import java.util.Calendar; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; /** Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; /** Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/InExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/InExpression.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/InExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import java.util.ArrayList; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import java.io.Serializable; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; Modified: 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; 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 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import java.util.Calendar; Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; Modified: 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/XPathSelect.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/XPathSelect.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath; import org.apache.commons.lang.StringUtils; Modified: 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/AbstractCriteriaImpl.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; import java.io.Serializable; Modified: 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/AbstractMagnoliaCriteriaImpl.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; import info.magnolia.cms.core.Content; Modified: 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/MagnoliaCriteriaImpl.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaImpl.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; import info.magnolia.cms.core.Content; Modified: 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/impl/MagnoliaCriteriaWithLimitImpl.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaWithLimitImpl.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; import info.magnolia.cms.core.Content; Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils; import org.apache.commons.lang.StringUtils; Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java 2010-01-09 14:03:37 UTC (rev 1618) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java 2010-01-09 14:09:02 UTC (rev 1619) @@ -1,6 +1,7 @@ /** * - * Copyright Openmind http://www.openmindonline.it + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; import junit.framework.Assert; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-27 10:11:36
|
Revision: 2064 http://openutils.svn.sourceforge.net/openutils/?rev=2064&view=rev Author: fgiust Date: 2010-02-27 10:11:24 +0000 (Sat, 27 Feb 2010) Log Message: ----------- CRIT-7 brand new API for jcr2 features, work in progress Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml 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/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 Added Paths: ----------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaFactory.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedResult.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedResultItem.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-02-26 09:02:21 UTC (rev 2063) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-02-27 10:11:24 UTC (rev 2064) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -70,7 +71,7 @@ <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> - <version>4.2.3</version> + <version>${magnolia.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> @@ -88,6 +89,16 @@ <version>2.4</version> </dependency> <dependency> + <groupId>com.google.collections</groupId> + <artifactId>google-collections</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>javax.jcr</groupId> + <artifactId>jcr</artifactId> + <version>2.0</version> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.7</version> @@ -98,7 +109,7 @@ <repository> <id>repository.magnolia.info</id> <name>magnolia repository</name> - <url>http://repo.magnolia.info/m2</url> + <url>http://repository.magnolia-cms.com/m2/</url> <releases> <enabled>true</enabled> </releases> @@ -107,4 +118,7 @@ </snapshots> </repository> </repositories> + <properties> + <magnolia.version>4.2.3</magnolia.version> + </properties> </project> \ No newline at end of file Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -0,0 +1,20 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; + + +/** + * @author fgiust + * @version $Id$ + */ +public interface AdvancedCriteria extends Criteria +{ + + public AdvancedCriteria setBasePath(String path); + + public AdvancedCriteria setWorkspace(String path); + + public AdvancedResult execute(); + + public AdvancedCriteria setPaging(int itemsPerPage, int pageNumberStartingFromOne); +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.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/advanced/AdvancedCriteriaFactory.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaFactory.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaFactory.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -0,0 +1,28 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced; + +import javax.jcr.query.Query; + +import net.sourceforge.openutils.mgnlcriteria.advanced.impl.AdvancedCriteriaImpl; + + +/** + * @author fgiust + * @version $Id$ + */ +public class AdvancedCriteriaFactory +{ + + public static AdvancedCriteria createAdvancedCriteria() + { + try + { + String jcrJqom = Query.JCR_JQOM; + } + catch (Throwable e) + { + throw new RuntimeException("AdvancedCriteria requires Jcr 2.0"); + } + + return new AdvancedCriteriaImpl(); + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaFactory.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/advanced/AdvancedResult.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedResult.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedResult.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -0,0 +1,20 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced; + +/** + * @author fgiust + * @version $Id$ + */ +public interface AdvancedResult +{ + + int getItemsPerPage(); + + int getPage(); + + int getTotalSize(); + + String getSpellCheckerSuggestion(); + + ResultIterator<AdvancedResultItem> getItems(); + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedResult.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/advanced/AdvancedResultItem.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedResultItem.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedResultItem.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -0,0 +1,16 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced; + +import info.magnolia.cms.core.Content; + + +/** + * @author fgiust + * @version $Id$ + */ +public interface AdvancedResultItem extends Content +{ + + String getExcerpt(); + + Double getScore(); +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedResultItem.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/advanced/impl/AdvancedCriteriaImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -0,0 +1,127 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced.impl; + +import info.magnolia.cms.beans.config.ContentRepository; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.context.MgnlContext; + +import java.util.Collection; + +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.query.InvalidQueryException; + +import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedCriteria; +import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedResult; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractCriteriaImpl; + +import org.apache.jackrabbit.core.query.QueryImpl; +import org.apache.jackrabbit.core.query.lucene.QueryResultImpl; + + +/** + * @author fgiust + * @version $Id$ + */ +public class AdvancedCriteriaImpl extends AbstractCriteriaImpl implements AdvancedCriteria +{ + + private String workspace = ContentRepository.WEBSITE; + + private int pageNumberStartingFromOne; + + public AdvancedCriteriaImpl() + { + // empty + } + + /** + * {@inheritDoc} + */ + public AdvancedCriteria setBasePath(String path) + { + this.path = path; + return this; + } + + /** + * {@inheritDoc} + */ + public AdvancedCriteria setWorkspace(String workspace) + { + this.workspace = workspace; + return this; + } + + /** + * {@inheritDoc} + */ + public AdvancedCriteria setPaging(int itemsPerPage, int pageNumberStartingFromOne) + { + this.maxResults = itemsPerPage; + this.pageNumberStartingFromOne = pageNumberStartingFromOne; + + this.offset = (Math.min(pageNumberStartingFromOne, 1) - 1) * maxResults; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Collection< ? > list() throws JCRQueryException + { + throw new UnsupportedOperationException("list() is not supported in AdvancedCriteria, please call execute()"); + } + + /** + * {@inheritDoc} + */ + public AdvancedResult execute() + { + HierarchyManager hm = MgnlContext.getHierarchyManager(workspace); + + Session jcrSession = hm.getWorkspace().getSession(); + javax.jcr.query.QueryManager jcrQueryManager; + + String stmt = toXpathExpression(); + + try + { + jcrQueryManager = jcrSession.getWorkspace().getQueryManager(); + + QueryImpl query = (QueryImpl) jcrQueryManager.createQuery(stmt, javax.jcr.query.Query.XPATH); + + if (this.maxResults > 0) + { + query.setLimit(this.maxResults); + } + + if (this.offset > 0) + { + query.setOffset(this.offset); + } + + return new AdvancedResultImpl( + (QueryResultImpl) query.execute(), + maxResults, + pageNumberStartingFromOne, + stmt, + hm); + + } + catch (InvalidQueryException e) + { + JCRQueryException jqe = new JCRQueryException(stmt, e); + log.error(jqe.getMessage()); + throw jqe; + } + catch (RepositoryException e) + { + JCRQueryException jqe = new JCRQueryException(stmt, e); + log.error(jqe.getMessage()); + throw jqe; + } + + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.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/advanced/impl/AdvancedResultImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -0,0 +1,100 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced.impl; + +import info.magnolia.cms.core.HierarchyManager; + +import javax.jcr.RepositoryException; +import javax.jcr.query.RowIterator; + +import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedResult; +import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedResultItem; +import net.sourceforge.openutils.mgnlcriteria.advanced.ResultIterator; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; + +import org.apache.jackrabbit.core.query.lucene.QueryResultImpl; + + +/** + * @author fgiust + * @version $Id$ + */ +public class AdvancedResultImpl implements AdvancedResult +{ + + private final QueryResultImpl jcrQueryResult; + + private final int itemsPerPage; + + private final int pageNumberStartingFromOne; + + private final String statement; + + private HierarchyManager hm; + + /** + * @param execute + */ + public AdvancedResultImpl( + QueryResultImpl jcrQueryResult, + int itemsPerPage, + int pageNumberStartingFromOne, + String statement, + HierarchyManager hm) + { + this.jcrQueryResult = jcrQueryResult; + this.itemsPerPage = itemsPerPage; + this.pageNumberStartingFromOne = pageNumberStartingFromOne; + this.statement = statement; + this.hm = hm; + } + + /** + * {@inheritDoc} + */ + public int getItemsPerPage() + { + return itemsPerPage; + } + + /** + * {@inheritDoc} + */ + public int getPage() + { + return pageNumberStartingFromOne; + } + + /** + * {@inheritDoc} + */ + public int getTotalSize() + { + return jcrQueryResult.getTotalSize(); + } + + public ResultIterator<AdvancedResultItem> getItems() + { + + RowIterator rows; + try + { + rows = jcrQueryResult.getRows(); + } + catch (RepositoryException e) + { + JCRQueryException jqe = new JCRQueryException(statement, e); + throw jqe; + } + + return new AdvancedResultItemResultIterator(rows, this.hm); + } + + /** + * {@inheritDoc} + */ + public String getSpellCheckerSuggestion() + { + // TODO Auto-generated method stub + return null; + } + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.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/advanced/impl/AdvancedResultItemImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -0,0 +1,77 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced.impl; + +import info.magnolia.cms.core.Content; +import info.magnolia.cms.core.DefaultContent; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.security.AccessDeniedException; + +import javax.jcr.RepositoryException; +import javax.jcr.query.Row; + +import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedResultItem; + + +/** + * @author fgiust + * @version $Id$ + */ +public class AdvancedResultItemImpl extends DefaultContent implements Content, AdvancedResultItem +{ + + private String excerpt; + + private Double score; + + private final Row row; + + /** + * @param elem + * @param hierarchyManager + * @throws RepositoryException + * @throws AccessDeniedException + */ + public AdvancedResultItemImpl(Row row, HierarchyManager hierarchyManager) + throws RepositoryException, + AccessDeniedException + { + super(row.getNode(), hierarchyManager); + this.row = row; + } + + /** + * Returns the excerpt. + * @return the excerpt + */ + public String getExcerpt() + { + return excerpt; + } + + /** + * Sets the excerpt. + * @param excerpt the excerpt to set + */ + public void setExcerpt(String excerpt) + { + this.excerpt = excerpt; + } + + /** + * Returns the score. + * @return the score + */ + public Double getScore() + { + return score; + } + + /** + * Sets the score. + * @param score the score to set + */ + public void setScore(Double score) + { + this.score = score; + } + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: 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 2010-02-26 09:02:21 UTC (rev 2063) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -19,11 +19,9 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query; -import java.util.Iterator; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria.CriterionEntry; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria.OrderEntry; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractCriteriaImpl; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractMagnoliaCriteriaImpl; - import org.apache.commons.lang.StringUtils; @@ -34,15 +32,15 @@ public class JCRMagnoliaCriteriaQueryTranslator { - private final AbstractMagnoliaCriteriaImpl criteria; + private final TranslatableCriteria criteria; - public JCRMagnoliaCriteriaQueryTranslator(final AbstractMagnoliaCriteriaImpl criteria) throws JCRQueryException + public JCRMagnoliaCriteriaQueryTranslator(final TranslatableCriteria criteria) throws JCRQueryException { this.criteria = criteria; } - public AbstractCriteriaImpl getRootCriteria() + public Criteria getRootCriteria() { return criteria; } @@ -50,12 +48,11 @@ public String getPredicate() { StringBuilder condition = new StringBuilder(30); - Iterator<AbstractMagnoliaCriteriaImpl.CriterionEntry> criterionIterator = criteria.iterateExpressionEntries(); boolean isfirst = true; - while (criterionIterator.hasNext()) + + for (CriterionEntry entry : criteria.getCriterionEntries()) { - AbstractMagnoliaCriteriaImpl.CriterionEntry entry = criterionIterator.next(); String xpathString = entry.getCriterion().toXPathString(entry.getCriteria()); if (StringUtils.isNotBlank(xpathString)) @@ -76,10 +73,9 @@ public String getOrderBy() { StringBuilder orderBy = new StringBuilder(30); - Iterator<AbstractMagnoliaCriteriaImpl.OrderEntry> criterionIterator = criteria.iterateOrderings(); - while (criterionIterator.hasNext()) + + for (OrderEntry oe : criteria.getOrderEntries()) { - AbstractMagnoliaCriteriaImpl.OrderEntry oe = criterionIterator.next(); orderBy.append(oe.getOrder().toXPathString(oe.getCriteria())); break; // ignore the rest @@ -87,6 +83,7 @@ * if ( criterionIterator.hasNext() ) { orderBy.append( ", " ); } */ } + return orderBy.toString(); } } \ No newline at end of file Modified: 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 2010-02-26 09:02:21 UTC (rev 2063) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -19,32 +19,30 @@ 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 +public class JCRQueryException extends RuntimeException { private static final long serialVersionUID = -8737641628360563743L; - public JCRQueryException(String msg, Throwable cause) - { - super(msg, cause); - } + private String statement; - public JCRQueryException(String msg) + public JCRQueryException(String statement, Throwable cause) { - super(msg); + super("An error occurred while executing a query. Xpath query was " + + statement + + ". Exception message is " + + cause.getMessage(), cause); + this.statement = statement; } - public JCRQueryException(Throwable cause) + public String getStatement() { - super(cause); + return statement; } } Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -0,0 +1,84 @@ +package net.sourceforge.openutils.mgnlcriteria.jcr.query; + +import java.io.Serializable; +import java.util.Collection; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Criterion; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Order; + + +/** + * @author fgiust + * @version $Id$ + */ +public interface TranslatableCriteria extends Criteria +{ + + Collection<OrderEntry> getOrderEntries(); + + Collection<CriterionEntry> getCriterionEntries(); + + public static final class CriterionEntry implements Serializable + { + + private static final long serialVersionUID = 1L; + + private final Criterion criterion; + + private final Criteria criteria; + + public CriterionEntry(Criterion criterion, Criteria criteria) + { + this.criteria = criteria; + this.criterion = criterion; + } + + public Criterion getCriterion() + { + return criterion; + } + + public Criteria getCriteria() + { + return criteria; + } + + @Override + public String toString() + { + return criterion.toString(); + } + } + + public static final class OrderEntry implements Serializable + { + + private static final long serialVersionUID = 1L; + + private final Order order; + + private final Criteria criteria; + + public OrderEntry(Order order, Criteria criteria) + { + this.criteria = criteria; + this.order = order; + } + + public Order getOrder() + { + return order; + } + + public Criteria getCriteria() + { + return criteria; + } + + @Override + public String toString() + { + return order.toString(); + } + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: 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/AbstractCriteriaImpl.java 2010-02-26 09:02:21 UTC (rev 2063) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -19,16 +19,19 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; -import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; +import java.util.Collections; import java.util.List; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRMagnoliaCriteriaQueryTranslator; import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria; 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.xpath.XPathSelect; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,44 +42,42 @@ * @author fgrilli * @version $Id$ */ -public abstract class AbstractCriteriaImpl implements Criteria +public abstract class AbstractCriteriaImpl implements Criteria, TranslatableCriteria { - private static final long serialVersionUID = -66324747458323718L; + protected Logger log = LoggerFactory.getLogger(getClass()); - protected static final Logger log = LoggerFactory.getLogger(AbstractMagnoliaCriteriaImpl.class); - protected String path = Criterion.JCR_ROOT; protected String itemType; protected Class< ? > classType; - private List<CriterionEntry> criterionEntries = new ArrayList<CriterionEntry>(); + protected List<CriterionEntry> criterionEntries = new ArrayList<CriterionEntry>(); - private List<OrderEntry> orderEntries = new ArrayList<OrderEntry>(); + protected List<OrderEntry> orderEntries = new ArrayList<OrderEntry>(); - private Integer maxResults = Integer.MAX_VALUE; + protected int maxResults = 0; - private Integer firstResult = 0; + protected int offset = 0; - private Integer timeout; + protected Integer timeout; - private String comment; + protected String comment; protected AbstractCriteriaImpl() { super(); } - public Iterator<CriterionEntry> iterateExpressionEntries() + public Collection<CriterionEntry> getCriterionEntries() { - return criterionEntries.iterator(); + return Collections.unmodifiableCollection(criterionEntries); } - public Iterator<OrderEntry> iterateOrderings() + public Collection<OrderEntry> getOrderEntries() { - return orderEntries.iterator(); + return Collections.unmodifiableCollection(orderEntries); } public Criteria add(Criteria criteriaInst, Criterion expression) @@ -110,12 +111,12 @@ public Integer getFirstResult() { - return firstResult; + return offset; } public Criteria setFirstResult(int firstResult) { - this.firstResult = firstResult; + this.offset = firstResult; return this; } @@ -141,70 +142,20 @@ return this; } - public abstract Collection< ? > list() throws JCRQueryException; - - public static final class CriterionEntry implements Serializable + /** + * @return + */ + public String toXpathExpression() { - - private static final long serialVersionUID = 1L; - - private final Criterion criterion; - - private final Criteria criteria; - - private CriterionEntry(Criterion criterion, Criteria criteria) - { - this.criteria = criteria; - this.criterion = criterion; - } - - public Criterion getCriterion() - { - return criterion; - } - - public Criteria getCriteria() - { - return criteria; - } - - @Override - public String toString() - { - return criterion.toString(); - } + JCRMagnoliaCriteriaQueryTranslator translator = new JCRMagnoliaCriteriaQueryTranslator(this); + XPathSelect statement = new XPathSelect(); + statement.setRoot(XPathTextUtils.encodeDigitsInPath(this.path)); + statement.setPredicate(translator.getPredicate()); + statement.setOrderByClause(translator.getOrderBy()); + String stmt = statement.toStatementString(); + return stmt; } - public static final class OrderEntry implements Serializable - { + public abstract Collection< ? > list() throws JCRQueryException; - private static final long serialVersionUID = 1L; - - private final Order order; - - private final Criteria criteria; - - private OrderEntry(Order order, Criteria criteria) - { - this.criteria = criteria; - this.order = order; - } - - public Order getOrder() - { - return order; - } - - public Criteria getCriteria() - { - return criteria; - } - - @Override - public String toString() - { - return order.toString(); - } - } - } \ No newline at end of file Modified: 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/AbstractMagnoliaCriteriaImpl.java 2010-02-26 09:02:21 UTC (rev 2063) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -22,8 +22,6 @@ import info.magnolia.cms.core.Content; import info.magnolia.cms.core.ItemType; import info.magnolia.cms.core.search.QueryManager; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRMagnoliaCriteriaQueryTranslator; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.XPathSelect; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; import org.apache.commons.lang.StringUtils; @@ -63,17 +61,4 @@ this.classType = classType == null ? Content.class : classType; } - /** - * @return - */ - public String toXpathExpression() - { - JCRMagnoliaCriteriaQueryTranslator translator = new JCRMagnoliaCriteriaQueryTranslator(this); - XPathSelect statement = new XPathSelect(); - statement.setRoot(this.path); - statement.setPredicate(translator.getPredicate()); - statement.setOrderByClause(translator.getOrderBy()); - String stmt = statement.toStatementString(); - return stmt; - } } \ No newline at end of file Modified: 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/MagnoliaCriteriaImpl.java 2010-02-26 09:02:21 UTC (rev 2063) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaImpl.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -117,7 +117,7 @@ catch (Content2BeanException e) { log.error(e.getMessage()); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } } log.debug("got {} node(s) in {} ms", new Object[]{list.size(), stop - start }); @@ -128,12 +128,12 @@ catch (InvalidQueryException e) { log.error(EXCEPTION_MSG, new Object[]{stmt, e.getMessage() }); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } catch (RepositoryException e) { log.error(EXCEPTION_MSG, new Object[]{stmt, e.getMessage() }); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } } Modified: 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/impl/MagnoliaCriteriaWithLimitImpl.java 2010-02-26 09:02:21 UTC (rev 2063) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaWithLimitImpl.java 2010-02-27 10:11:24 UTC (rev 2064) @@ -49,6 +49,8 @@ import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.XPathSelect; import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -60,6 +62,11 @@ public class MagnoliaCriteriaWithLimitImpl extends AbstractMagnoliaCriteriaImpl { + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(MagnoliaCriteriaWithLimitImpl.class); + private static final String HIERARCHY_MANAGER = "hm"; private static final String QUERY_MANAGER = "queryManager"; @@ -104,21 +111,16 @@ org.apache.jackrabbit.core.query.QueryImpl q = (org.apache.jackrabbit.core.query.QueryImpl) jcrManager .createQuery(stmt, Query.XPATH); - if (getMaxResults() <= 0) + if (getMaxResults() > 0) { - String msg = "maxResults value [" + getMaxResults() + "] cannot be less than or equal to 0"; - log.error(msg); - throw new InvalidQueryException(msg); + q.setLimit(getMaxResults()); } - q.setLimit(getMaxResults()); - if (getFirstResult() < 0) + if (getFirstResult() >= 0) { - String msg = "firstResult value [" + getFirstResult() + "] cannot be less than 0"; - log.error(msg); - throw new InvalidQueryException(msg); + q.setOffset(getFirstResult()); } - q.setOffset(getFirstResult()); + log.debug("offset is {} limit is {}", new Object[]{getFirstResult(), getMaxResults() }); log.debug("executing Query {}", q.getStatement()); @@ -163,7 +165,7 @@ catch (Content2BeanException e) { log.error(e.getMessage()); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } } log.debug("got {} node(s) in {} ms", new Object[]{list.size(), stop - start }); @@ -173,32 +175,32 @@ catch (InvalidQueryException e) { log.error(e.getMessage()); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } catch (RepositoryException e) { log.error(e.getMessage()); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } catch (SecurityException e) { log.error(e.getMessage()); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } catch (NoSuchFieldException e) { log.error(e.getMessage()); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } catch (IllegalArgumentException e) { log.error(e.getMessage()); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } catch (IllegalAccessException e) { log.error(e.getMessage()); - throw new JCRQueryException(e); + throw new JCRQueryException(stmt, e); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-27 10:37:34
|
Revision: 2065 http://openutils.svn.sourceforge.net/openutils/?rev=2065&view=rev Author: fgiust Date: 2010-02-27 10:37:22 +0000 (Sat, 27 Feb 2010) Log Message: ----------- CRIT-7 brand new API for jcr2 features, work in progress Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml Added Paths: ----------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ResultIterator.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-02-27 10:11:24 UTC (rev 2064) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-02-27 10:37:22 UTC (rev 2065) @@ -89,11 +89,6 @@ <version>2.4</version> </dependency> <dependency> - <groupId>com.google.collections</groupId> - <artifactId>google-collections</artifactId> - <version>1.0</version> - </dependency> - <dependency> <groupId>javax.jcr</groupId> <artifactId>jcr</artifactId> <version>2.0</version> Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ResultIterator.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ResultIterator.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ResultIterator.java 2010-02-27 10:37:22 UTC (rev 2065) @@ -0,0 +1,80 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced; + +import info.magnolia.cms.core.HierarchyManager; + +import javax.jcr.RangeIterator; +import javax.jcr.query.Row; +import javax.jcr.query.RowIterator; + + +/** + * @author fgiust + * @version $Id$ + */ +public abstract class ResultIterator<T> implements RangeIterator +{ + + protected RowIterator rowIterator; + + protected final HierarchyManager hm; + + /** + * @param rowIterator + */ + public ResultIterator(RowIterator rowIterator, HierarchyManager hm) + { + this.rowIterator = rowIterator; + this.hm = hm; + } + + /** + * {@inheritDoc} + */ + public boolean hasNext() + { + return rowIterator.hasNext(); + } + + /** + * {@inheritDoc} + */ + public void remove() + { + rowIterator.remove(); + } + + /** + * {@inheritDoc} + */ + public void skip(long skipNum) + { + rowIterator.skip(skipNum); + } + + /** + * {@inheritDoc} + */ + public long getSize() + { + return rowIterator.getSize(); + } + + /** + * {@inheritDoc} + */ + public long getPosition() + { + return rowIterator.getPosition(); + } + + /** + * {@inheritDoc} + */ + public T next() + { + return wrap(rowIterator.nextRow()); + } + + protected abstract T wrap(Row row); + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ResultIterator.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/advanced/impl/AdvancedResultItemResultIterator.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java 2010-02-27 10:37:22 UTC (rev 2065) @@ -0,0 +1,50 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced.impl; + +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.security.AccessDeniedException; + +import javax.jcr.RepositoryException; +import javax.jcr.query.Row; +import javax.jcr.query.RowIterator; + +import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedResultItem; +import net.sourceforge.openutils.mgnlcriteria.advanced.ResultIterator; + + +/** + * @author fgiust + * @version $Id$ + */ +public class AdvancedResultItemResultIterator extends ResultIterator<AdvancedResultItem> +{ + + /** + * @param rowIterator + * @param hm + */ + public AdvancedResultItemResultIterator(RowIterator rowIterator, HierarchyManager hm) + { + super(rowIterator, hm); + } + + /** + * {@inheritDoc} + */ + @Override + protected AdvancedResultItem wrap(Row row) + { + try + { + return new AdvancedResultItemImpl(row, null); + } + catch (AccessDeniedException e) + { + throw new RuntimeException(e); + } + catch (RepositoryException e) + { + throw new RuntimeException(e); + } + } + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-27 15:11:40
|
Revision: 2067 http://openutils.svn.sourceforge.net/openutils/?rev=2067&view=rev Author: fgiust Date: 2010-02-27 15:11:31 +0000 (Sat, 27 Feb 2010) Log Message: ----------- CRIT-7 (failing) test cases Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml Added Paths: ----------- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java trunk/openutils-mgnlcriteria/src/test/resources/ trunk/openutils-mgnlcriteria/src/test/resources/crit-bootstrap/ trunk/openutils-mgnlcriteria/src/test/resources/crit-bootstrap/website.00000.xml trunk/openutils-mgnlcriteria/src/test/resources/crit-repository/ trunk/openutils-mgnlcriteria/src/test/resources/crit-repository/indexing_configuration.xml trunk/openutils-mgnlcriteria/src/test/resources/crit-repository/jackrabbit-test-configuration.xml trunk/openutils-mgnlcriteria/src/test/resources/crit-repository/test-repositories.xml trunk/openutils-mgnlcriteria/src/test/resources/log4j.dtd trunk/openutils-mgnlcriteria/src/test/resources/log4j.xml trunk/openutils-mgnlcriteria/src/test/resources/test-magnolia.properties trunk/openutils-mgnlcriteria/src/test/resources/test_dir.txt Property Changed: ---------------- trunk/openutils-mgnlcriteria/ Property changes on: trunk/openutils-mgnlcriteria ___________________________________________________________________ Modified: svn:ignore - .settings target .checkstyle .classpath .project + .settings target .checkstyle .classpath .project temp-testng-customsuite.xml Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-02-27 14:35:18 UTC (rev 2066) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-02-27 15:11:31 UTC (rev 2067) @@ -75,13 +75,18 @@ </dependency> <dependency> <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.5.8</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>1.5.6</version> + <version>1.5.8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> - <version>1.5.6</version> + <version>1.5.8</version> </dependency> <dependency> <groupId>commons-lang</groupId> @@ -94,11 +99,25 @@ <version>2.0</version> </dependency> <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <classifier>tests</classifier> + <version>${magnolia.version}</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.7</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.10</version> + <scope>test</scope> + </dependency> </dependencies> <repositories> <repository> Added: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java 2010-02-27 15:11:31 UTC (rev 2067) @@ -0,0 +1,248 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced; + +import info.magnolia.cms.beans.config.ContentRepository; +import info.magnolia.cms.core.Content; +import info.magnolia.context.MgnlContext; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import junit.framework.Assert; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Disjunction; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Order; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions; +import net.sourceforge.openutils.mgnlcriteria.tests.RepositoryTestNgTestcase; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + + +/** + * @author lbrindisi + * @version $Id$ + */ +public class AdvancedCriteriaSearchTest extends RepositoryTestNgTestcase +{ + + /** + * {@inheritDoc} + */ + @Override + @BeforeClass + protected void setUp() throws Exception + { + setRepositoryConfigFileName("/crit-repository/test-repositories.xml"); + setJackrabbitRepositoryConfigFileName("/crit-repository/jackrabbit-test-configuration.xml"); + + super.setUp(); + + bootstrapSingleResource("/crit-bootstrap/website.00000.xml"); + MgnlContext.getHierarchyManager(ContentRepository.WEBSITE).save(); + } + + @Test + public void testSearchFrancia() throws Exception + { + // Frància + // Franciacorta + // Parigi (Francia) + // Parigi (Frància) + // frappè -> francia in una proprietà di pagina (non titolo) + // federale -> francia nel testo + + AdvancedResult advResult = search("francia", 1, 200); + Collection< ? extends Content> result = collectCollectionFromResult(advResult); + + // "Franciacorta", ??? deve apparire o no? + + // "frappè" non deve apparire perchè la proprietà "anotherproperty" non è indicizzata + + assertSortedResults( + new String[]{"Frància", "Parigi (Francia)", "Parigi (Frància)", "federale" }, + result, + "francia"); + } + + @Test + public void testSearchDante() throws Exception + { + // Dante Alighieri + // Alighieri, Dante + + AdvancedResult advResult = search("Dante Alighieri", 1, 200); + Collection< ? extends Content> result = collectCollectionFromResult(advResult); + + assertNumOfResults(2, result, "Dante Alighieri"); + } + + @Test + public void testSearchFagiano() throws Exception + { + // fagiano + // fagiàno + // fàgiànò + + AdvancedResult advResult = search("fagiano", 1, 200); + Collection< ? extends Content> result = collectCollectionFromResult(advResult); + + assertNumOfResults(3, result, "fagiano"); + } + + @Test + public void testSearchPesca() throws Exception + { + // pèsca + // canna da pesca + + AdvancedResult advResult = search("pesca", 1, 200); + Collection< ? extends Content> result = collectCollectionFromResult(advResult); + + assertSortedResults(new String[]{"pèsca", "canna da pesca" }, result, "pesca"); + } + + @Test + public void testNotInPrivatePropertiesNoJcr() + { + AdvancedResult advResult = search("admin", 1, 200); + Collection< ? extends Content> result = collectCollectionFromResult(advResult); + + assertNumOfResults(0, result, "admin"); + } + + @Test + public void testNotInPrivatePropertiesNoMagnoliaUser() + { + + AdvancedResult advResult = search("superuser", 1, 200); + Collection< ? extends Content> result = collectCollectionFromResult(advResult); + + assertNumOfResults(0, result, "superuser"); + } + + @Test + public void testNotInPrivatePropertiesNoTemplates() + { + AdvancedResult advResult = search("t-redirect", 1, 200); + Collection< ? extends Content> result = collectCollectionFromResult(advResult); + + assertNumOfResults(0, result, "t-redirect"); + } + + protected void assertNumOfResults(int expected, Collection< ? extends Content> result, String search) + { + if (result.size() != expected) + { + List<String> titles = new ArrayList<String>(); + for (Content content : result) + { + titles.add(content.getTitle()); + } + + Assert.fail("Wrong result when searching for \"" + + search + + "\", expected " + + expected + + " results, found " + + result.size() + + ". Pages found: " + + ArrayUtils.toString(titles)); + } + } + + protected void assertSortedResults(String[] expected, Collection< ? extends Content> result, String search) + { + List<String> titles = new ArrayList<String>(); + for (Content content : result) + { + titles.add(content.getTitle()); + } + + if (result.size() != expected.length) + { + Assert.fail("Wrong result when searching for \"" + + search + + "\", expected " + + expected.length + + " results, found " + + result.size() + + ". Pages found: " + + ArrayUtils.toString(titles)); + } + + Assert.assertEquals("Wrong order searching for \"" + search + "\"", ArrayUtils.toString(expected), ArrayUtils + .toString(titles.toArray())); + + } + + public AdvancedResult search(String searchText, int page, int itemsPerPage) + { + return search(searchText, StringUtils.EMPTY, ContentRepository.WEBSITE, false, page, itemsPerPage); + } + + protected AdvancedResult search(String searchText, String path, String repository, boolean titleOnly, int page, + int itemsPerPage) + { + if (StringUtils.isBlank(searchText)) + { + return AdvancedResult.EMPTY_RESULT; + } + + AdvancedCriteria criteria = createCriteria(repository, path); + + if (titleOnly) + { + criteria.add(Restrictions.contains("@title", StringUtils.defaultString(searchText))); + } + else + { + Disjunction disjunction = Restrictions.disjunction(); + disjunction.add(Restrictions.contains("@title", StringUtils.defaultString(searchText))); // serve per il + // boost! + disjunction.add(Restrictions.contains(".", StringUtils.defaultString(searchText))); + criteria.add(disjunction); + } + + if (itemsPerPage >= 0) + { + criteria.setMaxResults(itemsPerPage); + } + if (page > 1) + { + criteria.setFirstResult((page - 1) * itemsPerPage); + } + + return criteria.execute(); + } + + /** + * @param repo + * @param startnode + * @return + */ + protected AdvancedCriteria createCriteria(String repo, String startnode) + { + AdvancedCriteria criteria = AdvancedCriteriaFactory.createAdvancedCriteria().setWorkspace(repo).addOrder( + Order.desc("@jcr:score")).add(Restrictions.eq("@jcr:primaryType", "mgnl:content")); + + if (startnode != null) + { + criteria.setBasePath(startnode); + } + return criteria; + } + + private Collection<AdvancedResultItem> collectCollectionFromResult(AdvancedResult result) + { + + ResultIterator<AdvancedResultItem> items = result.getItems(); + ArrayList<AdvancedResultItem> list = new ArrayList<AdvancedResultItem>(); + + CollectionUtils.addAll(list, items); + return list; + } + +} Property changes on: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java 2010-02-27 15:11:31 UTC (rev 2067) @@ -0,0 +1,24 @@ +package net.sourceforge.openutils.mgnlcriteria.tests; + +import java.io.Reader; + +import org.apache.lucene.analysis.ISOLatin1AccentFilter; +import org.apache.lucene.analysis.LowerCaseFilter; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.standard.StandardAnalyzer; + + +/** + * @author molaschi + * @version $Id$ + */ +public class ItalianSnowballAnalyzer extends StandardAnalyzer +{ + + @Override + public TokenStream tokenStream(String fieldName, Reader reader) + { + return new ISOLatin1AccentFilter(new LowerCaseFilter((super.tokenStream(fieldName, reader)))); + } + +} Property changes on: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java 2010-02-27 15:11:31 UTC (rev 2067) @@ -0,0 +1,300 @@ +package net.sourceforge.openutils.mgnlcriteria.tests; + +import info.magnolia.cms.beans.config.ContentRepository; +import info.magnolia.cms.beans.config.PropertiesInitializer; +import info.magnolia.cms.core.Path; +import info.magnolia.cms.core.SystemProperty; +import info.magnolia.cms.util.ClasspathResourcesUtil; +import info.magnolia.context.MgnlContext; +import info.magnolia.context.SystemContext; +import info.magnolia.context.SystemRepositoryStrategy; +import info.magnolia.importexport.BootstrapUtil; +import info.magnolia.test.mock.MockContext; +import info.magnolia.test.mock.MockHierarchyManager; +import info.magnolia.test.mock.MockUtil; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.util.Map; + +import javax.jcr.ImportUUIDBehavior; +import javax.jcr.RepositoryException; +import javax.jcr.UnsupportedRepositoryOperationException; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.jackrabbit.core.jndi.BindableRepositoryFactory; +import org.apache.log4j.Level; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * TestNG version of Magnolia RepositoryTestcase + * @author fgiust + * @version $Id$ + */ + +public abstract class RepositoryTestNgTestcase +{ + + protected static final String REPO_CONF_PROPERTY = "magnolia.repositories.config"; + + protected static final String JACKRABBIT_REPO_CONF_PROPERTY = "magnolia.repositories.jackrabbit.config"; + + protected static final String EXTRACTED_REPO_CONF_FILE = "target/repositories.xml"; + + protected static final String EXTRACTED_JACKRABBIT_REPO_CONF_FILE = "target/repo-conf/extracted.xml"; + + private boolean autoStart = true; + + private String repositoryConfigFileName; + + private String jackrabbitRepositoryConfigFileName; + + private boolean quiet = true; + + protected boolean isAutoStart() + { + return this.autoStart; + } + + protected void setAutoStart(boolean autoStart) + { + this.autoStart = autoStart; + } + + protected void setRepositoryConfigFileName(String repositoryConfigFileName) + { + this.repositoryConfigFileName = repositoryConfigFileName; + } + + protected void setJackrabbitRepositoryConfigFileName(String jackrabbitRepositoryConfigFileName) + { + this.jackrabbitRepositoryConfigFileName = jackrabbitRepositoryConfigFileName; + } + + protected boolean isQuiet() + { + return this.quiet; + } + + protected void setQuiet(boolean quiet) + { + this.quiet = quiet; + } + + /** + * Logger. + */ + protected Logger log = LoggerFactory.getLogger(getClass()); + + @BeforeClass + protected void setUp() throws Exception + { + // ignore mapping warnings + org.apache.log4j.Logger.getLogger(ContentRepository.class).setLevel(Level.ERROR); + + // ComponentsTestUtil.clear(); + initDefaultImplementations(); + setMagnoliaProperties(); + initContext(); + workaroundJCR1778(); + + if (isAutoStart()) + { + cleanUp(); + startRepository(); + } + } + + protected void initContext() + { + MockUtil.initMockContext(); + } + + @AfterClass + protected void tearDown() throws Exception + { + if (isAutoStart()) + { + shutdownRepository(true); + } + SystemProperty.getProperties().clear(); + + // ComponentsTestUtil.clear(); + SystemProperty.getProperties().clear(); + MgnlContext.setInstance(null); + } + + protected void setMagnoliaProperties() throws Exception + { + setMagnoliaProperties(getMagnoliaPropertiesStream()); + } + + protected void setMagnoliaProperties(InputStream propertiesStream) throws IOException + { + try + { + SystemProperty.getProperties().load(propertiesStream); + } + finally + { + IOUtils.closeQuietly(propertiesStream); + } + } + + protected InputStream getMagnoliaPropertiesStream() throws IOException + { + return this.getClass().getResourceAsStream(getMagnoliaPropertiesFileName()); + } + + protected String getMagnoliaPropertiesFileName() + { + return "/test-magnolia.properties"; + } + + protected void initDefaultImplementations() throws IOException + { + PropertiesInitializer.getInstance().loadBeanProperties(); + PropertiesInitializer.getInstance().loadAllModuleProperties(); + } + + protected MockHierarchyManager initMockConfigRepository(String properties) throws IOException, RepositoryException, + UnsupportedRepositoryOperationException + { + + MockHierarchyManager hm = MockUtil.createAndSetHierarchyManager(ContentRepository.CONFIG, properties); + + return hm; + } + + /** + * @deprecated - workaround until JCR-1778 is fixed + * @see <a href="https://issues.apache.org/jira/browse/JCR-1778">JCR-1778</a> + */ + static void workaroundJCR1778() throws NoSuchFieldException, IllegalAccessException + { + final Field cacheField = BindableRepositoryFactory.class.getDeclaredField("cache"); + cacheField.setAccessible(true); + final Map cache = (Map) cacheField.get(null); + cache.clear(); + } + + protected void modifyContextesToUseRealRepository() + { + // create a mock web context with same repository acquiring strategy as the system context + SystemContext systemContext = (SystemContext) MgnlContext.getSystemContext(); + SystemRepositoryStrategy repositoryStrategy = new SystemRepositoryStrategy(systemContext); + + // update the mock context + ((MockContext) systemContext).setRepositoryStrategy(repositoryStrategy); + ((MockContext) MgnlContext.getInstance()).setRepositoryStrategy(repositoryStrategy); + } + + protected void startRepository() throws Exception + { + final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("info.magnolia"); + final Level originalLogLevel = logger.getLevel(); + if (this.isQuiet()) + { + logger.setLevel(Level.WARN); + } + ContentRepository.REPOSITORY_USER = SystemProperty.getProperty("magnolia.connection.jcr.userId"); + ContentRepository.REPOSITORY_PSWD = SystemProperty.getProperty("magnolia.connection.jcr.password"); + + extractConfigFile(REPO_CONF_PROPERTY, getRepositoryConfigFileStream(), EXTRACTED_REPO_CONF_FILE); + extractConfigFile( + JACKRABBIT_REPO_CONF_PROPERTY, + getJackrabbitRepositoryConfigFileStream(), + EXTRACTED_JACKRABBIT_REPO_CONF_FILE); + + ContentRepository.init(); + + modifyContextesToUseRealRepository(); + + logger.setLevel(originalLogLevel); + } + + protected void extractConfigFile(String propertyName, InputStream configFileStream, String extractToPath) + throws Exception + { + String targetFilename = Path.getAbsoluteFileSystemPath(extractToPath); + File targetFile = new File(targetFilename); + // extract resource to the filesystem (jackrabbit can't use a stream) + new File(targetFile.getParent()).mkdirs(); + IOUtils.copy(configFileStream, new FileOutputStream(targetFile)); + SystemProperty.setProperty(propertyName, extractToPath); + } + + protected InputStream getRepositoryConfigFileStream() throws Exception + { + String configFile = getRepositoryConfigFileName(); + return ClasspathResourcesUtil.getResource(configFile).openStream(); + } + + protected InputStream getJackrabbitRepositoryConfigFileStream() throws Exception + { + String configFile = getJackrabbitRepositoryConfigFileName(); + return ClasspathResourcesUtil.getResource(configFile).openStream(); + } + + protected String getRepositoryConfigFileName() + { + if (StringUtils.isEmpty(repositoryConfigFileName)) + { + repositoryConfigFileName = SystemProperty.getProperty(REPO_CONF_PROPERTY); + } + return repositoryConfigFileName; + } + + protected String getJackrabbitRepositoryConfigFileName() + { + if (StringUtils.isEmpty(jackrabbitRepositoryConfigFileName)) + { + jackrabbitRepositoryConfigFileName = SystemProperty.getProperty(JACKRABBIT_REPO_CONF_PROPERTY); + } + return jackrabbitRepositoryConfigFileName; + } + + protected void shutdownRepository(boolean cleanup) throws IOException + { + final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("info.magnolia"); + final Level originalLogLevel = logger.getLevel(); + if (this.isQuiet()) + { + logger.setLevel(Level.WARN); + } + MgnlContext.release(); + MgnlContext.getSystemContext().release(); + ContentRepository.shutdown(); + if (cleanup) + { + cleanUp(); + } + logger.setLevel(originalLogLevel); + } + + protected void cleanUp() throws IOException + { + FileUtils.deleteDirectory(new File(SystemProperty.getProperty("magnolia.repositories.home"))); + } + + protected void bootstrapSingleResource(String resource) throws Exception + { + BootstrapUtil.bootstrap(new String[]{resource }, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW); + } + + protected void bootstrap(ClasspathResourcesUtil.Filter filter) throws Exception + { + String[] resourcesToBootstrap = ClasspathResourcesUtil.findResources(filter); + BootstrapUtil.bootstrap(resourcesToBootstrap, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW); + } + +} Property changes on: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-mgnlcriteria/src/test/resources/crit-bootstrap/website.00000.xml =================================================================== --- trunk/openutils-mgnlcriteria/src/test/resources/crit-bootstrap/website.00000.xml (rev 0) +++ trunk/openutils-mgnlcriteria/src/test/resources/crit-bootstrap/website.00000.xml 2010-02-27 15:11:31 UTC (rev 2067) @@ -0,0 +1,3815 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="00000" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:content</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>920b1fcd-5fb2-458d-a970-45c167e0491d</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-20T22:00:18.812+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-20T22:00:56.967+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>t-redirect</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="900580"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:content</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>fa2578b6-adc9-40b6-a1d5-b40ac305b39c</sv:value> + </sv:property> + <sv:property sv:name="categories" sv:type="String"> + <sv:value>d5b12456-097a-3cdd-8f16-ded1343730e6</sv:value> + </sv:property> + <sv:property sv:name="idLemma" sv:type="String"> + <sv:value>900580</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="title" sv:type="String"> + <sv:value>Frància</sv:value> + </sv:property> + <sv:property sv:name="urlMappingId" sv:type="String"> + <sv:value>1073780</sv:value> + </sv:property> + <sv:property sv:name="urlMappingOtid" sv:type="String"> + <sv:value>GEDEA_fruttifico</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-21T09:57:41.878+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>t-lemma-enc</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="mainframe"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>d648f898-edb0-4158-b992-70663e459e25</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="i1"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>47836f91-80b6-4fd2-b0d2-cc4f3351a201</sv:value> + </sv:property> + <sv:property sv:name="imagePosition" sv:type="String"> + <sv:value>L</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="lineSeparator" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="text" sv:type="String"> + <sv:value> + <p>agg. disus. (pl. m. -ci) [sec. XIV; dal latino <em>fructifícus</em>]. + <a href="${link:{uuid:{57addc9d-5ef1-3ab3-888c-d9e9d3346a34},repository:{gedea},handle:{/enciclopedia/Fruttifero},nodeData:{},extension:{html}}}">Fruttifero</a> + , fruttuoso. +</p> + </sv:value> + </sv:property> + <sv:property sv:name="titleh2" sv:type="String"> + <sv:value/> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>p-text-image</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="text_files"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>a9a5bcb5-7027-4acc-ae46-538e00670f4a</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="999"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>22bd9aa8-023a-437a-8bcd-3df4f312797c</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="paths" sv:type="String"> + <sv:value>d5b12456-097a-3cdd-8f16-ded1343730e6 +</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>p-box-paths</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="columnDx"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>16ade014-4407-4175-935d-9cef849c76d8</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="1"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>01512b51-d85a-4198-810c-83586042bd21</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="links" sv:type="String"> + <sv:value>Fruttifero 57addc9d-5ef1-3ab3-888c-d9e9d3346a34 +</sv:value> + </sv:property> + <sv:property sv:name="title" sv:type="String"> + <sv:value>Collegamenti</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>p-box-links</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="900300"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:content</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>7a6d6176-416b-412a-bbbb-8fdbeabdc022</sv:value> + </sv:property> + <sv:property sv:name="categories" sv:type="String"> + <sv:value>174828c4-532f-3140-b728-53b6d8f85686</sv:value> + <sv:value>d5b12456-097a-3cdd-8f16-ded1343730e6</sv:value> + </sv:property> + <sv:property sv:name="idLemma" sv:type="String"> + <sv:value>900300</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="title" sv:type="String"> + <sv:value>federale</sv:value> + </sv:property> + <sv:property sv:name="urlMappingId" sv:type="String"> + <sv:value>1068637</sv:value> + </sv:property> + <sv:property sv:name="urlMappingOtid" sv:type="String"> + <sv:value>GEDEA_federale</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-21T10:31:11.688+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>t-lemma-enc</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="mainframe"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>8cdacc05-a653-4381-a674-5e2d7c756b3b</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="i1"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>b93661c0-fdbe-4a64-b092-5687f4dd7bcb</sv:value> + </sv:property> + <sv:property sv:name="imagePosition" sv:type="String"> + <sv:value>L</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="lineSeparator" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="text" sv:type="String"> + <sv:value> + <p>agg. e sm. [sec. XIX; francese + <em>fédéral</em>, dal latino <em>foedus-ĕris</em>, patto]. +</p> + </sv:value> + </sv:property> + <sv:property sv:name="titleh2" sv:type="String"> + <sv:value/> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>p-text-image</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="text_files"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>5effc461-e4cb-41fd-9a62-af2bc0782897</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="i2"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>d3f6bddd-2123-401a-ab4a-ce227720446c</sv:value> + </sv:property> + <sv:property sv:name="height" sv:type="String"> + <sv:value>190</sv:value> + </sv:property> + <sv:property sv:name="imagePosition" sv:type="String"> + <sv:value>L</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="lineSeparator" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="text" sv:type="String"> + <sv:value><p>1) Agg., che &egrave; proprio di una federazione di Stati: <em>Stato </em>federale ( <a href="/enciclopedia/federalismo.html">federalismo</a> ); che si riferisce a uno Stato federale: <em>parlamento </em>federale; francia che &egrave; proprio di una federazione politica, sindacale, sportiva e simili: <em>norma federale.</em></p></sv:value> + </sv:property> + <sv:property sv:name="useBox" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-20T22:02:04.555+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>p-text-image</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="text_files"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>48998939-d1c9-4607-afb7-3e77d3e3e329</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="i3"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>5053a91c-4948-4ebc-8fbe-510f9cb564f4</sv:value> + </sv:property> + <sv:property sv:name="imagePosition" sv:type="String"> + <sv:value>L</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="lineSeparator" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="text" sv:type="String"> + <sv:value> + <p>2) Sm., segretario di una federazione provinciale di un partito, in particolare del partito fascista. +</p> + </sv:value> + </sv:property> + <sv:property sv:name="titleh2" sv:type="String"> + <sv:value/> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>p-text-image</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="text_files"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>151215ed-6b3c-4cdb-9a06-76ad9186383a</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="999"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>640c63f0-b81e-4847-9eb0-6986d7dd6469</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="paths" sv:type="String"> + <sv:value>174828c4-532f-3140-b728-53b6d8f85686 +d5b12456-097a-3cdd-8f16-ded1343730e6 +</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>p-box-paths</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="columnDx"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>79d8f7a3-c2ad-4850-8ff0-9fd1a9bf47b8</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="1"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>3757eb6a-0229-411c-a446-b864c0c1d2f6</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="links" sv:type="String"> + <sv:value>federalismo 3905bd5c-2e06-3b58-8934-0609b69085b3 +</sv:value> + </sv:property> + <sv:property sv:name="title" sv:type="String"> + <sv:value>Collegamenti</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:31.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>p-box-links</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="900581"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:content</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>2035a059-2c64-4e7b-a07d-60d74ae22363</sv:value> + </sv:property> + <sv:property sv:name="categories" sv:type="String"> + <sv:value>d5b12456-097a-3cdd-8f16-ded1343730e6</sv:value> + </sv:property> + <sv:property sv:name="idLemma" sv:type="String"> + <sv:value>900580</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>import</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="title" sv:type="String"> + <sv:value>Parigi (Frància)</sv:value> + </sv:property> + <sv:property sv:name="urlMappingId" sv:type="String"> + <sv:value>1073780</sv:value> + </sv:property> + <sv:property sv:name="urlMappingOtid" sv:type="String"> + <sv:value>GEDEA_fruttifico</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-02-05T13:01:41.001+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-02-21T09:58:15.383+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>t-lemma-enc</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="mainframe"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>7b35371d-b79f-417b-93cd-19b28f96be47</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jc... [truncated message content] |
From: <fg...@us...> - 2010-03-02 07:44:23
|
Revision: 2078 http://openutils.svn.sourceforge.net/openutils/?rev=2078&view=rev Author: fgiust Date: 2010-03-02 07:44:15 +0000 (Tue, 02 Mar 2010) Log Message: ----------- CRIT-7 reworked API with the addition of direct jcr queries Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java 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/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/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java Added Paths: ----------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/DirectJcrQuery.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ExecutableQuery.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/JCRMagnoliaCriteriaQueryTranslator.java Removed Paths: ------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaFactory.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java Property Changed: ---------------- trunk/openutils-mgnlcriteria/ Property changes on: trunk/openutils-mgnlcriteria ___________________________________________________________________ Modified: svn:ignore - .settings target .checkstyle .classpath .project temp-testng-customsuite.xml + .settings target .checkstyle .classpath .project temp-testng-customsuite.xml pom.xml.releaseBackup release.properties Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteria.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -31,7 +31,7 @@ * @author fgiust * @version $Id$ */ -public interface AdvancedCriteria extends Criteria +public interface AdvancedCriteria extends Criteria, ExecutableQuery { AdvancedCriteria setBasePath(String path); @@ -50,8 +50,6 @@ @Deprecated Collection< ? > list() throws JCRQueryException; - AdvancedResult execute(); - AdvancedCriteria setPaging(int itemsPerPage, int pageNumberStartingFromOne); } Deleted: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaFactory.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaFactory.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaFactory.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -1,37 +0,0 @@ -/** - * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sourceforge.openutils.mgnlcriteria.advanced; - -import net.sourceforge.openutils.mgnlcriteria.advanced.impl.AdvancedCriteriaImpl; - - -/** - * Advanced criterias require jackrabbit 1.6 or up. - * @author fgiust - * @version $Id$ - */ -public class AdvancedCriteriaFactory -{ - - public static AdvancedCriteria createAdvancedCriteria() - { - return new AdvancedCriteriaImpl(); - } -} Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/DirectJcrQuery.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/DirectJcrQuery.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/DirectJcrQuery.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -0,0 +1,91 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced; + +import info.magnolia.cms.core.HierarchyManager; +import net.sourceforge.openutils.mgnlcriteria.advanced.impl.QueryExecutorHelper; + + +/** + * @author fgiust + * @version $Id$ + */ +public class DirectJcrQuery implements ExecutableQuery +{ + + private HierarchyManager hm; + + private String query; + + private String language; + + private String spellCheckString; + + private int maxResults; + + private int offset; + + /** + * @param hm + * @param query + * @param language + */ + public DirectJcrQuery(HierarchyManager hm, String query, String language) + { + this.hm = hm; + this.query = query; + this.language = language; + } + + /** + * Sets the spellCheckString. + * @param spellCheckString the spellCheckString to set + */ + public DirectJcrQuery setSpellCheckString(String spellCheckString) + { + this.spellCheckString = spellCheckString; + return this; + } + + /** + * Sets the maxResults. + * @param maxResults the maxResults to set + */ + public DirectJcrQuery setMaxResultsPerPage(int maxResults) + { + this.maxResults = maxResults; + return this; + } + + /** + * Sets the offset. + * @param offset the offset to set + */ + public DirectJcrQuery setOffset(int offset) + { + this.offset = offset; + return this; + } + + /** + * Utility method for setting offset easier. If this method is called you should not use setOffset/setMaxResults + * directly anymore. + * @param itemsPerPage + * @param pageNumberStartingFromOne + * @return + */ + public DirectJcrQuery setPaging(int itemsPerPage, int pageNumberStartingFromOne) + { + this.maxResults = itemsPerPage; + this.offset = (Math.max(pageNumberStartingFromOne, 1) - 1) * maxResults; + return this; + } + + /** + * {@inheritDoc} + */ + public AdvancedResult execute() + { + + return QueryExecutorHelper.execute(query, language, hm, maxResults, offset, spellCheckString); + } + +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/DirectJcrQuery.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/advanced/ExecutableQuery.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ExecutableQuery.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ExecutableQuery.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -0,0 +1,11 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced; + +/** + * @author fgiust + * @version $Id$ + */ +public interface ExecutableQuery +{ + + AdvancedResult execute(); +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/ExecutableQuery.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -25,22 +25,14 @@ import java.util.Collection; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.jcr.query.InvalidQueryException; -import javax.jcr.query.Query; - import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedCriteria; import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedResult; import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; 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.xpath.impl.AbstractCriteriaImpl; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; import org.apache.commons.lang.StringUtils; -import org.apache.jackrabbit.core.query.QueryImpl; -import org.apache.jackrabbit.core.query.lucene.QueryResultImpl; /** @@ -52,8 +44,6 @@ private String workspace = ContentRepository.WEBSITE; - private int pageNumberStartingFromOne = 1; - private String spellCheckString; public AdvancedCriteriaImpl() @@ -66,8 +56,19 @@ */ public AdvancedCriteria setBasePath(String path) { - // @todo fixme, shoulb be mangled on query composition - this.path = path + "//*"; + + String finalPath = path; + if (!StringUtils.startsWith(path, Criterion.JCR_ROOT) && !StringUtils.startsWith(path, Criterion.JCR_ROOT)) + { + finalPath = Criterion.JCR_ROOT + path; + } + if (!StringUtils.contains(finalPath, "*")) + { + finalPath = finalPath + "//*"; + } + + this.path = finalPath; + return this; } @@ -95,8 +96,6 @@ public AdvancedCriteria setPaging(int itemsPerPage, int pageNumberStartingFromOne) { this.maxResults = itemsPerPage; - this.pageNumberStartingFromOne = Math.max(1, pageNumberStartingFromOne); - this.offset = (Math.max(pageNumberStartingFromOne, 1) - 1) * maxResults; return this; } @@ -124,7 +123,6 @@ /** * {@inheritDoc} */ - @Override public Collection< ? > list() throws JCRQueryException { throw new UnsupportedOperationException("list() is not supported in AdvancedCriteria, please call execute()"); @@ -135,59 +133,10 @@ */ public AdvancedResult execute() { + String language = javax.jcr.query.Query.XPATH; + String stmt = toXpathExpression(); HierarchyManager hm = MgnlContext.getHierarchyManager(workspace); - Session jcrSession = hm.getWorkspace().getSession(); - javax.jcr.query.QueryManager jcrQueryManager; - - String stmt = toXpathExpression(); - - try - { - jcrQueryManager = jcrSession.getWorkspace().getQueryManager(); - - QueryImpl query = (QueryImpl) jcrQueryManager.createQuery(stmt, javax.jcr.query.Query.XPATH); - - if (this.maxResults > 0) - { - query.setLimit(this.maxResults); - } - - if (this.offset > 0) - { - query.setOffset(this.offset); - } - - Query spellCheckerQuery = null; - - if (StringUtils.isNotBlank(spellCheckString)) - { - spellCheckerQuery = jcrQueryManager.createQuery("/jcr:root[rep:spellcheck('" - + XPathTextUtils.stringToJCRSearchExp(spellCheckString) - + "')]/(rep:spellcheck())", Query.XPATH); - } - - return new AdvancedResultImpl( - (QueryResultImpl) query.execute(), - maxResults, - pageNumberStartingFromOne, - stmt, - hm, - spellCheckerQuery); - - } - catch (InvalidQueryException e) - { - JCRQueryException jqe = new JCRQueryException(stmt, e); - log.error(jqe.getMessage()); - throw jqe; - } - catch (RepositoryException e) - { - JCRQueryException jqe = new JCRQueryException(stmt, e); - log.error(jqe.getMessage()); - throw jqe; - } - + return QueryExecutorHelper.execute(stmt, language, hm, maxResults, offset, spellCheckString); } } Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -77,10 +77,11 @@ { this.jcrQueryResult = jcrQueryResult; this.itemsPerPage = itemsPerPage; - this.pageNumberStartingFromOne = pageNumberStartingFromOne; this.statement = statement; this.hm = hm; this.spellCheckerQuery = spellCheckerQuery; + + this.pageNumberStartingFromOne = pageNumberStartingFromOne; } /** Added: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -0,0 +1,94 @@ +package net.sourceforge.openutils.mgnlcriteria.advanced.impl; + +import info.magnolia.cms.core.HierarchyManager; + +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.query.InvalidQueryException; +import javax.jcr.query.Query; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; + +import org.apache.commons.lang.StringUtils; +import org.apache.jackrabbit.core.query.QueryImpl; +import org.apache.jackrabbit.core.query.lucene.QueryResultImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * Warning, provisional class, users should not use this directly. + * @author fgiust + * @version $Id$ + */ +public class QueryExecutorHelper +{ + + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(QueryExecutorHelper.class); + + public static AdvancedResultImpl execute(String stmt, String language, HierarchyManager hm, int maxResults, + int offset, String spellCheckString) + { + + Session jcrSession = hm.getWorkspace().getSession(); + javax.jcr.query.QueryManager jcrQueryManager; + + try + { + jcrQueryManager = jcrSession.getWorkspace().getQueryManager(); + + QueryImpl query = (QueryImpl) jcrQueryManager.createQuery(stmt, language); + + if (maxResults > 0) + { + query.setLimit(maxResults); + } + + if (offset > 0) + { + query.setOffset(offset); + } + + int pageNumberStartingFromOne = 1; + if (maxResults > 0 && offset > maxResults) + { + pageNumberStartingFromOne = (offset / maxResults) + 1; + } + + Query spellCheckerQuery = null; + + if (StringUtils.isNotBlank(spellCheckString)) + { + spellCheckerQuery = jcrQueryManager.createQuery("/jcr:root[rep:spellcheck('" + + XPathTextUtils.stringToJCRSearchExp(spellCheckString) + + "')]/(rep:spellcheck())", Query.XPATH); + } + + return new AdvancedResultImpl( + (QueryResultImpl) query.execute(), + maxResults, + pageNumberStartingFromOne, + stmt, + hm, + spellCheckerQuery); + + } + catch (InvalidQueryException e) + { + JCRQueryException jqe = new JCRQueryException(stmt, e); + log.error(jqe.getMessage()); + throw jqe; + } + catch (RepositoryException e) + { + JCRQueryException jqe = new JCRQueryException(stmt, e); + log.error(jqe.getMessage()); + throw jqe; + } + + } +} Property changes on: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native 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 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -21,6 +21,7 @@ import java.util.Collection; +import net.sourceforge.openutils.mgnlcriteria.advanced.ExecutableQuery; 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; @@ -114,7 +115,7 @@ * @author Federico Grilli * @version $Id$ */ -public interface Criteria +public interface Criteria extends ExecutableQuery { /** @@ -146,17 +147,13 @@ */ 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. + * @deprecated use execute() */ + @Deprecated Collection< ? > list() throws JCRQueryException; /** Modified: 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 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -19,6 +19,11 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.util.DeprecationUtil; +import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedCriteria; +import net.sourceforge.openutils.mgnlcriteria.advanced.DirectJcrQuery; +import net.sourceforge.openutils.mgnlcriteria.advanced.impl.AdvancedCriteriaImpl; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaImpl; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaWithLimitImpl; @@ -34,6 +39,16 @@ { } + public static AdvancedCriteria createAdvancedCriteria() + { + return new AdvancedCriteriaImpl(); + } + + public static DirectJcrQuery createDirectJcrQuery(HierarchyManager hm, String query, String language) + { + return new DirectJcrQuery(hm, query, language); + } + /** * A factory for Magnolia CMS specific Criteria implementation <br> * <strong>Warning: the object returned by this method is not thread-safe</strong>To use it as a shared global @@ -83,10 +98,13 @@ * @param queryManager - an instance of info.magnolia.cms.core.search.QueryManager * @param itemType String - if not specified defaults to "mgnl:content" * @return a factory for Magnolia CMS specific Criteria implementation + * @deprecated if you need paging/query limits please use createAdvancedCriteria() */ + @Deprecated public static Criteria createMgnlCriteriaWithLimit(String path, info.magnolia.cms.core.search.QueryManager queryManager, String itemType) { + DeprecationUtil.isDeprecated("please use createAdvancedCriteria() instead"); return new MagnoliaCriteriaWithLimitImpl(path, queryManager, itemType); } @@ -107,10 +125,15 @@ * @param itemType String - if not specified defaults to "mgnl:content" * @param clazz Class<?> - the list method of this implementation must return instances of this type * @return a factory for Magnolia CMS specific Criteria implementation + * @deprecated if you need paging/query limits please use createAdvancedCriteria() */ + @Deprecated public static Criteria createMgnlCriteriaWithLimit(String path, info.magnolia.cms.core.search.QueryManager queryManager, String itemType, Class< ? > clazz) { + + DeprecationUtil.isDeprecated("please use createAdvancedCriteria() instead"); return new MagnoliaCriteriaWithLimitImpl(path, queryManager, itemType, clazz); } + } Deleted: 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 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRMagnoliaCriteriaQueryTranslator.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -1,89 +0,0 @@ -/** - * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sourceforge.openutils.mgnlcriteria.jcr.query; - -import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria.CriterionEntry; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria.OrderEntry; - -import org.apache.commons.lang.StringUtils; - - -/** - * @author Federico Grilli - * @version $Id$ - */ -public class JCRMagnoliaCriteriaQueryTranslator -{ - - private final TranslatableCriteria criteria; - - public JCRMagnoliaCriteriaQueryTranslator(final TranslatableCriteria criteria) throws JCRQueryException - { - - this.criteria = criteria; - } - - public Criteria getRootCriteria() - { - return criteria; - } - - public String getPredicate() - { - StringBuilder condition = new StringBuilder(30); - - boolean isfirst = true; - - for (CriterionEntry entry : criteria.getCriterionEntries()) - { - String xpathString = entry.getCriterion().toXPathString(entry.getCriteria()); - - if (StringUtils.isNotBlank(xpathString)) - { - if (!isfirst && StringUtils.isNotBlank(xpathString)) - { - condition.append(" and "); - } - - condition.append(xpathString); - isfirst = false; - } - } - - return condition.toString(); - } - - public String getOrderBy() - { - StringBuilder orderBy = new StringBuilder(30); - - for (OrderEntry oe : criteria.getOrderEntries()) - { - 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 Copied: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/JCRMagnoliaCriteriaQueryTranslator.java (from rev 2075, 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/xpath/JCRMagnoliaCriteriaQueryTranslator.java (rev 0) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/JCRMagnoliaCriteriaQueryTranslator.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -0,0 +1,92 @@ +/** + * + * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath; + +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria.CriterionEntry; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria.OrderEntry; + +import org.apache.commons.lang.StringUtils; + + +/** + * @author Federico Grilli + * @version $Id$ + */ +public class JCRMagnoliaCriteriaQueryTranslator +{ + + private final TranslatableCriteria criteria; + + public JCRMagnoliaCriteriaQueryTranslator(final TranslatableCriteria criteria) throws JCRQueryException + { + + this.criteria = criteria; + } + + public Criteria getRootCriteria() + { + return criteria; + } + + public String getPredicate() + { + StringBuilder condition = new StringBuilder(30); + + boolean isfirst = true; + + for (CriterionEntry entry : criteria.getCriterionEntries()) + { + String xpathString = entry.getCriterion().toXPathString(entry.getCriteria()); + + if (StringUtils.isNotBlank(xpathString)) + { + if (!isfirst && StringUtils.isNotBlank(xpathString)) + { + condition.append(" and "); + } + + condition.append(xpathString); + isfirst = false; + } + } + + return condition.toString(); + } + + public String getOrderBy() + { + StringBuilder orderBy = new StringBuilder(30); + + for (OrderEntry oe : criteria.getOrderEntries()) + { + 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 Modified: 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/AbstractCriteriaImpl.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -25,11 +25,10 @@ import java.util.List; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRMagnoliaCriteriaQueryTranslator; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; import net.sourceforge.openutils.mgnlcriteria.jcr.query.TranslatableCriteria; 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.xpath.JCRMagnoliaCriteriaQueryTranslator; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.XPathSelect; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; @@ -156,6 +155,4 @@ return stmt; } - public abstract Collection< ? > list() throws JCRQueryException; - } \ No newline at end of file Modified: 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/AbstractMagnoliaCriteriaImpl.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -20,8 +20,12 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; import info.magnolia.cms.core.Content; +import info.magnolia.cms.core.HierarchyManager; import info.magnolia.cms.core.ItemType; import info.magnolia.cms.core.search.QueryManager; +import net.sourceforge.openutils.mgnlcriteria.advanced.AdvancedResult; +import net.sourceforge.openutils.mgnlcriteria.advanced.impl.QueryExecutorHelper; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; import org.apache.commons.lang.StringUtils; @@ -61,4 +65,41 @@ this.classType = classType == null ? Content.class : classType; } + /** + * {@inheritDoc} + */ + public AdvancedResult execute() + { + + String language = javax.jcr.query.Query.XPATH; + String stmt = toXpathExpression(); + + return QueryExecutorHelper.execute( + stmt, + language, + getPrivateHierarchyManagerFromQuery(stmt), + maxResults, + offset, + null); + } + + private HierarchyManager getPrivateHierarchyManagerFromQuery(String stmt) + { + java.lang.reflect.Field field; + try + { + field = queryManager.getClass().getDeclaredField("hm"); + field.setAccessible(true); + HierarchyManager hm = (HierarchyManager) field.get(queryManager); + return hm; + } + catch (Throwable e) + { + + log.error(e.getMessage()); + throw new JCRQueryException(stmt, e); + } + + } + } \ No newline at end of file Modified: 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/MagnoliaCriteriaImpl.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaImpl.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -23,6 +23,7 @@ import info.magnolia.cms.core.search.Query; import info.magnolia.cms.core.search.QueryManager; import info.magnolia.cms.core.search.QueryResult; +import info.magnolia.cms.util.DeprecationUtil; import info.magnolia.content2bean.Content2BeanException; import info.magnolia.content2bean.Content2BeanUtil; @@ -58,9 +59,10 @@ } @SuppressWarnings("unchecked") - @Override public Collection< ? > list() throws JCRQueryException { + DeprecationUtil.isDeprecated("please use execute() instead"); + if (queryManager == null) { throw new IllegalStateException("QueryManager cannot be null"); Modified: 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/impl/MagnoliaCriteriaWithLimitImpl.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaWithLimitImpl.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -44,8 +44,8 @@ import javax.jcr.RepositoryException; import javax.jcr.query.InvalidQueryException; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRMagnoliaCriteriaQueryTranslator; import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.JCRMagnoliaCriteriaQueryTranslator; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.XPathSelect; import org.apache.commons.lang.StringUtils; @@ -56,9 +56,14 @@ /** * Magnolia XPATH implementation of the <tt>Criteria</tt> interface which supports limiting the result set according to * the underlying JCR implementation (e.g. Jackrabbit 1.4+) + * @deprecated due to the way results are collected there is no guarantee that the offset specified is respected: for + * example if your query matches both a page and a paragraph in it, and you ask for results of type mgnl:content those + * two results will be merged into one. If you need paging use AdvancedCriteria and be sure to specify the desired + * return type in the query directly. * @author Federico Grilli * @version $Id$ */ +@Deprecated public class MagnoliaCriteriaWithLimitImpl extends AbstractMagnoliaCriteriaImpl { @@ -82,11 +87,12 @@ } @SuppressWarnings("unchecked") - @Override public Collection< ? > list() throws JCRQueryException { if (queryManager == null) + { throw new IllegalStateException("QueryManager cannot be null"); + } log.debug("creating statement..."); long start = System.currentTimeMillis(); Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java 2010-03-01 23:28:56 UTC (rev 2077) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/AdvancedCriteriaSearchTest.java 2010-03-02 07:44:15 UTC (rev 2078) @@ -28,6 +28,7 @@ import java.util.List; import junit.framework.Assert; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRCriteriaFactory; import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Disjunction; import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Order; import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions; @@ -85,6 +86,18 @@ } @Test + public void testSearchFranciaPaginated() throws Exception + { + + AdvancedResult advResult = search("francia", 2, 3); + + Assert.assertEquals(4, advResult.getTotalSize()); + Collection< ? extends Content> result = collectCollectionFromResult(advResult); + + assertSortedResults(new String[]{"federale" }, result, "francia"); + } + + @Test public void testSearchDante() throws Exception { // Dante Alighieri @@ -233,7 +246,7 @@ */ protected AdvancedCriteria createCriteria(String repo, String startnode) { - AdvancedCriteria criteria = AdvancedCriteriaFactory.createAdvancedCriteria().setWorkspace(repo).addOrder( + AdvancedCriteria criteria = JCRCriteriaFactory.createAdvancedCriteria().setWorkspace(repo).addOrder( Order.desc("@jcr:score")).add(Restrictions.eq("@jcr:primaryType", "mgnl:content")); if (startnode != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-08-27 18:50:54
|
Revision: 2912 http://openutils.svn.sourceforge.net/openutils/?rev=2912&view=rev Author: fgiust Date: 2010-08-27 18:50:47 +0000 (Fri, 27 Aug 2010) Log Message: ----------- cleanup junit leftovers and switch everything to testng Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java trunk/openutils-mgnlcriteria/src/test/resources/crit-repository/indexing_configuration.xml Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-08-27 15:37:53 UTC (rev 2911) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-08-27 18:50:47 UTC (rev 2912) @@ -136,17 +136,17 @@ <scope>test</scope> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.7</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <classifier>jdk15</classifier> <version>5.10</version> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> </dependency> </dependencies> <repositories> @@ -167,8 +167,5 @@ <jackrabbit.version>1.6.2</jackrabbit.version> <jcr.version>1.0</jcr.version> </properties> - <!-- test running maven with - -Djcr.version=2.0 -Djackrabbit.version=2.0.0 - -Djcr.version=2.0 -Djackrabbit.version=2.1.0 - --> + <!-- test running maven with -Djcr.version=2.0 -Djackrabbit.version=2.0.0 -Djcr.version=2.0 -Djackrabbit.version=2.1.0 --> </project> \ No newline at end of file Modified: 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/AbstractMagnoliaCriteriaImpl.java 2010-08-27 15:37:53 UTC (rev 2911) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java 2010-08-27 18:50:47 UTC (rev 2912) @@ -77,6 +77,11 @@ protected static HierarchyManager getPrivateHierarchyManagerFromQuery(QueryManager queryManager) { + if (queryManager == null) + { + return null; + } + java.lang.reflect.Field field; try { Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java 2010-08-27 15:37:53 UTC (rev 2911) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java 2010-08-27 18:50:47 UTC (rev 2912) @@ -19,13 +19,13 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; -import junit.framework.Assert; import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRCriteriaFactory; import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Junction; import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions; -import org.junit.Test; +import org.testng.Assert; +import org.testng.annotations.Test; /** Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java 2010-08-27 15:37:53 UTC (rev 2911) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/RepositoryTestNgTestcase.java 2010-08-27 18:50:47 UTC (rev 2912) @@ -45,10 +45,10 @@ import org.apache.commons.lang.StringUtils; import org.apache.jackrabbit.core.jndi.BindableRepositoryFactory; import org.apache.log4j.Level; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; /** Modified: trunk/openutils-mgnlcriteria/src/test/resources/crit-repository/indexing_configuration.xml =================================================================== --- trunk/openutils-mgnlcriteria/src/test/resources/crit-repository/indexing_configuration.xml 2010-08-27 15:37:53 UTC (rev 2911) +++ trunk/openutils-mgnlcriteria/src/test/resources/crit-repository/indexing_configuration.xml 2010-08-27 18:50:47 UTC (rev 2912) @@ -2,34 +2,22 @@ <!DOCTYPE configuration SYSTEM "http://jackrabbit.apache.org/dtd/indexing-configuration-1.2.dtd"> <configuration xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mgnl="http://www.magnolia.info/jcr/mgnl" xmlns:jcr="http://www.jcp.org/jcr/1.0"> + <!-- - <analyzers> - <analyzer class="org.apache.lucene.analysis.KeywordAnalyzer"> - <property>tags</property> - </analyzer> - </analyzers> <index-rule nodeType="nt:hierarchyNode"> <property boost="10" useInExcerpt="false">title</property> <property boost="1.0" useInExcerpt="true">text</property> - <property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">mgnl:.*</property> - <property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">jcr:.*</property> </index-rule> <index-rule nodeType="mgnl:content"> <property boost="10" useInExcerpt="false">title</property> <property boost="1.0" useInExcerpt="true">text</property> - <property nodeScopeIndex="false" useInExcerpt="false">excludedproperty</property> - <property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">mgnl:.*</property> - <property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">jcr:.*</property> - <property nodeScopeIndex="false" useInExcerpt="false">jcr:createdBy</property> </index-rule> <index-rule nodeType="mgnl:contentNode"> - <property boost="0.5" nodeScopeIndex="false" useInExcerpt="false">title</property> - <property boost="1.0" nodeScopeIndex="false" useInExcerpt="true">text</property> - <property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">mgnl:.*</property> - <property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">jcr:.*</property> - <property nodeScopeIndex="false" useInExcerpt="false">jcr:createdBy</property> + <property boost="0.5" useInExcerpt="false">title</property> + <property boost="1.0" useInExcerpt="true">text</property> </index-rule> --> + <!-- index text content on paragraphs --> <aggregate primaryType="mgnl:content"> <!-- aggregates content on the main column --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-08-29 15:11:42
|
Revision: 2924 http://openutils.svn.sourceforge.net/openutils/?rev=2924&view=rev Author: fgiust Date: 2010-08-29 15:11:35 +0000 (Sun, 29 Aug 2010) Log Message: ----------- magnolia 4.0 compatibility Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java trunk/openutils-mgnlcriteria/src/test/resources/test-magnolia.properties Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-08-29 08:58:29 UTC (rev 2923) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-08-29 15:11:35 UTC (rev 2924) @@ -89,6 +89,11 @@ <version>${magnolia.version}</version> </dependency> <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.2</version> + </dependency> + <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.5.8</version> Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java 2010-08-29 08:58:29 UTC (rev 2923) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java 2010-08-29 15:11:35 UTC (rev 2924) @@ -160,7 +160,8 @@ FileProperties props = new FileProperties(this, (String) key); value = props.getProperty(FileProperties.PATH); } - else if (nodeData.isMultiValue() == NodeData.MULTIVALUE_TRUE) + else if (nodeData.isMultiValue() == 1) + // not using NodeData.MULTIVALUE_TRUE since the constant is not defined in magnolia 4.0 { Value[] values = nodeData.getValues(); Modified: trunk/openutils-mgnlcriteria/src/test/resources/test-magnolia.properties =================================================================== --- trunk/openutils-mgnlcriteria/src/test/resources/test-magnolia.properties 2010-08-29 08:58:29 UTC (rev 2923) +++ trunk/openutils-mgnlcriteria/src/test/resources/test-magnolia.properties 2010-08-29 15:11:35 UTC (rev 2924) @@ -31,6 +31,7 @@ ####### solo per test ##### info.magnolia.logging.AuditLoggingManager=info.magnolia.logging.AuditLoggingManager +info.magnolia.link.LinkTransformerManager=info.magnolia.link.LinkTransformerManager ####### info.magnolia.cms.i18n.I18nContentSupport=info.magnolia.cms.i18n.DefaultI18nContentSupport This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-08-29 16:00:29
|
Revision: 2933 http://openutils.svn.sourceforge.net/openutils/?rev=2933&view=rev Author: fgiust Date: 2010-08-29 16:00:21 +0000 (Sun, 29 Aug 2010) Log Message: ----------- CRIT-23 Remove deprecated API Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.xml trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java 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/xpath/impl/AbstractCriteriaImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java trunk/openutils-mgnlcriteria/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryDecoratorSupport.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java Removed Paths: ------------- 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 Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-08-29 16:00:21 UTC (rev 2933) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -115,7 +116,7 @@ <dependency> <groupId>javax.jcr</groupId> <artifactId>jcr</artifactId> - <version>2.0</version> + <version>${jcr.version}</version> </dependency> <dependency> <groupId>org.apache.jackrabbit</groupId> @@ -169,7 +170,7 @@ <properties> <magnolia.version>4.3.6</magnolia.version> <jackrabbit.version>1.6.2</jackrabbit.version> - <jcr.version>1.0</jcr.version> + <jcr.version>2.0</jcr.version> </properties> <!-- test running maven with -Djcr.version=2.0 -Djackrabbit.version=2.0.0 -Djcr.version=2.0 -Djackrabbit.version=2.1.0 --> </project> \ No newline at end of file Modified: trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.xml =================================================================== --- trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.xml 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/assembly/assembly-bundle.xml 2010-08-29 16:00:21 UTC (rev 2933) @@ -29,6 +29,8 @@ <outputDirectory>bin</outputDirectory> <includes> <include>net.sourceforge.openutils:*</include> + <include>cglib:*</include> + <include>javax.jcr:*</include> </includes> </dependencySet> </dependencySets> Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -19,9 +19,6 @@ package net.sourceforge.openutils.mgnlcriteria.advanced.impl; -import java.util.Collection; - -import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.AbstractCriteriaImpl; @@ -32,11 +29,4 @@ public class AdvancedCriteriaImpl extends AbstractCriteriaImpl { - /** - * {@inheritDoc} - */ - public Collection< ? > list() throws JCRQueryException - { - throw new UnsupportedOperationException("list() is not supported in advanced Criteria, please call execute()"); - } } 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 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -19,8 +19,6 @@ 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; @@ -131,15 +129,6 @@ Criteria setFirstResult(int firstResult); /** - * Method kept in 2.x only for temporary backward compatibility. Always use execute(); - * @return The Collection of matched query results. - * @throws JCRQueryException query exception - * @deprecated use execute() - */ - @Deprecated - Collection< ? > list() throws JCRQueryException; - - /** * Sets the base path of the query, i.e. the branch in the repository tree where the search will take place * @param path the handle of a node, or a xpath query prefix in the form //handle/of/a/node//* * @return this (for method chaining) Modified: 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 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -20,10 +20,7 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query; import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.util.DeprecationUtil; import net.sourceforge.openutils.mgnlcriteria.advanced.impl.AdvancedCriteriaImpl; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaImpl; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl.MagnoliaCriteriaWithLimitImpl; /** @@ -62,97 +59,4 @@ return new DirectJcrQuery(hm, query, language); } - /** - * A factory for Magnolia CMS specific Criteria implementation <br> - * <strong>Warning: the object returned by this method is not thread-safe</strong>To use it as a shared global - * variable, client-code must coordinate access to it. - * @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 a factory for Magnolia CMS specific Criteria implementation - * @deprecated please use createCriteria() - */ - @Deprecated - public static Criteria createMgnlCriteria(String path, info.magnolia.cms.core.search.QueryManager queryManager, - String itemType) - { - DeprecationUtil.isDeprecated("please use createCriteria() instead"); - return new MagnoliaCriteriaImpl(path, queryManager, itemType); - } - - /** - * A factory for Magnolia CMS specific Criteria implementation <br> - * <strong>Warning: the object returned by this method is not thread-safe</strong>To use it as a shared global - * variable, client-code must coordinate access to it. - * @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 clazz Class<?> - the list method of this implementation must return instances of this type - * @return a factory for Magnolia CMS specific Criteria implementation - * @deprecated please use createCriteria() - */ - @Deprecated - public static Criteria createMgnlCriteria(String path, info.magnolia.cms.core.search.QueryManager queryManager, - String itemType, Class< ? > clazz) - { - DeprecationUtil.isDeprecated("please use createCriteria() instead"); - return new MagnoliaCriteriaImpl(path, queryManager, itemType, clazz); - } - - /** - * A factory for Magnolia CMS specific Criteria implementation which can return a subset of results instead of the - * whole resultset, much like a MySQL limit clause. For this to work, the underlying JCR repository implementation - * must support this feature (Jackrabbit 1.4+ does).<br> - * To set the maximum number of returned items you must call {@link Criteria#setMaxResults(int)} (by default - * {@link Criteria#setFirstResult(int)} is set to 0).<br> - * Please notice that if {@link Criteria#setMaxResults(int)} is not explicitly called before the - * {@link Criteria#list()} method, the latter will return the entire resultset as in - * {@link JCRCriteriaFactory#createMgnlCriteria(String, info.magnolia.cms.core.search.QueryManager, String)} <br> - * <strong>Warning: the object returned by this method is not thread-safe</strong>To use it as a shared global - * variable, client-code must coordinate access to it. - * @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 a factory for Magnolia CMS specific Criteria implementation - * @deprecated please use createCriteria() - */ - @Deprecated - public static Criteria createMgnlCriteriaWithLimit(String path, - info.magnolia.cms.core.search.QueryManager queryManager, String itemType) - { - DeprecationUtil.isDeprecated("please use createCriteria() instead"); - return new MagnoliaCriteriaWithLimitImpl(path, queryManager, itemType); - } - - /** - * A factory for Magnolia CMS specific Criteria implementation which can return a subset of results instead of the - * whole resultset, much like a MySQL limit clause. For this to work, the underlying JCR repository implementation - * must support this feature (Jackrabbit 1.4+ does).<br> - * To set the maximum number of returned items you must call {@link Criteria#setMaxResults(int)} (by default - * {@link Criteria#setFirstResult(int)} is set to 0).<br> - * Please notice that if {@link Criteria#setMaxResults(int)} is not explicitly called before the - * {@link Criteria#list()} method, the latter will return the entire resultset as in - * {@link JCRCriteriaFactory#createMgnlCriteria(String, info.magnolia.cms.core.search.QueryManager, String, Class)} <br> - * <strong>Warning: the object returned by this method is not thread-safe</strong>To use it as a shared global - * variable, client-code must coordinate access to it. - * @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 clazz Class<?> - the list method of this implementation must return instances of this type - * @return a factory for Magnolia CMS specific Criteria implementation - * @deprecated please use createCriteria() - */ - @Deprecated - public static Criteria createMgnlCriteriaWithLimit(String path, - info.magnolia.cms.core.search.QueryManager queryManager, String itemType, Class< ? > clazz) - { - - DeprecationUtil.isDeprecated("please use createCriteria() instead"); - return new MagnoliaCriteriaWithLimitImpl(path, queryManager, itemType, clazz); - } - } Modified: 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/AbstractCriteriaImpl.java 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -20,7 +20,6 @@ package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; import info.magnolia.cms.beans.config.ContentRepository; -import info.magnolia.cms.core.HierarchyManager; import info.magnolia.context.MgnlContext; import java.util.ArrayList; @@ -65,8 +64,6 @@ protected int offset; - protected HierarchyManager hm; - protected String spellCheckString; protected String workspace = ContentRepository.WEBSITE; @@ -76,12 +73,6 @@ } - protected AbstractCriteriaImpl(HierarchyManager hm) - { - super(); - this.hm = hm; - } - /** * {@inheritDoc} */ @@ -226,13 +217,14 @@ */ public AdvancedResult execute() { + @SuppressWarnings("deprecation") String language = javax.jcr.query.Query.XPATH; String stmt = toXpathExpression(); return QueryExecutorHelper.execute( stmt, language, - this.hm != null ? this.hm : MgnlContext.getHierarchyManager(workspace), + MgnlContext.getHierarchyManager(workspace), maxResults, offset, spellCheckString); Deleted: 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/AbstractMagnoliaCriteriaImpl.java 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractMagnoliaCriteriaImpl.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -1,101 +0,0 @@ -/** - * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; - -import info.magnolia.cms.core.Content; -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.ItemType; -import info.magnolia.cms.core.search.QueryManager; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; - -import org.apache.commons.lang.StringUtils; - - -/** - * @author fgrilli - * @version $Id$ - */ -@Deprecated -public abstract class AbstractMagnoliaCriteriaImpl extends AbstractCriteriaImpl -{ - - @Deprecated - protected info.magnolia.cms.core.search.QueryManager queryManager; - - @Deprecated - protected String itemType; - - /** - * @param hm - */ - public AbstractMagnoliaCriteriaImpl(HierarchyManager hm) - { - super(hm); - } - - /** - * Constructor to be used by subclasses - * @param path String - the path preceding the predicate in the jcr query statement (you dont need to do escaping - * yourself) - * @param queryManager - an instance of {@link QueryManager} - * @param itemType - String the itemType. Defaults to {@link ItemType#getSystemName#toString()} - * @param classType Class<?> - defaults to {@link Content} - */ - protected AbstractMagnoliaCriteriaImpl(String path, QueryManager queryManager, String itemType, Class< ? > classType) - { - - super(getPrivateHierarchyManagerFromQuery(queryManager)); - if (StringUtils.isBlank(itemType)) - { - this.itemType = ItemType.CONTENT.getSystemName(); - } - else - { - this.itemType = itemType; - } - this.path = path; - this.queryManager = queryManager; - // defaults to info.magnolia.cms.core.Content - this.classType = classType == null ? Content.class : classType; - } - - protected static HierarchyManager getPrivateHierarchyManagerFromQuery(QueryManager queryManager) - { - if (queryManager == null) - { - return null; - } - - java.lang.reflect.Field field; - try - { - field = queryManager.getClass().getDeclaredField("hm"); - field.setAccessible(true); - HierarchyManager hm = (HierarchyManager) field.get(queryManager); - return hm; - } - catch (Throwable e) - { - throw new JCRQueryException("getting hierarchyManager", e); - } - - } - -} \ No newline at end of file Deleted: 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/MagnoliaCriteriaImpl.java 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaImpl.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -1,155 +0,0 @@ -/** - * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; - -import info.magnolia.cms.core.Content; -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.search.Query; -import info.magnolia.cms.core.search.QueryManager; -import info.magnolia.cms.core.search.QueryResult; -import info.magnolia.cms.util.DeprecationUtil; -import info.magnolia.content2bean.Content2BeanException; -import info.magnolia.content2bean.Content2BeanUtil; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.jcr.RepositoryException; -import javax.jcr.query.InvalidQueryException; - -import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; - - -/** - * Magnolia XPATH implementation of the <tt>Criteria</tt> interface - * @author Federico Grilli - * @version $Id$ - */ -@Deprecated -public class MagnoliaCriteriaImpl extends AbstractMagnoliaCriteriaImpl -{ - - protected static final String EXCEPTION_MSG = "An error occurred while executing a query. Xpath query was {}. Exception message is {}"; - - @Deprecated - public MagnoliaCriteriaImpl(String path, QueryManager queryManager, String itemType) - { - super(path, queryManager, itemType, null); - } - - @Deprecated - public MagnoliaCriteriaImpl(String path, QueryManager queryManager, String itemType, Class< ? > classType) - { - super(path, queryManager, itemType, classType); - } - - /** - * @param hm - */ - public MagnoliaCriteriaImpl(HierarchyManager hm) - { - super(hm); - } - - @SuppressWarnings("unchecked") - @Deprecated - public Collection< ? > list() throws JCRQueryException - { - DeprecationUtil.isDeprecated("please use execute() instead"); - - if (queryManager == null) - { - throw new IllegalStateException("QueryManager cannot be null"); - } - - log.debug("creating statement..."); - long start = System.currentTimeMillis(); - - String stmt = toXpathExpression(); - - long stop = System.currentTimeMillis(); - log.debug("statement created in {} ms", stop - start); - Collection< ? > retVal; - try - { - - Query q = queryManager.createQuery(stmt, Query.XPATH); - - log.debug("executing Query {}", q.getStatement()); - start = System.currentTimeMillis(); - - QueryResult r = q.execute(); - - stop = System.currentTimeMillis(); - log.debug("Query executed in {} ms", stop - start); - - log.debug("getting content..."); - start = System.currentTimeMillis(); - - retVal = r.getContent(itemType); - - stop = System.currentTimeMillis(); - - if (Content.class.isAssignableFrom(classType)) - { - log.debug("returning a Collection holding objects of type {} ", Content.class.getName()); - retVal = retVal == null ? new ArrayList<Content>() : retVal; - log.debug("got {} node(s) in {} ms", new Object[]{retVal.size(), stop - start }); - - return retVal; - - } - else - { - log.debug("returning a Collection holding objects of type {} ", classType.getName()); - List list = new ArrayList(); - for (Iterator iter = retVal.iterator(); iter.hasNext();) - { - Content node = (Content) iter.next(); - try - { - list.add(classType.cast(Content2BeanUtil.toBean(node, true, classType))); - } - catch (Content2BeanException e) - { - log.error(e.getMessage()); - throw new JCRQueryException(stmt, e); - } - } - log.debug("got {} node(s) in {} ms", new Object[]{list.size(), stop - start }); - return list; - } - - } - catch (InvalidQueryException e) - { - log.error(EXCEPTION_MSG, new Object[]{stmt, e.getMessage() }); - throw new JCRQueryException(stmt, e); - } - catch (RepositoryException e) - { - log.error(EXCEPTION_MSG, new Object[]{stmt, e.getMessage() }); - throw new JCRQueryException(stmt, e); - } - } - -} \ No newline at end of file Deleted: 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/impl/MagnoliaCriteriaWithLimitImpl.java 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaWithLimitImpl.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -1,344 +0,0 @@ -/** - * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.impl; - -import info.magnolia.cms.core.Content; -import info.magnolia.cms.core.DefaultContent; -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.ItemType; -import info.magnolia.cms.core.Path; -import info.magnolia.cms.core.search.Query; -import info.magnolia.cms.core.search.QueryManager; -import info.magnolia.cms.core.search.QueryResult; -import info.magnolia.cms.security.AccessManager; -import info.magnolia.cms.security.Permission; -import info.magnolia.content2bean.Content2BeanException; -import info.magnolia.content2bean.Content2BeanUtil; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.jcr.Node; -import javax.jcr.NodeIterator; -import javax.jcr.RepositoryException; -import javax.jcr.query.InvalidQueryException; - -import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRQueryException; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.JCRMagnoliaCriteriaQueryTranslator; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.XPathSelect; -import net.sourceforge.openutils.mgnlcriteria.jcr.query.xpath.utils.XPathTextUtils; - -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * <strong>Deprecated in mgnlcriteria 2.x. Paging is now implemented at jcr level in AdvancedCriteria, this class should - * not be used anymore.</strong> Magnolia XPATH implementation of the <tt>Criteria</tt> interface which supports - * limiting the result set according to the underlying JCR implementation (e.g. Jackrabbit 1.4+) - * @deprecated due to the way results are collected there is no guarantee that the offset specified is respected: for - * example if your query matches both a page and a paragraph in it, and you ask for results of type mgnl:content those - * two results will be merged into one. If you need paging use AdvancedCriteria and be sure to specify the desired - * return type in the query directly. - * @author Federico Grilli - * @version $Id$ - */ -@Deprecated -public class MagnoliaCriteriaWithLimitImpl extends MagnoliaCriteriaImpl -{ - - /** - * Logger. - */ - private static Logger log = LoggerFactory.getLogger(MagnoliaCriteriaWithLimitImpl.class); - - private static final String HIERARCHY_MANAGER = "hm"; - - private static final String QUERY_MANAGER = "queryManager"; - - @Deprecated - public MagnoliaCriteriaWithLimitImpl(String path, QueryManager queryManager, String itemType) - { - super(path, queryManager, itemType, null); - } - - @Deprecated - public MagnoliaCriteriaWithLimitImpl(String path, QueryManager queryManager, String itemType, Class< ? > classType) - { - super(path, queryManager, itemType, classType); - } - - /** - * @param hm - */ - public MagnoliaCriteriaWithLimitImpl(HierarchyManager hm) - { - super(hm); - } - - @Override - @SuppressWarnings("unchecked") - @Deprecated - public Collection< ? > list() throws JCRQueryException - { - if (queryManager == null) - { - throw new IllegalStateException("QueryManager cannot be null"); - } - - log.debug("creating statement..."); - long start = System.currentTimeMillis(); - - JCRMagnoliaCriteriaQueryTranslator translator = new JCRMagnoliaCriteriaQueryTranslator(this); - XPathSelect statement = new XPathSelect(); - statement.setRoot(XPathTextUtils.encodeDigitsInPath(this.path)); - statement.setPredicate(translator.getPredicate()); - statement.setOrderByClause(translator.getOrderBy()); - String stmt = statement.toStatementString(); - - long stop = System.currentTimeMillis(); - log.debug("statement created in {} milliseconds", stop - start); - - try - { - Class< ? extends QueryManager> managerClass = queryManager.getClass(); - java.lang.reflect.Field field = managerClass.getDeclaredField(QUERY_MANAGER); - field.setAccessible(true); - - javax.jcr.query.QueryManager jcrManager = (javax.jcr.query.QueryManager) field.get(queryManager); - org.apache.jackrabbit.core.query.QueryImpl q = (org.apache.jackrabbit.core.query.QueryImpl) jcrManager - .createQuery(stmt, Query.XPATH); - - if (getMaxResults() > 0) - { - q.setLimit(getMaxResults()); - } - - if (getFirstResult() >= 0) - { - q.setOffset(getFirstResult()); - } - - log.debug("offset is {} limit is {}", new Object[]{getFirstResult(), getMaxResults() }); - - log.debug("executing Query {}", q.getStatement()); - start = System.currentTimeMillis(); - javax.jcr.query.QueryResult result = q.execute(); - - stop = System.currentTimeMillis(); - log.debug("Query executed in {} milliseconds", stop - start); - - Collection<Content> retVal; - field = managerClass.getDeclaredField(HIERARCHY_MANAGER); - field.setAccessible(true); - HierarchyManager hm = (HierarchyManager) field.get(queryManager); - - log.debug("getting content..."); - start = System.currentTimeMillis(); - QueryResultImpl filteredResult = new QueryResultImpl(result, hm); - retVal = filteredResult.getContent(itemType); - - stop = System.currentTimeMillis(); - - if (Content.class.isAssignableFrom(classType)) - { - log.debug("returning a Collection holding objects of type {} ", Content.class.getName()); - retVal = retVal == null ? new ArrayList<Content>() : retVal; - log.debug("got {} node(s) in {} ms", new Object[]{retVal.size(), stop - start }); - - return retVal; - } - else - { - log.debug("returning a Collection holding objects of type {} ", classType.getName()); - Iterator iter = retVal.iterator(); - List list = new ArrayList(); - while (iter.hasNext()) - { - Content node = (Content) iter.next(); - try - { - list.add(classType.cast(Content2BeanUtil.toBean(node, true, classType))); - } - catch (Content2BeanException e) - { - log.error(e.getMessage()); - throw new JCRQueryException(stmt, e); - } - } - log.debug("got {} node(s) in {} ms", new Object[]{list.size(), stop - start }); - return list; - } - } - catch (InvalidQueryException e) - { - log.error(e.getMessage()); - throw new JCRQueryException(stmt, e); - } - catch (RepositoryException e) - { - log.error(e.getMessage()); - throw new JCRQueryException(stmt, e); - } - catch (SecurityException e) - { - log.error(e.getMessage()); - throw new JCRQueryException(stmt, e); - } - catch (NoSuchFieldException e) - { - log.error(e.getMessage()); - throw new JCRQueryException(stmt, e); - } - catch (IllegalArgumentException e) - { - log.error(e.getMessage()); - throw new JCRQueryException(stmt, e); - } - catch (IllegalAccessException e) - { - log.error(e.getMessage()); - throw new JCRQueryException(stmt, e); - } - } - - /** - * This is {@link QueryResultImpl} slightly modified - */ - protected static final class QueryResultImpl implements QueryResult - { - - /** - * Unfiltered result object - */ - private javax.jcr.query.QueryResult result; - - private AccessManager accessManager; - - private HierarchyManager hm; - - private Map<String, String> dirtyHandles = new Hashtable<String, String>(); - - protected QueryResultImpl(javax.jcr.query.QueryResult result, HierarchyManager hm) - { - this.result = result; - this.hm = hm; - this.accessManager = hm.getAccessManager(); - } - - public AccessManager getAccessManager() - { - return accessManager; - } - - public javax.jcr.query.QueryResult getJcrResult() - { - return result; - } - - /** - * Build required result objects - */ - private void build(String nodeType, Collection<Content> collection) throws RepositoryException - { - NodeIterator nodeIterator = this.result.getNodes(); - while (nodeIterator.hasNext()) - { - Node node = nodeIterator.nextNode(); - try - { - build(node, nodeType, collection); - } - catch (RepositoryException re) - { - log.error( - "{} caught while iterating on query results: {}", - re.getClass().getName(), - re.getMessage()); - if (log.isDebugEnabled()) - { - log.debug( - re.getClass().getName() + " caught while iterating on query results: " + re.getMessage(), - re); - } - } - } - } - - /** - * Build required result objects - */ - private void build(Node node, String nodeType, Collection<Content> collection) throws RepositoryException - { - /** - * All custom node types - */ - if ((node.isNodeType(nodeType) || StringUtils.isEmpty(nodeType)) && !node.isNodeType(ItemType.NT_RESOURCE)) - { - if (this.dirtyHandles.get(node.getPath()) == null) - { - boolean isAllowed = this.accessManager.isGranted( - Path.getAbsolutePath(node.getPath()), - Permission.READ); - if (isAllowed) - { - collection.add(new DefaultContent(node, this.hm)); - this.dirtyHandles.put(node.getPath(), StringUtils.EMPTY); - } - } - return; - } - if (node.getDepth() > 0) - { - this.build(node.getParent(), nodeType, collection); - } - } - - /** - * @see info.magnolia.cms.core.search.QueryResult#getContent() - */ - public Collection<Content> getContent() - { - return getContent(ItemType.CONTENT.getSystemName()); - } - - /** - * @see info.magnolia.cms.core.search.QueryResult#getContent(java.lang.String) - */ - public Collection<Content> getContent(String nodeType) - { - Collection<Content> resultSet = new ArrayList<Content>(); - try - { - this.build(nodeType, resultSet); - } - catch (RepositoryException re) - { - log.error(re.getMessage()); - } - return resultSet; - } - } -} \ No newline at end of file Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -40,44 +40,6 @@ } /** - * Escapes all illegal XPath search characters of a string. - * <p> - * Example:<br> - * A search string like 'test?' will run into a ParseException documented in - * http://issues.apache.org/jira/browse/JCR-1248 This is copied from org.apache.jackrabbit.util.Text and was put - * here just to keep this API JCR implementation agnostic - * @param s the string to encode - * @return the escaped string - * @deprecated may cause JCRQueryException on search-expressions like "\"milano\"" (CRIT-9) - */ - @Deprecated - public static String escapeIllegalXpathSearchChars(String s) - { - if (StringUtils.isEmpty(s)) - { - return s; - } - StringBuffer sb = new StringBuffer(); - sb.append(s.substring(0, (s.length() - 1))); - char c = s.charAt(s.length() - 1); - if (c == '!' - || c == '(' - || c == ':' - || c == '^' - || c == '[' - || c == ']' - || c == '\"' - || c == '{' - || c == '}' - || c == '?') - { - sb.append('\\'); - } - sb.append(c); - return sb.toString(); - } - - /** * Convert a string to an XPath 2.0 string literal, suitable for inclusion in a query. See JSR-170 spec v1.0, Sec. * 6.6.4.9. * @param str Any string. Modified: trunk/openutils-mgnlcriteria/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryDecoratorSupport.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryDecoratorSupport.java 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryDecoratorSupport.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -33,10 +33,13 @@ public class QueryDecoratorSupport { + /** + * The search index. + */ protected final SearchIndex index; /** - * + * */ public QueryDecoratorSupport(SearchIndex index) { Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java 2010-08-29 15:43:29 UTC (rev 2932) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java 2010-08-29 16:00:21 UTC (rev 2933) @@ -68,6 +68,7 @@ MgnlContext.getHierarchyManager(ContentRepository.WEBSITE).save(); } + @SuppressWarnings("deprecation") @Test public void testTrailingUnescaped() throws Exception { @@ -91,6 +92,7 @@ Assert.assertEquals(advResult.getTotalSize(), 0); } + @SuppressWarnings("deprecation") @Test public void testTrailingEscaped() throws Exception { @@ -103,6 +105,7 @@ Assert.assertEquals(advResult.getItems().next().getTitle(), "hello test? world"); } + @SuppressWarnings("deprecation") @Test public void testMiddle() throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2010-09-23 17:08:08
|
Revision: 3114 http://openutils.svn.sourceforge.net/openutils/?rev=3114&view=rev Author: molaschi Date: 2010-09-23 17:08:01 +0000 (Thu, 23 Sep 2010) Log Message: ----------- CRIT-29 Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-09-15 16:58:57 UTC (rev 3113) +++ trunk/openutils-mgnlcriteria/pom.xml 2010-09-23 17:08:01 UTC (rev 3114) @@ -180,8 +180,8 @@ </repositories> <properties> <magnolia.version>4.3.6</magnolia.version> - <jackrabbit.version>2.0.0</jackrabbit.version> - <jcr.version>2.0</jcr.version> + <jackrabbit.version>1.6.2</jackrabbit.version> + <jcr.version>1.0</jcr.version> </properties> <!-- test running maven with -Djcr.version=2.0 -Djackrabbit.version=2.0.0 -Djcr.version=2.0 -Djackrabbit.version=2.1.0 --> </project> \ No newline at end of file Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java 2010-09-15 16:58:57 UTC (rev 3113) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java 2010-09-23 17:08:01 UTC (rev 3114) @@ -19,15 +19,21 @@ package net.sourceforge.openutils.mgnlcriteria.advanced.impl; +import info.magnolia.cms.core.Content; import info.magnolia.cms.core.HierarchyManager; import info.magnolia.cms.security.AccessDeniedException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import javax.jcr.Item; import javax.jcr.RepositoryException; import javax.jcr.Value; import javax.jcr.query.Row; import net.sourceforge.openutils.mgnlcriteria.jcr.query.AdvancedResultItem; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,17 +52,85 @@ */ private Logger log = LoggerFactory.getLogger(AdvancedResultItemImpl.class); + private final static Method JCR_ROW_GETNODE; + + private final static Method JCR_ROW_GETSCORE; + + static + { + Method jcrRowGetNode = null; + try + { + jcrRowGetNode = Row.class.getDeclaredMethod("getNode", (Class[]) null); + } + catch (SecurityException e) + { + } + catch (NoSuchMethodException e) + { + } + JCR_ROW_GETNODE = jcrRowGetNode; + + Method jcrRowGetScore = null; + try + { + jcrRowGetScore = Row.class.getDeclaredMethod("getScore", new Class[]{String.class }); + } + catch (SecurityException e) + { + } + catch (NoSuchMethodException e) + { + } + JCR_ROW_GETSCORE = jcrRowGetScore; + } + + public static Item getJCRNode(Row row, HierarchyManager hierarchyManager) throws RepositoryException + { + if (JCR_ROW_GETNODE != null) + { + try + { + return (Item) JCR_ROW_GETNODE.invoke(row, (Object[]) null); + } + catch (IllegalAccessException e) + { + } + catch (InvocationTargetException e) + { + } + } + else + { + Value path = row.getValue("jcr:path"); + if (path != null && StringUtils.isNotBlank(path.getString())) + { + Content node = hierarchyManager.getContent(path.getString()); + if (node != null) + { + return node.getJCRNode(); + } + } + + } + return null; + } + /** * @param elem * @param hierarchyManager * @throws RepositoryException * @throws AccessDeniedException + * @throws InvocationTargetException + * @throws IllegalAccessException + * @throws IllegalStateException + * @throws IllegalArgumentException */ public AdvancedResultItemImpl(Row row, HierarchyManager hierarchyManager) throws RepositoryException, AccessDeniedException { - super(row.getNode(), hierarchyManager); + super(getJCRNode(row, hierarchyManager), hierarchyManager); this.row = row; } @@ -115,15 +189,52 @@ */ public double getScore(String selector) { - try + if (JCR_ROW_GETSCORE != null) { - return row.getScore(selector); + try + { + return (Double) JCR_ROW_GETSCORE.invoke(row, new Object[]{selector }); + } + catch (IllegalArgumentException e) + { + log.warn("Error getting score for {}", this.getHandle(), e); + } + catch (IllegalAccessException e) + { + log.warn("Error getting score for {}", this.getHandle(), e); + } + catch (InvocationTargetException e) + { + log.warn("Error getting score for {}", this.getHandle(), e); + } } - catch (RepositoryException e) + else { - log.warn("Error getting score for " + this.getHandle(), e); - return 0; + Value scoreValue; + try + { + scoreValue = row.getValue("jcr:score(" + selector + ")"); + } + catch (RepositoryException e) + { + log.warn("Error getting excerpt for " + this.getHandle(), e); + return 0; + } + + if (scoreValue != null) + { + try + { + return scoreValue.getDouble(); + } + catch (RepositoryException e) + { + log.warn("Error getting score for " + this.getHandle(), e); + return 0; + } + } } + return 0; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-01-01 19:33:53
|
Revision: 3197 http://openutils.svn.sourceforge.net/openutils/?rev=3197&view=rev Author: fgiust Date: 2011-01-01 19:33:47 +0000 (Sat, 01 Jan 2011) Log Message: ----------- fix test analyzer to make it work with jackrabbit 2.2.0 Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2010-12-28 14:33:32 UTC (rev 3196) +++ trunk/openutils-mgnlcriteria/pom.xml 2011-01-01 19:33:47 UTC (rev 3197) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -133,16 +134,6 @@ <groupId>org.apache.jackrabbit</groupId> <artifactId>jackrabbit-core</artifactId> <version>${jackrabbit.version}</version> - <exclusions> - <exclusion> - <groupId>org.apache.poi</groupId> - <artifactId>poi</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.poi</groupId> - <artifactId>poi-scratchpad</artifactId> - </exclusion> - </exclusions> </dependency> <dependency> <groupId>info.magnolia</groupId> @@ -165,19 +156,6 @@ </exclusions> </dependency> </dependencies> - <repositories> - <repository> - <id>repository.magnolia.info</id> - <name>magnolia repository</name> - <url>http://nexus.magnolia-cms.com/content/groups/public/</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> - </repositories> <properties> <magnolia.version>4.4.1</magnolia.version> <jackrabbit.version>1.6.2</jackrabbit.version> Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java 2010-12-28 14:33:32 UTC (rev 3196) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/ItalianSnowballAnalyzer.java 2011-01-01 19:33:47 UTC (rev 3197) @@ -19,25 +19,62 @@ package net.sourceforge.openutils.mgnlcriteria.tests; +import java.io.IOException; import java.io.Reader; +import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.ISOLatin1AccentFilter; import org.apache.lucene.analysis.LowerCaseFilter; import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.lucene.analysis.standard.StandardFilter; +import org.apache.lucene.analysis.standard.StandardTokenizer; /** * @author molaschi * @version $Id$ */ -public class ItalianSnowballAnalyzer extends StandardAnalyzer +public class ItalianSnowballAnalyzer extends Analyzer { @Override public TokenStream tokenStream(String fieldName, Reader reader) { - return new ISOLatin1AccentFilter(new LowerCaseFilter((super.tokenStream(fieldName, reader)))); + StandardTokenizer tokenStream = new StandardTokenizer(reader); + + TokenStream result = new StandardFilter(tokenStream); + result = new LowerCaseFilter(result); + result = new ISOLatin1AccentFilter(result); + return result; } + @Override + public TokenStream reusableTokenStream(String fieldName, Reader reader) throws IOException + { + SavedStreams streams = (SavedStreams) getPreviousTokenStream(); + if (streams == null) + { + streams = new SavedStreams(); + setPreviousTokenStream(streams); + streams.tokenStream = new StandardTokenizer(reader); + streams.filteredTokenStream = new StandardFilter(streams.tokenStream); + streams.filteredTokenStream = new LowerCaseFilter(streams.filteredTokenStream); + streams.filteredTokenStream = new ISOLatin1AccentFilter(streams.filteredTokenStream); + } + else + { + streams.tokenStream.reset(reader); + } + + return streams.filteredTokenStream; + } + + private static final class SavedStreams + { + + StandardTokenizer tokenStream; + + TokenStream filteredTokenStream; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-01-02 10:50:32
|
Revision: 3207 http://openutils.svn.sourceforge.net/openutils/?rev=3207&view=rev Author: fgiust Date: 2011-01-02 10:50:23 +0000 (Sun, 02 Jan 2011) Log Message: ----------- update project name according to new standards Modified Paths: -------------- trunk/openutils-mgnlcriteria/pom.xml trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIterator.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResult.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResultItem.java 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/DirectJcrQuery.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ExecutableQuery.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/JCRQueryException.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIterator.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIteratorImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BaseCriterion.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/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/InExpression.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/lucene/AclQueryDecorator.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclSearchIndex.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/JCRMagnoliaCriteriaQueryTranslator.java 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/AbstractCriteriaImpl.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ASCIIFoldingAnalyzer.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ASCIIFoldingFilter.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/BaseAnalyzer.java trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/Latin1Analyzer.java trunk/openutils-mgnlcriteria/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryDecoratorSupport.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathWithSpacesTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/Content2BeanTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/FirstDigitEscapeTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsCriteriaSearchTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/PaginationTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/ScoreAnalizerAndSortTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/XpathEscapeTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIteratorTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/ConjunctionTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclSearchIndexTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/MagnoliaCriteriaTest.java trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/CriteriaTestUtils.java Modified: trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- trunk/openutils-mgnlcriteria/pom.xml 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/pom.xml 2011-01-02 10:50:23 UTC (rev 3207) @@ -7,7 +7,7 @@ <version>1.7</version> </parent> <artifactId>openutils-mgnlcriteria</artifactId> - <name>Magnolia Criteria API</name> + <name>Criteria API for Magnolia CMS</name> <version>3.2.1-SNAPSHOT</version> <inceptionYear>2009</inceptionYear> <description>A Hibernate's Criteria-like API to programmatically generate JCR queries with Magnolia</description> Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIterator.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIterator.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIterator.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedCriteriaImpl.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResult.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResult.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResult.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResultItem.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResultItem.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResultItem.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/Criteria.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/DirectJcrQuery.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/DirectJcrQuery.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/DirectJcrQuery.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ExecutableQuery.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ExecutableQuery.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ExecutableQuery.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRQueryException.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIterator.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIterator.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIterator.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIteratorImpl.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIteratorImpl.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIteratorImpl.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/TranslatableCriteria.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BaseCriterion.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BaseCriterion.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BaseCriterion.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + package net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion; import java.text.SimpleDateFormat; Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/BetweenExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Conjunction.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Criterion.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Disjunction.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/InExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/InExpression.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/InExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNotNullExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/IsNullExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/JCRFunctionExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Junction.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LikeExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/LogicalExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/MatchMode.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/NotExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Order.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/Restrictions.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/criterion/SimpleExpression.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclQueryDecorator.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclQueryDecorator.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclQueryDecorator.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclSearchIndex.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclSearchIndex.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclSearchIndex.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/JCRMagnoliaCriteriaQueryTranslator.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/JCRMagnoliaCriteriaQueryTranslator.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/JCRMagnoliaCriteriaQueryTranslator.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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/XPathSelect.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/XPathSelect.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: 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/AbstractCriteriaImpl.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/utils/XPathTextUtils.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,7 +1,7 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) - * Copyright (C)2009 - 2010, Openmind S.r.l. http://www.openmindonline.it + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ASCIIFoldingAnalyzer.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ASCIIFoldingAnalyzer.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ASCIIFoldingAnalyzer.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + package net.sourceforge.openutils.mgnlcriteria.utils; import org.apache.lucene.analysis.LowerCaseFilter; Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ASCIIFoldingFilter.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ASCIIFoldingFilter.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ASCIIFoldingFilter.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/BaseAnalyzer.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/BaseAnalyzer.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/BaseAnalyzer.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/Latin1Analyzer.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/Latin1Analyzer.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/Latin1Analyzer.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryDecoratorSupport.java =================================================================== --- trunk/openutils-mgnlcriteria/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryDecoratorSupport.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryDecoratorSupport.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathWithSpacesTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathWithSpacesTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathWithSpacesTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/Content2BeanTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/Content2BeanTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/Content2BeanTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/FirstDigitEscapeTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/FirstDigitEscapeTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/FirstDigitEscapeTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsCriteriaSearchTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsCriteriaSearchTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsCriteriaSearchTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/PaginationTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/PaginationTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/PaginationTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/ScoreAnalizerAndSortTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/ScoreAnalizerAndSortTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/ScoreAnalizerAndSortTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/XpathEscapeTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/XpathEscapeTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/XpathEscapeTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIteratorTest.java =================================================================== --- trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIteratorTest.java 2011-01-02 10:47:12 UTC (rev 3206) +++ trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIteratorTest.java 2011-01-02 10:50:23 UTC (rev 3207) @@ -1,6 +1,6 @@ /** * - * Magnolia Criteria API (http://www.openmindlab.com/lab/products/mgnlcriteria.html) + * Criteria API for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcriteria.html) * Copyright(C) 2009-2010, Openmind S.r.l. http://www.openmindonline.it * * This program is free software: you can redistribute it and/or modify Modified: trunk/openut... [truncated message content] |