jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792142 [35/35] - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrab...
Date Wed, 08 Jul 2009 13:57:46 GMT
Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java Wed Jul  8 13:57:13 2009
@@ -39,7 +39,9 @@
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.Subscription;
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
+import org.apache.jackrabbit.spi.Event;
 import org.apache.jackrabbit.spi.commons.EventFilterImpl;
+import org.apache.jackrabbit.spi.commons.EventBundleImpl;
 import org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefinitionImpl;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
@@ -79,12 +81,21 @@
 import javax.jcr.ItemVisitor;
 import javax.jcr.ValueFactory;
 import javax.jcr.GuestCredentials;
+import javax.jcr.PropertyIterator;
 import javax.jcr.util.TraversingItemVisitor;
 import javax.jcr.observation.ObservationManager;
 import javax.jcr.observation.EventListener;
+import javax.jcr.observation.EventJournal;
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.QueryManager;
 import javax.jcr.query.Query;
+import javax.jcr.query.qom.Constraint;
+import javax.jcr.query.qom.And;
+import javax.jcr.query.qom.Or;
+import javax.jcr.query.qom.Not;
+import javax.jcr.query.qom.Comparison;
+import javax.jcr.query.qom.BindVariableValue;
+import javax.jcr.query.qom.QueryObjectModel;
 import javax.jcr.lock.LockException;
 import javax.jcr.lock.Lock;
 import javax.jcr.version.VersionException;
@@ -412,6 +423,27 @@
     /**
      * {@inheritDoc}
      */
