From: <fg...@us...> - 2009-02-28 20:23:23
|
Revision: 1065 http://openutils.svn.sourceforge.net/openutils/?rev=1065&view=rev Author: fgrilli Date: 2009-02-28 20:23:13 +0000 (Sat, 28 Feb 2009) Log Message: ----------- made constructor private. Added factory methods for getting MagnoliaCriteriaWithLimitImpl. Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 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 2009-02-28 20:20:59 UTC (rev 1064) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2009-02-28 20:23:13 UTC (rev 1065) @@ -12,14 +12,18 @@ public class JCRCriteriaFactory { + private 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 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) @@ -29,13 +33,13 @@ /** * 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 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) @@ -44,6 +48,49 @@ } /** + * 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 these methods are 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)} + * @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 MagnoliaCriteriaWithLimitImpl + */ + public static Criteria createMgnlCriteriaWithLimit(String path, + info.magnolia.cms.core.search.QueryManager queryManager, String itemType) + { + 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 these methods are 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)} + * @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 MagnoliaCriteriaWithLimitImpl + */ + public static Criteria createMgnlCriteriaWithLimit(String path, + info.magnolia.cms.core.search.QueryManager queryManager, String itemType, Class< ? > classType) + { + return new MagnoliaCriteriaWithLimitImpl(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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |