Ate Douma pushed to branch feature/translations-psp1 at cms / hippo-repository


Commits:
58d20c26 by Unico Hommes at 2015-12-21T10:39:50+00:00
REPO-1408 bump project pom
- - - - -
4cd8d261 by Tobias Jeger at 2016-01-06T08:23:50+00:00
REPO-1244: Make xpath and sql query field a text area for better UX.
- - - - -
a70069da by Tobias Jeger at 2016-01-06T08:33:04+00:00
REPO-1413: Add favicon to repository servlet.
- - - - -
f75c5bc9 by Tobias Jeger at 2016-01-06T08:35:37+00:00
REPO-1413: Update copyright year.
- - - - -
54169e7d by Arent-Jan Banck at 2016-01-08T14:28:45+00:00
CMS-9856: Update copyright year to 2016
- - - - -
eb9443aa by Ate Douma at 2016-01-11T13:35:46+00:00
REPO-1417: Expose 'lastModifiedBy' property in DocumentVariant
- - - - -
5b0b511a by Ate Douma at 2016-01-15T15:46:24+00:00
REPO-1412: Improve MockPropertyDefinition regarding some unsupported getter 
methods
- - - - -
9d1b3dd4 by Tobias Jeger at 2016-01-25T11:44:53+00:00
REPO-1422: Update hippo:version to cause reload of hippostdpubwf CND to keep 
CND up to date.
- - - - -
985a3149 by Arent-Jan Banck at 2016-01-26T12:47:17+00:00
CMS-9899: prepare branch hippo-repository-3.2.x
- - - - -
348730d8 by Arent-Jan Banck at 2016-01-26T12:47:23+00:00
CMS-9899: prepare for next development iteration
- - - - -
a6673c85 by Ate Douma at 2016-01-27T13:36:01+00:00
CMS-9905: Update and align project pom parent and other dependency version 
references across all product projects
- - - - -
b3de05d5 by Ard Schrijvers at 2016-02-10T23:11:55+01:00
REPO-1429 support newly added nodetypes can be found by already logged in 
session

The SearchAfterNodeTypeChangeTest is a test that failed without the fix in this 
issue. The fix is that there is a global counter that keeps track of everytime 
a nodetype change is found. After a nodetype change, the authorisation query 
will be recreated (and thus 'nodetype expansion' in the query will also include 
the new nodetype). Note I had to add a hippoecm-extension.xml to the test jar 
to add user 'editor' to the group 'editor' and likewise for 'author'. Namely 
the users do exist, but they are in 'config module' not added to the groups. 
Since we should not add them by default (apparently), I have added them by 
default in the test setup only. All tests still pass (at least for repo but I 
expect downstream projects as well)

- - - - -
5f0aaef6 by Ate Douma at 2016-02-11T00:20:54+01:00
Merge branch 'bugfix/REPO-1429'

- - - - -
063b2bbe by Ate Douma at 2016-02-14T00:04:52+01:00
REPO-1281 merge changes from master

- - - - -


36 changed files:

- NOTICE
- api/pom.xml
- builtin/pom.xml
- config/pom.xml
- connector/pom.xml
- dependencies/pom.xml
- deprecated/facetsearch/pom.xml
- deprecated/facetselectmirror/pom.xml
- deprecated/pom.xml
- engine/pom.xml
- engine/src/main/java/org/hippoecm/repository/LocalHippoRepository.java
- engine/src/main/java/org/hippoecm/repository/jackrabbit/SessionImplHelper.java
- + 
engine/src/main/java/org/hippoecm/repository/nodetypes/NodeTypesChangeTracker.java
- jaxrs/pom.xml
- modules/pom.xml
- pom.xml
- provider/pom.xml
- resources/pom.xml
- scripts/pom.xml
- servlets/pom.xml
- servlets/src/main/resources/org/hippoecm/repository/RepositoryServlet-html.ftl
- test/pom.xml
- + 
test/src/test/java/org/onehippo/repository/search/SearchAfterNodeTypeChangeTest.java
- testcontent/pom.xml
- testutils/pom.xml
- testutils/src/main/java/org/onehippo/repository/mock/MockItem.java
- testutils/src/main/java/org/onehippo/repository/mock/MockItemDefinition.java
- testutils/src/main/java/org/onehippo/repository/mock/MockProperty.java
- 
testutils/src/main/java/org/onehippo/repository/mock/MockPropertyDefinition.java
- + testutils/src/main/resources/hippoecm-extension.xml
- + 
testutils/src/test/java/org/onehippo/repository/mock/MockPropertyDefinitionTest.java
- upgrade/pom.xml
- utilities/pom.xml
- workflow/pom.xml
- 
workflow/src/main/java/org/onehippo/repository/documentworkflow/DocumentVariant.java
- workflow/src/main/resources/hippoecm-extension.xml


Changes:

=====================================
NOTICE
=====================================
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Hippo Repository
-Copyright 2007-2015 Hippo B.V. (http://www.onehippo.com)
+Copyright 2007-2016 Hippo B.V. (http://www.onehippo.com)
 
 This product includes software developed by:
 Hippo B.V., Amsterdam, The Netherlands (http://www.onehippo.com/);


=====================================
api/pom.xml
=====================================
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository API</name>


=====================================
builtin/pom.xml
=====================================
--- a/builtin/pom.xml
+++ b/builtin/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Builtin workflow</name>


=====================================
config/pom.xml
=====================================
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Default Configuration</name>


=====================================
connector/pom.xml
=====================================
--- a/connector/pom.xml
+++ b/connector/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Connector</name>


=====================================
dependencies/pom.xml
=====================================
--- a/dependencies/pom.xml
+++ b/dependencies/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Dependencies</name>


=====================================
deprecated/facetsearch/pom.xml
=====================================
--- a/deprecated/facetsearch/pom.xml
+++ b/deprecated/facetsearch/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository-deprecated</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Deprecated Facetsearch</name>


=====================================
deprecated/facetselectmirror/pom.xml
=====================================
--- a/deprecated/facetselectmirror/pom.xml
+++ b/deprecated/facetselectmirror/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository-deprecated</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Deprecated Facetselect Mirror</name>


=====================================
deprecated/pom.xml
=====================================
--- a/deprecated/pom.xml
+++ b/deprecated/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Deprecated</name>


=====================================
engine/pom.xml
=====================================
--- a/engine/pom.xml
+++ b/engine/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Engine</name>


=====================================
engine/src/main/java/org/hippoecm/repository/LocalHippoRepository.java
=====================================
--- a/engine/src/main/java/org/hippoecm/repository/LocalHippoRepository.java
+++ b/engine/src/main/java/org/hippoecm/repository/LocalHippoRepository.java
@@ -1,12 +1,12 @@
 /*
- *  Copyright 2008-2013 Hippo B.V. (http://www.onehippo.com)
- * 
+ *  Copyright 2008-2016 Hippo B.V. (http://www.onehippo.com)
+ *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
- * 
+ *
  *       http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,12 +34,12 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.fs.FileSystemException;
+import org.hippoecm.repository.nodetypes.NodeTypesChangeTracker;
 import org.onehippo.repository.bootstrap.InitializationProcessor;
 import org.onehippo.repository.bootstrap.PostStartupTask;
 import org.hippoecm.repository.api.ReferenceWorkspace;
@@ -90,6 +90,8 @@ public class LocalHippoRepository extends HippoRepositoryImpl 
{
 
     private ModuleManager moduleManager;
 
+    private NodeTypesChangeTracker nodeTypesChangeTracker;
+
     protected LocalHippoRepository() {
         super();
     }
@@ -181,7 +183,7 @@ public class LocalHippoRepository extends 
HippoRepositoryImpl {
             repoPath = getWorkingDirectory();
         }
         else if (new File(path).isAbsolute() || basePath == null) {
-                repoPath = path;
+            repoPath = path;
         }
         else {
             repoPath = basePath + System.getProperty("file.separator") + path;
@@ -295,6 +297,9 @@ public class LocalHippoRepository extends 
HippoRepositoryImpl {
             moduleManager = new ModuleManager(rootSession.impersonate(new 
SimpleCredentials("system", new char[]{})));
             moduleManager.start();
 
+            nodeTypesChangeTracker = new 
NodeTypesChangeTracker(rootSession.impersonate(new SimpleCredentials("system", 
new char[]{})));
+            nodeTypesChangeTracker.start();
+
             log.debug("Executing post-startup tasks");
             for (PostStartupTask task : postStartupTasks) {
                 task.execute();
@@ -420,6 +425,10 @@ public class LocalHippoRepository extends 
HippoRepositoryImpl {
             moduleManager.stop();
             moduleManager = null;
         }
+        if (nodeTypesChangeTracker != null) {
+            nodeTypesChangeTracker.stop();
+            nodeTypesChangeTracker = null;
+        }
         if (jackrabbitRepository != null) {
             try {
                 jackrabbitRepository.shutdown();


=====================================
engine/src/main/java/org/hippoecm/repository/jackrabbit/SessionImplHelper.java
=====================================
--- 
a/engine/src/main/java/org/hippoecm/repository/jackrabbit/SessionImplHelper.java
+++ 
b/engine/src/main/java/org/hippoecm/repository/jackrabbit/SessionImplHelper.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2008-2015 Hippo B.V. (http://www.onehippo.com)
+ *  Copyright 2008-2016 Hippo B.V. (http://www.onehippo.com)
  * 
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -70,6 +70,7 @@ import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.commons.conversion.IllegalNameException;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.util.XMLChar;
+import org.hippoecm.repository.nodetypes.NodeTypesChangeTracker;
 import org.hippoecm.repository.dataprovider.HippoNodeId;
 import org.hippoecm.repository.dataprovider.MirrorNodeId;
 import org.hippoecm.repository.decorating.NodeDecorator;
@@ -107,6 +108,7 @@ abstract class SessionImplHelper {
      */
     private final Map<String, String> namespaces = new HashMap<String, 
String>();
     private AuthorizationQuery authorizationQuery;
+    private int nodeTypesChangeCounter = -1;
 
     /**
      * Clears the local namespace mappings. Subclasses that for example
@@ -298,17 +300,6 @@ abstract class SessionImplHelper {
      * @throws RepositoryException
      */
     void init() throws RepositoryException {
-        final RepositoryImpl repository = (RepositoryImpl) 
context.getRepository();
-        HippoQueryHandler queryHandler = 
repository.getHippoQueryHandler(session.getWorkspace().getName());
-        if (queryHandler != null) {
-            this.authorizationQuery = new 
AuthorizationQuery(context.getSessionImpl().getSubject(),
-                                                         
queryHandler.getNamespaceMappings(),
-                                                         
queryHandler.getIndexingConfig(),
-                                                         
context.getNodeTypeManager(),
-                                                         
context.getSessionImpl(),
-                                                         userId);
-        }
-
         HippoLocalItemStateManager localISM = 
(HippoLocalItemStateManager)(context.getWorkspace().getItemStateManager());
         
((RepositoryImpl)context.getRepository()).initializeLocalItemStateManager(localISM,
 context.getSessionImpl(), subject);
     }
@@ -613,7 +604,25 @@ abstract class SessionImplHelper {
     }
 
     public AuthorizationQuery getAuthorizationQuery() {
-        return this.authorizationQuery;
+        if (authorizationQuery == null || 
NodeTypesChangeTracker.getChangesCounter() != nodeTypesChangeCounter) {
+            nodeTypesChangeCounter = 
NodeTypesChangeTracker.getChangesCounter();
+            try {
+                final RepositoryImpl repository = 
(RepositoryImpl)context.getRepository();
+                HippoQueryHandler queryHandler = 
repository.getHippoQueryHandler(session.getWorkspace().getName());
+                if (queryHandler != null) {
+                    authorizationQuery = new 
AuthorizationQuery(context.getSessionImpl().getSubject(),
+                            queryHandler.getNamespaceMappings(),
+                            queryHandler.getIndexingConfig(),
+                            context.getNodeTypeManager(),
+                            context.getSessionImpl(),
+                            userId);
+                }
+            } catch (RepositoryException e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        return authorizationQuery;
     }
 
 }


=====================================
engine/src/main/java/org/hippoecm/repository/nodetypes/NodeTypesChangeTracker.java
=====================================
--- /dev/null
+++ 
b/engine/src/main/java/org/hippoecm/repository/nodetypes/NodeTypesChangeTracker.java
@@ -0,0 +1,57 @@
+/*
+ *  Copyright 2016 Hippo B.V. (http://www.onehippo.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.repository.nodetypes;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.observation.Event;
+import javax.jcr.observation.EventIterator;
+import javax.jcr.observation.EventListener;
+
+public class NodeTypesChangeTracker {
+
+    private final Session session;
+    private final static AtomicInteger counter = new AtomicInteger(0);
+
+    private final EventListener nodeTypesChangeListener = new EventListener() {
+        @Override
+        public void onEvent(final EventIterator events) {
+            counter.incrementAndGet();
+        }
+    };
+
+    public NodeTypesChangeTracker(Session session) {
+        this.session = session;
+    }
+
+    public void start() throws RepositoryException {
+        
session.getWorkspace().getObservationManager().addEventListener(nodeTypesChangeListener,
+                Event.NODE_ADDED | Event.NODE_REMOVED | Event.NODE_MOVED | 
Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED,
+                "/jcr:system/jcr:nodeTypes", true, null, null, false);
+    }
+
+    public void stop() {
+        // note session logout already removes the nodeTypesChangeListener
+        session.logout();
+    }
+
+    public static int getChangesCounter() {
+        return counter.get();
+    }
+
+}


=====================================
jaxrs/pom.xml
=====================================
--- a/jaxrs/pom.xml
+++ b/jaxrs/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository JAX-RS Services</name>


=====================================
modules/pom.xml
=====================================
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Modules</name>


=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -20,13 +20,13 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-cms7-project</artifactId>
-    <version>27.4</version>
+    <version>28-SNAPSHOT</version>
   </parent>
 
   <name>Repository</name>
   <description>Hippo Repository</description>
   <artifactId>hippo-repository</artifactId>
-  <version>3.x-translations-1.0-SNAPSHOT</version>
+  <version>4.0.0-translations-psp1-SNAPSHOT</version
   <packaging>pom</packaging>
 
   <inceptionYear>2007</inceptionYear>
@@ -71,10 +71,10 @@
     <!-- use root project name for all project modules NOTICE files, should be 
the same as in the root NOTICE file -->
     <notice.project.name>Hippo Repository</notice.project.name>
 
-    <hippo.commons.version>2.2.0-SNAPSHOT</hippo.commons.version>
-    <hippo.services.version>2.2.0-SNAPSHOT</hippo.services.version>
-    
<hippo.services.eventbus.version>2.2.0-SNAPSHOT</hippo.services.eventbus.version>
-    <hippo.utilities.version>2.2.0-SNAPSHOT</hippo.utilities.version>
+    <hippo.commons.version>3.0.0-SNAPSHOT</hippo.commons.version>
+    <hippo.services.version>3.0.0-SNAPSHOT</hippo.services.version>
+    
<hippo.services.eventbus.version>3.0.0-SNAPSHOT</hippo.services.eventbus.version>
+    <hippo.utilities.version>3.0.0-SNAPSHOT</hippo.utilities.version>
     <hippo.jcrdiff.version>1.01.05</hippo.jcrdiff.version>
 
     <!-- Test dependencies  -->
@@ -96,14 +96,12 @@
     <commons-scxml2.version>2.0-M1</commons-scxml2.version>
     <h2.version>1.3.175</h2.version>
     <mysql.version>5.1.34</mysql.version>
-    <groovy.version>2.4.4</groovy.version>
-
   </properties>
 
   <scm>
-    
<connection>scm:svn:http://svn.onehippo.org/repos/hippo/hippo-cms7/repository/branches/repository-3.1.0-translations-1</connection>
-    
<developerConnection>scm:svn:https://svn.onehippo.org/repos/hippo/hippo-cms7/repository/branches/repository-3.1.0-translations-1</developerConnection>
-    
<url>http://svn.onehippo.org/repos/hippo/hippo-cms7/repository/branches/repository-3.1.0-translations-1</url>
+    
<connection>scm:svn:http://svn.onehippo.org/repos/hippo/hippo-cms7/repository/trunk</connection>
+    
<developerConnection>scm:svn:https://svn.onehippo.org/repos/hippo/hippo-cms7/repository/trunk</developerConnection>
+    <url>http://svn.onehippo.org/repos/hippo/hippo-cms7/repository/trunk</url>
   </scm>
 
   <build>


=====================================
provider/pom.xml
=====================================
--- a/provider/pom.xml
+++ b/provider/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Provider Module Interface</name>


=====================================
resources/pom.xml
=====================================
--- a/resources/pom.xml
+++ b/resources/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Resources</name>


=====================================
scripts/pom.xml
=====================================
--- a/scripts/pom.xml
+++ b/scripts/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Groovy Scripts</name>


=====================================
servlets/pom.xml
=====================================
--- a/servlets/pom.xml
+++ b/servlets/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Servlets</name>


=====================================
servlets/src/main/resources/org/hippoecm/repository/RepositoryServlet-html.ftl
=====================================
--- 
a/servlets/src/main/resources/org/hippoecm/repository/RepositoryServlet-html.ftl
+++ 
b/servlets/src/main/resources/org/hippoecm/repository/RepositoryServlet-html.ftl
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <#--
-  Copyright 2014-2015 Hippo B.V. (http://www.onehippo.com)
+  Copyright 2014-2016 Hippo B.V. (http://www.onehippo.com)
 
   Licensed under the Apache License, Version 2.0 (the  "License");
   you may not use this file except in compliance with the License.
@@ -44,6 +44,8 @@ ${response.setContentType("text/html;charset=UTF-8")}
         .logout { float: right; padding: 4px 10px 0 0;}
         .logout a { color: white; font-size: small;}
 
+        .query-input {width: 100%; height: 75px;}
+
         .search-params {padding: 20px 0 10px 0;}
         .search-params input { margin-bottom: 4px}
 
@@ -69,6 +71,7 @@ ${response.setContentType("text/html;charset=UTF-8")}
         .search-type-selector #sql-select:checked ~ .search-params .text-tab 
{display:none}
         .search-type-selector #sql-select:checked ~ .search-params .xpath-tab 
{display:none}
     </style>
+    <link 
href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1tbW/8bGxv/BwcH/xMTE/8TExP/ExMT/xMTE/8TExP/ExMT/xMTE/8TExP/ExMT/xMTE/8rKyv8AAAAIAAAAAJGRkf9ycnL/ZmZm/2pqav9qamr/ampq/2pqav9qamr/ampq/2pqav9qamr/ampq/2pqav+ioqL/ysrK/6Wlpf8/Pz//PDw8//Hx8f9AQED/QEBA/0BAQP8/Pz//PT09/z09Pf8+Pj7/Pz8//z8/P/8/Pz//ampq/8TExP+lpaX/QUFB/z8/P//x8fH/S0tL/0BAQP8/Pz//Pj4+/zs7O/87Ozv/Ozs7/z09Pf8/Pz//Pz8//2pqav/ExMT/paWl/0NDQ/9DQ0P/YmJi//Hx8f9LS0v/QEBA/2JiYv+YmJj/8fHx/7i4uP91dXX/PT09/z8/P/9qamr/xMTE/6Wlpf9HR0f/R0dH/0ZGRv9vb2//8fHx//Hx8f+wsLD/b29v/0FBQf+CgoL/8fHx/3V1df8/Pz//ampq/8TExP+lpaX/SEhI/0pKSv9KSkr/SUlJ/6enp/9UVFT/SEhI/0dHR/9FRUX/V1dX/1VVVf/x8fH/ampq/2pqav/ExMT/paWl/0pKSv9LS0v/TExM/0xMTP9MTEz/S0tL/0pKSv9JSUn/RkZG/0NDQ/8/Pz//UlJS/66urv9qamr/xMTE/6Wlpf9MTEz/Tk5O/05OTv9OTk7/Tk5O/05OTv9MTEz/SkpK/0hISP9DQ0P/SkpK/0hISP+5ubn/ampq/8TExP+lpaX/Tk5O/05OTv9OTk7/T09P/09PT/9OTk7/TExM/0pKSv9ISEj/QUFB//Hx8f+Li4v/ubm5/2pqav/ExMT/o6Oj/0xMTP9N
 TU3/Tk5O
 
/09PT/9QUFD/TU1N/0pKSv9JSUn/RUVF/0JCQv9LS0v/r6+v/6Ojo/9qamr/xMTE/6Kiov9KSkr/SkpK/4CAgP+goKD/Tk5O/0xMTP9ycnL/8fHx/05OTv+bm5v/8fHx//Hx8f9MTEz/ampq/8TExP+enp7/SEhI/2lpaf/x8fH/a2tr/01NTf9LS0v/U1NT/3Jycv/x8fH/fHx8/1paWv9CQkL/QEBA/2pqav/ExMT/oKCg/35+fv/x8fH/p6en/1ZWVv/x8fH/8fHx//Hx8f/R0dH/aGho/0dHR/9ERET/QkJC/0BAQP95eXn/ysrK/6Ojo/91dXX/dXV1//Hx8f++vr7/bGxs/05OTv9MTEz/SkpK/0hISP9HR0f/RERE/0JCQv9AQED/lZWV/9fX1/8AAAAApaWl/6Wlpf+lpaX/paWl/6Wlpf+lpaX/paWl/6Wlpf+lpaX/paWl/6Wlpf+lpaX/paWl/6Wlpf////8AgAEAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAEAAA=="
 rel="icon" type="image/x-icon" />
   </head>
 
   <body>
@@ -118,14 +121,14 @@ ${response.setContentType("text/html;charset=UTF-8")}
             <#--XPATH-->
             <div class="xpath-tab">
               <noscript><div>&nbsp;</div>XPath:</noscript>
-              <input name="xpath" type="text" size="60" 
value="${request.getParameter('xpath')!}" placeholder="XPath query"/><br/>
+              <textarea class="query-input" name="xpath" placeholder="XPath 
query">${request.getParameter('xpath')!}</textarea><br/>
               Limit<noscript> (XPath query)</noscript>: <input 
name="xpath-limit" type="text" size="5" 
value="${request.getParameter('xpath-limit')!1000?c}"/>
             </div>
 
             <#--SQL-->
             <div class="sql-tab">
               <noscript><div>&nbsp;</div>SQL:&nbsp;&nbsp;</noscript>
-              <input name="sql" type="text" size="60" 
value="${request.getParameter('sql')!}" placeholder="SQL query"/><br/>
+              <textarea class="query-input" name="sql" placeholder="SQL 
query">${request.getParameter('sql')!}</textarea><br/>
               Limit<noscript> (SQL query)</noscript>: <input name="sql-limit" 
type="text" size="5" value="${request.getParameter('sql-limit')!1000?c}"/>
             </div>
           </div>


=====================================
test/pom.xml
=====================================
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Test</name>


=====================================
test/src/test/java/org/onehippo/repository/search/SearchAfterNodeTypeChangeTest.java
=====================================
--- /dev/null
+++ 
b/test/src/test/java/org/onehippo/repository/search/SearchAfterNodeTypeChangeTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2016 Hippo B.V. (http://www.onehippo.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onehippo.repository.search;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.List;
+
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryResult;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader;
+import org.apache.jackrabbit.commons.cnd.ParseException;
+import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
+import org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl;
+import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
+import org.apache.jackrabbit.spi.QNodeTypeDefinition;
+import org.apache.jackrabbit.spi.commons.namespace.NamespaceMapping;
+import org.hippoecm.repository.decorating.RepositoryDecorator;
+import org.hippoecm.repository.jackrabbit.HippoCompactNodeTypeDefReader;
+import org.hippoecm.repository.jackrabbit.RepositoryImpl;
+import org.junit.Test;
+import org.onehippo.repository.testutils.RepositoryTestCase;
+
+import static org.junit.Assert.assertEquals;
+
+public class SearchAfterNodeTypeChangeTest extends RepositoryTestCase {
+
+    @Test
+    public void 
assert_newly_added_nodetypes_can_be_found_through_searching_by_already_logged_in_user()
 throws Exception {
+
+        // create test data
+        Node testNode = session.getRootNode().addNode("test");
+        testNode.addMixin("mix:referenceable");
+
+        testNode.addNode("doc1", 
"hippo:authtestdocument").setProperty("title", "foo");
+        session.save();
+
+        final Session editor = server.login(new SimpleCredentials("editor", 
"editor".toCharArray()));
+
+        final Query query = 
editor.getWorkspace().getQueryManager().createQuery("/jcr:root/test//element(*,nt:base)",
 "xpath");
+        final QueryResult execute = query.execute();
+
+        assertEquals(1L, execute.getNodes().getSize());
+
+        // add a new nodetype and add documents of this new nodetype. Make 
sure the 'editor' can find these documents as well
+
+        addNewNodeType();
+
+        testNode.addNode("doc2", 
"hippo:authtestsubdocument").setProperty("title", "foo");
+        session.save();
+
+        editor.refresh(false);
+
+        assertEquals("Expected that doc2 would also be found by 'editor' ",2L, 
query.execute().getNodes().getSize());
+    }
+
+    private void addNewNodeType() throws ParseException, RepositoryException, 
InvalidNodeTypeDefException {
+        final InputStream in = IOUtils.toInputStream(
+                "<hippo='http://www.onehippo.org/jcr/hippo/nt/2.0'>\n" +
+                        "\n" +
+                        "[hippo:authtestsubdocument] > 
hippo:authtestdocument");
+        RepositoryImpl repository = 
(RepositoryImpl)RepositoryDecorator.unwrap(session.getRepository());
+        final NamespaceRegistry namespaceRegistry = 
repository.getNamespaceRegistry();
+        final CompactNodeTypeDefReader<QNodeTypeDefinition, NamespaceMapping> 
cndReader =
+                new HippoCompactNodeTypeDefReader(new InputStreamReader(in), 
"<test>", namespaceRegistry);
+        final List<QNodeTypeDefinition> ntdList = 
cndReader.getNodeTypeDefinitions();
+        final NodeTypeRegistry nodeTypeRegistry = 
((NodeTypeManagerImpl)session.getWorkspace().getNodeTypeManager()).getNodeTypeRegistry();
+        for (QNodeTypeDefinition ntd : ntdList) {
+            nodeTypeRegistry.registerNodeType(ntd);
+        }
+    }
+}


=====================================
testcontent/pom.xml
=====================================
--- a/testcontent/pom.xml
+++ b/testcontent/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Test Content</name>


=====================================
testutils/pom.xml
=====================================
--- a/testutils/pom.xml
+++ b/testutils/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Test Utilities</name>


=====================================
testutils/src/main/java/org/onehippo/repository/mock/MockItem.java
=====================================
--- a/testutils/src/main/java/org/onehippo/repository/mock/MockItem.java
+++ b/testutils/src/main/java/org/onehippo/repository/mock/MockItem.java
@@ -53,7 +53,7 @@ public abstract class MockItem implements Item {
     }
 
     protected boolean isRootNode() {
-        return parent == null;
+        return isNode() && parent == null;
     }
 
     void setParent(final MockNode parent) {
@@ -62,7 +62,7 @@ public abstract class MockItem implements Item {
 
     @Override
     public MockNode getParent() throws ItemNotFoundException {
-        if (isRootNode()) {
+        if (isRootNode() || parent == null) {
             throw new ItemNotFoundException("A root node does not have a 
parent");
         }
         return parent;


=====================================
testutils/src/main/java/org/onehippo/repository/mock/MockItemDefinition.java
=====================================
--- 
a/testutils/src/main/java/org/onehippo/repository/mock/MockItemDefinition.java
+++ 
b/testutils/src/main/java/org/onehippo/repository/mock/MockItemDefinition.java
@@ -15,6 +15,10 @@
  */
 package org.onehippo.repository.mock;
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
 import javax.jcr.nodetype.ItemDefinition;
 import javax.jcr.nodetype.NodeType;
 
@@ -23,8 +27,114 @@ import javax.jcr.nodetype.NodeType;
  */
 public class MockItemDefinition implements ItemDefinition {
 
+    // mandatory item names (from alphabetically ordered list) specified in 
the section 3.7, JCR 2.0 specification
+    private static final Set<String> JCR2_SPEC_MANDATORY_ITEM_NAMES =
+            new HashSet<>(Arrays.asList(
+                    "jcr:autoCreated",
+                    "jcr:availableQueryOperators",
+                    "jcr:baseVersion",
+                    "jcr:childVersionHistory",
+                    "jcr:content",
+                    "jcr:created",
+                    "jcr:data",
+                    "jcr:frozenPrimaryType",
+                    "jcr:hasOrderableChildNodes",
+                    "jcr:isAbstract",
+                    "jcr:isCheckedOut",
+                    "jcr:isFullTextSearchable",
+                    "jcr:isMixin",
+                    "jcr:isQueryOrderable",
+                    "jcr:isQueryable",
+                    "jcr:mandatory",
+                    "jcr:multiple",
+                    "jcr:nodeTypeName",
+                    "jcr:onParentVersion",
+                    "jcr:predecessors",
+                    "jcr:primaryType",
+                    "jcr:protected",
+                    "jcr:requiredPrimaryTypes",
+                    "jcr:requiredType",
+                    "jcr:rootVersion",
+                    "jcr:sameNameSiblings",
+                    "jcr:uuid",
+                    "jcr:versionHistory",
+                    "jcr:versionableUuid"
+                    ));
+
+    // autocreated item names (from alphabetically ordered list) specified in 
the section 3.7, JCR 2.0 specification
+    private static final Set<String> JCR2_SPEC_AUTOCREATED_ITEM_NAMES =
+            new HashSet<>(Arrays.asList(
+                    "jcr:childVersionHistory",
+                    "jcr:created",
+                    "jcr:createdBy",
+                    "jcr:etag",
+                    "jcr:frozenPrimaryType",
+                    "jcr:isCheckedOut",
+                    "jcr:lastModified",
+                    "jcr:lastModifiedBy",
+                    "jcr:primaryType",
+                    "jcr:rootVersion",
+                    "jcr:uuid",
+                    "jcr:versionableUuid"
+                    ));
+
+    // protected item names (from alphabetically ordered list) specified in 
the section 3.7, JCR 2.0 specification
+    private static final Set<String> JCR2_SPEC_PROTECTED_ITEM_NAMES =
+            new HashSet<>(Arrays.asList(
+                    "jcr:activity",
+                    "jcr:autoCreated",
+                    "jcr:availableQueryOperators",
+                    "jcr:baseVersion",
+                    "jcr:childNodeDefinition",
+                    "jcr:childVersionHistory",
+                    "jcr:configuration",
+                    "jcr:copiedFrom",
+                    "jcr:created",
+                    "jcr:defaultPrimaryType",
+                    "jcr:defaultValues",
+                    "jcr:etag",
+                    "jcr:frozenMixinTypes",
+                    "jcr:frozenNode",
+                    "jcr:frozenPrimaryType",
+                    "jcr:frozenUuid",
+                    "jcr:hasOrderableChildNodes",
+                    "jcr:isAbstract",
+                    "jcr:isCheckedOut",
+                    "jcr:isFullTextSearchable",
+                    "jcr:isMixin",
+                    "jcr:isQueryOrderable",
+                    "jcr:isQueryable",
+                    "jcr:mandatory",
+                    "jcr:mergeFailed",
+                    "jcr:mixinTypes",
+                    "jcr:multiple",
+                    "jcr:name",
+                    "jcr:nodeTypeName",
+                    "jcr:onParentVersion",
+                    "jcr:predecessors",
+                    "jcr:primaryItemName",
+                    "jcr:primaryType",
+                    "jcr:propertyDefinition",
+                    "jcr:protected",
+                    "jcr:requiredPrimaryTypes",
+                    "jcr:requiredType",
+                    "jcr:rootVersion",
+                    "jcr:sameNameSiblings",
+                    "jcr:successors",
+                    "jcr:supertypes",
+                    "jcr:uuid",
+                    "jcr:valueConstraints",
+                    "jcr:versionHistory",
+                    "jcr:versionLabels",
+                    "jcr:versionableUuid"
+                    ));
+
     private final String name;
 
+    private Boolean mandatory;
+    private Boolean autoCreated;
+    private Boolean isProtected;
+
     public MockItemDefinition(final String name) {
         this.name = name;
     }
@@ -34,30 +144,66 @@ public class MockItemDefinition implements ItemDefinition {
         return name;
     }
 
-    // REMAINING METHODS ARE NOT IMPLEMENTED
-
     @Override
-    public NodeType getDeclaringNodeType() {
-        throw new UnsupportedOperationException();
+    public boolean isMandatory() {
+        if (mandatory != null) {
+            return mandatory.booleanValue();
+        }
+
+        if (JCR2_SPEC_MANDATORY_ITEM_NAMES.contains(getName())) {
+            return true;
+        }
+
+        return false;
+    }
+
+    public void setMandatory(boolean mandatory) {
+        this.mandatory = mandatory;
     }
 
     @Override
     public boolean isAutoCreated() {
-        throw new UnsupportedOperationException();
+        if (autoCreated != null) {
+            return autoCreated.booleanValue();
+        }
+
+        if (JCR2_SPEC_AUTOCREATED_ITEM_NAMES.contains(getName())) {
+            return true;
+        }
+
+        return false;
+    }
+
+    public void setAutoCreated(boolean autoCreated) {
+        this.autoCreated = autoCreated;
     }
 
     @Override
-    public boolean isMandatory() {
-        throw new UnsupportedOperationException();
+    public boolean isProtected() {
+        if (isProtected != null) {
+            return isProtected.booleanValue();
+        }
+
+        if (JCR2_SPEC_PROTECTED_ITEM_NAMES.contains(getName())) {
+            return true;
+        }
+
+        return false;
     }
 
+    public void setProtected(boolean isProtected) {
+        this.isProtected = isProtected;
+    }
+
+    // REMAINING METHODS ARE NOT IMPLEMENTED
+
     @Override
-    public int getOnParentVersion() {
+    public NodeType getDeclaringNodeType() {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public boolean isProtected() {
+    public int getOnParentVersion() {
         throw new UnsupportedOperationException();
     }
 


=====================================
testutils/src/main/java/org/onehippo/repository/mock/MockProperty.java
=====================================
--- a/testutils/src/main/java/org/onehippo/repository/mock/MockProperty.java
+++ b/testutils/src/main/java/org/onehippo/repository/mock/MockProperty.java
@@ -38,9 +38,10 @@ import org.apache.jackrabbit.util.ISO8601;
  */
 public class MockProperty extends MockItem implements Property {
 
-    private int type;
-    private List<MockValue> values;
+    private final int type;
     private boolean multiple;
+    private List<MockValue> values;
+    private MockPropertyDefinition propertyDefinition;
 
     MockProperty(String name, int type) {
         super(name);
@@ -133,7 +134,11 @@ public class MockProperty extends MockItem implements 
Property {
 
     @Override
     public PropertyDefinition getDefinition() {
-        return new MockPropertyDefinition(getName(), multiple);
+        if (propertyDefinition == null) {
+            propertyDefinition = new MockPropertyDefinition(getName(), 
getType(), isMultiple());
+        }
+
+        return propertyDefinition;
     }
 
     @Override


=====================================
testutils/src/main/java/org/onehippo/repository/mock/MockPropertyDefinition.java
=====================================
--- 
a/testutils/src/main/java/org/onehippo/repository/mock/MockPropertyDefinition.java
+++ 
b/testutils/src/main/java/org/onehippo/repository/mock/MockPropertyDefinition.java
@@ -15,6 +15,7 @@
  */
 package org.onehippo.repository.mock;
 
+import javax.jcr.PropertyType;
 import javax.jcr.Value;
 import javax.jcr.nodetype.PropertyDefinition;
 
@@ -23,47 +24,77 @@ import javax.jcr.nodetype.PropertyDefinition;
  */
 public class MockPropertyDefinition extends MockItemDefinition implements 
PropertyDefinition {
 
-    private final boolean isMultiple;
+    private final int requiredType;
+    private final boolean multiple;
 
+    private boolean fullTextSearchable = true;
+    private boolean queryOrderable = true;
+
+    /**
+     * Constructor.
+     * @deprecated Use {@link #MockPropertyDefinition(String, int, boolean)} 
instead.
+     * @param name property name
+     * @param isMultiple whether or not it is multiple
+     */
+    @Deprecated
     public MockPropertyDefinition(final String name, final boolean isMultiple) 
{
+        this(name, PropertyType.STRING, isMultiple);
+    }
+
+    /**
+     * Constructor.
+     * @param name property name
+     * @param requiredType required type
+     * @param multiple whether or not it is multiple
+     */
+    public MockPropertyDefinition(final String name, final int requiredType, 
final boolean multiple) {
         super(name);
-        this.isMultiple = isMultiple;
+        this.requiredType = requiredType;
+        this.multiple = multiple;
     }
 
     @Override
-    public boolean isMultiple() {
-        return isMultiple;
+    public int getRequiredType() {
+        return requiredType;
     }
 
-    // REMAINING METHODS ARE NOT IMPLEMENTED
-
     @Override
-    public int getRequiredType() {
-        throw new UnsupportedOperationException();
+    public boolean isMultiple() {
+        return multiple;
     }
 
     @Override
-    public String[] getValueConstraints() {
-        throw new UnsupportedOperationException();
+    public boolean isFullTextSearchable() {
+        return fullTextSearchable;
+    }
+
+    public void setFullTextSearchable(boolean fullTextSearchable) {
+        this.fullTextSearchable = fullTextSearchable;
     }
 
     @Override
-    public Value[] getDefaultValues() {
-        throw new UnsupportedOperationException();
+    public boolean isQueryOrderable() {
+        return queryOrderable;
     }
 
+    public void setQueryOrderable(boolean queryOrderable) {
+        this.queryOrderable = queryOrderable;
+    }
+
+    // REMAINING METHODS ARE NOT IMPLEMENTED
+
     @Override
-    public String[] getAvailableQueryOperators() {
+    public String[] getValueConstraints() {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public boolean isFullTextSearchable() {
+    public Value[] getDefaultValues() {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public boolean isQueryOrderable() {
+    public String[] getAvailableQueryOperators() {
         throw new UnsupportedOperationException();
     }
 


=====================================
testutils/src/main/resources/hippoecm-extension.xml
=====================================
--- /dev/null
+++ b/testutils/src/main/resources/hippoecm-extension.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2016 Hippo
+
+  Licensed under the Apache License, Version 2.0 (the  "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS"
+  BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0"; sv:name="hippo:initialize">
+  <sv:property sv:name="jcr:primaryType" sv:type="Name">
+    <sv:value>hippo:initializefolder</sv:value>
+  </sv:property>
+  <sv:node sv:name="editorMemberOfEditor">
+    <sv:property sv:name="jcr:primaryType" sv:type="Name">
+      <sv:value>hippo:initializeitem</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:contentpropadd" sv:type="String">
+      <sv:value>editor</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:contentroot" sv:type="String">
+      
<sv:value>/hippo:configuration/hippo:groups/editor/hipposys:members</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:sequence" sv:type="Double">
+      <sv:value>1000.0</sv:value>
+    </sv:property>
+  </sv:node>
+  <sv:node sv:name="authorMemberOfEditor">
+    <sv:property sv:name="jcr:primaryType" sv:type="Name">
+      <sv:value>hippo:initializeitem</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:contentpropadd" sv:type="String">
+      <sv:value>author</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:contentroot" sv:type="String">
+      
<sv:value>/hippo:configuration/hippo:groups/author/hipposys:members</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:sequence" sv:type="Double">
+      <sv:value>1000.0</sv:value>
+    </sv:property>
+  </sv:node>
+
+</sv:node>


=====================================
testutils/src/test/java/org/onehippo/repository/mock/MockPropertyDefinitionTest.java
=====================================
--- /dev/null
+++ 
b/testutils/src/test/java/org/onehippo/repository/mock/MockPropertyDefinitionTest.java
@@ -0,0 +1,92 @@
+/*
+ *  Copyright 2012-2013 Hippo B.V. (http://www.onehippo.com)
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.onehippo.repository.mock;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import javax.jcr.Property;
+import javax.jcr.PropertyType;
+
+import org.junit.Test;
+
+public class MockPropertyDefinitionTest {
+
+    @Test
+    public void testMandatoryProperties() throws Exception {
+        Property jcrBaseVersionProp = new MockProperty("jcr:baseVersion", 
PropertyType.REFERENCE);
+        assertTrue(jcrBaseVersionProp.getDefinition().isMandatory());
+
+        Property jcrDataProp = new MockProperty("jcr:data", 
PropertyType.BINARY);
+        assertTrue(jcrDataProp.getDefinition().isMandatory());
+
+        Property titleProp = new MockProperty("ns1:title", 
PropertyType.STRING);
+        assertFalse(titleProp.getDefinition().isMandatory());
+        ((MockPropertyDefinition) 
titleProp.getDefinition()).setMandatory(true);
+        assertTrue(titleProp.getDefinition().isMandatory());
+    }
+
+    @Test
+    public void testAutoCreatedProperties() throws Exception {
+        Property jcrCreatedProp = new MockProperty("jcr:created", 
PropertyType.DATE);
+        assertTrue(jcrCreatedProp.getDefinition().isAutoCreated());
+
+        Property jcrIsCheckedOutProp = new MockProperty("jcr:isCheckedOut", 
PropertyType.BOOLEAN);
+        assertTrue(jcrIsCheckedOutProp.getDefinition().isAutoCreated());
+
+        Property titleProp = new MockProperty("ns1:title", 
PropertyType.STRING);
+        assertFalse(titleProp.getDefinition().isAutoCreated());
+        ((MockPropertyDefinition) 
titleProp.getDefinition()).setAutoCreated(true);
+        assertTrue(titleProp.getDefinition().isAutoCreated());
+    }
+
+    @Test
+    public void testProtectedProperties() throws Exception {
+        Property jcrUuidProp = new MockProperty("jcr:uuid", 
PropertyType.STRING);
+        assertTrue(jcrUuidProp.getDefinition().isProtected());
+
+        Property jcrPrimaryTypeProp = new MockProperty("jcr:primaryType", 
PropertyType.STRING);
+        assertTrue(jcrPrimaryTypeProp.getDefinition().isProtected());
+
+        Property titleProp = new MockProperty("ns1:title", 
PropertyType.STRING);
+        assertFalse(titleProp.getDefinition().isProtected());
+        ((MockPropertyDefinition) 
titleProp.getDefinition()).setProtected(true);
+        assertTrue(titleProp.getDefinition().isProtected());
+    }
+
+    @Test
+    public void testGetRequiredType() throws Exception {
+        Property jcrBaseVersionProp = new MockProperty("jcr:baseVersion", 
PropertyType.REFERENCE);
+        assertEquals(PropertyType.REFERENCE, 
jcrBaseVersionProp.getDefinition().getRequiredType());
+
+        Property jcrDataProp = new MockProperty("jcr:data", 
PropertyType.BINARY);
+        assertEquals(PropertyType.BINARY, 
jcrDataProp.getDefinition().getRequiredType());
+
+        Property jcrCreatedProp = new MockProperty("jcr:created", 
PropertyType.DATE);
+        assertEquals(PropertyType.DATE, 
jcrCreatedProp.getDefinition().getRequiredType());
+
+        Property jcrIsCheckedOutProp = new MockProperty("jcr:isCheckedOut", 
PropertyType.BOOLEAN);
+        assertEquals(PropertyType.BOOLEAN, 
jcrIsCheckedOutProp.getDefinition().getRequiredType());
+
+        Property jcrUuidProp = new MockProperty("jcr:uuid", 
PropertyType.STRING);
+        assertEquals(PropertyType.STRING, 
jcrUuidProp.getDefinition().getRequiredType());
+
+        Property titleProp = new MockProperty("ns1:title", 
PropertyType.STRING);
+        assertEquals(PropertyType.STRING, 
titleProp.getDefinition().getRequiredType());
+    }
+
+}


=====================================
upgrade/pom.xml
=====================================
--- a/upgrade/pom.xml
+++ b/upgrade/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Upgrade</name>


=====================================
utilities/pom.xml
=====================================
--- a/utilities/pom.xml
+++ b/utilities/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository Utilities</name>


=====================================
workflow/pom.xml
=====================================
--- a/workflow/pom.xml
+++ b/workflow/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-repository</artifactId>
-    <version>3.x-translations-1.0-SNAPSHOT</version>
+    <version>4.0.0-translations-psp1-SNAPSHOT</version
   </parent>
 
   <name>Repository workflow implementations</name>


=====================================
workflow/src/main/java/org/onehippo/repository/documentworkflow/DocumentVariant.java
=====================================
--- 
a/workflow/src/main/java/org/onehippo/repository/documentworkflow/DocumentVariant.java
+++ 
b/workflow/src/main/java/org/onehippo/repository/documentworkflow/DocumentVariant.java
@@ -112,4 +112,8 @@ public class DocumentVariant extends Document {
         }
         return date;
     }
+
+    public String getLastModifiedBy() throws RepositoryException {
+        return 
getStringProperty(HippoStdPubWfNodeType.HIPPOSTDPUBWF_LAST_MODIFIED_BY);
+    }
 }


=====================================
workflow/src/main/resources/hippoecm-extension.xml
=====================================
--- a/workflow/src/main/resources/hippoecm-extension.xml
+++ b/workflow/src/main/resources/hippoecm-extension.xml
@@ -36,7 +36,7 @@
       <sv:value>true</sv:value>
     </sv:property>
     <sv:property sv:name="hippo:version" sv:type="String">
-      <sv:value>2.24.02</sv:value>
+      <sv:value>3.2.0</sv:value>
     </sv:property>
   </sv:node>
 



View it on GitLab: 
https://code.onehippo.org/cms/hippo-repository/compare/237ec3ba65a004e0654dc3168f24ab61ffa137e3...063b2bbeec4317fc7317f710906d13878675739f
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to