+    public Iterator<PropertyId> getReferences(SessionInfo sessionInfo, NodeId nodeId, Name propertyName, boolean weakReferences) throws ItemNotFoundException, RepositoryException {
+        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
+        Node node = getNode(nodeId, sInfo);
+        String jcrName = (propertyName == null) ? null : sInfo.getNamePathResolver().getJCRName(propertyName);
+
+        List<PropertyId> ids = new ArrayList<PropertyId>();
+        PropertyIterator it;
+        if (weakReferences) {
+            it = node.getWeakReferences(jcrName);
+        } else {
+            it = node.getReferences(jcrName);
+        }
+        while (it.hasNext()) {
+            ids.add(idFactory.createPropertyId(it.nextProperty(), sInfo.getNamePathResolver()));
+        }
+        return ids.iterator();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public PropertyInfo getPropertyInfo(SessionInfo sessionInfo,
                                         PropertyId propertyId)
             throws ItemNotFoundException, RepositoryException {
@@ -791,8 +823,8 @@
         final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
         return (Iterator) executeWithLocalEvents(new Callable() {
             public Object run() throws RepositoryException {
-                Node n = getNode(nodeId, sInfo);
-                NodeIterator it = n.merge(srcWorkspaceName, bestEffort);
+                String nodePath = getNodePath(nodeId, sInfo);
+                NodeIterator it = getVersionManager(sInfo).merge(nodePath, srcWorkspaceName, bestEffort);
                 List ids = new ArrayList();
                 while (it.hasNext()) {
                     ids.add(idFactory.createNodeId(it.nextNode(),
@@ -815,8 +847,8 @@
         final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
         return (Iterator) executeWithLocalEvents(new Callable() {
             public Object run() throws RepositoryException {
-                VersionManager vMgr = sInfo.getSession().getWorkspace().getVersionManager();
-                NodeIterator it = vMgr.merge(getNodePath(nodeId, sInfo), srcWorkspaceName, bestEffort, isShallow);
+                String nodePath = getNodePath(nodeId, sInfo);
+                NodeIterator it = getVersionManager(sInfo).merge(nodePath, srcWorkspaceName, bestEffort, isShallow);
                 List ids = new ArrayList();
                 while (it.hasNext()) {
                     ids.add(idFactory.createNodeId(it.nextNode(),
@@ -924,6 +956,68 @@
     /**
      * {@inheritDoc}
      */
+    public NodeId createActivity(SessionInfo sessionInfo, final String title) throws UnsupportedRepositoryOperationException, RepositoryException {
+        final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
+        final VersionManager vMgr = getVersionManager(sInfo);
+        Node activity = (Node) executeWithLocalEvents(new Callable() {
+            public Object run() throws RepositoryException {
+                return vMgr.createActivity(title);
+            }
+        }, getSessionInfoImpl(sessionInfo));
+        return idFactory.createNodeId(activity, sInfo.getNamePathResolver());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void removeActivity(SessionInfo sessionInfo, final NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException {
+        final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
+        final VersionManager vMgr = getVersionManager(sInfo);
+        Node activity = (Node) executeWithLocalEvents(new Callable() {
+            public Object run() throws RepositoryException {
+                // TODO: uncomment as soon as removeActivity method is fixed in jsr 283
+                // return vMgr.removeActivity(getNode(activityId, sInfo));
+                throw new UnsupportedOperationException("Impl missing... waiting for updated jsr 283 jar.");
+            }
+        }, getSessionInfoImpl(sessionInfo));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Iterator mergeActivity(SessionInfo sessionInfo, final NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException {
+        final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
+        return (Iterator) executeWithLocalEvents(new Callable() {
+            public Object run() throws RepositoryException {
+                Node node = getNode(activityId, sInfo);
+                NodeIterator it = getVersionManager(sInfo).merge(node);
+                List ids = new ArrayList();
+                while (it.hasNext()) {
+                    ids.add(idFactory.createNodeId(it.nextNode(),
+                            sInfo.getNamePathResolver()));
+                }
+                return ids.iterator();
+            }
+        }, sInfo);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public NodeId createConfiguration(SessionInfo sessionInfo, final NodeId nodeId, final NodeId baselineId) throws UnsupportedRepositoryOperationException, RepositoryException {
+        final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
+        final VersionManager vMgr = getVersionManager(sInfo);
+        Node configuration = (Node) executeWithLocalEvents(new Callable() {
+            public Object run() throws RepositoryException {
+                return vMgr.createConfiguration(getNodePath(nodeId, sInfo), (Version) getNode(baselineId, sInfo));
+            }
+        }, getSessionInfoImpl(sessionInfo));
+        return idFactory.createNodeId(configuration, sInfo.getNamePathResolver());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public String[] getSupportedQueryLanguages(SessionInfo sessionInfo)
             throws RepositoryException {
         SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
@@ -933,26 +1027,36 @@
     /**
      * {@inheritDoc}
      */
-    public void checkQueryStatement(SessionInfo sessionInfo,
+    public String[] checkQueryStatement(SessionInfo sessionInfo,
                                     String statement,
                                     String language,
                                     Map namespaces)
             throws InvalidQueryException, RepositoryException {
-        createQuery(getSessionInfoImpl(sessionInfo).getSession(), statement,
-                language, namespaces);
+        Query q = createQuery(getSessionInfoImpl(sessionInfo).getSession(),
+                statement, language, namespaces);
+        return getBindVariableNames(q);
     }
 
     /**
      * {@inheritDoc}
      */
-    public QueryInfo executeQuery(SessionInfo sessionInfo,
-                                  String statement,
-                                  String language,
-                                  Map namespaces) throws RepositoryException {
+    public QueryInfo executeQuery(SessionInfo sessionInfo, String statement, String language, Map<String, String> namespaces, long limit, long offset, Map<String, QValue> values) throws RepositoryException {
         SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
         Query query = createQuery(sInfo.getSession(), statement,
                 language, namespaces);
-        return new QueryInfoImpl(query.execute(), idFactory,
+        if (limit != -1) {
+            query.setLimit(limit);
+        }
+        if (offset != -1) {
+            query.setOffset(offset);
+        }
+        if (values != null && !values.isEmpty()) {
+            for (Map.Entry<String, QValue> entry : values.entrySet()) {
+                Value value = ValueFormat.getJCRValue(entry.getValue(), sInfo.getNamePathResolver(), sInfo.getSession().getValueFactory());
+                query.bindValue(entry.getKey(), value);
+            }
+        }
+        return new QueryInfoImpl(query, query.execute(), idFactory,
                 sInfo.getNamePathResolver(), getQValueFactory());
     }
 
@@ -980,7 +1084,7 @@
     public Subscription createSubscription(SessionInfo sessionInfo,
                                            EventFilter[] filters)
             throws UnsupportedRepositoryOperationException, RepositoryException {
-        return getSessionInfoImpl(sessionInfo).createSubscription(idFactory, filters);
+        return getSessionInfoImpl(sessionInfo).createSubscription(idFactory, qValueFactory, filters);
     }
 
     /**
@@ -999,6 +1103,37 @@
     /**
      * {@inheritDoc}
      */
+    public EventBundle getEvents(SessionInfo sessionInfo,
+                                   EventFilter filter,
+                                   long after)
+            throws RepositoryException, UnsupportedRepositoryOperationException {
+        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
+        EventJournal journal = sInfo.getSession().getWorkspace().getObservationManager().getEventJournal();
+        if (journal == null) {
+            throw new UnsupportedRepositoryOperationException();
+        }
+        EventFactory factory = new EventFactory(sInfo.getSession(),
+                sInfo.getNamePathResolver(), idFactory, qValueFactory);
+        journal.skipTo(after);
+        List<Event> events = new ArrayList<Event>();
+        int batchSize = 1024;
+        boolean distinctDates = true;
+        long lastDate = Long.MIN_VALUE;
+        while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
+            Event e = factory.fromJCREvent(journal.nextEvent());
+            if (filter.accept(e, false)) {
+                distinctDates = lastDate != e.getDate();
+                lastDate = e.getDate();
+                events.add(e);
+                batchSize--;
+            }
+        }
+        return new EventBundleImpl(events, false);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void updateEventFilters(Subscription subscription,
                                    EventFilter[] filters)
             throws RepositoryException {
@@ -1376,6 +1511,16 @@
             });
         }
 
+        public void setPrimaryType(final NodeId nodeId, final Name primaryNodeTypeName) throws RepositoryException {
+            executeGuarded(new Callable() {
+                public Object run() throws RepositoryException {
+                    Node n = getNode(nodeId, sInfo);
+                    n.setPrimaryType(getJcrName(primaryNodeTypeName));
+                    return null;
+                }
+            });
+        }
+
         public void move(final NodeId srcNodeId,
                          final NodeId destParentNodeId,
                          final Name destName) throws RepositoryException {
@@ -1570,6 +1715,10 @@
         return n.getProperty(jcrPath);
     }
 
+    private VersionManager getVersionManager(SessionInfoImpl sessionInfo) throws RepositoryException {
+        return sessionInfo.getSession().getWorkspace().getVersionManager();
+    }
+
     private Query createQuery(Session session,
                               String statement,
                               String language,
@@ -1682,4 +1831,36 @@
         // if we get here simply run as is
         return call.run();
     }
+
+    private String[] getBindVariableNames(Query query) {
+        List<String> names = new ArrayList<String>();
+        if (query instanceof QueryObjectModel) {
+            QueryObjectModel qom = (QueryObjectModel) query;
+            collectBindVariableNames(qom.getConstraint(), names);
+        } else {
+            // TODO: use when available
+            // names.addAll(Arrays.asList(q.getBindVariableNames()));
+        }
+        return names.toArray(new String[names.size()]);
+    }
+
+    private void collectBindVariableNames(Constraint c, List<String> names) {
+        if (c instanceof And) {
+            collectBindVariableNames(((And) c).getConstraint1(), names);
+            collectBindVariableNames(((And) c).getConstraint2(), names);
+        } else if (c instanceof Or) {
+            collectBindVariableNames(((Or) c).getConstraint1(), names);
+            collectBindVariableNames(((Or) c).getConstraint2(), names);
+        } else if (c instanceof Not) {
+            collectBindVariableNames(((Not) c).getConstraint(), names);
+        } else if (c instanceof Comparison) {
+            collectBindVariableNames((Comparison) c, names);
+        }
+    }
+
+    private void collectBindVariableNames(Comparison c, List<String> names) {
+        if (c.getOperand2() instanceof BindVariableValue) {
+            names.add(((BindVariableValue) c.getOperand2()).getBindVariableName());
+        }
+    }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/SessionInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/SessionInfoImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/SessionInfoImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/SessionInfoImpl.java Wed Jul  8 13:57:13 2009
@@ -22,6 +22,7 @@
 import org.apache.jackrabbit.spi.Subscription;
 import org.apache.jackrabbit.spi.EventFilter;
 import org.apache.jackrabbit.spi.IdFactory;
+import org.apache.jackrabbit.spi.QValueFactory;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.conversion.ParsingNameResolver;
@@ -35,6 +36,8 @@
 import javax.jcr.Session;
 import javax.jcr.RepositoryException;
 import javax.jcr.Credentials;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.lock.LockException;
 import java.io.ObjectInputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ObjectOutputStream;
@@ -151,15 +154,16 @@
      * Creates a subscriptions for this session info.
      *
      * @param idFactory the id factory.
+     * @param qValueFactory
      * @param filters the initial list of filters.
      * @return a subscription.
      * @throws RepositoryException
      */
-    Subscription createSubscription(IdFactory idFactory, EventFilter[] filters)
+    Subscription createSubscription(IdFactory idFactory, QValueFactory qValueFactory, EventFilter[] filters)
             throws RepositoryException {
         synchronized (subscriptionChange) {
             List tmp = new ArrayList(subscriptions);
-            EventSubscription s = new EventSubscription(idFactory, this, filters);
+            EventSubscription s = new EventSubscription(idFactory, qValueFactory, this, filters);
             tmp.add(s);
             subscriptions = Collections.unmodifiableList(tmp);
             return s;
@@ -225,21 +229,25 @@
     /**
      * @inheritDoc
      */
-    public String[] getLockTokens() {
-        return session.getLockTokens();
+    public String[] getLockTokens() throws UnsupportedRepositoryOperationException, RepositoryException {
+        return session.getWorkspace().getLockManager().getLockTokens();
     }
 
     /**
      * @inheritDoc
      */
-    public void addLockToken(String lockToken) {
-        session.addLockToken(lockToken);
+    public void addLockToken(String lockToken) throws UnsupportedRepositoryOperationException, LockException, RepositoryException {
+        session.getWorkspace().getLockManager().addLockToken(lockToken);
     }
 
     /**
      * @inheritDoc
      */
-    public void removeLockToken(String lockToken) {
-        session.removeLockToken(lockToken);
+    public void removeLockToken(String lockToken) throws UnsupportedRepositoryOperationException, LockException, RepositoryException {
+        session.getWorkspace().getLockManager().removeLockToken(lockToken);
+    }
+
+    public void setUserData(String userData) throws RepositoryException {
+        session.getWorkspace().getObservationManager().setUserData(userData);
     }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/spi2jcr/ServiceStubImpl.java Wed Jul  8 13:57:13 2009
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.spi2jcr;
 
 import java.util.Properties;
+import java.util.Collections;
 
 import javax.jcr.Credentials;
 import javax.jcr.Repository;
@@ -25,7 +26,8 @@
 
 import org.apache.jackrabbit.spi.RepositoryService;
 import org.apache.jackrabbit.spi.RepositoryServiceStub;
-import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.RepositoryStubException;
+import org.apache.jackrabbit.test.RepositoryStub;
 
 /** <code>ServiceStubImpl</code>... */
 public class ServiceStubImpl extends RepositoryServiceStub {
@@ -45,7 +47,12 @@
 
     public RepositoryService getRepositoryService() throws RepositoryException {
         if (service == null) {
-            Repository repository = AbstractJCRTest.helper.getRepository();
+            Repository repository;
+            try {
+                repository = RepositoryStub.getInstance(Collections.EMPTY_MAP).getRepository();
+            } catch (RepositoryStubException e) {
+                throw new RepositoryException(e);
+            }
             service = new RepositoryServiceImpl(repository, new BatchReadConfig());
         }
         return service;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/java/org/apache/jackrabbit/test/TestAll.java Wed Jul  8 13:57:13 2009
@@ -18,25 +18,11 @@
 
 import junit.framework.TestCase;
 import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.apache.jackrabbit.test.JCRTestSuite;
 
 public class TestAll extends TestCase {
 
     public static Test suite() {
         return new JCRTestSuite();
     }
-
-    private static class JCRTestSuite extends TestSuite {
-
-        private JCRTestSuite() {
-            super("JCR API tests");
-            addTest(org.apache.jackrabbit.test.api.TestAll.suite());
-            addTest(org.apache.jackrabbit.test.api.query.TestAll.suite());
-            addTest(org.apache.jackrabbit.test.api.nodetype.TestAll.suite());
-            addTest(org.apache.jackrabbit.test.api.util.TestAll.suite());
-            addTest(org.apache.jackrabbit.test.api.lock.TestAll.suite());
-            addTest(org.apache.jackrabbit.test.api.version.TestAll.suite());
-            addTest(org.apache.jackrabbit.test.api.observation.TestAll.suite());
-        }
-    }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties Wed Jul  8 13:57:13 2009
@@ -22,6 +22,12 @@
 # Use this stub implementation for testing Jackrabbit-Core without intermediate SPI
 # javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.spi2jcr.DefaultRepositoryStub
 
+# the repository home
+org.apache.jackrabbit.repository.home=target/repository
+
+# the repository configuration
+org.apache.jackrabbit.repository.config=target/test-classes/repository.xml
+
 # alternative workspace used for update tests etc.
 org.apache.jackrabbit.jcr2spi.workspace2.name=test
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml Wed Jul  8 13:57:13 2009
@@ -33,43 +33,34 @@
     <relativePath>../jackrabbit-parent/pom.xml</relativePath>
   </parent>
   <artifactId>jackrabbit-standalone</artifactId>
+  <packaging>bundle</packaging>
   <name>Jackrabbit Standalone</name>
   <description>Runnable jar packaging of Apache Jackrabbit</description>
 
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-jar-plugin</artifactId>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
         <configuration>
-          <archive>
-            <manifest>
-              <mainClass>org.apache.jackrabbit.standalone.Main</mainClass>
-            </manifest>
-          </archive>
+          <instructions>
+            <Export-Package>
+              org.apache.jackrabbit.standalone
+            </Export-Package>
+            <Embed-Dependency>
+              *;inline=
+              *.txt|*.html|*.jsp|*.xml|*.jar|*.properties|
+              remoting/**|bootstrap/**|javax/**|repackage/**|images/**|
+              com/**|Resources/**|css/**|schema*/**|EDU/**|error/**|org/**|
+              META-INF/*.tld|META-INF/maven/**|META-INF/services/**|
+              WEB-INF/config.xml|WEB-INF/*.properties|WEB-INF/templates/**
+            </Embed-Dependency>
+            <Embed-Transitive>true</Embed-Transitive>
+            <Main-Class>org.apache.jackrabbit.standalone.Main</Main-Class>
+          </instructions>
         </configuration>
       </plugin>
-      <plugin>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>unpack-dependencies</id>
-            <phase>process-resources</phase>
-            <goals>
-              <goal>unpack-dependencies</goal>
-            </goals>
-            <configuration>
-              <outputDirectory>${project.build.directory}/classes</outputDirectory>
-              <excludes>
-                LICENSE*, NOTICE*, META-INF/LICENSE*, META-INF/NOTICE*,
-                license, license/**/*, test, test/**/*,
-                WEB-INF/web.xml, WEB-INF/log4j.*,
-                WEB-INF/lib, WEB-INF/lib/**/*,
-                WEB-INF/classes, WEB-INF/classes/**/*
-              </excludes>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
   </build>
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/pom.xml?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/pom.xml Wed Jul  8 13:57:13 2009
@@ -49,8 +49,8 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>rat-maven-plugin</artifactId>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
         <configuration>
           <excludes>
             <exclude>**/*.rtf</exclude>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/src/main/java/org/apache/jackrabbit/extractor/PlainTextExtractor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/src/main/java/org/apache/jackrabbit/extractor/PlainTextExtractor.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/src/main/java/org/apache/jackrabbit/extractor/PlainTextExtractor.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/src/main/java/org/apache/jackrabbit/extractor/PlainTextExtractor.java Wed Jul  8 13:57:13 2009
@@ -20,7 +20,6 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
-import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 
 import org.slf4j.Logger;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/src/main/java/org/apache/jackrabbit/extractor/RTFTextExtractor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/src/main/java/org/apache/jackrabbit/extractor/RTFTextExtractor.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/src/main/java/org/apache/jackrabbit/extractor/RTFTextExtractor.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-text-extractors/src/main/java/org/apache/jackrabbit/extractor/RTFTextExtractor.java Wed Jul  8 13:57:13 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.extractor;
 
-import javax.swing.text.BadLocationException;
 import javax.swing.text.DefaultStyledDocument;
 import javax.swing.text.rtf.RTFEditorKit;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml Wed Jul  8 13:57:13 2009
@@ -160,8 +160,8 @@
         </executions>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>rat-maven-plugin</artifactId>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
         <configuration>
           <excludes>
             <exclude>src/main/webapp/WEB-INF/log4j.dtd</exclude>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/DavResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/DavResource.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/DavResource.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/DavResource.java Wed Jul  8 13:57:13 2009
@@ -25,7 +25,6 @@
 import org.apache.jackrabbit.webdav.lock.Type;
 import org.apache.jackrabbit.webdav.property.DavProperty;
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
-import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
 import org.apache.jackrabbit.webdav.property.DavPropertySet;
 
 import java.io.IOException;
@@ -165,22 +164,6 @@
     public void removeProperty(DavPropertyName propertyName) throws DavException;
 
     /**
-     * Set/add the specified properties and remove the properties with the given
-     * names from this resource respectively.
-     *
-     * @param setProperties Set of properties to be added or modified
-     * @param removePropertyNames Set of property names to be removed
-     * @return multistatus response listing the status resulting from
-     * setting and/or removing the specified properties, in order to allow a
-     * detailed multistatus response.
-     * @throws DavException if an error occurred. This may be the case if the
-     * general state of the resource prevents any properties to be set or removed
-     * (e.g. due to a lock).
-     * @deprecated use {@link #alterProperties(List)} instead
-     */
-    public MultiStatusResponse alterProperties(DavPropertySet setProperties, DavPropertyNameSet removePropertyNames) throws DavException;
-
-    /**
      * Set/add and remove the specified properties from this resource.
      *
      * @param changeList list containing {@link DavPropertyName} objects (for

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/DavServletRequest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/DavServletRequest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/DavServletRequest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/DavServletRequest.java Wed Jul  8 13:57:13 2009
@@ -18,7 +18,6 @@
 
 import org.apache.jackrabbit.webdav.lock.LockInfo;
 import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
-import org.apache.jackrabbit.webdav.property.DavPropertySet;
 import org.apache.jackrabbit.webdav.property.DavProperty;
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.w3c.dom.Document;
@@ -153,43 +152,15 @@
     public DavPropertyNameSet getPropFindProperties() throws DavException;
 
     /**
-     * Return the set of properties the client wanted to modify / create with a
-     * PROPPATCH request, i.e. all entries in the &lt;propertyupdate&gt; element
-     * of the request body with name &lt;set&gt;.
+     * Return a {@link List} of property change operations. Each entry
+     * is either of type {@link DavPropertyName}, indicating a &lt;remove&gt;
+     * operation, or of type {@link DavProperty}, indicating a &lt;set&gt;
+     * operation. Note that ordering is significant here.
      *
-     * @return set of properties the client wanted to modify / create with a
-     * PROPPATCH request.
+     * @return {@link List} of property change operations
      * @throws DavException In case of invalid request body
-     * @deprecated use {@link #getPropPatchChangeList()} instead
      */
-    public DavPropertySet getPropPatchSetProperties() throws DavException;
-
-    /**
-     * Return the set of property names the client wanted to remove with a
-     * PROPPATCH request, i.e. all entries in the &lt;propertyupdate&gt; element
-     * of the request body with name &lt;remove&gt;.<br>
-     * Note, that in constrast to the &lt;set&gt; Xml element, all the XML
-     * elements in a prop XML element inside of a remove XML element must be
-     * empty, as only the names of properties to be removed are required. Therefore
-     * a <code>DavPropertyNameSet</code> is returned and not a <code>DavPropertySet</code>
-     *
-     * @return set of property names the client wanted to remove with a
-     * PROPPATCH request.
-     * @throws DavException In case of invalid request body
-     * @deprecated use {@link #getPropPatchChangeList()} instead
-     */
-    public DavPropertyNameSet getPropPatchRemoveProperties() throws DavException;
-
-     /**
-      * Return a {@link List} of property change operations. Each entry
-      * is either of type {@link DavPropertyName}, indicating a &lt;remove&gt;
-      * operation, or of type {@link DavProperty}, indicating a &lt;set&gt;
-      * operation. Note that ordering is significant here.
-      *
-      * @return {@link List} of property change operations
-      * @throws DavException In case of invalid request body
-      */
-     public List getPropPatchChangeList() throws DavException;
+    public List getPropPatchChangeList() throws DavException;
 
     /**
      * Return the parsed 'lockinfo' request body, the {@link DavConstants#HEADER_TIMEOUT

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavRequestImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavRequestImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavRequestImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavRequestImpl.java Wed Jul  8 13:57:13 2009
@@ -422,38 +422,6 @@
         }   
     }
 
-    /**
-     * Return the list of 'set' entries in the PROPPATCH request body. The list
-     * is empty if the request body could not be parsed or if the request body did
-     * not contain any 'set' elements.
-     *
-     * @return the list of 'set' entries in the PROPPATCH request body
-     * @see DavServletRequest#getPropPatchSetProperties()
-     * @deprecated use {@link #getPropPatchChangeList()} instead
-     */
-    public DavPropertySet getPropPatchSetProperties() throws DavException {
-        if (proppatchSet == null) {
-            parsePropPatchRequest();
-        }
-        return proppatchSet;
-    }
-
-    /**
-     * Return the list of 'remove' entries in the PROPPATCH request body. The list
-     * is empty if the request body could not be parsed or if the request body did
-     * not contain any 'remove' elements.
-     *
-     * @return the list of 'remove' entries in the PROPPATCH request body
-     * @see DavServletRequest#getPropPatchRemoveProperties()
-     * @deprecated use {@link #getPropPatchChangeList()} instead
-     */
-    public DavPropertyNameSet getPropPatchRemoveProperties() throws DavException {
-        if (proppatchRemove == null) {
-            parsePropPatchRequest();
-        }
-        return proppatchRemove;
-    }
-
      /**
       * Return a {@link List} of property change operations. Each entry
       * is either of type {@link DavPropertyName}, indicating a &lt;remove&gt;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Scope.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Scope.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Scope.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Scope.java Wed Jul  8 13:57:13 2009
@@ -106,7 +106,7 @@
      * @return Scope object.
      */
     public static Scope create(String localName, Namespace namespace) {
-        String key = DomUtil.getQualifiedName(localName, namespace);
+        String key = DomUtil.getExpandedName(localName, namespace);
         if (scopes.containsKey(key)) {
             return (Scope) scopes.get(key);
         } else {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Type.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Type.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Type.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/lock/Type.java Wed Jul  8 13:57:13 2009
@@ -104,7 +104,7 @@
      * @return <code>Type</code> object.
      */
     public static Type create(String localName, Namespace namespace) {
-        String key = DomUtil.getQualifiedName(localName, namespace);
+        String key = DomUtil.getExpandedName(localName, namespace);
         if (types.containsKey(key)) {
             return (Type) types.get(key);
         } else {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/DefaultEventType.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/DefaultEventType.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/DefaultEventType.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/DefaultEventType.java Wed Jul  8 13:57:13 2009
@@ -64,7 +64,7 @@
         if (localName == null || "".equals(localName)) {
             throw new IllegalArgumentException("null and '' are not valid local names of an event type.");
         }
-        String key = DomUtil.getQualifiedName(localName, namespace);
+        String key = DomUtil.getExpandedName(localName, namespace);
         if (eventTypes.containsKey(key)) {
             return (EventType) eventTypes.get(key);
         } else {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java Wed Jul  8 13:57:13 2009
@@ -69,7 +69,11 @@
     public static final String XML_EVENT_TRANSACTION_ID = "transactionid";
     public static final String XML_EVENT = "event";
     public static final String XML_EVENTUSERID = "eventuserid";
-
+    public static final String XML_EVENTUSERDATA = "eventuserdata";
+    public static final String XML_EVENTDATE = "eventdate";
+    public static final String XML_EVENTIDENTIFIER = "eventidentifier";
+    public static final String XML_EVENTINFO = "eventinfo";
+    
     //---< Property Names >-----------------------------------------------------
     /**
      * The protected subscription discovery property is used to find out about

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/DavPropertyName.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/DavPropertyName.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/DavPropertyName.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/DavPropertyName.java Wed Jul  8 13:57:13 2009
@@ -184,7 +184,7 @@
      * @return a human readable string representation
      */
     public String toString() {
-        return DomUtil.getQualifiedName(name, namespace);
+        return DomUtil.getExpandedName(name, namespace);
     }
 
     /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/HrefProperty.java Wed Jul  8 13:57:13 2009
@@ -154,11 +154,11 @@
     }
 
     /**
-     * Return an array of String containing the text of those DAV:href elements
+     * Return an list of String containing the text of those DAV:href elements
      * that would be returned as child elements of this property on
      * {@link org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document)}
      *
-     * @return array of href String
+     * @return list of href String
      */
     public List getHrefs() {
         return (value != null) ? Arrays.asList(value) : new ArrayList();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/ResourceType.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/ResourceType.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/ResourceType.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/property/ResourceType.java Wed Jul  8 13:57:13 2009
@@ -182,7 +182,7 @@
         private TypeName(String localName, Namespace namespace) {
             this.localName = localName;
             this.namespace = namespace;
-            hashCode = DomUtil.getQualifiedName(localName, namespace).hashCode();
+            hashCode = DomUtil.getExpandedName(localName, namespace).hashCode();
         }
 
         public int hashCode() {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/search/QueryGrammerSet.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/search/QueryGrammerSet.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/search/QueryGrammerSet.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/search/QueryGrammerSet.java Wed Jul  8 13:57:13 2009
@@ -115,7 +115,7 @@
         Grammer(String localName, Namespace namespace) {
             this.localName = localName;
             this.namespace = namespace;
-            hashCode = DomUtil.getQualifiedName(localName, namespace).hashCode();
+            hashCode = DomUtil.getExpandedName(localName, namespace).hashCode();
         }
 
         public int hashCode() {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/search/SearchInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/search/SearchInfo.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/search/SearchInfo.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/search/SearchInfo.java Wed Jul  8 13:57:13 2009
@@ -62,6 +62,13 @@
 
     private static Logger log = LoggerFactory.getLogger(SearchInfo.class);
 
+    public static final long NRESULTS_UNDEFINED = -1;
+    public static final long OFFSET_UNDEFINED = -1;
+
+    private static final String LIMIT = "limit";
+    private static final String NRESULTS = "nresults";
+    private static final String OFFSET = "offset";
+
     /**
      * Set of namespace uri String which are ignored in the search request.
      */
@@ -80,6 +87,9 @@
     private final String query;
     private final Map namespaces;
 
+    private long nresults = NRESULTS_UNDEFINED;
+    private long offset = OFFSET_UNDEFINED;
+
     /**
      * Create a new <code>SearchInfo</code> instance.
      *
@@ -143,6 +153,42 @@
     }
 
     /**
+     * Returns the maximal number of search results that should be returned.
+     *
+     * @return the maximal number of search results that should be returned.
+     */
+    public long getNumberResults() {
+        return nresults;
+    }
+
+    /**
+     * Sets the maximal number of search results that should be returned.
+     *
+     * @param nresults The maximal number of search results
+     */
+    public void setNumberResults(long nresults) {
+        this.nresults = nresults;
+    }
+
+    /**
+     * Returns the desired offset in the total result set.
+     *
+     * @return the desired offset in the total result set.
+     */
+    public long getOffset() {
+        return offset;
+    }
+
+    /**
+     * Sets the desired offset in the total result set.
+     *
+     * @param offset The desired offset in the total result set.
+     */
+    public void setOffset(long offset) {
+        this.offset = offset;
+    }
+
+    /**
      * Return the xml representation of this <code>SearchInfo</code> instance.
      *
      * @return xml representation
@@ -156,6 +202,16 @@
             DomUtil.setNamespaceAttribute(sRequestElem, prefix, uri);
         }
         DomUtil.addChildElement(sRequestElem, language, languageNamespace, query);
+        if (nresults != NRESULTS_UNDEFINED|| offset != OFFSET_UNDEFINED) {
+            Element limitE = DomUtil.addChildElement(sRequestElem, LIMIT, NAMESPACE);
+            if (nresults != NRESULTS_UNDEFINED) {
+                DomUtil.addChildElement(limitE, NRESULTS, NAMESPACE, nresults + "");
+            }
+            if (offset != OFFSET_UNDEFINED) {
+                // TODO define reasonable namespace...
+                DomUtil.addChildElement(limitE, OFFSET, Namespace.EMPTY_NAMESPACE, offset + "");
+            }
+        }
         return sRequestElem;
     }
 
@@ -182,11 +238,35 @@
                 namespaces.put(nsAttributes[i].getLocalName(), nsAttributes[i].getValue());
             }
         }
+        SearchInfo sInfo;
         if (first != null) {
-            return new SearchInfo(first.getLocalName(), DomUtil.getNamespace(first), DomUtil.getText(first), namespaces);
+            sInfo = new SearchInfo(first.getLocalName(), DomUtil.getNamespace(first), DomUtil.getText(first), namespaces);
         } else {
             log.warn("A single child element is expected with the 'DAV:searchrequest'.");
             throw new DavException(DavServletResponse.SC_BAD_REQUEST);
         }
+
+        Element limit = DomUtil.getChildElement(searchRequest, LIMIT, NAMESPACE);
+        if (limit != null) {
+            // try to get the value DAV:nresults element
+            String nresults = DomUtil.getChildTextTrim(limit, NRESULTS, NAMESPACE);
+            if (nresults != null) {
+                try {
+                    sInfo.setNumberResults(Long.valueOf(nresults));
+                } catch (NumberFormatException e) {
+                    log.error("DAV:nresults cannot be parsed into a long -> ignore.");
+                }
+            }
+            // try of an offset is defined within the DAV:limit element.
+            String offset = DomUtil.getChildTextTrim(limit, OFFSET, Namespace.EMPTY_NAMESPACE);
+            if (offset != null) {
+                try {
+                    sInfo.setOffset(Long.valueOf(offset));
+                } catch (NumberFormatException e) {
+                    log.error("'offset' cannot be parsed into a long -> ignore.");
+                }
+            }
+        }
+        return sInfo;
     }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/OptionsResponse.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/OptionsResponse.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/OptionsResponse.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/OptionsResponse.java Wed Jul  8 13:57:13 2009
@@ -68,7 +68,7 @@
      */
     public void addEntry(String localName, Namespace namespace, String[] hrefs) {
         Entry entry = new Entry(localName, namespace, hrefs);
-        entries.put(DomUtil.getQualifiedName(localName, namespace), entry);
+        entries.put(DomUtil.getExpandedName(localName, namespace), entry);
     }
 
     /**
@@ -78,7 +78,7 @@
      * @return
      */
     public String[] getHrefs(String localName, Namespace namespace) {
-        String key = DomUtil.getQualifiedName(localName, namespace);
+        String key = DomUtil.getExpandedName(localName, namespace);
         if (entries.containsKey(key)) {
             return ((Entry)entries.get(key)).hrefs;
         } else {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ReportInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ReportInfo.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ReportInfo.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ReportInfo.java Wed Jul  8 13:57:13 2009
@@ -137,7 +137,7 @@
      * @return Name of the report type
      */
     public String getReportName() {
-        return DomUtil.getQualifiedName(typeLocalName, typeNamespace);
+        return DomUtil.getExpandedName(typeLocalName, typeNamespace);
     }
 
     /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ReportType.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ReportType.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ReportType.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ReportType.java Wed Jul  8 13:57:13 2009
@@ -147,7 +147,7 @@
         if (localName == null || namespace == null || reportClass == null) {
             throw new IllegalArgumentException("A ReportType cannot be registered with a null name, namespace or report class");
         }
-        String key = DomUtil.getQualifiedName(localName, namespace);
+        String key = DomUtil.getExpandedName(localName, namespace);
         if (types.containsKey(key)) {
             return (ReportType) types.get(key);
         } else {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java Wed Jul  8 13:57:13 2009
@@ -592,17 +592,38 @@
     }
 
     /**
-     * Return a qualified name of a DOM node consisting of "{" + namespace uri + "}"
+     * Same as {@link #getExpandedName(String, Namespace)}.
+     *
+     * @param localName
+     * @param namespace
+     * @return the expanded name of a DOM node consisting of "{" + namespace uri + "}"
      * + localName. If the specified namespace is <code>null</code> or represents
      * the empty namespace, the local name is returned.
+     * @deprecated As of 2.0. Please use {@link #getExpandedName(String, Namespace)}
+     * instead. This method was named according to usage of 'qualified name' in
+     * JSR 170 that conflicts with the terminology used in XMLNS. As of JCR 2.0
+     * the String consisting of <code>"{" + namespace uri + "}" + localName</code>
+     * is called <code>Expanded Name</code>.
+     *
+     */
+    public static String getQualifiedName(String localName, Namespace namespace) {
+        return getExpandedName(localName, namespace);
+    }
+
+    /**
+     * Returns a string representation of the name of a DOM node consisting
+     * of "{" + namespace uri + "}" + localName. If the specified namespace is
+     * <code>null</code> or represents the empty namespace, the local name is
+     * returned.
      *
      * @param localName
      * @param namespace
-     * @return the qualified name of a DOM node consisting of "{" + namespace uri + "}"
+     * @return String representation of the name of a DOM node consisting of "{" + namespace uri + "}"
      * + localName. If the specified namespace is <code>null</code> or represents
      * the empty namespace, the local name is returned.
+     * @since 2.0 Replaces the deprecated method {@link #getQualifiedName(String, Namespace)}.
      */
-    public static String getQualifiedName(String localName, Namespace namespace) {
+    public static String getExpandedName(String localName, Namespace namespace) {
         if (namespace == null || namespace.equals(Namespace.EMPTY_NAMESPACE)) {
             return localName;
         }
@@ -613,7 +634,7 @@
     }
 
     /**
-     * Return the prefixed name of a DOM node consisting of
+     * Return the qualified name of a DOM node consisting of
      * namespace prefix + ":" + local name. If the specified namespace is <code>null</code>
      * or contains an empty prefix, the local name is returned.<br>
      * NOTE, that this is the value to be used for the 'qualified Name' parameter

Modified: jackrabbit/sandbox/JCR-1456/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/pom.xml?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/pom.xml Wed Jul  8 13:57:13 2009
@@ -54,6 +54,7 @@
     <module>jackrabbit-jcr2spi</module>
     <module>jackrabbit-spi2jcr</module>
     <module>jackrabbit-spi2dav</module>
+    <module>jackrabbit-jcr-client</module>
     <module>jackrabbit-standalone</module>
   </modules>
 



Mime
View raw message