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. |
From: <fg...@us...> - 2009-02-28 20:37:00
|
Revision: 1066 http://openutils.svn.sourceforge.net/openutils/?rev=1066&view=rev Author: fgrilli Date: 2009-02-28 20:36:57 +0000 (Sat, 28 Feb 2009) Log Message: ----------- improved javadoc 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:23:13 UTC (rev 1065) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2009-02-28 20:36:57 UTC (rev 1066) @@ -53,10 +53,11 @@ * 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 + * 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)} - * @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} @@ -74,10 +75,11 @@ * 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 + * 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)} - * @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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-03-01 11:44:20
|
Revision: 1067 http://openutils.svn.sourceforge.net/openutils/?rev=1067&view=rev Author: fgrilli Date: 2009-03-01 11:44:17 +0000 (Sun, 01 Mar 2009) Log Message: ----------- fixed small typo 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:36:57 UTC (rev 1066) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2009-03-01 11:44:17 UTC (rev 1067) @@ -49,7 +49,7 @@ /** * 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 + * 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> @@ -71,7 +71,7 @@ /** * 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 + * 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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-06-06 12:53:19
|
Revision: 1239 http://openutils.svn.sourceforge.net/openutils/?rev=1239&view=rev Author: fgrilli Date: 2009-06-06 12:15:46 +0000 (Sat, 06 Jun 2009) Log Message: ----------- javadoc: added warning about objects returned by this factory not being thread-safe 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-06-05 13:24:45 UTC (rev 1238) +++ trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java 2009-06-06 12:15:46 UTC (rev 1239) @@ -34,7 +34,9 @@ } /** - * A factory for Magnolia CMS specific Criteria implementation + * 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 @@ -48,18 +50,20 @@ } /** - * A factory for Magnolia CMS specific Criteria implementation + * 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 classType Class<?> - the list method of this implementation must return instances of this type + * @param clazz Class<?> - the list method of this implementation must return instances of this type * @return a factory for Magnolia CMS specific Criteria implementation */ public static Criteria createMgnlCriteria(String path, info.magnolia.cms.core.search.QueryManager queryManager, - String itemType, Class< ? > classType) + String itemType, Class< ? > clazz) { - return new MagnoliaCriteriaImpl(path, queryManager, itemType, classType); + return new MagnoliaCriteriaImpl(path, queryManager, itemType, clazz); } /** @@ -70,7 +74,9 @@ * {@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)} + * {@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 @@ -91,28 +97,19 @@ * {@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)} + * {@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 classType Class<?> - the list method of this implementation must return instances of this type + * @param clazz Class<?> - the list method of this implementation must return instances of this type * @return a factory for Magnolia CMS specific Criteria implementation */ public static Criteria createMgnlCriteriaWithLimit(String path, - info.magnolia.cms.core.search.QueryManager queryManager, String itemType, Class< ? > classType) + info.magnolia.cms.core.search.QueryManager queryManager, String itemType, Class< ? > clazz) { - return new MagnoliaCriteriaWithLimitImpl(path, queryManager, itemType, classType); + return new MagnoliaCriteriaWithLimitImpl(path, queryManager, itemType, clazz); } - - /* - * @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(); } - */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |