From: <fg...@us...> - 2013-05-18 16:07:22
|
Revision: 4222 http://openutils.svn.sourceforge.net/openutils/?rev=4222&view=rev Author: fgiust Date: 2013-05-18 16:07:19 +0000 (Sat, 18 May 2013) Log Message: ----------- removing magnolia 4.5 deprecated APIs and add compatibility with the Node interface + ContentMap Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcriteria/pom.xml magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIterator.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/AdvancedResultItem.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/DirectJcrQuery.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/JCRCriteriaFactory.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/ResultIteratorImpl.java magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/xpath/impl/AbstractCriteriaImpl.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/BasePathWithSpacesTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/Content2BeanTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/FirstDigitEscapeTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsCriteriaSearchTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/JcrContainsQuestionMarkTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/OrderingTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/PaginationTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/ScoreAnalizerAndSortTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/XpathEscapeTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIteratorTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/CorrectElementsWithoutMaxResults.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/CriteriaTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/jcr/query/lucene/AclSearchIndexTest.java magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/net/sourceforge/openutils/mgnlcriteria/tests/CriteriaTestUtils.java Added Paths: ----------- magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/utils/ToBeanUtils.java Removed Paths: ------------- magnoliamodules/trunk/openutils-mgnlcriteria/src/test/java/it/ Modified: magnoliamodules/trunk/openutils-mgnlcriteria/pom.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcriteria/pom.xml 2013-04-05 20:56:05 UTC (rev 4221) +++ magnoliamodules/trunk/openutils-mgnlcriteria/pom.xml 2013-05-18 16:07:19 UTC (rev 4222) @@ -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> @@ -167,6 +168,12 @@ <scope>test</scope> </dependency> <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnltests</artifactId> + <version>5.0.0</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> Modified: magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIterator.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIterator.java 2013-04-05 20:56:05 UTC (rev 4221) +++ magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AccessibleResultItemResultIterator.java 2013-05-18 16:07:19 UTC (rev 4222) @@ -19,11 +19,13 @@ package net.sourceforge.openutils.mgnlcriteria.advanced.impl; -import info.magnolia.cms.core.HierarchyManager; import info.magnolia.cms.security.PermissionUtil; +import info.magnolia.jcr.RuntimeRepositoryException; +import info.magnolia.jcr.util.NodeUtil; import java.util.NoSuchElementException; +import javax.jcr.RepositoryException; import javax.jcr.Session; import javax.jcr.query.RowIterator; @@ -53,9 +55,9 @@ /** * */ - public AccessibleResultItemResultIterator(RowIterator rowIterator, HierarchyManager hm) + public AccessibleResultItemResultIterator(RowIterator rowIterator) { - super(rowIterator, hm); + super(rowIterator); } /** @@ -78,10 +80,20 @@ do { next = super.next(); - if (!PermissionUtil.isGranted(hm.getWorkspace().getName(), next.getHandle(), Session.ACTION_READ)) + try { - next = null; + if (!PermissionUtil.isGranted( + next.getSession().getWorkspace().getName(), + NodeUtil.getPathIfPossible(next.getJCRNode()), + Session.ACTION_READ)) + { + next = null; + } } + catch (RepositoryException e) + { + throw new RuntimeRepositoryException(e); + } } while (next == null && super.hasNext()); // return true if a next result exists and it is accessible Modified: magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java 2013-04-05 20:56:05 UTC (rev 4221) +++ magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultImpl.java 2013-05-18 16:07:19 UTC (rev 4222) @@ -19,9 +19,9 @@ package net.sourceforge.openutils.mgnlcriteria.advanced.impl; -import info.magnolia.cms.core.HierarchyManager; import info.magnolia.content2bean.Content2BeanException; import info.magnolia.content2bean.Content2BeanUtil; +import info.magnolia.jcr.RuntimeRepositoryException; import javax.jcr.Item; import javax.jcr.RepositoryException; @@ -37,6 +37,7 @@ import net.sourceforge.openutils.mgnlcriteria.jcr.query.ResultIterator; import net.sourceforge.openutils.mgnlcriteria.jcr.query.ResultIteratorImpl; import net.sourceforge.openutils.mgnlcriteria.utils.JcrCompatUtils; +import net.sourceforge.openutils.mgnlcriteria.utils.ToBeanUtils; import org.apache.jackrabbit.core.query.lucene.QueryResultImpl; import org.slf4j.Logger; @@ -58,15 +59,10 @@ private final String statement; - private HierarchyManager hm; - private String spellCheckerSuggestion; private final Query spellCheckerQuery; - /** - * Logger. - */ private Logger log = LoggerFactory.getLogger(AdvancedResultImpl.class); private final boolean applyLocalPaging; @@ -86,10 +82,9 @@ int itemsPerPage, int pageNumberStartingFromOne, String statement, - HierarchyManager hm, Query spellCheckerQuery) { - this(jcrQueryResult, itemsPerPage, pageNumberStartingFromOne, statement, hm, spellCheckerQuery, false); + this(jcrQueryResult, itemsPerPage, pageNumberStartingFromOne, statement, spellCheckerQuery, false); } /** @@ -106,19 +101,10 @@ int itemsPerPage, int pageNumberStartingFromOne, String statement, - HierarchyManager hm, Query spellCheckerQuery, boolean applyLocalPaging) { - this( - jcrQueryResult, - itemsPerPage, - pageNumberStartingFromOne, - statement, - hm, - spellCheckerQuery, - applyLocalPaging, - 0); + this(jcrQueryResult, itemsPerPage, pageNumberStartingFromOne, statement, spellCheckerQuery, applyLocalPaging, 0); } /** @@ -136,7 +122,6 @@ int itemsPerPage, int pageNumberStartingFromOne, String statement, - HierarchyManager hm, Query spellCheckerQuery, boolean applyLocalPaging, int offset) @@ -144,7 +129,6 @@ this.jcrQueryResult = jcrQueryResult; this.itemsPerPage = itemsPerPage; this.statement = statement; - this.hm = hm; this.spellCheckerQuery = spellCheckerQuery; this.pageNumberStartingFromOne = pageNumberStartingFromOne; this.applyLocalPaging = applyLocalPaging; @@ -223,7 +207,7 @@ rows.skip(offset); // removing folllowing records and alter getSize() - return new AccessibleResultItemResultIterator(rows, this.hm) + return new AccessibleResultItemResultIterator(rows) { /** @@ -246,7 +230,7 @@ }; } - return new AccessibleResultItemResultIterator(rows, this.hm); + return new AccessibleResultItemResultIterator(rows); } /** @@ -327,7 +311,7 @@ rows.skip(offset); // removing folllowing records and alter getSize() - return new ResultIteratorImpl<K>(rows, this.hm) + return new ResultIteratorImpl<K>(rows) { /** @@ -360,24 +344,17 @@ return null; } - return (K) Content2BeanUtil.toBean( - new AdvancedResultItemImpl(row, jcrNode, this.hm), - true, - theclass); + return (K) ToBeanUtils.toBean(new AdvancedResultItemImpl(row, jcrNode), true, theclass); } catch (RepositoryException e) { - throw new RuntimeException(e); + throw new RuntimeRepositoryException(e); } - catch (Content2BeanException e) - { - throw new RuntimeException(e); - } } }; } - return new ResultIteratorImpl<K>(rows, hm) + return new ResultIteratorImpl<K>(rows) { @SuppressWarnings("unchecked") @@ -392,19 +369,12 @@ return null; } - return (K) Content2BeanUtil.toBean( - new AdvancedResultItemImpl(row, jcrNode, this.hm), - true, - theclass); + return (K) ToBeanUtils.toBean(new AdvancedResultItemImpl(row, jcrNode), true, theclass); } catch (RepositoryException e) { - throw new RuntimeException(e); + throw new RuntimeRepositoryException(e); } - catch (Content2BeanException e) - { - throw new RuntimeException(e); - } } }; } Modified: magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java 2013-04-05 20:56:05 UTC (rev 4221) +++ magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemImpl.java 2013-05-18 16:07:19 UTC (rev 4222) @@ -19,17 +19,47 @@ package net.sourceforge.openutils.mgnlcriteria.advanced.impl; -import info.magnolia.cms.core.HierarchyManager; import info.magnolia.cms.security.AccessDeniedException; +import info.magnolia.jcr.RuntimeRepositoryException; +import info.magnolia.jcr.util.ContentMap; +import info.magnolia.jcr.wrapper.I18nNodeWrapper; +import java.io.InputStream; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.util.Calendar; +import javax.jcr.Binary; +import javax.jcr.InvalidItemStateException; +import javax.jcr.InvalidLifecycleTransitionException; import javax.jcr.Item; +import javax.jcr.ItemExistsException; +import javax.jcr.ItemNotFoundException; +import javax.jcr.ItemVisitor; +import javax.jcr.MergeException; +import javax.jcr.NoSuchWorkspaceException; import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.PathNotFoundException; +import javax.jcr.Property; +import javax.jcr.PropertyIterator; +import javax.jcr.ReferentialIntegrityException; import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.UnsupportedRepositoryOperationException; import javax.jcr.Value; +import javax.jcr.ValueFormatException; +import javax.jcr.lock.Lock; +import javax.jcr.lock.LockException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.nodetype.NoSuchNodeTypeException; +import javax.jcr.nodetype.NodeDefinition; +import javax.jcr.nodetype.NodeType; import javax.jcr.query.Row; +import javax.jcr.version.ActivityViolationException; +import javax.jcr.version.Version; +import javax.jcr.version.VersionException; +import javax.jcr.version.VersionHistory; import net.sourceforge.openutils.mgnlcriteria.jcr.query.AdvancedResultItem; @@ -42,11 +72,13 @@ * @author fgiust * @version $Id$ */ -public class AdvancedResultItemImpl extends MappedDefaultContent implements AdvancedResultItem +public class AdvancedResultItemImpl extends ContentMap implements AdvancedResultItem { private final Row row; + private final Node node; + /** * Logger. */ @@ -62,11 +94,10 @@ * @throws IllegalStateException * @throws IllegalArgumentException */ - public AdvancedResultItemImpl(Row row, Item item, HierarchyManager hierarchyManager) - throws RepositoryException, - AccessDeniedException + public AdvancedResultItemImpl(Row row, Item item) throws RepositoryException, AccessDeniedException { - super((Node) item, hierarchyManager); + super(new I18nNodeWrapper((Node) item)); + this.node = new I18nNodeWrapper((Node) item); this.row = row; } @@ -143,53 +174,1231 @@ */ public double getScore(String selector) { - - Method jcrRowGetScore = null; + if (selector == null) + { + try + { + return row.getScore(); + } + catch (RepositoryException e) + { + log.warn("unable to extract score from {}", row); + } + } try { - jcrRowGetScore = row.getClass().getDeclaredMethod("getScore", new Class[]{String.class }); - jcrRowGetScore.setAccessible(true); + return row.getScore(selector); } - catch (SecurityException e) + catch (RepositoryException e) { + log.warn("unable to extract score from {} using selector {}", row, selector); } - catch (NoSuchMethodException e) + + return 0; + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Item#getPath() + */ + public String getPath() throws RepositoryException + { + return node.getPath(); + } + + /** + * @ * @see javax.jcr.Item#getName() + */ + public String getName() + { + try { + return node.getName(); } + catch (RepositoryException e) + { + throw new RuntimeRepositoryException(e); + } + } - if (jcrRowGetScore != null) + /** + * @param depth + * @return + * @throws ItemNotFoundException + * @throws AccessDeniedException + * @throws RepositoryException + * @see javax.jcr.Item#getAncestor(int) + */ + public Item getAncestor(int depth) throws ItemNotFoundException, javax.jcr.AccessDeniedException, + RepositoryException + { + return node.getAncestor(depth); + } + + /** + * @param relPath + * @return + * @throws ItemExistsException + * @throws PathNotFoundException + * @throws VersionException + * @throws ConstraintViolationException + * @throws LockException + * @throws RepositoryException + * @see javax.jcr.Node#addNode(java.lang.String) + */ + public Node addNode(String relPath) throws ItemExistsException, PathNotFoundException, VersionException, + ConstraintViolationException, LockException, RepositoryException + { + return node.addNode(relPath); + } + + /** + * @return + * @throws ItemNotFoundException + * @throws AccessDeniedException + * @throws RepositoryException + * @see javax.jcr.Item#getParent() + */ + public Node getParent() throws ItemNotFoundException, javax.jcr.AccessDeniedException, RepositoryException + { + return node.getParent(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Item#getDepth() + */ + public int getDepth() throws RepositoryException + { + return node.getDepth(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Item#getSession() + */ + public Session getSession() throws RepositoryException + { + return node.getSession(); + } + + /** + * @return + * @see javax.jcr.Item#isNode() + */ + public boolean isNode() + { + return node.isNode(); + } + + /** + * @return + * @see javax.jcr.Item#isNew() + */ + public boolean isNew() + { + return node.isNew(); + } + + /** + * @return + * @see javax.jcr.Item#isModified() + */ + public boolean isModified() + { + return node.isModified(); + } + + /** + * @param otherItem + * @return + * @throws RepositoryException + * @see javax.jcr.Item#isSame(javax.jcr.Item) + */ + public boolean isSame(Item otherItem) throws RepositoryException + { + return node.isSame(otherItem); + } + + /** + * @param relPath + * @param primaryNodeTypeName + * @return + * @throws ItemExistsException + * @throws PathNotFoundException + * @throws NoSuchNodeTypeException + * @throws LockException + * @throws VersionException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#addNode(java.lang.String, java.lang.String) + */ + public Node addNode(String relPath, String primaryNodeTypeName) throws ItemExistsException, PathNotFoundException, + NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException + { + return node.addNode(relPath, primaryNodeTypeName); + } + + /** + * @param visitor + * @throws RepositoryException + * @see javax.jcr.Item#accept(javax.jcr.ItemVisitor) + */ + public void accept(ItemVisitor visitor) throws RepositoryException + { + node.accept(visitor); + } + + /** + * @throws AccessDeniedException + * @throws ItemExistsException + * @throws ConstraintViolationException + * @throws InvalidItemStateException + * @throws ReferentialIntegrityException + * @throws VersionException + * @throws LockException + * @throws NoSuchNodeTypeException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Item#save() + */ + @Deprecated + public void save() throws javax.jcr.AccessDeniedException, ItemExistsException, ConstraintViolationException, + InvalidItemStateException, ReferentialIntegrityException, VersionException, LockException, + NoSuchNodeTypeException, RepositoryException + { + node.save(); + } + + /** + * @param srcChildRelPath + * @param destChildRelPath + * @throws UnsupportedRepositoryOperationException + * @throws VersionException + * @throws ConstraintViolationException + * @throws ItemNotFoundException + * @throws LockException + * @throws RepositoryException + * @see javax.jcr.Node#orderBefore(java.lang.String, java.lang.String) + */ + public void orderBefore(String srcChildRelPath, String destChildRelPath) + throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, + ItemNotFoundException, LockException, RepositoryException + { + node.orderBefore(srcChildRelPath, destChildRelPath); + } + + /** + * @param keepChanges + * @throws InvalidItemStateException + * @throws RepositoryException + * @see javax.jcr.Item#refresh(boolean) + */ + public void refresh(boolean keepChanges) throws InvalidItemStateException, RepositoryException + { + node.refresh(keepChanges); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Value) + */ + public Property setProperty(String name, Value value) throws ValueFormatException, VersionException, LockException, + ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws AccessDeniedException + * @throws RepositoryException + * @see javax.jcr.Item#remove() + */ + public void remove() throws VersionException, LockException, ConstraintViolationException, + javax.jcr.AccessDeniedException, RepositoryException + { + node.remove(); + } + + /** + * @param name + * @param value + * @param type + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Value, int) + */ + public Property setProperty(String name, Value value, int type) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value, type); + } + + /** + * @param name + * @param values + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Value[]) + */ + public Property setProperty(String name, Value[] values) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, values); + } + + /** + * @param name + * @param values + * @param type + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Value[], int) + */ + public Property setProperty(String name, Value[] values, int type) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, values, type); + } + + /** + * @param name + * @param values + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, java.lang.String[]) + */ + public Property setProperty(String name, String[] values) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, values); + } + + /** + * @param name + * @param values + * @param type + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, java.lang.String[], int) + */ + public Property setProperty(String name, String[] values, int type) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, values, type); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, java.lang.String) + */ + public Property setProperty(String name, String value) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param name + * @param value + * @param type + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, java.lang.String, int) + */ + public Property setProperty(String name, String value, int type) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value, type); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#setProperty(java.lang.String, java.io.InputStream) + */ + @Deprecated + public Property setProperty(String name, InputStream value) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Binary) + */ + public Property setProperty(String name, Binary value) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, boolean) + */ + public Property setProperty(String name, boolean value) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, double) + */ + public Property setProperty(String name, double value) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, java.math.BigDecimal) + */ + public Property setProperty(String name, BigDecimal value) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, long) + */ + public Property setProperty(String name, long value) throws ValueFormatException, VersionException, LockException, + ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, java.util.Calendar) + */ + public Property setProperty(String name, Calendar value) throws ValueFormatException, VersionException, + LockException, ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param name + * @param value + * @return + * @throws ValueFormatException + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Node) + */ + public Property setProperty(String name, Node value) throws ValueFormatException, VersionException, LockException, + ConstraintViolationException, RepositoryException + { + return node.setProperty(name, value); + } + + /** + * @param relPath + * @return + * @throws PathNotFoundException + * @throws RepositoryException + * @see javax.jcr.Node#getNode(java.lang.String) + */ + public Node getNode(String relPath) throws PathNotFoundException, RepositoryException + { + return node.getNode(relPath); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getNodes() + */ + public NodeIterator getNodes() throws RepositoryException + { + return node.getNodes(); + } + + /** + * @param namePattern + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getNodes(java.lang.String) + */ + public NodeIterator getNodes(String namePattern) throws RepositoryException + { + return node.getNodes(namePattern); + } + + /** + * @param nameGlobs + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getNodes(java.lang.String[]) + */ + public NodeIterator getNodes(String[] nameGlobs) throws RepositoryException + { + return node.getNodes(nameGlobs); + } + + /** + * @param relPath + * @return + * @throws PathNotFoundException + * @throws RepositoryException + * @see javax.jcr.Node#getProperty(java.lang.String) + */ + public Property getProperty(String relPath) throws PathNotFoundException, RepositoryException + { + return node.getProperty(relPath); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getProperties() + */ + public PropertyIterator getProperties() throws RepositoryException + { + return node.getProperties(); + } + + /** + * @param namePattern + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getProperties(java.lang.String) + */ + public PropertyIterator getProperties(String namePattern) throws RepositoryException + { + return node.getProperties(namePattern); + } + + /** + * @param nameGlobs + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getProperties(java.lang.String[]) + */ + public PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException + { + return node.getProperties(nameGlobs); + } + + /** + * @return + * @throws ItemNotFoundException + * @throws RepositoryException + * @see javax.jcr.Node#getPrimaryItem() + */ + public Item getPrimaryItem() throws ItemNotFoundException, RepositoryException + { + return node.getPrimaryItem(); + } + + /** + * @return + * @throws UnsupportedRepositoryOperationException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#getUUID() + */ + @Deprecated + public String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException + { + return node.getUUID(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getIdentifier() + */ + public String getIdentifier() throws RepositoryException + { + return node.getIdentifier(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getIndex() + */ + public int getIndex() throws RepositoryException + { + return node.getIndex(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getReferences() + */ + public PropertyIterator getReferences() throws RepositoryException + { + return node.getReferences(); + } + + /** + * @param name + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getReferences(java.lang.String) + */ + public PropertyIterator getReferences(String name) throws RepositoryException + { + return node.getReferences(name); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getWeakReferences() + */ + public PropertyIterator getWeakReferences() throws RepositoryException + { + return node.getWeakReferences(); + } + + /** + * @param name + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getWeakReferences(java.lang.String) + */ + public PropertyIterator getWeakReferences(String name) throws RepositoryException + { + return node.getWeakReferences(name); + } + + /** + * @param relPath + * @return + * @throws RepositoryException + * @see javax.jcr.Node#hasNode(java.lang.String) + */ + public boolean hasNode(String relPath) throws RepositoryException + { + return node.hasNode(relPath); + } + + /** + * @param relPath + * @return + * @throws RepositoryException + * @see javax.jcr.Node#hasProperty(java.lang.String) + */ + public boolean hasProperty(String relPath) throws RepositoryException + { + return node.hasProperty(relPath); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#hasNodes() + */ + public boolean hasNodes() throws RepositoryException + { + return node.hasNodes(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#hasProperties() + */ + public boolean hasProperties() throws RepositoryException + { + return node.hasProperties(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getPrimaryNodeType() + */ + public NodeType getPrimaryNodeType() throws RepositoryException + { + return node.getPrimaryNodeType(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getMixinNodeTypes() + */ + public NodeType[] getMixinNodeTypes() throws RepositoryException + { + return node.getMixinNodeTypes(); + } + + /** + * @param nodeTypeName + * @return + * @throws RepositoryException + * @see javax.jcr.Node#isNodeType(java.lang.String) + */ + public boolean isNodeType(String nodeTypeName) throws RepositoryException + { + return node.isNodeType(nodeTypeName); + } + + /** + * @param nodeTypeName + * @throws NoSuchNodeTypeException + * @throws VersionException + * @throws ConstraintViolationException + * @throws LockException + * @throws RepositoryException + * @see javax.jcr.Node#setPrimaryType(java.lang.String) + */ + public void setPrimaryType(String nodeTypeName) throws NoSuchNodeTypeException, VersionException, + ConstraintViolationException, LockException, RepositoryException + { + node.setPrimaryType(nodeTypeName); + } + + /** + * @param mixinName + * @throws NoSuchNodeTypeException + * @throws VersionException + * @throws ConstraintViolationException + * @throws LockException + * @throws RepositoryException + * @see javax.jcr.Node#addMixin(java.lang.String) + */ + public void addMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, + ConstraintViolationException, LockException, RepositoryException + { + node.addMixin(mixinName); + } + + /** + * @param mixinName + * @throws NoSuchNodeTypeException + * @throws VersionException + * @throws ConstraintViolationException + * @throws LockException + * @throws RepositoryException + * @see javax.jcr.Node#removeMixin(java.lang.String) + */ + public void removeMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, + ConstraintViolationException, LockException, RepositoryException + { + node.removeMixin(mixinName); + } + + /** + * @param mixinName + * @return + * @throws NoSuchNodeTypeException + * @throws RepositoryException + * @see javax.jcr.Node#canAddMixin(java.lang.String) + */ + public boolean canAddMixin(String mixinName) throws NoSuchNodeTypeException, RepositoryException + { + return node.canAddMixin(mixinName); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getDefinition() + */ + public NodeDefinition getDefinition() throws RepositoryException + { + return node.getDefinition(); + } + + /** + * @return + * @throws VersionException + * @throws UnsupportedRepositoryOperationException + * @throws InvalidItemStateException + * @throws LockException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#checkin() + */ + @Deprecated + public Version checkin() throws VersionException, UnsupportedRepositoryOperationException, + InvalidItemStateException, LockException, RepositoryException + { + return node.checkin(); + } + + /** + * @throws UnsupportedRepositoryOperationException + * @throws LockException + * @throws ActivityViolationException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#checkout() + */ + @Deprecated + public void checkout() throws UnsupportedRepositoryOperationException, LockException, ActivityViolationException, + RepositoryException + { + node.checkout(); + } + + /** + * @param version + * @throws VersionException + * @throws InvalidItemStateException + * @throws UnsupportedRepositoryOperationException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#doneMerge(javax.jcr.version.Version) + */ + @Deprecated + public void doneMerge(Version version) throws VersionException, InvalidItemStateException, + UnsupportedRepositoryOperationException, RepositoryException + { + node.doneMerge(version); + } + + /** + * @param version + * @throws VersionException + * @throws InvalidItemStateException + * @throws UnsupportedRepositoryOperationException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#cancelMerge(javax.jcr.version.Version) + */ + @Deprecated + public void cancelMerge(Version version) throws VersionException, InvalidItemStateException, + UnsupportedRepositoryOperationException, RepositoryException + { + node.cancelMerge(version); + } + + /** + * @param srcWorkspace + * @throws NoSuchWorkspaceException + * @throws AccessDeniedException + * @throws LockException + * @throws InvalidItemStateException + * @throws RepositoryException + * @see javax.jcr.Node#update(java.lang.String) + */ + public void update(String srcWorkspace) throws NoSuchWorkspaceException, javax.jcr.AccessDeniedException, + LockException, InvalidItemStateException, RepositoryException + { + node.update(srcWorkspace); + } + + /** + * @param srcWorkspace + * @param bestEffort + * @return + * @throws NoSuchWorkspaceException + * @throws AccessDeniedException + * @throws MergeException + * @throws LockException + * @throws InvalidItemStateException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#merge(java.lang.String, boolean) + */ + @Deprecated + public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws NoSuchWorkspaceException, + javax.jcr.AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException + { + return node.merge(srcWorkspace, bestEffort); + } + + /** + * @param workspaceName + * @return + * @throws ItemNotFoundException + * @throws NoSuchWorkspaceException + * @throws AccessDeniedException + * @throws RepositoryException + * @see javax.jcr.Node#getCorrespondingNodePath(java.lang.String) + */ + public String getCorrespondingNodePath(String workspaceName) throws ItemNotFoundException, + NoSuchWorkspaceException, javax.jcr.AccessDeniedException, RepositoryException + { + return node.getCorrespondingNodePath(workspaceName); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#getSharedSet() + */ + public NodeIterator getSharedSet() throws RepositoryException + { + return node.getSharedSet(); + } + + /** + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#removeSharedSet() + */ + public void removeSharedSet() throws VersionException, LockException, ConstraintViolationException, + RepositoryException + { + node.removeSharedSet(); + } + + /** + * @throws VersionException + * @throws LockException + * @throws ConstraintViolationException + * @throws RepositoryException + * @see javax.jcr.Node#removeShare() + */ + public void removeShare() throws VersionException, LockException, ConstraintViolationException, RepositoryException + { + node.removeShare(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#isCheckedOut() + */ + public boolean isCheckedOut() throws RepositoryException + { + return node.isCheckedOut(); + } + + /** + * @param versionName + * @param removeExisting + * @throws VersionException + * @throws ItemExistsException + * @throws UnsupportedRepositoryOperationException + * @throws LockException + * @throws InvalidItemStateException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#restore(java.lang.String, boolean) + */ + @Deprecated + public void restore(String versionName, boolean removeExisting) throws VersionException, ItemExistsException, + UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException + { + node.restore(versionName, removeExisting); + } + + /** + * @param version + * @param removeExisting + * @throws VersionException + * @throws ItemExistsException + * @throws InvalidItemStateException + * @throws UnsupportedRepositoryOperationException + * @throws LockException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#restore(javax.jcr.version.Version, boolean) + */ + @Deprecated + public void restore(Version version, boolean removeExisting) throws VersionException, ItemExistsException, + InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException + { + node.restore(version, removeExisting); + } + + /** + * @param version + * @param relPath + * @param removeExisting + * @throws PathNotFoundException + * @throws ItemExistsException + * @throws VersionException + * @throws ConstraintViolationException + * @throws UnsupportedRepositoryOperationException + * @throws LockException + * @throws InvalidItemStateException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#restore(javax.jcr.version.Version, java.lang.String, boolean) + */ + @Deprecated + public void restore(Version version, String relPath, boolean removeExisting) throws PathNotFoundException, + ItemExistsException, VersionException, ConstraintViolationException, UnsupportedRepositoryOperationException, + LockException, InvalidItemStateException, RepositoryException + { + node.restore(version, relPath, removeExisting); + } + + /** + * @param versionLabel + * @param removeExisting + * @throws VersionException + * @throws ItemExistsException + * @throws UnsupportedRepositoryOperationException + * @throws LockException + * @throws InvalidItemStateException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#restoreByLabel(java.lang.String, boolean) + */ + @Deprecated + public void restoreByLabel(String versionLabel, boolean removeExisting) throws VersionException, + ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, + RepositoryException + { + node.restoreByLabel(versionLabel, removeExisting); + } + + /** + * @return + * @throws UnsupportedRepositoryOperationException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#getVersionHistory() + */ + @Deprecated + public VersionHistory getVersionHistory() throws UnsupportedRepositoryOperationException, RepositoryException + { + return node.getVersionHistory(); + } + + /** + * @return + * @throws UnsupportedRepositoryOperationException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#getBaseVersion() + */ + @Deprecated + public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException + { + return node.getBaseVersion(); + } + + /** + * @param isDeep + * @param isSessionScoped + * @return + * @throws UnsupportedRepositoryOperationException + * @throws LockException + * @throws AccessDeniedException + * @throws InvalidItemStateException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#lock(boolean, boolean) + */ + @Deprecated + public Lock lock(boolean isDeep, boolean isSessionScoped) throws UnsupportedRepositoryOperationException, + LockException, javax.jcr.AccessDeniedException, InvalidItemStateException, RepositoryException + { + return node.lock(isDeep, isSessionScoped); + } + + /** + * @return + * @throws UnsupportedRepositoryOperationException + * @throws LockException + * @throws AccessDeniedException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#getLock() + */ + @Deprecated + public Lock getLock() throws UnsupportedRepositoryOperationException, LockException, + javax.jcr.AccessDeniedException, RepositoryException + { + return node.getLock(); + } + + /** + * @throws UnsupportedRepositoryOperationException + * @throws LockException + * @throws AccessDeniedException + * @throws InvalidItemStateException + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#unlock() + */ + @Deprecated + public void unlock() throws UnsupportedRepositoryOperationException, LockException, + javax.jcr.AccessDeniedException, InvalidItemStateException, RepositoryException + { + node.unlock(); + } + + /** + * @return + * @throws RepositoryException + * @deprecated + * @see javax.jcr.Node#holdsLock() + */ + @Deprecated + public boolean holdsLock() throws RepositoryException + { + return node.holdsLock(); + } + + /** + * @return + * @throws RepositoryException + * @see javax.jcr.Node#isLocked() + */ + public boolean isLocked() throws RepositoryException + { + return node.isLocked(); + } + + /** + * @param transition + * @throws UnsupportedRepositoryOperationException + * @throws InvalidLifecycleTransitionException + * @throws RepositoryException + * @see javax.jcr.Node#followLifecycleTransition(java.lang.String) + */ + public void followLifecycleTransition(String transition) throws UnsupportedRepositoryOperationException, + InvalidLifecycleTransitionException, RepositoryException + { + node.followLifecycleTransition(transition); + } + + /** + * @return + * @throws UnsupportedRepositoryOperationException + * @throws RepositoryException + * @see javax.jcr.Node#getAllowedLifecycleTransistions() + */ + public String[] getAllowedLifecycleTransistions() throws UnsupportedRepositoryOperationException, + RepositoryException + { + return node.getAllowedLifecycleTransistions(); + } + + public String getTitle() + { + try { - try + if (node.hasProperty("title")) { - if (selector == null) - { - return (Double) PropertyUtils.getSimpleProperty(row, "score"); - } - return (Double) jcrRowGetScore.invoke(row, new Object[]{selector }); + return node.getProperty("title").getString(); } - 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.getTargetException()); - } - catch (NoSuchMethodException e) - { - log.warn("Error getting score for " + this.getHandle(), e); - } } - else + catch (RepositoryException e) { - log - .error("Unsupported version of jackrabbit detected, you need at least 1.6.x or a jcr 2.0 compliant version"); + throw new RuntimeRepositoryException(e); } - return 0; + + return null; } + public String getHandle() + { + try + { + return node.getPath(); + } + catch (RepositoryException e) + { + throw new RuntimeRepositoryException(e); + } + } + } Modified: magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java 2013-04-05 20:56:05 UTC (rev 4221) +++ magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/AdvancedResultItemResultIterator.java 2013-05-18 16:07:19 UTC (rev 4222) @@ -19,7 +19,6 @@ package net.sourceforge.openutils.mgnlcriteria.advanced.impl; -import info.magnolia.cms.core.HierarchyManager; import info.magnolia.cms.security.AccessDeniedException; import javax.jcr.Item; @@ -44,9 +43,9 @@ * @param rowIterator * @param hm */ - public AdvancedResultItemResultIterator(RowIterator rowIterator, HierarchyManager hm) + public AdvancedResultItemResultIterator(RowIterator rowIterator) { - super(rowIterator, hm); + super(rowIterator); } /** @@ -63,7 +62,7 @@ return null; } - return new AdvancedResultItemImpl(row, jcrNode, this.hm); + return new AdvancedResultItemImpl(row, jcrNode); } catch (AccessDeniedException e) { Modified: magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java 2013-04-05 20:56:05 UTC (rev 4221) +++ magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/MappedDefaultContent.java 2013-05-18 16:07:19 UTC (rev 4222) @@ -21,7 +21,6 @@ import info.magnolia.cms.beans.runtime.FileProperties; import info.magnolia.cms.core.DefaultContent; -import info.magnolia.cms.core.HierarchyManager; import info.magnolia.cms.core.NodeData; import info.magnolia.cms.security.AccessDeniedException; import info.magnolia.cms.util.NodeDataUtil; @@ -50,6 +49,7 @@ * @author fgiust * @version $Id$ */ +@SuppressWarnings("deprecation") public class MappedDefaultContent extends DefaultContent implements Map<String, Object> { @@ -64,7 +64,7 @@ * @throws RepositoryException * @throws AccessDeniedException */ - public MappedDefaultContent(Node elem, HierarchyManager hierarchyManager) + public MappedDefaultContent(Node elem) throws RepositoryException, AccessDeniedException { Modified: magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java 2013-04-05 20:56:05 UTC (rev 4221) +++ magnoliamodules/trunk/openutils-mgnlcriteria/src/main/java/net/sourceforge/openutils/mgnlcriteria/advanced/impl/QueryExecutorHelper.java 2013-05-18 16:07:19 UTC (rev 4222) @@ -19,8 +19,6 @@ 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; @@ -69,34 +67,33 @@ * Executes a jcr query. * @param stmt the statement of the jcr query * @param language the language of the jcr query - * @param hm the HirarchyManager for obtaining the QueryManager + * @param jcrSession the Session * @param maxResults maximun number of results to retrieve * @param offset the index of the first result to retrieve (0, 1, 2, ...) * @param spellCheckString the input string used for spell checking * @return the execution result */ - public static AdvancedResultImpl execute(String stmt, String language, HierarchyManager hm, int maxResults, + public static AdvancedResultImpl execute(String stmt, String language, Session jcrSession, int maxResults, int offset, String spellCheckString) { - return execute(stmt, language, hm, maxResults, offset, spellCheckString, false); + return execute(stmt, language, jcrSession, maxResults, offset, spellCheckString, false); } /** * Executes a jcr query. * @param stmt the statement of the jcr query * @param language the language of the jcr query - * @param hm the HirarchyManager for obtaining the QueryManager + * @param jcrSession the Session * @param maxResults maximun number of results to retrieve * @param offset the index of the first result to retrieve (0, 1, 2, ...) * @param spellCheckString the input string used for spell checking * @param forcePagingWithDocumentOrder see {@link Criteria#setForcePagingWithDocumentOrder(boolean)} * @return the execution result */ - public static AdvancedResultImpl execute(String stmt, String language, HierarchyManager hm, int maxResults, + @SuppressWarnings("deprecation") + public static AdvancedResultImpl execute(String stmt, String lan... [truncated message content] |