You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:47:40 UTC

[sling-org-apache-sling-jcr-contentloader] annotated tag org.apache.sling.jcr.contentloader-2.1.0 created (now d0d0642)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git.


      at d0d0642  (tag)
 tagging 9c3c2e8e916368aa0234adbbeb981847d3b58b0d (commit)
      by Justin Edelson
      on Mon Sep 6 14:58:34 2010 +0000

- Log -----------------------------------------------------------------
org.apache.sling.jcr.contentloader-2.1.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 089d630  Start new module for content loading.
     new e7c3f36  SLING-400: Move content loading to own bundle.
     new 37489b3  SLING-400: Move content loading to own bundle.
     new 6adfd33  SLING-400: Move content loading to own bundle.
     new 6ba13f4  Eclude maven-eclipse.xml generated by the maven eclipse plugin.
     new 96424e1  SLING-413: Get sling.id only once; handling start and stop should be sufficient.
     new 525d242  SLING-413: Handle bundle update and correctly handle overwrite flag.
     new 76f7b76  SLING-412: Remove support for "name" property which defines the name of the root node imported through json.
     new 5e6f6b9  Use new manifest parser in content loader.
     new 1a9cb53  #SLING-414: Move generation and managing of the sling id to own service in the engine.
     new 55e5771  SLING-453: Initial content loading to target location https://issues.apache.org/jira/browse/SLING-453
     new 97fa605  SLING-365 Implement support for initial checkin of mix:versionable nodes on-demand
     new 7a2d4b1  Add explicit dependency to JUnit library
     new d8971e5  SLING-479 Fix @scr.tags:   - normalize metadata attribute settings to "no"   - ensure proper metadata and ds attributes are set   - create metatype.properties files where required   - fix metatype.properties files
     new 66b1860  SLING-483: Add excludes for javadocs (WiP)
     new 7857ffd  SLING-495 - NOTICE files generated using mknotice script
     new 74d5c76  SLING-495 - NOTICE files updated according to changes in revision 662927
     new 60e1c27  SLING-495 - NOTICE files regenerated with revision 663097 changes
     new 9b24eb4  Use released version of parent pom.
     new 538a808  Use released versions (or soon to be released versions).
     new ffa3b1c  [maven-release-plugin] prepare release org.apache.sling.jcr.contentloader-2.0.0-incubator
     new 11176fe  [maven-release-plugin] prepare for next development iteration
     new 9e8c1dc  Set version to next development version.
     new 9fe2a8e  Fix reference to parent pom.
     new 5f28fb6  SLING-521: Restore more notice files.
     new b037f12  SLING-521: Separate between notice files for bin and src dists.
     new 289aa18  SLING-521: Separate between notice files for bin and src dists.
     new 7085ebf  Change copyright year to 2008.
     new 5773655  SLING-539: Merge LICENSE.* information to LICENSE files     - kXML license
     new 0487817  Update to released versions.
     new a4f12d3  [maven-release-plugin] prepare release org.apache.sling.jcr.contentloader-2.0.2-incubator
     new c706feb  [maven-release-plugin] prepare for next development iteration
     new 9f2975d  Use latest snapshots again to make project buildable.
     new b748cf1  SLING-545 Apply modified patch (see issue for modification details)
     new 899bdff  SLING-548: Rewrite of content loading from creating mock node/property objects to event based loading. This mechanism allows to create nodes and properties on the fly while reading from the input stream. (ViP) Enable tests again (they were in the wrong directory)
     new 0a0ce10  SLING-548: Remove wrong test src dir.
     new 9fbe62f  Use released versions.
     new 5510767  Use released parent pom where possible.
     new d05e8d2  SLING-548: Add methods for setting properties from objects.
     new b042f5d  SLING-548: Provide methods for creating file nodes and to change the current context node.
     new 24de4c8  SLING-548: Initial version to extract zips and jars into the repository.
     new 32d477e  SLING-548: Refactor code and provide a mechanism to disable import providers.
     new bb27019  Create path if it is not existend
     new e07a62a  Fix input stream handling.
     new ef74c9d  SLING-553 Allow references and paths to be loaded from JSON through JsonReader. Applied patch by Bryce Ewing.
     new 55a2d63  SLING-555 : Update all poms to use the latest parent pom; update parent pom to include the incubator repo for plugins and use latest plugins.
     new 7fe9fc0  Create sling:Folder as intermediate node.
     new 63fc0a9  SLING-578 : Create intermediate nodes with type sling:Folder SLING-579 : Allow additional content information for files.
     new f504f45  Refresh session before save.
     new 5736f52  SLING-766 : Don't uninstall content when bundle is stopped. The content is now only uninstalled when the bundle is uninstalled. During installation a string array containing all paths that will be removed later on is collected which makes the uninstall easier. Also refactored the classes and packages a little bit.
     new 921136c  SLING-808 : Increase version to 5-incubator-SNAPSHOT
     new 43b6516  Update notice files to include 2009 in copyright statement.
     new f72f256  SLING-811 Reduce DependencyManagement in the parent pom and add explicit versions to the modules
     new c02f7c7  SLING-829 Cosmetics to the bundle/project names
     new ee4f054  SLING-836 : Always create a new session for content loading / unloading. Try all bundles on startup even if one bundle fails.
     new 94f72a0  SLING-838 : Clean up code, use method for session logout.
     new 01f8990  SLING-865 : Move to bundles
     new 4146903  SLING-865 : Adjust reactor pom and svn information in each module.
     new c653fd3  SLING-865 : Adjust path to parent pom and add profiles for samples and contrib
     new 3e3e882  SLING-857 Apply patch by Vidar Ramdal (Thanks alot) to support XSLT   for XML imports
     new e0a5ce4  SLING-857 - test case for XmlReader using an XSLT transform contributed by Vidar S. Ramdal, thanks!
     new e7184db  SLING-941: Lots of svn:eol-style settings missing
     new eb4517b  Use release parent pom
     new 72f7d1a  [maven-release-plugin] prepare release org.apache.sling.jcr.contentloader-2.0.4-incubator
     new f15b9d3  [maven-release-plugin] prepare for next development iteration
     new fe7503b  Use next dev version of parent pom
     new 8ab68cd  Set parent pom to released version.
     new e0c49f1  Move Sling to new TLP location
     new 9e6cca4  SLING-1011 : Remove disclaimer file.
     new 2c8f185  SLING-1011 : Adjust svn location
     new 7c79af7  SLING-1011 : Remove disclaimer from readme's, adjust links to webite, fix versions in poms.
     new 87e18a8  SLING-1033 Upgrade to Sling parent POM 6 (and ensure web app has the leglize stuff, too)
     new c13c032  SLING-981 Patch from Eric Norman applied, thanks.   Issues was first created by myself (ieb), but the patch represented a vast improvement on the orriginal contribution.   This commit adds the ability to specify ACE's in the json file that would have previously only modified properties   on the node. In addition it allows the creation of new principals to allow the ACE's to be added to the node.
     new a0c672e  SLING-981 Corrected trailing white space introduced by previous commit.
     new d003a8a  SLING-971     Patch applied (from myself)     Corrects the Java doc and readme surrounding the contentloader, especially for the json format.
     new 85066e3  Update to latest release.
     new 50de0c9  SLING-1161 implemented. Now supports including external files with nt:file in content loader XML
     new a3acd00  SLING-1165 Last modifie date reported by the filesystem is now used, instead of current date
     new 5613331  SLING-1161 - fix code to compile with JDK 1.5
     new d292bfb  Clean up code
     new 30e1775  Clean up code
     new ec21069  SLING-1205 Upgrade all projects to parent POM 8 and use OSGi provided OSGi libraries
     new 27a9874  SLING-694 :  Initial Content does not load initial content from a file
     new dfba411  SLING-1130 : Content Loader does not parse dates. Apply patch from Josh Kennedy.
     new c44cbb7  [maven-release-plugin] prepare release org.apache.sling.jcr.contentloader-2.0.6
     new d707628  [maven-release-plugin] prepare for next development iteration
     new 26c26d3  Going back to 2.0.5
     new 602ab43  Use latest sling jcr api.
     new e076935  SLING-1250 : Revert changes and use old jcr api
     new 49ef371  SLING-1236 : Scala Scripting: Make all types of the script arguments visible on the Scala side. Apply patch from Michael Dürig
     new defa57e  SLING-1251 Applied Patch from Ray Davis (Thanks) fixes acl policies after JR16 upgrade, and fixes a potential NPE.
     new dd0dad2  SLING-1325 : Bundle deploy fails utterly if any XML files contains an element named "type" - throw exception now instead of an NPE.
     new 2a21b72  Use latest jcr api to decouple modules from jcr 1.0 (contained in older jcr api releases)
     new 7e66f24  SLING-1359 - updating contentloader bundle to use Undefined instead of String as the default property type
     new e099445  Update notice files.
     new 7c9f35a  [maven-release-plugin] prepare release org.apache.sling.jcr.contentloader-2.0.6
     new 7b5fd0e  [maven-release-plugin] prepare for next development iteration
     new b5f2013  SLING-1212 - upgrading to Jackrabbit 2. Also includes re-revert of SLING-1363 and implementation of SLING-1330. Thanks to Felix for getting this started.
     new 7e16c91  SLING-1395 - adding support for multi-valued properties
     new a62f635  SLING-1409 : ignoreImportProviders doesn't allow multiple values.
     new 3a22eb3  SLING-1409 : Reverting the change
     new ca5b19b  SLING-1411 Add replaceAccessControlEntry method to AccessControlUtil Thanks to Ray Davis for the contribution.
     new 2336611  SLING-1448 - adding support for Sling-Initial-Content-Workspace manifest header
     new 2a30280  SLING-1457 SLING-1458 - enable support for specifying the position of an ACE (within the ACL) when it is added/updated
     new ea594e0  SLING-1440 : Overwrite rule of bundle initial content cannot be switched back to "false"
     new c1d6350  SLING-1448 - adding support for workspace directive; removing support for separate header
     new 31d0cc4  Remove unused import
     new 9198b47  Use released parent pom.
     new 49b5bbe  SLING-1532 - just overwriting properties for resource nodes
     new 6887f0a  SLING-1526 Extra property names of security:principals lost when loaded via contentloader.   Applied patch from Mike Moulton.
     new 90b2827  SLING-1561 - changing destination of ROOT descriptor if path is specified in manifest entry
     new 06c581e  SLING-1172 Allow uploading JSON files to create content structures
     new 649f3d4  SLING-1582 added better information at debug level.
     new af5c7d3  SLING-1583  Changed name to :name and added to ignore list.
     new a4686f9  SLING-1172 Allow uploading JSON files to create content structures Fixed the import case where no name is provided
     new d7d3007  SLING-1589 DefaultContentImporter service doesn't have a pretty name/description
     new 1a2abcd  SLING-1448 - removing unused constant
     new 51f92ec  SLING-1592 - using the ws:/path notation in the uninstall-paths node property.
     new c9c1e2a  Clean up code
     new 24b16f2  SLING-1613 Fixed and change the test pattern to include arrays.
     new fda07c0  SLING-1627 import operation support for overwrite of properties
     new 560747b  upgrading contentloader to depend upon base release
     new 2046895  [maven-release-plugin] prepare release org.apache.sling.jcr.contentloader-2.1.0
     new 9c3c2e8  [maven-scm] copy for tag org.apache.sling.jcr.contentloader-2.1.0

The 124 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-jcr-contentloader] 13/28: SLING-1532 - just overwriting properties for resource nodes

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 49b5bbe3d5ebb530935ae382e20cbeb6b012161a
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Jun 1 15:12:49 2010 +0000

    SLING-1532 - just overwriting properties for resource nodes
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@950105 13f79535-47bb-0310-9956-ffa450edef68
---
 .../internal/DefaultContentCreator.java            | 92 ++++++++++++----------
 1 file changed, 51 insertions(+), 41 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index eb628c8..bbd8ef4 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -417,20 +417,7 @@ public class DefaultContentCreator implements ContentCreator {
      */
     public void createProperty(String name, Object value)
     throws RepositoryException {
-        final Node node = this.parentNodeStack.peek();
-        // check if the property already exists, don't overwrite it in this case
-        if (node.hasProperty(name)
-            && !node.getProperty(name).isNew()) {
-            return;
-        }
-        if ( value == null ) {
-            if ( node.hasProperty(name) ) {
-                node.getProperty(name).remove();
-            }
-        } else {
-            final Value jcrValue = this.createValue(node.getSession().getValueFactory(), value);
-            node.setProperty(name, jcrValue);
-        }
+       createProperty(name, value, false);
     }
 
     /**
@@ -438,23 +425,7 @@ public class DefaultContentCreator implements ContentCreator {
      */
     public void createProperty(String name, Object[] values)
     throws RepositoryException {
-        final Node node = this.parentNodeStack.peek();
-        // check if the property already exists, don't overwrite it in this case
-        if (node.hasProperty(name)
-            && !node.getProperty(name).isNew()) {
-            return;
-        }
-        if ( values == null || values.length == 0 ) {
-            if ( node.hasProperty(name) ) {
-                node.getProperty(name).remove();
-            }
-        } else {
-            final Value[] jcrValues = new Value[values.length];
-            for(int i = 0; i < values.length; i++) {
-                jcrValues[i] = this.createValue(node.getSession().getValueFactory(), values[i]);
-            }
-            node.setProperty(name, jcrValues);
-        }
+        createProperty(name, values, false);
     }
 
     /**
@@ -613,6 +584,45 @@ public class DefaultContentCreator implements ContentCreator {
       return null;
     }
 
+    private void createProperty(String name, Object value, boolean overwriteExisting)
+    throws RepositoryException {
+        final Node node = this.parentNodeStack.peek();
+        // check if the property already exists, don't overwrite it in this case
+        if (node.hasProperty(name)
+            && !node.getProperty(name).isNew() && !overwriteExisting) {
+            return;
+        }
+        if ( value == null ) {
+            if ( node.hasProperty(name) ) {
+                node.getProperty(name).remove();
+            }
+        } else {
+            final Value jcrValue = this.createValue(node.getSession().getValueFactory(), value);
+            node.setProperty(name, jcrValue);
+        }
+    }
+
+    private void createProperty(String name, Object[] values, boolean overwriteExisting)
+    throws RepositoryException {
+        final Node node = this.parentNodeStack.peek();
+        // check if the property already exists, don't overwrite it in this case
+        if (node.hasProperty(name)
+            && !node.getProperty(name).isNew() && !overwriteExisting) {
+            return;
+        }
+        if ( values == null || values.length == 0 ) {
+            if ( node.hasProperty(name) ) {
+                node.getProperty(name).remove();
+            }
+        } else {
+            final Value[] jcrValues = new Value[values.length];
+            for(int i = 0; i < values.length; i++) {
+                jcrValues[i] = this.createValue(node.getSession().getValueFactory(), values[i]);
+            }
+            node.setProperty(name, jcrValues);
+        }
+    }
+
     /**
      * @see org.apache.sling.jcr.contentloader.internal.ContentCreator#createFileAndResourceNode(java.lang.String, java.io.InputStream, java.lang.String, long)
      */
@@ -626,12 +636,15 @@ public class DefaultContentCreator implements ContentCreator {
         final Node parentNode = this.parentNodeStack.peek();
 
         // if node already exists but should be overwritten, delete it
-        if (this.configuration.isOverwrite() && parentNode.hasNode(name)) {
-            parentNode.getNode(name).remove();
-        } else if (parentNode.hasNode(name)) {
+        if (parentNode.hasNode(name)) {
             this.parentNodeStack.push(parentNode.getNode(name));
             this.parentNodeStack.push(parentNode.getNode(name).getNode("jcr:content"));
-            return;
+            if (!this.configuration.isOverwrite()) {
+                return;
+            }
+        } else {
+            this.createNode(name, "nt:file", null);
+            this.createNode("jcr:content", "nt:resource", null);
         }
 
         // ensure content type
@@ -649,12 +662,9 @@ public class DefaultContentCreator implements ContentCreator {
         if (lastModified <= 0) {
             lastModified = System.currentTimeMillis();
         }
-
-        this.createNode(name, "nt:file", null);
-        this.createNode("jcr:content", "nt:resource", null);
-        this.createProperty("jcr:mimeType", mimeType);
-        this.createProperty("jcr:lastModified", lastModified);
-        this.createProperty("jcr:data", data);
+        this.createProperty("jcr:mimeType", mimeType, true);
+        this.createProperty("jcr:lastModified", lastModified, true);
+        this.createProperty("jcr:data", data, true);
     }
 
     /**

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 07/28: SLING-1448 - adding support for Sling-Initial-Content-Workspace manifest header

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 23366116ded663c8deaaa4a245b9fc515d42977d
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Sat Mar 20 02:22:41 2010 +0000

    SLING-1448 - adding support for Sling-Initial-Content-Workspace manifest header
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@925533 13f79535-47bb-0310-9956-ffa450edef68
---
 .../internal/ContentLoaderService.java             | 43 +++++++++++-----------
 .../sling/jcr/contentloader/internal/Loader.java   |  7 +++-
 2 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
index 24d6e35..9062a13 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
@@ -60,6 +60,9 @@ import org.slf4j.LoggerFactory;
  */
 public class ContentLoaderService implements SynchronousBundleListener {
 
+    /** The manifest header to specify the workspace for initial content loading. */
+    public static final String CONTENT_WORKSPACE_HEADER = "Sling-Initial-Content-Workspace";
+
     public static final String PROPERTY_CONTENT_LOADED = "content-loaded";
     private static final String PROPERTY_CONTENT_LOADED_AT = "content-load-time";
     private static final String PROPERTY_CONTENT_LOADED_BY = "content-loaded-by";
@@ -135,20 +138,21 @@ public class ContentLoaderService implements SynchronousBundleListener {
         //
 
         Session session = null;
+        final Bundle bundle = event.getBundle();
         switch (event.getType()) {
             case BundleEvent.STARTING:
                 // register content when the bundle content is available
                 // as node types are registered when the bundle is installed
                 // we can safely add the content at this point.
                 try {
-                    session = this.getSession();
-                    final boolean isUpdate = this.updatedBundles.remove(event.getBundle().getSymbolicName());
-                    initialContentLoader.registerBundle(session, event.getBundle(), isUpdate);
+                    session = this.getSession(bundle);
+                    final boolean isUpdate = this.updatedBundles.remove(bundle.getSymbolicName());
+                    initialContentLoader.registerBundle(session, bundle, isUpdate);
                 } catch (Throwable t) {
                     log.error(
                         "bundleChanged: Problem loading initial content of bundle "
-                            + event.getBundle().getSymbolicName() + " ("
-                            + event.getBundle().getBundleId() + ")", t);
+                            + bundle.getSymbolicName() + " ("
+                            + bundle.getBundleId() + ")", t);
                 } finally {
                     this.ungetSession(session);
                 }
@@ -156,17 +160,17 @@ public class ContentLoaderService implements SynchronousBundleListener {
             case BundleEvent.UPDATED:
                 // we just add the symbolic name to the list of updated bundles
                 // we will use this info when the new start event is triggered
-                this.updatedBundles.add(event.getBundle().getSymbolicName());
+                this.updatedBundles.add(bundle.getSymbolicName());
                 break;
             case BundleEvent.UNINSTALLED:
                 try {
-                    session = this.getSession();
-                    initialContentLoader.unregisterBundle(session, event.getBundle());
+                    session = this.getSession(bundle);
+                    initialContentLoader.unregisterBundle(session, bundle);
                 } catch (Throwable t) {
                     log.error(
                         "bundleChanged: Problem unloading initial content of bundle "
-                            + event.getBundle().getSymbolicName() + " ("
-                            + event.getBundle().getBundleId() + ")", t);
+                            + bundle.getSymbolicName() + " ("
+                            + bundle.getBundleId() + ")", t);
                 } finally {
                     this.ungetSession(session);
                 }
@@ -247,10 +251,7 @@ public class ContentLoaderService implements SynchronousBundleListener {
             passwordDigestAlgoritm = DEFAULT_PASSWORD_DIGEST_ALGORITHM;
         }
 
-        Session session = null;
         try {
-            session = this.getSession();
-            this.createRepositoryPath(session, ContentLoaderService.BUNDLE_CONTENT_NODE);
             log.debug(
                     "Activated - attempting to load content from all "
                     + "bundles which are neither INSTALLED nor UNINSTALLED");
@@ -259,6 +260,7 @@ public class ContentLoaderService implements SynchronousBundleListener {
             Bundle[] bundles = componentContext.getBundleContext().getBundles();
             for (Bundle bundle : bundles) {
                 if ((bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
+                    Session session = getSession(bundle);
                     // load content for bundles which are neither INSTALLED nor
                     // UNINSTALLED
                     try {
@@ -269,9 +271,7 @@ public class ContentLoaderService implements SynchronousBundleListener {
                                 + bundle.getSymbolicName() + " ("
                                 + bundle.getBundleId() + ")", t);
                     } finally {
-                        if ( session.hasPendingChanges() ) {
-                            session.refresh(false);
-                        }
+                        this.ungetSession(session);
                     }
                 } else {
                     ignored++;
@@ -287,8 +287,6 @@ public class ContentLoaderService implements SynchronousBundleListener {
         } catch (Throwable t) {
             log.error("activate: Problem while loading initial content and"
                 + " registering mappings for existing bundles", t);
-        } finally {
-            this.ungetSession(session);
         }
     }
 
@@ -311,11 +309,14 @@ public class ContentLoaderService implements SynchronousBundleListener {
     }
 
     /**
-     * Returns an administrative session to the default workspace.
+     * Returns an administrative session to the workspace
+     * specified in the bundle or, if none specified,
+     * the default workspace
      */
-    private Session getSession()
+    private Session getSession(Bundle bundle)
     throws RepositoryException {
-        return getRepository().loginAdministrative(null);
+        String workspace = (String) bundle.getHeaders().get(CONTENT_WORKSPACE_HEADER);
+        return getRepository().loginAdministrative(workspace);
     }
 
     /**
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index 6b87271..c33145c 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -107,10 +107,12 @@ public class Loader {
      *
      * @param session
      * @param bundle
+     * @throws RepositoryException
      */
     public void registerBundle(final Session session,
                                final Bundle bundle,
-                               final boolean isUpdate) {
+                               final boolean isUpdate) throws RepositoryException {
+
         // if this is an update, we have to uninstall the old content first
         if ( isUpdate ) {
             this.unregisterBundle(session, bundle);
@@ -157,6 +159,7 @@ public class Loader {
         }
 
         try {
+            jcrContentHelper.createRepositoryPath(session, ContentLoaderService.BUNDLE_CONTENT_NODE);
 
             // check if the content has already been loaded
             final Map<String, Object> bundleContentInfo = jcrContentHelper.getBundleContentInfo(
@@ -225,6 +228,8 @@ public class Loader {
 
         } else {
             try {
+                jcrContentHelper.createRepositoryPath(session, ContentLoaderService.BUNDLE_CONTENT_NODE);
+
                 final Map<String, Object> bundleContentInfo = jcrContentHelper.getBundleContentInfo(
                         session, bundle, false);
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 14/28: SLING-1526 Extra property names of security:principals lost when loaded via contentloader. Applied patch from Mike Moulton.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 6887f0a7e7bd47bfd3c006d26aced1eeb3986e06
Author: Eric Norman <en...@apache.org>
AuthorDate: Mon Jun 7 03:35:32 2010 +0000

    SLING-1526 Extra property names of security:principals lost when loaded via contentloader.   Applied patch from Mike Moulton.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@952077 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/jcr/contentloader/internal/DefaultContentCreator.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index bbd8ef4..0b96104 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -739,7 +739,7 @@ public class DefaultContentCreator implements ContentCreator {
         	Set<Entry<String, Object>> entrySet = extraProperties.entrySet();
         	for (Entry<String, Object> entry : entrySet) {
         		Value value = createValue(valueFactory, entry.getValue());
-        		authorizable.setProperty(name, value);
+        		authorizable.setProperty(entry.getKey(), value);
 			}
         }
 	}
@@ -780,7 +780,7 @@ public class DefaultContentCreator implements ContentCreator {
         	Set<Entry<String, Object>> entrySet = extraProperties.entrySet();
         	for (Entry<String, Object> entry : entrySet) {
         		Value value = createValue(valueFactory, entry.getValue());
-        		authorizable.setProperty(name, value);
+        		authorizable.setProperty(entry.getKey(), value);
 			}
         }
 	}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 19/28: SLING-1172 Allow uploading JSON files to create content structures Fixed the import case where no name is provided

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit a4686f9d156da1022f3210e1ff811a1da9e07e28
Author: Eric Norman <en...@apache.org>
AuthorDate: Fri Jul 2 23:18:18 2010 +0000

    SLING-1172 Allow uploading JSON files to create content structures
    Fixed the import case where no name is provided
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@960134 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/jcr/contentloader/internal/DefaultContentCreator.java      | 3 ++-
 .../sling/jcr/contentloader/internal/DefaultContentImporter.java     | 5 ++++-
 .../apache/sling/jcr/contentloader/internal/readers/JsonReader.java  | 4 +---
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index 3c5565d..57af6c1 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -239,6 +239,7 @@ public class DefaultContentCreator implements ContentCreator {
                            String[] mixinNodeTypes)
     throws RepositoryException {
         final Node parentNode = this.parentNodeStack.peek();
+        boolean isParentImport = (name == null && isParentNodeImport);
         if ( name == null ) {
             if ( this.parentNodeStack.size() > 1 ) {
                 throw new RepositoryException("Node needs to have a name.");
@@ -247,7 +248,7 @@ public class DefaultContentCreator implements ContentCreator {
         }
 
         // if we are in parent node import mode, we don't create the root top level node!
-        if ( !isParentNodeImport || this.parentNodeStack.size() > 1 ) {
+        if ( !isParentImport || this.parentNodeStack.size() > 1 ) {
             // if node already exists but should be overwritten, delete it
             if (!this.ignoreOverwriteFlag && this.configuration.isOverwrite() && parentNode.hasNode(name)) {
                 parentNode.getNode(name).remove();
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java
index c974fd7..b1c14e9 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java
@@ -120,7 +120,10 @@ public class DefaultContentImporter extends BaseImportLoader implements JcrConte
     private String toPlainName(DefaultContentCreator contentCreator, String name) {
         final String providerExt = contentCreator.getImportProviderExtension(name);
         if (providerExt != null) {
-            return name.substring(0, name.length() - providerExt.length());
+        	if (name.length() == providerExt.length()) {
+        		return null; //no name is provided
+        	}
+        	return name.substring(0, name.length() - providerExt.length());
         }
         return name;
     }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
index 01696e0..2a8e599 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
@@ -105,7 +105,6 @@ public class JsonReader implements ContentReader {
         ignoredNames.add("jcr:successors");
         ignoredNames.add("jcr:checkedOut");
         ignoredNames.add("jcr:created");
-        ignoredNames.add(":name");
     }
 
     private static final Set<String> ignoredPrincipalPropertyNames = new HashSet<String>();
@@ -157,8 +156,7 @@ public class JsonReader implements ContentReader {
             }
 
             JSONObject json = new JSONObject(jsonString);
-            String optionalName = json.optString(":name", null);
-            this.createNode(optionalName, json, contentCreator);
+            this.createNode(null, json, contentCreator);
         } catch (JSONException je) {
             throw (IOException) new IOException(je.getMessage()).initCause(je);
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 02/28: SLING-1212 - upgrading to Jackrabbit 2. Also includes re-revert of SLING-1363 and implementation of SLING-1330. Thanks to Felix for getting this started.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit b5f20131f58457361876abbbb7694883b98e6ea1
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Feb 18 15:08:43 2010 +0000

    SLING-1212 - upgrading to Jackrabbit 2. Also includes re-revert of SLING-1363 and implementation of SLING-1330. Thanks to Felix for getting this started.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@911430 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 23 +++++++++++-----------
 .../internal/DefaultContentCreator.java            | 12 +++++------
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6215a69..764f8b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,9 +7,9 @@
     to you 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
@@ -92,6 +92,7 @@
         <dependency>
             <groupId>javax.jcr</groupId>
             <artifactId>jcr</artifactId>
+            <version>2.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -124,6 +125,12 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-api</artifactId>
+            <version>2.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
@@ -145,7 +152,7 @@
             <version>1.4</version>
             <scope>provided</scope>
         </dependency>
-    <!-- Testing -->        
+    <!-- Testing -->
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
@@ -154,18 +161,12 @@
             <groupId>org.jmock</groupId>
             <artifactId>jmock-junit4</artifactId>
         </dependency>
-        
+
         <!-- for security content loader (users/groups/acls) -->
         <dependency>
-            <groupId>org.apache.jackrabbit</groupId>
-            <artifactId>jackrabbit-api</artifactId>
-            <version>1.5.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.base</artifactId>
-            <version>2.0.4-incubator</version>
+            <version>2.0.7-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index d9efe3a..961cdf1 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -47,13 +47,13 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
+import javax.jcr.security.AccessControlEntry;
+import javax.jcr.security.AccessControlList;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.security.AccessControlPolicy;
+import javax.jcr.security.AccessControlPolicyIterator;
+import javax.jcr.security.Privilege;
 
-import org.apache.jackrabbit.api.jsr283.security.AccessControlEntry;
-import org.apache.jackrabbit.api.jsr283.security.AccessControlList;
-import org.apache.jackrabbit.api.jsr283.security.AccessControlManager;
-import org.apache.jackrabbit.api.jsr283.security.AccessControlPolicy;
-import org.apache.jackrabbit.api.jsr283.security.AccessControlPolicyIterator;
-import org.apache.jackrabbit.api.jsr283.security.Privilege;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 09/28: SLING-1440 : Overwrite rule of bundle initial content cannot be switched back to "false"

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit ea594e0fd27be1af44e5a53da6499da58de0171e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Apr 7 16:25:18 2010 +0000

    SLING-1440 : Overwrite rule of bundle initial content cannot be switched back to "false"
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@931611 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/jcr/contentloader/internal/ContentLoaderService.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
index 9062a13..db20b37 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
@@ -416,6 +416,7 @@ public class ContentLoaderService implements SynchronousBundleListener {
                 bcNode.setProperty(ContentLoaderService.PROPERTY_CONTENT_LOADED, false);
                 bcNode.setProperty(PROPERTY_CONTENT_UNLOADED_AT, Calendar.getInstance());
                 bcNode.setProperty(PROPERTY_CONTENT_UNLOADED_BY, this.slingId);
+                bcNode.setProperty(PROPERTY_UNINSTALL_PATHS, (String[])null);
                 bcNode.save();
             }
         } catch (RepositoryException re) {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 27/28: [maven-release-plugin] prepare release org.apache.sling.jcr.contentloader-2.1.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 20468958239246a5c8283720c16e64513a59be5e
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Mon Sep 6 14:58:28 2010 +0000

    [maven-release-plugin] prepare release org.apache.sling.jcr.contentloader-2.1.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@993055 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 557fec6..aefab52 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,7 @@
     </parent>
 
     <artifactId>org.apache.sling.jcr.contentloader</artifactId>
-    <version>2.0.7-SNAPSHOT</version>
+    <version>2.1.0</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Initial Content Loader</name>
@@ -36,9 +36,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/contentloader</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.contentloader-2.1.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.contentloader-2.1.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.jcr.contentloader-2.1.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 10/28: SLING-1448 - adding support for workspace directive; removing support for separate header

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit c1d6350a1705b1374fefdadc76aa3d7bab40d8f8
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Apr 29 02:01:25 2010 +0000

    SLING-1448 - adding support for workspace directive; removing support for separate header
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@939174 13f79535-47bb-0310-9956-ffa450edef68
---
 .../internal/ContentLoaderService.java             | 22 +++---
 .../sling/jcr/contentloader/internal/Loader.java   | 91 +++++++++++++++-------
 .../jcr/contentloader/internal/PathEntry.java      | 20 +++++
 3 files changed, 97 insertions(+), 36 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
index db20b37..2d68b2c 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
@@ -145,7 +145,7 @@ public class ContentLoaderService implements SynchronousBundleListener {
                 // as node types are registered when the bundle is installed
                 // we can safely add the content at this point.
                 try {
-                    session = this.getSession(bundle);
+                    session = this.getSession();
                     final boolean isUpdate = this.updatedBundles.remove(bundle.getSymbolicName());
                     initialContentLoader.registerBundle(session, bundle, isUpdate);
                 } catch (Throwable t) {
@@ -164,7 +164,7 @@ public class ContentLoaderService implements SynchronousBundleListener {
                 break;
             case BundleEvent.UNINSTALLED:
                 try {
-                    session = this.getSession(bundle);
+                    session = this.getSession();
                     initialContentLoader.unregisterBundle(session, bundle);
                 } catch (Throwable t) {
                     log.error(
@@ -251,7 +251,10 @@ public class ContentLoaderService implements SynchronousBundleListener {
             passwordDigestAlgoritm = DEFAULT_PASSWORD_DIGEST_ALGORITHM;
         }
 
+        Session session = null;
         try {
+            session = this.getSession();
+            this.createRepositoryPath(session, ContentLoaderService.BUNDLE_CONTENT_NODE);
             log.debug(
                     "Activated - attempting to load content from all "
                     + "bundles which are neither INSTALLED nor UNINSTALLED");
@@ -260,7 +263,7 @@ public class ContentLoaderService implements SynchronousBundleListener {
             Bundle[] bundles = componentContext.getBundleContext().getBundles();
             for (Bundle bundle : bundles) {
                 if ((bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
-                    Session session = getSession(bundle);
+
                     // load content for bundles which are neither INSTALLED nor
                     // UNINSTALLED
                     try {
@@ -271,7 +274,9 @@ public class ContentLoaderService implements SynchronousBundleListener {
                                 + bundle.getSymbolicName() + " ("
                                 + bundle.getBundleId() + ")", t);
                     } finally {
-                        this.ungetSession(session);
+                        if ( session.hasPendingChanges() ) {
+                            session.refresh(false);
+                        }
                     }
                 } else {
                     ignored++;
@@ -309,14 +314,11 @@ public class ContentLoaderService implements SynchronousBundleListener {
     }
 
     /**
-     * Returns an administrative session to the workspace
-     * specified in the bundle or, if none specified,
-     * the default workspace
+     * Returns an administrative session to the default workspace.
      */
-    private Session getSession(Bundle bundle)
+    private Session getSession()
     throws RepositoryException {
-        String workspace = (String) bundle.getHeaders().get(CONTENT_WORKSPACE_HEADER);
-        return getRepository().loginAdministrative(workspace);
+        return getRepository().loginAdministrative(null);
     }
 
     /**
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index c33145c..34fc88e 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -39,10 +39,12 @@ import java.util.StringTokenizer;
 
 import javax.jcr.InvalidSerializedDataException;
 import javax.jcr.Item;
+import javax.jcr.NoSuchWorkspaceException;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.contentloader.internal.readers.JsonReader;
 import org.apache.sling.jcr.contentloader.internal.readers.XmlReader;
 import org.apache.sling.jcr.contentloader.internal.readers.ZipReader;
@@ -70,7 +72,7 @@ public class Loader {
     /** default log */
     private final Logger log = LoggerFactory.getLogger(Loader.class);
 
-    private ContentLoaderService jcrContentHelper;
+    private ContentLoaderService contentLoaderService;
 
     /** All available import providers. */
     private Map<String, ImportProvider> defaultImportProviders;
@@ -80,9 +82,9 @@ public class Loader {
     // bundles whose registration failed and should be retried
     private List<Bundle> delayedBundles;
 
-    public Loader(ContentLoaderService jcrContentHelper) {
-        this.jcrContentHelper = jcrContentHelper;
-        this.contentCreator = new DefaultContentCreator(jcrContentHelper);
+    public Loader(ContentLoaderService contentLoaderService) {
+        this.contentLoaderService = contentLoaderService;
+        this.contentCreator = new DefaultContentCreator(contentLoaderService);
         this.delayedBundles = new LinkedList<Bundle>();
 
         defaultImportProviders = new LinkedHashMap<String, ImportProvider>();
@@ -98,30 +100,30 @@ public class Loader {
             delayedBundles.clear();
             delayedBundles = null;
         }
-        jcrContentHelper = null;
+        contentLoaderService = null;
         defaultImportProviders = null;
     }
 
     /**
      * Register a bundle and install its content.
      *
-     * @param session
+     * @param metadataSession
      * @param bundle
      * @throws RepositoryException
      */
-    public void registerBundle(final Session session,
+    public void registerBundle(final Session metadataSession,
                                final Bundle bundle,
                                final boolean isUpdate) throws RepositoryException {
 
         // if this is an update, we have to uninstall the old content first
         if ( isUpdate ) {
-            this.unregisterBundle(session, bundle);
+            this.unregisterBundle(metadataSession, bundle);
         }
 
         log.debug("Registering bundle {} for content loading.",
             bundle.getSymbolicName());
 
-        if (registerBundleInternal(session, bundle, false, isUpdate)) {
+        if (registerBundleInternal(metadataSession, bundle, false, isUpdate)) {
 
             // handle delayed bundles, might help now
             int currentSize = -1;
@@ -132,7 +134,7 @@ public class Loader {
                 for (Iterator<Bundle> di = delayedBundles.iterator(); di.hasNext();) {
 
                     Bundle delayed = di.next();
-                    if (registerBundleInternal(session, delayed, true, false)) {
+                    if (registerBundleInternal(metadataSession, delayed, true, false)) {
                         di.remove();
                     }
 
@@ -147,7 +149,7 @@ public class Loader {
         }
     }
 
-    private boolean registerBundleInternal(final Session session,
+    private boolean registerBundleInternal(final Session metadataSession,
             final Bundle bundle, final boolean isRetry, final boolean isUpdate) {
 
         // check if bundle has initial content
@@ -159,11 +161,11 @@ public class Loader {
         }
 
         try {
-            jcrContentHelper.createRepositoryPath(session, ContentLoaderService.BUNDLE_CONTENT_NODE);
+            contentLoaderService.createRepositoryPath(metadataSession, ContentLoaderService.BUNDLE_CONTENT_NODE);
 
             // check if the content has already been loaded
-            final Map<String, Object> bundleContentInfo = jcrContentHelper.getBundleContentInfo(
-                session, bundle, true);
+            final Map<String, Object> bundleContentInfo = contentLoaderService.getBundleContentInfo(
+                metadataSession, bundle, true);
 
             // if we don't get an info, someone else is currently loading
             if (bundleContentInfo == null) {
@@ -183,7 +185,7 @@ public class Loader {
 
                 } else {
 
-                    createdNodes = installContent(session, bundle, pathIter,
+                    createdNodes = installContent(metadataSession, bundle, pathIter,
                         contentAlreadyLoaded);
 
                     if (isRetry) {
@@ -199,7 +201,7 @@ public class Loader {
                 return true;
 
             } finally {
-                jcrContentHelper.unlockBundleContentInfo(session, bundle,
+                contentLoaderService.unlockBundleContentInfo(metadataSession, bundle,
                     success, createdNodes);
             }
 
@@ -228,9 +230,9 @@ public class Loader {
 
         } else {
             try {
-                jcrContentHelper.createRepositoryPath(session, ContentLoaderService.BUNDLE_CONTENT_NODE);
+                contentLoaderService.createRepositoryPath(session, ContentLoaderService.BUNDLE_CONTENT_NODE);
 
-                final Map<String, Object> bundleContentInfo = jcrContentHelper.getBundleContentInfo(
+                final Map<String, Object> bundleContentInfo = contentLoaderService.getBundleContentInfo(
                         session, bundle, false);
 
                 // if we don't get an info, someone else is currently loading or unloading
@@ -241,9 +243,9 @@ public class Loader {
 
                 try {
                     uninstallContent(session, bundle, (String[])bundleContentInfo.get(ContentLoaderService.PROPERTY_UNINSTALL_PATHS));
-                    jcrContentHelper.contentIsUninstalled(session, bundle);
+                    contentLoaderService.contentIsUninstalled(session, bundle);
                 } finally {
-                    jcrContentHelper.unlockBundleContentInfo(session, bundle, false, null);
+                    contentLoaderService.unlockBundleContentInfo(session, bundle, false, null);
 
                 }
             } catch (RepositoryException re) {
@@ -259,12 +261,13 @@ public class Loader {
      * Install the content from the bundle.
      * @return If the content should be removed on uninstall, a list of top nodes
      */
-    private List<String> installContent(final Session session,
+    private List<String> installContent(final Session defaultSession,
                                         final Bundle bundle,
                                         final Iterator<PathEntry> pathIter,
                                         final boolean contentAlreadyLoaded)
     throws RepositoryException {
         final List<String> createdNodes = new ArrayList<String>();
+        final Map<String, Session> createdSessions = new HashMap<String, Session>();
 
         log.debug("Installing initial content from bundle {}",
             bundle.getSymbolicName());
@@ -273,8 +276,20 @@ public class Loader {
             while (pathIter.hasNext()) {
                 final PathEntry entry = pathIter.next();
                 if (!contentAlreadyLoaded || entry.isOverwrite()) {
+                    String workspace = entry.getWorkspace();
+                    final Session targetSession;
+                    if (workspace != null) {
+                        if (createdSessions.containsKey(workspace)){
+                            targetSession = createdSessions.get(workspace);
+                        } else {
+                            targetSession = createSession(workspace);
+                            createdSessions.put(workspace, targetSession);
+                        }
+                    } else {
+                        targetSession = defaultSession;
+                    }
 
-                    final Node targetNode = getTargetNode(session, entry.getTarget());
+                    final Node targetNode = getTargetNode(targetSession, entry.getTarget());
 
                     if (targetNode != null) {
                         installFromPath(bundle, entry.getPath(), entry, targetNode,
@@ -299,8 +314,13 @@ public class Loader {
             }
 
             // persist modifications now
-            session.refresh(true);
-            session.save();
+            defaultSession.refresh(true);
+            defaultSession.save();
+
+            for (Session session : createdSessions.values()) {
+                session.refresh(true);
+                session.save();
+            }
 
             // finally checkin versionable nodes
             for (final Node versionable : this.contentCreator.getVersionables()) {
@@ -309,8 +329,13 @@ public class Loader {
 
         } finally {
             try {
-                if (session.hasPendingChanges()) {
-                    session.refresh(false);
+                if (defaultSession.hasPendingChanges()) {
+                    defaultSession.refresh(false);
+                }
+                for (Session session : createdSessions.values()) {
+                    if (session.hasPendingChanges()) {
+                        session.refresh(false);
+                    }
                 }
             } catch (RepositoryException re) {
                 log.warn(
@@ -318,6 +343,9 @@ public class Loader {
                     bundle.getSymbolicName(), re);
             }
             this.contentCreator.clear();
+            for (Session session : createdSessions.values()) {
+                session.logout();
+            }
         }
         log.debug("Done installing initial content from bundle {}",
             bundle.getSymbolicName());
@@ -811,4 +839,15 @@ public class Loader {
         return name;
 
     }
+
+    private Session createSession(String workspace) throws RepositoryException {
+        try {
+            return contentLoaderService.getRepository().loginAdministrative(workspace);
+        } catch (NoSuchWorkspaceException e) {
+            Session temp = contentLoaderService.getRepository().loginAdministrative(null);
+            temp.getWorkspace().createWorkspace(workspace);
+            temp.logout();
+            return contentLoaderService.getRepository().loginAdministrative(workspace);
+        }
+    }
 }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
index 64213c5..2532ee1 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
@@ -50,6 +50,11 @@ public class PathEntry {
     public static final String PATH_DIRECTIVE = "path";
 
     /**
+     * The workspace into which the content will be loaded.
+     */
+    public static final String WORKSPACE_DIRECTIVE = "workspace";
+
+    /**
      * The checkin directive specifying whether versionable nodes should be
      * checked in
      */
@@ -84,6 +89,9 @@ public class PathEntry {
      */
     private final String target;
 
+    /** Workspace to import into. */
+    private final String workspace;
+
     public static Iterator<PathEntry> getContentPaths(final Bundle bundle) {
         final List<PathEntry> entries = new ArrayList<PathEntry>();
 
@@ -147,6 +155,14 @@ public class PathEntry {
                 this.ignoreImportProviders.add(st.nextToken());
             }
         }
+
+        // workspace directive
+        final String workspaceValue = entry.getDirectiveValue(WORKSPACE_DIRECTIVE);
+        if (pathValue != null) {
+            this.workspace = workspaceValue;
+        } else {
+            this.workspace = null;
+        }
     }
 
     public String getPath() {
@@ -175,4 +191,8 @@ public class PathEntry {
     public String getTarget() {
         return target;
     }
+
+    public String getWorkspace() {
+        return workspace;
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 17/28: SLING-1582 added better information at debug level.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 649f3d41bfddcd1a84df811dc3f9df008b9177dd
Author: Ian Boston <ie...@apache.org>
AuthorDate: Fri Jul 2 22:24:24 2010 +0000

    SLING-1582 added better information at debug level.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@960126 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/jcr/contentloader/internal/Loader.java   | 91 ++++++++++++----------
 1 file changed, 50 insertions(+), 41 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index d00bb9e..53e9b86 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -440,51 +440,60 @@ public class Loader extends BaseImportLoader {
     throws RepositoryException {
         final URL file = bundle.getEntry(entry);
         final String name = getName(entry);
-
-        if (processedEntries.containsKey(file)) {
-            // this is a consumed node descriptor
-            return;
-        }
-
-        // check for node descriptor
-        URL nodeDescriptor = null;
-        for (String ext : this.contentCreator.getImportProviders().keySet()) {
-            nodeDescriptor = bundle.getEntry(entry + ext);
-            if (nodeDescriptor != null) {
-                break;
+        try {
+            if (processedEntries.containsKey(file)) {
+                // this is a consumed node descriptor
+                return;
             }
-        }
-
-        // install if it is a descriptor
-        boolean foundProvider = this.contentCreator.getImportProvider(entry) != null;
-
-        Node node = null;
-        if (foundProvider) {
-            if ((node = createNode(parent, name, file, configuration)) != null) {
-                processedEntries.put(file, node);
+    
+            // check for node descriptor
+            URL nodeDescriptor = null;
+            for (String ext : this.contentCreator.getImportProviders().keySet()) {
+                nodeDescriptor = bundle.getEntry(entry + ext);
+                if (nodeDescriptor != null) {
+                    break;
+                }
             }
-        }
-
-        // otherwise just place as file
-        if ( node == null ) {
-            try {
-                createFile(configuration, parent, file, createdNodes);
-                node = parent.getNode(name);
-            } catch (IOException ioe) {
-                log.warn("Cannot create file node for {}", file, ioe);
+    
+            // install if it is a descriptor
+            boolean foundProvider = this.contentCreator.getImportProvider(entry) != null;
+    
+            Node node = null;
+            if (foundProvider) {
+                if ((node = createNode(parent, name, file, configuration)) != null) {
+                    log.debug("Created Node as {} {} ",node.getPath(),name);
+                    processedEntries.put(file, node);
+                } else {
+                    log.warn("No Node created for file {} {} ",file,name);
+                }
+            } else {
+                log.debug("Cant find provider for Entry {} at {} ",entry,name);
             }
-        }
-        // if we have a descriptor, which has not been processed yet,
-        // process it
-        if (nodeDescriptor != null && processedEntries.get(nodeDescriptor) == null ) {
-            try {
-                this.contentCreator.setIgnoreOverwriteFlag(true);
-                node = createNode(parent, name, nodeDescriptor,
-                                  configuration);
-                processedEntries.put(nodeDescriptor, node);
-            } finally {
-                this.contentCreator.setIgnoreOverwriteFlag(false);
+    
+            // otherwise just place as file
+            if ( node == null ) {
+                try {
+                    createFile(configuration, parent, file, createdNodes);
+                    node = parent.getNode(name);
+                } catch (IOException ioe) {
+                    log.warn("Cannot create file node for {}", file, ioe);
+                }
+            }
+            // if we have a descriptor, which has not been processed yet,
+            // process it
+            if (nodeDescriptor != null && processedEntries.get(nodeDescriptor) == null ) {
+                try {
+                    this.contentCreator.setIgnoreOverwriteFlag(true);
+                    node = createNode(parent, name, nodeDescriptor,
+                                      configuration);
+                    processedEntries.put(nodeDescriptor, node);
+                } finally {
+                    this.contentCreator.setIgnoreOverwriteFlag(false);
+                }
             }
+        } catch ( RepositoryException e ) {
+            log.error("Failed to process process file {} from {}", file, name);
+            throw e;
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 05/28: SLING-1409 : Reverting the change

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 3a22eb3905bec86bdf61d51c0d0e14dfcd3e9e3f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Feb 25 09:15:17 2010 +0000

    SLING-1409 : Reverting the change
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@916189 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/jcr/contentloader/internal/PathEntry.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
index b9f4882..64213c5 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
@@ -142,7 +142,7 @@ public class PathEntry {
         this.ignoreImportProviders = new ArrayList<String>();
         final String expandValue = entry.getDirectiveValue(IGNORE_IMPORT_PROVIDERS_DIRECTIVE);
         if ( expandValue != null && expandValue.length() > 0 ) {
-            final StringTokenizer st = new StringTokenizer(expandValue, "/");
+            final StringTokenizer st = new StringTokenizer(expandValue, ",");
             while ( st.hasMoreTokens() ) {
                 this.ignoreImportProviders.add(st.nextToken());
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 25/28: SLING-1627 import operation support for overwrite of properties

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit fda07c0691badf1cf52b974fb049da46ecc2ab8f
Author: Eric Norman <en...@apache.org>
AuthorDate: Fri Aug 6 22:23:05 2010 +0000

    SLING-1627 import operation support for overwrite of properties
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@983135 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  6 ++
 .../sling/jcr/contentloader/ImportOptions.java     | 24 ++++++
 .../internal/DefaultContentCreator.java            |  8 +-
 .../jcr/contentloader/internal/PathEntry.java      | 27 +++++-
 .../internal/DefaultContentCreatorTest.java        | 97 ++++++++++++++++++++++
 5 files changed, 158 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 05718ef..eb2c58f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -161,6 +161,12 @@
             <groupId>org.jmock</groupId>
             <artifactId>jmock-junit4</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-nop</artifactId>
+            <version>1.5.2</version>
+            <scope>test</scope>
+        </dependency>
 
         <!-- for security content loader (users/groups/acls) -->
         <dependency>
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/ImportOptions.java b/src/main/java/org/apache/sling/jcr/contentloader/ImportOptions.java
index fa3d53c..b380f8b 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/ImportOptions.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/ImportOptions.java
@@ -24,10 +24,34 @@ package org.apache.sling.jcr.contentloader;
  */
 public abstract class ImportOptions {
 
+	/**
+	 * Specifies whether imported nodes should overwrite existing nodes.
+	 * NOTE: this means the existing node will be deleted and a new node 
+	 * will be created in the same location.
+	 * @return true to overwrite nodes, false otherwise
+	 */
 	public abstract boolean isOverwrite();
 
+	/**
+	 * Specifies whether imported properties should overwrite existing properties.
+	 * @return true to overwrite node properties, false otherwise
+	 */
+	public abstract boolean isPropertyOverwrite();
+
+	/**
+	 * Specifies whether versionable nodes is automatically checked in at the
+	 * end of the import operation.
+	 * @return true to checkin the versionable nodes, false otherwise
+	 */
 	public abstract boolean isCheckin();
 
+	/**
+	 * Check if the import provider for the given file extension should
+	 * be ignored.
+	 * 
+	 * @param extension the extension to check
+	 * @return true to ignore the provider, false otherwise
+	 */
 	public abstract boolean isIgnoredImportProvider(String extension);
 
 }
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index 97bf1b9..a67b72f 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -307,9 +307,10 @@ public class DefaultContentCreator implements ContentCreator {
     public void createProperty(String name, int propertyType, String value)
     throws RepositoryException {
         final Node node = this.parentNodeStack.peek();
-        // check if the property already exists, don't overwrite it in this case
+        // check if the property already exists and isPropertyOverwrite() is false, don't overwrite it in this case
         if (node.hasProperty(name)
-            && !node.getProperty(name).isNew()) {
+            && !this.configuration.isPropertyOverwrite()
+            && !node.getProperty(name).isNew()) { 
             return;
         }
 
@@ -364,8 +365,9 @@ public class DefaultContentCreator implements ContentCreator {
     public void createProperty(String name, int propertyType, String[] values)
     throws RepositoryException {
         final Node node = this.parentNodeStack.peek();
-        // check if the property already exists, don't overwrite it in this case
+        // check if the property already exists and isPropertyOverwrite() is false, don't overwrite it in this case
         if (node.hasProperty(name)
+            && !this.configuration.isPropertyOverwrite()
             && !node.getProperty(name).isNew()) {
             return;
         }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
index aa003c4..75989a3 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
@@ -41,6 +41,12 @@ public class PathEntry extends ImportOptions {
      */
     public static final String OVERWRITE_DIRECTIVE = "overwrite";
 
+    /**
+     * The overwriteProperties directive specifying if content properties 
+     * should be overwritten or just initially added.
+     */
+    public static final String OVERWRITE_PROPERTIES_DIRECTIVE = "overwriteProperties";
+
     /** The uninstall directive specifying if content should be uninstalled. */
     public static final String UNINSTALL_DIRECTIVE = "uninstall";
 
@@ -75,6 +81,9 @@ public class PathEntry extends ImportOptions {
     /** Should existing content be overwritten? */
     private final boolean overwrite;
 
+    /** Should existing content properties be overwritten? */
+    private final boolean overwriteProperties;
+
     /** Should existing content be uninstalled? */
     private final boolean uninstall;
 
@@ -123,6 +132,14 @@ public class PathEntry extends ImportOptions {
             this.overwrite = false;
         }
 
+        // overwriteProperties directive
+        final String overwritePropertiesValue = entry.getDirectiveValue(OVERWRITE_PROPERTIES_DIRECTIVE);
+        if (overwritePropertiesValue != null) {
+            this.overwriteProperties = Boolean.valueOf(overwritePropertiesValue);
+        } else {
+            this.overwriteProperties = false;
+        }
+        
         // uninstall directive
         final String uninstallValue = entry.getDirectiveValue(UNINSTALL_DIRECTIVE);
         if (uninstallValue != null) {
@@ -177,7 +194,15 @@ public class PathEntry extends ImportOptions {
         return this.overwrite;
     }
 
-    public boolean isUninstall() {
+    /* (non-Javadoc)
+	 * @see org.apache.sling.jcr.contentloader.ImportOptions#isPropertyOverwrite()
+	 */
+	@Override
+	public boolean isPropertyOverwrite() {
+		return this.overwriteProperties;
+	}
+
+	public boolean isUninstall() {
         return this.uninstall;
     }
 
diff --git a/src/test/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreatorTest.java b/src/test/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreatorTest.java
new file mode 100644
index 0000000..c195396
--- /dev/null
+++ b/src/test/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreatorTest.java
@@ -0,0 +1,97 @@
+package org.apache.sling.jcr.contentloader.internal;
+
+import java.util.HashMap;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+
+import org.apache.sling.jcr.contentloader.ImportOptions;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.runner.RunWith;
+
+@RunWith(JMock.class)
+public class DefaultContentCreatorTest {
+    
+    DefaultContentCreator contentCreator;
+    
+    Mockery mockery = new JUnit4Mockery();
+    
+    Node parentNode;
+    
+    Property prop;
+    
+    @org.junit.Test public void willRewriteUndefinedPropertyType() throws RepositoryException {
+        contentCreator = new DefaultContentCreator(null);
+        parentNode = mockery.mock(Node.class);
+        prop = mockery.mock(Property.class);
+        contentCreator.init(new ImportOptions(){
+
+            @Override
+            public boolean isCheckin() {
+                return false;
+            }
+
+            @Override
+            public boolean isIgnoredImportProvider(String extension) {
+                return false;
+            }
+
+            @Override
+            public boolean isOverwrite() {
+                return true;
+            }
+            
+            @Override
+			public boolean isPropertyOverwrite() {
+				return true;
+			} }, new HashMap<String, ImportProvider>(), null, null);
+        
+        contentCreator.prepareParsing(parentNode, null);
+        this.mockery.checking(new Expectations() {{
+            oneOf (parentNode).hasProperty("foo"); will(returnValue(Boolean.TRUE));
+            oneOf (parentNode).setProperty(with(equal("foo")), with(equal("bar")));
+        }});
+        contentCreator.createProperty("foo", PropertyType.UNDEFINED, "bar");
+    }
+    
+    @org.junit.Test public void willNotRewriteUndefinedPropertyType() throws RepositoryException {
+        contentCreator = new DefaultContentCreator(null);
+        parentNode = mockery.mock(Node.class);
+        prop = mockery.mock(Property.class);
+        contentCreator.init(new ImportOptions(){
+
+            @Override
+            public boolean isCheckin() {
+                return false;
+            }
+
+            @Override
+            public boolean isIgnoredImportProvider(String extension) {
+                return false;
+            }
+
+            @Override
+            public boolean isOverwrite() {
+                return false;
+            }
+
+			@Override
+			public boolean isPropertyOverwrite() {
+				return false;
+			} }, new HashMap<String, ImportProvider>(), null, null);
+        
+        contentCreator.prepareParsing(parentNode, null);
+        this.mockery.checking(new Expectations() {{
+            oneOf (parentNode).hasProperty("foo"); will(returnValue(Boolean.TRUE));
+            oneOf (parentNode).getProperty("foo"); will(returnValue(prop));
+            oneOf (prop).isNew(); will(returnValue(Boolean.FALSE));
+        }});
+        contentCreator.createProperty("foo", PropertyType.UNDEFINED, "bar");
+    }
+
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 26/28: upgrading contentloader to depend upon base release

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 560747be6dfd6f0744c720f5e9a51c47f78c2ef1
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Mon Sep 6 14:57:20 2010 +0000

    upgrading contentloader to depend upon base release
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@993054 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index eb2c58f..557fec6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -172,7 +172,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.base</artifactId>
-            <version>2.0.7-SNAPSHOT</version>
+            <version>2.1.0</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 21/28: SLING-1448 - removing unused constant

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 1a2abcd926f6d4e4b064b7100076ec9ec9441a21
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Jul 7 13:37:38 2010 +0000

    SLING-1448 - removing unused constant
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@961370 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/jcr/contentloader/internal/ContentLoaderService.java  | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
index b023d68..432b4f1 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
@@ -60,9 +60,6 @@ import org.slf4j.LoggerFactory;
  */
 public class ContentLoaderService implements SynchronousBundleListener, JcrContentHelper {
 
-    /** The manifest header to specify the workspace for initial content loading. */
-    public static final String CONTENT_WORKSPACE_HEADER = "Sling-Initial-Content-Workspace";
-
     public static final String PROPERTY_CONTENT_LOADED = "content-loaded";
     private static final String PROPERTY_CONTENT_LOADED_AT = "content-load-time";
     private static final String PROPERTY_CONTENT_LOADED_BY = "content-loaded-by";

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 16/28: SLING-1172 Allow uploading JSON files to create content structures

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 06c581e216bceffbea0143e859e8ffe80dae7894
Author: Eric Norman <en...@apache.org>
AuthorDate: Sun Jun 27 19:36:49 2010 +0000

    SLING-1172 Allow uploading JSON files to create content structures
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@958411 13f79535-47bb-0310-9956-ffa450edef68
---
 .../jcr/contentloader/ContentImportListener.java   |  67 ++++++
 .../sling/jcr/contentloader/ContentImporter.java   |  53 +++++
 .../ContentReader.java => ImportOptions.java}      |  25 +--
 .../contentloader/internal/BaseImportLoader.java   |  54 +++++
 .../internal/ContentLoaderService.java             |   4 +-
 .../jcr/contentloader/internal/ContentReader.java  |   9 +
 .../internal/DefaultContentCreator.java            |  76 ++++++-
 .../internal/DefaultContentImporter.java           | 238 +++++++++++++++++++++
 .../{ContentReader.java => JcrContentHelper.java}  |  31 +--
 .../sling/jcr/contentloader/internal/Loader.java   |  36 +---
 .../jcr/contentloader/internal/PathEntry.java      |  12 +-
 .../contentloader/internal/readers/JsonReader.java |   3 +-
 .../contentloader/internal/readers/XmlReader.java  |  25 ++-
 .../contentloader/internal/readers/ZipReader.java  |  16 +-
 14 files changed, 569 insertions(+), 80 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/ContentImportListener.java b/src/main/java/org/apache/sling/jcr/contentloader/ContentImportListener.java
new file mode 100644
index 0000000..b27735c
--- /dev/null
+++ b/src/main/java/org/apache/sling/jcr/contentloader/ContentImportListener.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.sling.jcr.contentloader;
+
+/**
+ * Listener interface to provide callbacks for all imported updates
+ * for interested parties.  This is primarily used to record
+ * the modifications during the "import" post operation.
+ */
+public interface ContentImportListener {
+
+    /**
+     * Content has been updated. The source path provides the path of
+     * the modified Item.
+     */
+	void onModify(String srcPath);
+
+    /**
+     * An Item has been deleted. The source path provides the path of the
+     * deleted Item.
+     */
+	void onDelete(String srcPath);
+	
+    /**
+     * An Item has been moved to a new location. The source provides the
+     * original path of the Item, the destination provides the new path of the
+     * Item.
+     */
+	void onMove(String srcPath, String destPath);
+
+    /**
+     * An Item has been copied to a new location. The source path provides the
+     * path of the copied Item, the destination path provides the path of the
+     * new Item.
+     */
+	void onCopy(String srcPath, String destPath);
+
+    /**
+     * A Node has been created. The source path provides the path of the newly
+     * created Node.
+     */
+	void onCreate(String srcPath);
+
+    /**
+     * A child Node has been reordered. The orderedPath provides the path of the
+     * node, which has been reordered. ThebeforeSibbling provides the name of
+     * the sibling node before which the source Node has been ordered. 
+     */
+	void onReorder(String orderedPath, String beforeSibbling);
+	
+}
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/ContentImporter.java b/src/main/java/org/apache/sling/jcr/contentloader/ContentImporter.java
new file mode 100644
index 0000000..e780324
--- /dev/null
+++ b/src/main/java/org/apache/sling/jcr/contentloader/ContentImporter.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.sling.jcr.contentloader;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+
+/**
+ * The <code>ContentImporter</code> service
+ * <p>
+ * This interface is not intended to be implemented by bundles. It is
+ * implemented by this bundle and may be used by client bundles.
+ * </p>
+ */
+public interface ContentImporter {
+
+	/**
+	 * Import content into the repository by parsing the provided
+	 * content stream.
+	 * 
+	 * @param parent the root node for the imported content
+	 * @param name the name of the imported content.  The file extension determines the content type
+	 * @param contentStream the content stream to be imported
+	 * @param importOptions (optional) additional options to control the import
+	 * @param importListener (optional) listener to receive callbacks for each change in the import
+	 * @throws RepositoryException
+	 * @throws IOException
+	 */
+	void importContent(Node parent, String name,
+			InputStream contentStream, ImportOptions importOptions,
+			ContentImportListener importListener) throws RepositoryException, IOException;
+
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java b/src/main/java/org/apache/sling/jcr/contentloader/ImportOptions.java
similarity index 60%
copy from src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java
copy to src/main/java/org/apache/sling/jcr/contentloader/ImportOptions.java
index 14bdbc0..fa3d53c 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/ImportOptions.java
@@ -16,25 +16,18 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.jcr.contentloader.internal;
+package org.apache.sling.jcr.contentloader;
 
-import java.io.IOException;
-import java.net.URL;
-
-import javax.jcr.RepositoryException;
 
 /**
- * The <code>ContentReader</code>
- * A content reader is provided by an {@link ImportProvider}.
+ * Encapsulates the options for the content import. 
  */
-public interface ContentReader {
+public abstract class ImportOptions {
+
+	public abstract boolean isOverwrite();
+
+	public abstract boolean isCheckin();
 
-    /**
-     * Read the content from the URL and create the
-     * content using the provided content creator.
-     * @param url The input stream.
-     * @throws IOException
-     */
-    void parse(URL url, ContentCreator creator) throws IOException, RepositoryException;
+	public abstract boolean isIgnoredImportProvider(String extension);
 
-}
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/BaseImportLoader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/BaseImportLoader.java
new file mode 100644
index 0000000..dd8c2f4
--- /dev/null
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/BaseImportLoader.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.sling.jcr.contentloader.internal;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.sling.jcr.contentloader.internal.readers.JsonReader;
+import org.apache.sling.jcr.contentloader.internal.readers.XmlReader;
+import org.apache.sling.jcr.contentloader.internal.readers.ZipReader;
+
+/**
+ * Base class that takes care of the details that are common to bundle content
+ * loader and the POST operation "import" loader.
+ */
+public abstract class BaseImportLoader {
+    public static final String EXT_XML = ".xml";
+    public static final String EXT_JCR_XML = ".jcr.xml";
+    public static final String EXT_JSON = ".json";
+    public static final String EXT_JAR = ".jar";
+    public static final String EXT_ZIP = ".zip";
+
+    /** All available import providers. */
+    Map<String, ImportProvider> defaultImportProviders;
+
+	public BaseImportLoader() {
+        defaultImportProviders = new LinkedHashMap<String, ImportProvider>();
+        defaultImportProviders.put(EXT_JCR_XML, null);
+        defaultImportProviders.put(EXT_JSON, JsonReader.PROVIDER);
+        defaultImportProviders.put(EXT_XML, XmlReader.PROVIDER);
+        defaultImportProviders.put(EXT_JAR, ZipReader.JAR_PROVIDER);
+        defaultImportProviders.put(EXT_ZIP, ZipReader.ZIP_PROVIDER);
+	}
+
+    public void dispose() {
+        defaultImportProviders = null;
+    }
+}
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
index 2d68b2c..b023d68 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
@@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory;
  *               Content Loader Implementation"
  * @scr.property name="service.vendor" value="The Apache Software Foundation"
  */
-public class ContentLoaderService implements SynchronousBundleListener {
+public class ContentLoaderService implements SynchronousBundleListener, JcrContentHelper {
 
     /** The manifest header to specify the workspace for initial content loading. */
     public static final String CONTENT_WORKSPACE_HEADER = "Sling-Initial-Content-Workspace";
@@ -220,7 +220,7 @@ public class ContentLoaderService implements SynchronousBundleListener {
      * @return the digested value
      * @throws IllegalArgumentException
      */
-    protected String digestPassword(String pwd) throws IllegalArgumentException {
+    public String digestPassword(String pwd) throws IllegalArgumentException {
         try {
             StringBuffer password = new StringBuffer();
             password.append("{").append(passwordDigestAlgoritm).append("}");
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java
index 14bdbc0..a7b3dfc 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java
@@ -19,6 +19,7 @@
 package org.apache.sling.jcr.contentloader.internal;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 
 import javax.jcr.RepositoryException;
@@ -37,4 +38,12 @@ public interface ContentReader {
      */
     void parse(URL url, ContentCreator creator) throws IOException, RepositoryException;
 
+    /**
+     * Read the content from the input stream and create the
+     * content using the provided content creator.
+     * @param ins the input stream.
+     * @throws IOException
+     */
+    void parse(InputStream ins, ContentCreator contentCreator) throws IOException, RepositoryException;
+    
 }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index b1bc0e3..3c5565d 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -24,6 +24,10 @@ import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
+import org.apache.sling.jcr.contentloader.ContentImportListener;
+import org.apache.sling.jcr.contentloader.ImportOptions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
@@ -59,7 +63,10 @@ import javax.jcr.ValueFactory;
  */
 public class DefaultContentCreator implements ContentCreator {
 
-	private PathEntry configuration;
+    /** default log */
+    final Logger log = LoggerFactory.getLogger(getClass());
+
+	private ImportOptions configuration;
 
     private final Pattern jsonDatePattern = Pattern.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}[-+]{1}[0-9]{2}[:]{0,1}[0-9]{2}$");
     private final SimpleDateFormat jsonDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
@@ -85,7 +92,7 @@ public class DefaultContentCreator implements ContentCreator {
     private static final String DEFAULT_CONTENT_TYPE = "application/octet-stream";
 
     /** Helper class to get the mime type of a file. */
-    private final ContentLoaderService jcrContentHelper;
+    private final JcrContentHelper jcrContentHelper;
 
     /** List of active import providers mapped by extension. */
     private Map<String, ImportProvider> importProviders;
@@ -93,6 +100,9 @@ public class DefaultContentCreator implements ContentCreator {
     /** Optional list of created nodes (for uninstall) */
     private List<String> createdNodes;
 
+    /** Optional listener to get notified about changes */
+    private ContentImportListener importListener;
+    
     /**
      * A one time use seed to randomize the user location.
      */
@@ -107,7 +117,7 @@ public class DefaultContentCreator implements ContentCreator {
      * Constructor.
      * @param jcrContentHelper Helper class to get the mime type of a file
      */
-    public DefaultContentCreator(ContentLoaderService jcrContentHelper) {
+    public DefaultContentCreator(JcrContentHelper jcrContentHelper) {
         this.jcrContentHelper = jcrContentHelper;
     }
 
@@ -117,9 +127,10 @@ public class DefaultContentCreator implements ContentCreator {
      * @param defaultImportProviders List of all import providers.
      * @param createdNodes Optional list to store new nodes (for uninstall)
      */
-    public void init(final PathEntry pathEntry,
+    public void init(final ImportOptions pathEntry,
                      final Map<String, ImportProvider> defaultImportProviders,
-                     final List<String> createdNodes) {
+                     final List<String> createdNodes,
+                     final ContentImportListener importListener) {
         this.configuration = pathEntry;
         // create list of allowed import providers
         this.importProviders = new HashMap<String, ImportProvider>();
@@ -131,6 +142,7 @@ public class DefaultContentCreator implements ContentCreator {
             }
         }
         this.createdNodes = createdNodes;
+        this.importListener = importListener;
     }
 
     /**
@@ -254,7 +266,9 @@ public class DefaultContentCreator implements ContentCreator {
                 if ( this.createdNodes != null ) {
                     this.createdNodes.add(node.getPath());
                 }
-
+                if ( this.importListener != null ) {
+                	this.importListener.onCreate(node.getPath());
+                }
             } else {
 
                 // explicit primary node type
@@ -262,6 +276,9 @@ public class DefaultContentCreator implements ContentCreator {
                 if ( this.createdNodes != null ) {
                     this.createdNodes.add(node.getPath());
                 }
+                if ( this.importListener != null ) {
+                	this.importListener.onCreate(node.getPath());
+                }
             }
 
             // ammend mixin node types
@@ -305,6 +322,10 @@ public class DefaultContentCreator implements ContentCreator {
             String uuid = getUUID(node.getSession(), propPath, getAbsPath(node, value));
             if (uuid != null) {
                 node.setProperty(name, uuid, propertyType);
+                
+                if ( this.importListener != null ) {
+                	this.importListener.onCreate(node.getProperty(name).getPath());
+                }
             }
 
         } else if ("jcr:isCheckedOut".equals(name)) {
@@ -325,12 +346,18 @@ public class DefaultContentCreator implements ContentCreator {
               // Fall back to default behaviour if this fails
               node.setProperty(name, value, propertyType);
             }
+            if ( this.importListener != null ) {
+            	this.importListener.onCreate(node.getProperty(name).getPath());
+            }
         } else {
             if (propertyType == PropertyType.UNDEFINED) {
                 node.setProperty(name, value);
             } else {
                 node.setProperty(name, value, propertyType);
             }
+            if ( this.importListener != null ) {
+            	this.importListener.onCreate(node.getProperty(name).getPath());
+            }
         }
     }
 
@@ -358,6 +385,9 @@ public class DefaultContentCreator implements ContentCreator {
             }
 
             node.setProperty(name, uuids, propertyType);
+            if ( this.importListener != null ) {
+            	this.importListener.onCreate(node.getProperty(name).getPath());
+            }
 
             if (!hasAll) {
                 delayedMultipleReferences.put(propPath, uuidOrPaths);
@@ -376,16 +406,21 @@ public class DefaultContentCreator implements ContentCreator {
             }
             catch (ParseException e) {
               // If this failes, fallback to the default
-              jcrContentHelper.log.warn("Could not create dates for property, fallingback to defaults", e);
+              log.warn("Could not create dates for property, fallingback to defaults", e);
               node.setProperty(name, values, propertyType);
             }
-
+            if ( this.importListener != null ) {
+            	this.importListener.onCreate(node.getProperty(name).getPath());
+            }
         } else {
             if (propertyType == PropertyType.UNDEFINED) {
                 node.setProperty(name, values);
             } else {
                 node.setProperty(name, values, propertyType);
             }
+            if ( this.importListener != null ) {
+            	this.importListener.onCreate(node.getProperty(name).getPath());
+            }
         }
     }
 
@@ -515,12 +550,18 @@ public class DefaultContentCreator implements ContentCreator {
                         }
                     }
                     parentNode.setProperty(name, uuids, PropertyType.REFERENCE);
+                    if ( this.importListener != null ) {
+                    	this.importListener.onCreate(parentNode.getProperty(name).getPath());
+                    }
 
                     if (hasAll) {
                         delayedMultipleReferences.remove(property);
                     }
                 } else {
                     parentNode.setProperty(name, uuid, PropertyType.REFERENCE);
+                    if ( this.importListener != null ) {
+                    	this.importListener.onCreate(parentNode.getProperty(name).getPath());
+                    }
                 }
             }
         }
@@ -594,11 +635,18 @@ public class DefaultContentCreator implements ContentCreator {
         }
         if ( value == null ) {
             if ( node.hasProperty(name) ) {
+            	String propPath = node.getProperty(name).getPath();
                 node.getProperty(name).remove();
+                if ( this.importListener != null ) {
+                	this.importListener.onDelete(propPath);
+                }
             }
         } else {
             final Value jcrValue = this.createValue(node.getSession().getValueFactory(), value);
             node.setProperty(name, jcrValue);
+            if ( this.importListener != null ) {
+            	this.importListener.onModify(node.getProperty(name).getPath());
+            }
         }
     }
 
@@ -612,7 +660,11 @@ public class DefaultContentCreator implements ContentCreator {
         }
         if ( values == null || values.length == 0 ) {
             if ( node.hasProperty(name) ) {
+            	String propPath = node.getProperty(name).getPath();
                 node.getProperty(name).remove();
+                if ( this.importListener != null ) {
+                	this.importListener.onDelete(propPath);
+                }
             }
         } else {
             final Value[] jcrValues = new Value[values.length];
@@ -620,6 +672,9 @@ public class DefaultContentCreator implements ContentCreator {
                 jcrValues[i] = this.createValue(node.getSession().getValueFactory(), values[i]);
             }
             node.setProperty(name, jcrValues);
+            if ( this.importListener != null ) {
+            	this.importListener.onModify(node.getProperty(name).getPath());
+            }
         }
     }
 
@@ -651,7 +706,7 @@ public class DefaultContentCreator implements ContentCreator {
         if (mimeType == null) {
             mimeType = jcrContentHelper.getMimeType(name);
             if (mimeType == null) {
-                jcrContentHelper.log.info(
+                log.info(
                     "createFile: Cannot find content type for {}, using {}",
                     name, DEFAULT_CONTENT_TYPE);
                 mimeType = DEFAULT_CONTENT_TYPE;
@@ -687,6 +742,9 @@ public class DefaultContentCreator implements ContentCreator {
                 if ( this.createdNodes != null ) {
                     this.createdNodes.add(n.getPath());
                 }
+                if ( this.importListener != null ) {
+                	this.importListener.onCreate(node.getPath());
+                }
             }
             node = node.getNode(token);
         }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java
new file mode 100644
index 0000000..c974fd7
--- /dev/null
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java
@@ -0,0 +1,238 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.sling.jcr.contentloader.internal;
+
+import static javax.jcr.ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.List;
+
+import javax.jcr.InvalidSerializedDataException;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.commons.mime.MimeTypeService;
+import org.apache.sling.jcr.contentloader.ContentImportListener;
+import org.apache.sling.jcr.contentloader.ContentImporter;
+import org.apache.sling.jcr.contentloader.ImportOptions;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The <code>DefaultContentImporter</code> is the default implementation of the 
+ * ContentImporter service providing the following functionality:
+ * <ul>
+ * <li>Import content into the content repository.
+ * </ul>
+ *
+ * @scr.component immediate="false" label="%content.import.service.name"
+ *                description="%content.import.service.description"
+ * @scr.property name="service.vendor" value="The Apache Software Foundation"
+ * @scr.property name="service.description"
+ *               value="Apache Sling Contnet Importer Service"
+ * @scr.service interface="org.apache.sling.jcr.contentloader.ContentImporter"
+ */
+public class DefaultContentImporter extends BaseImportLoader implements JcrContentHelper, ContentImporter {
+
+    /** default log */
+    private final Logger log = LoggerFactory.getLogger(DefaultContentImporter.class);
+
+    /**
+     * The MimeTypeService used by the initial content initialContentLoader to
+     * resolve MIME types for files to be installed.
+     *
+     * @scr.reference
+     */
+    private MimeTypeService mimeTypeService;
+    
+    /**
+     * To be used for the encryption. E.g. for passwords in
+     * {@link javax.jcr.SimpleCredentials#getPassword()} SimpleCredentials}
+     *
+     * @scr.property valueRef="DEFAULT_PASSWORD_DIGEST_ALGORITHM"
+     */
+    private static final String PROP_PASSWORD_DIGEST_ALGORITHM = "password.digest.algorithm";
+    private static final String DEFAULT_PASSWORD_DIGEST_ALGORITHM = "sha1";
+    private String passwordDigestAlgoritm = null;
+    
+    
+    /* (non-Javadoc)
+	 * @see org.apache.sling.jcr.contentloader.ContentImporter#importContent(javax.jcr.Node, java.lang.String, java.io.InputStream, org.apache.sling.jcr.contentloader.ImportOptions, org.apache.sling.jcr.contentloader.ContentImportListener)
+	 */
+	public void importContent(Node parent, String name,
+			InputStream contentStream, ImportOptions importOptions,
+			ContentImportListener importListener) throws RepositoryException, IOException {
+		
+        // special treatment for system view imports
+        if (name.endsWith(EXT_JCR_XML)) {
+            Node node = importSystemView(parent, name, contentStream);
+            if (node != null) {
+            	if (importListener != null) {
+            		importListener.onCreate(node.getPath());
+            	}
+            	return;
+            }
+        }
+		
+    	DefaultContentCreator contentCreator = new DefaultContentCreator(this);
+        List<String> createdPaths = new ArrayList<String>();
+        contentCreator.init(importOptions, this.defaultImportProviders, createdPaths, importListener);
+        
+        contentCreator.prepareParsing(parent, toPlainName(contentCreator, name));
+        
+        final ImportProvider ip = contentCreator.getImportProvider(name);
+        ContentReader reader = ip.getReader();
+		reader.parse(contentStream, contentCreator);
+
+		//save changes
+        Session session = parent.getSession();
+		session.save();
+
+        // finally checkin versionable nodes
+        for (final Node versionable : contentCreator.getVersionables()) {
+            versionable.checkin();
+        }
+    }
+    
+    private String toPlainName(DefaultContentCreator contentCreator, String name) {
+        final String providerExt = contentCreator.getImportProviderExtension(name);
+        if (providerExt != null) {
+            return name.substring(0, name.length() - providerExt.length());
+        }
+        return name;
+    }
+
+    
+    /**
+     * Import the XML file as JCR system or document view import. If the XML
+     * file is not a valid system or document view export/import file,
+     * <code>false</code> is returned.
+     *
+     * @param parent The parent node below which to import
+     * @param name the name of the import resource
+     * @param contentStream The XML content to import
+     * @return <code>true</code> if the import succeeds, <code>false</code>
+     *         if the import fails due to XML format errors.
+     * @throws IOException If an IO error occurrs reading the XML file.
+     */
+    private Node importSystemView(Node parent, String name, InputStream contentStream)
+    		throws IOException {
+        InputStream ins = null;
+        try {
+
+            // check whether we have the content already, nothing to do then
+            if ( name.endsWith(EXT_JCR_XML) ) {
+                name = name.substring(0, name.length() - EXT_JCR_XML.length());
+            }
+            if (parent.hasNode(name)) {
+                log.debug(
+                    "importSystemView: Node {} for XML already exists, nothing to to",
+                    name);
+                return parent.getNode(name);
+            }
+
+            ins = contentStream;
+            Session session = parent.getSession();
+            session.importXML(parent.getPath(), ins, IMPORT_UUID_CREATE_NEW);
+
+            // additionally check whether the expected child node exists
+            return (parent.hasNode(name)) ? parent.getNode(name) : null;
+        } catch (InvalidSerializedDataException isde) {
+
+            // the xml might not be System or Document View export, fall back
+            // to old-style XML reading
+            log.info(
+                "importSystemView: XML does not seem to be system view export, trying old style; cause: {}",
+                isde.toString());
+            return null;
+        } catch (RepositoryException re) {
+
+            // any other repository related issue...
+            log.info(
+                "importSystemView: Repository issue loading XML, trying old style; cause: {}",
+                re.toString());
+            return null;
+        } finally {
+            if (ins != null) {
+                try {
+                    ins.close();
+                } catch (IOException ignore) {
+                    // ignore
+                }
+            }
+        }
+    }
+    
+    
+    // ---------- JcrContentHelper implementation ---------------------------------------------
+    
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jcr.contentloader.internal.JcrContentHelper#digestPassword(java.lang.String)
+	 */
+	public String digestPassword(String pwd) throws IllegalArgumentException {
+        try {
+            StringBuffer password = new StringBuffer();
+            password.append("{").append(passwordDigestAlgoritm).append("}");
+            password.append(DefaultContentCreator.digest(passwordDigestAlgoritm,
+                pwd.getBytes("UTF-8")));
+            return password.toString();
+        } catch (NoSuchAlgorithmException e) {
+            throw new IllegalArgumentException(e.toString());
+        } catch (UnsupportedEncodingException e) {
+            throw new IllegalArgumentException(e.toString());
+        }
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.sling.jcr.contentloader.internal.JcrContentHelper#getMimeType(java.lang.String)
+	 */
+	public String getMimeType(String name) {
+        // local copy to not get NPE despite check for null due to concurrent
+        // unbind
+        MimeTypeService mts = mimeTypeService;
+        return (mts != null) ? mts.getMimeType(name) : null;
+	}
+	
+	
+    // ---------- SCR Integration ---------------------------------------------
+
+    /** Activates this component, called by SCR before registering as a service */
+    protected void activate(ComponentContext componentContext) {
+        Dictionary<?, ?> props = componentContext.getProperties();
+        Object propValue = props.get(PROP_PASSWORD_DIGEST_ALGORITHM);
+        if (propValue instanceof String) {
+            passwordDigestAlgoritm = (String) propValue;
+        } else {
+            passwordDigestAlgoritm = DEFAULT_PASSWORD_DIGEST_ALGORITHM;
+        }
+    }
+ 
+    /** Deativates this component, called by SCR to take out of service */
+    protected void deactivate(ComponentContext componentContext) {
+        passwordDigestAlgoritm = null;
+    }
+    
+}
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/JcrContentHelper.java
similarity index 62%
copy from src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java
copy to src/main/java/org/apache/sling/jcr/contentloader/internal/JcrContentHelper.java
index 14bdbc0..734bf59 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/JcrContentHelper.java
@@ -18,23 +18,26 @@
  */
 package org.apache.sling.jcr.contentloader.internal;
 
-import java.io.IOException;
-import java.net.URL;
-
-import javax.jcr.RepositoryException;
 
 /**
- * The <code>ContentReader</code>
- * A content reader is provided by an {@link ImportProvider}.
+ * Interface to provide helpers for the ContentCreator
+ *
  */
-public interface ContentReader {
+public interface JcrContentHelper {
+
+	/**
+	 * Returns the MIME type from the MimeTypeService for the given name
+	 * @param name the name of the file to get the mimeType for  
+	 */
+	String getMimeType(String name);
 
-    /**
-     * Read the content from the URL and create the
-     * content using the provided content creator.
-     * @param url The input stream.
-     * @throws IOException
-     */
-    void parse(URL url, ContentCreator creator) throws IOException, RepositoryException;
+	/**
+	 * Digest the given password using the configured digest algorithm
+	 * 
+	 * @param pwd the password to digest
+	 * @return digested password
+	 * @throws IllegalArgumentException
+	 */
+    String digestPassword(String pwd) throws IllegalArgumentException;
 
 }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index b52fb82..d00bb9e 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -31,7 +31,6 @@ import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -44,9 +43,7 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.apache.sling.jcr.contentloader.internal.readers.JsonReader;
-import org.apache.sling.jcr.contentloader.internal.readers.XmlReader;
-import org.apache.sling.jcr.contentloader.internal.readers.ZipReader;
+import org.apache.sling.jcr.contentloader.ImportOptions;
 import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -54,17 +51,7 @@ import org.slf4j.LoggerFactory;
 /**
  * The <code>Loader</code> loads initial content from the bundle.
  */
-public class Loader {
-
-    public static final String EXT_XML = ".xml";
-
-    public static final String EXT_JCR_XML = ".jcr.xml";
-
-    public static final String EXT_JSON = ".json";
-
-    public static final String EXT_JAR = ".jar";
-
-    public static final String EXT_ZIP = ".zip";
+public class Loader extends BaseImportLoader {
 
     public static final String ROOT_DESCRIPTOR = "/ROOT";
 
@@ -73,25 +60,16 @@ public class Loader {
 
     private ContentLoaderService contentLoaderService;
 
-    /** All available import providers. */
-    private Map<String, ImportProvider> defaultImportProviders;
-
     private final DefaultContentCreator contentCreator;
 
     // bundles whose registration failed and should be retried
     private List<Bundle> delayedBundles;
 
     public Loader(ContentLoaderService contentLoaderService) {
-        this.contentLoaderService = contentLoaderService;
+    	super();
+    	this.contentLoaderService = contentLoaderService;
         this.contentCreator = new DefaultContentCreator(contentLoaderService);
         this.delayedBundles = new LinkedList<Bundle>();
-
-        defaultImportProviders = new LinkedHashMap<String, ImportProvider>();
-        defaultImportProviders.put(EXT_JCR_XML, null);
-        defaultImportProviders.put(EXT_JSON, JsonReader.PROVIDER);
-        defaultImportProviders.put(EXT_XML, XmlReader.PROVIDER);
-        defaultImportProviders.put(EXT_JAR, ZipReader.JAR_PROVIDER);
-        defaultImportProviders.put(EXT_ZIP, ZipReader.ZIP_PROVIDER);
     }
 
     public void dispose() {
@@ -100,7 +78,7 @@ public class Loader {
             delayedBundles = null;
         }
         contentLoaderService = null;
-        defaultImportProviders = null;
+        super.dispose();
     }
 
     /**
@@ -369,7 +347,7 @@ public class Loader {
                                  final List<String> createdNodes)
     throws RepositoryException {
         //  init content creator
-        this.contentCreator.init(configuration, this.defaultImportProviders, createdNodes);
+        this.contentCreator.init(configuration, this.defaultImportProviders, createdNodes, null);
 
         final Map<URL, Node> processedEntries = new HashMap<URL, Node>();
 
@@ -598,7 +576,7 @@ public class Loader {
             path = srcPath.substring(0, pos + 1) + name;
         }
 
-        this.contentCreator.init(configuration, defaultImportProviders, createdNodes);
+        this.contentCreator.init(configuration, defaultImportProviders, createdNodes, null);
         this.contentCreator.prepareParsing(parent, name);
         final URLConnection conn = source.openConnection();
         final long lastModified = conn.getLastModified();
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
index 2532ee1..aa003c4 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
@@ -24,12 +24,13 @@ import java.util.List;
 import java.util.StringTokenizer;
 
 import org.apache.sling.commons.osgi.ManifestHeader;
+import org.apache.sling.jcr.contentloader.ImportOptions;
 import org.osgi.framework.Bundle;
 
 /**
  * A path entry from the manifest for initial content.
  */
-public class PathEntry {
+public class PathEntry extends ImportOptions {
 
     /** The manifest header to specify initial content to be loaded. */
     public static final String CONTENT_HEADER = "Sling-Initial-Content";
@@ -169,6 +170,9 @@ public class PathEntry {
         return this.path;
     }
 
+    /* (non-Javadoc)
+	 * @see org.apache.sling.jcr.contentloader.internal.ImportOptions#isOverwrite()
+	 */
     public boolean isOverwrite() {
         return this.overwrite;
     }
@@ -177,10 +181,16 @@ public class PathEntry {
         return this.uninstall;
     }
 
+    /* (non-Javadoc)
+	 * @see org.apache.sling.jcr.contentloader.internal.ImportOptions#isCheckin()
+	 */
     public boolean isCheckin() {
         return this.checkin;
     }
 
+    /* (non-Javadoc)
+	 * @see org.apache.sling.jcr.contentloader.internal.ImportOptions#isIgnoredImportProvider(java.lang.String)
+	 */
     public boolean isIgnoredImportProvider(String extension) {
         if ( extension.startsWith(".") ) {
             extension = extension.substring(1);
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
index 2a8e599..4889357 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
@@ -156,7 +156,8 @@ public class JsonReader implements ContentReader {
             }
 
             JSONObject json = new JSONObject(jsonString);
-            this.createNode(null, json, contentCreator);
+            String optionalName = json.optString("name", null);
+            this.createNode(optionalName, json, contentCreator);
         } catch (JSONException je) {
             throw (IOException) new IOException(je.getMessage()).initCause(je);
         }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/XmlReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/XmlReader.java
index 8cd74e1..5dfad35 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/XmlReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/XmlReader.java
@@ -172,14 +172,32 @@ public class XmlReader implements ContentReader {
         }
     }
 
-    private void parseInternal(final InputStream bufferedInput,
+    /* (non-Javadoc)
+	 * @see org.apache.sling.jcr.contentloader.internal.ContentReader#parse(java.io.InputStream, org.apache.sling.jcr.contentloader.internal.ContentCreator)
+	 */
+	public void parse(InputStream ins, ContentCreator creator)
+			throws IOException, RepositoryException {
+        BufferedInputStream bufferedInput = null;
+        try {
+            // We need to buffer input, so that we can reset the stream if we encounter an XSL stylesheet reference
+            bufferedInput = new BufferedInputStream(ins);
+            URL xmlLocation = null;
+            parseInternal(bufferedInput, creator, xmlLocation);
+        } catch (XmlPullParserException xppe) {
+            throw (IOException) new IOException(xppe.getMessage()).initCause(xppe);
+        } finally {
+            closeStream(bufferedInput);
+        }
+	}
+
+	private void parseInternal(final InputStream bufferedInput,
                                final ContentCreator creator,
                                final URL xmlLocation)
     throws XmlPullParserException, IOException, RepositoryException {
         final StringBuilder contentBuffer = new StringBuilder();
         // Mark the beginning of the stream. We assume that if there's an XSL processing instruction,
         // it will occur in the first gulp - which makes sense, as processing instructions must be
-        // specified before the root elemeent of an XML file.
+        // specified before the root element of an XML file.
         bufferedInput.mark(bufferedInput.available());
         // set the parser input, use null encoding to force detection with
         // <?xml?>
@@ -594,7 +612,8 @@ public class XmlReader implements ContentReader {
      */
     protected static class AttributeMap extends HashMap<String, String> {
 
-        private static final AttributeMap instance = new AttributeMap();
+		private static final long serialVersionUID = -6304058237706001104L;
+		private static final AttributeMap instance = new AttributeMap();
 
         public static AttributeMap getInstance() {
             return instance;
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/ZipReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/ZipReader.java
index e4debee..949f186 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/ZipReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/ZipReader.java
@@ -73,10 +73,16 @@ public class ZipReader implements ContentReader {
      * @see org.apache.sling.jcr.contentloader.internal.ContentReader#parse(java.net.URL, org.apache.sling.jcr.contentloader.internal.ContentCreator)
      */
     public void parse(java.net.URL url, ContentCreator creator)
-    throws IOException, RepositoryException {
-        InputStream ins = null;
+    		throws IOException, RepositoryException {
+    	parse(url.openStream(), creator);
+    }
+
+	/**
+	 * @see org.apache.sling.jcr.contentloader.internal.ContentReader#parse(java.io.InputStream, org.apache.sling.jcr.contentloader.internal.ContentCreator)
+	 */
+	public void parse(InputStream ins, ContentCreator creator)
+			throws IOException, RepositoryException {
         try {
-            ins = url.openStream();
             creator.createNode(null, NT_FOLDER, null);
             final ZipInputStream zis = new ZipInputStream(ins);
             ZipEntry entry;
@@ -109,6 +115,6 @@ public class ZipReader implements ContentReader {
                 }
             }
         }
-    }
-
+	}
+    
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 12/28: Use released parent pom.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 9198b47e98aece1ada4c6b8ba633f5003543a3dd
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon May 17 13:42:29 2010 +0000

    Use released parent pom.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@945149 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 764f8b5..05718ef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>8</version>
+        <version>9</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 18/28: SLING-1583 Changed name to :name and added to ignore list.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit af5c7d35aca47597b262e5c7f64d3b0a7c5774d0
Author: Ian Boston <ie...@apache.org>
AuthorDate: Fri Jul 2 22:25:40 2010 +0000

    SLING-1583  Changed name to :name and added to ignore list.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@960127 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/jcr/contentloader/internal/readers/JsonReader.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
index 4889357..01696e0 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
@@ -105,6 +105,7 @@ public class JsonReader implements ContentReader {
         ignoredNames.add("jcr:successors");
         ignoredNames.add("jcr:checkedOut");
         ignoredNames.add("jcr:created");
+        ignoredNames.add(":name");
     }
 
     private static final Set<String> ignoredPrincipalPropertyNames = new HashSet<String>();
@@ -156,7 +157,7 @@ public class JsonReader implements ContentReader {
             }
 
             JSONObject json = new JSONObject(jsonString);
-            String optionalName = json.optString("name", null);
+            String optionalName = json.optString(":name", null);
             this.createNode(optionalName, json, contentCreator);
         } catch (JSONException je) {
             throw (IOException) new IOException(je.getMessage()).initCause(je);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 11/28: Remove unused import

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 31d0cc4883a353924a66a653ff8e90355799a9b6
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 4 14:01:06 2010 +0000

    Remove unused import
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@940860 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index 34fc88e..2675d58 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -44,7 +44,6 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.contentloader.internal.readers.JsonReader;
 import org.apache.sling.jcr.contentloader.internal.readers.XmlReader;
 import org.apache.sling.jcr.contentloader.internal.readers.ZipReader;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 23/28: Clean up code

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit c9c1e2afcc959dbfcbaffd02db19f18577105fed
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 15 07:30:42 2010 +0000

    Clean up code
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@964331 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/jcr/contentloader/internal/Loader.java | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index 4e01752..4cf8d52 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -43,7 +43,6 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.apache.sling.jcr.contentloader.ImportOptions;
 import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -445,7 +444,7 @@ public class Loader extends BaseImportLoader {
                 // this is a consumed node descriptor
                 return;
             }
-    
+
             // check for node descriptor
             URL nodeDescriptor = null;
             for (String ext : this.contentCreator.getImportProviders().keySet()) {
@@ -454,10 +453,10 @@ public class Loader extends BaseImportLoader {
                     break;
                 }
             }
-    
+
             // install if it is a descriptor
             boolean foundProvider = this.contentCreator.getImportProvider(entry) != null;
-    
+
             Node node = null;
             if (foundProvider) {
                 if ((node = createNode(parent, name, file, configuration)) != null) {
@@ -469,7 +468,7 @@ public class Loader extends BaseImportLoader {
             } else {
                 log.debug("Cant find provider for Entry {} at {} ",entry,name);
             }
-    
+
             // otherwise just place as file
             if ( node == null ) {
                 try {
@@ -663,14 +662,14 @@ public class Loader extends BaseImportLoader {
     private void uninstallContent(final Session defaultSession, final Bundle bundle,
             final String[] uninstallPaths) {
         final Map<String, Session> createdSessions = new HashMap<String, Session>();
-        
+
         try {
             log.debug("Uninstalling initial content from bundle {}",
                 bundle.getSymbolicName());
             if ( uninstallPaths != null && uninstallPaths.length > 0 ) {
                 for(String path : uninstallPaths) {
                     final Session targetSession;
-                    
+
                     final int wsSepPos = path.indexOf(":/");
                     if (wsSepPos != -1) {
                         final String workspaceName = path.substring(0, wsSepPos);
@@ -691,7 +690,7 @@ public class Loader extends BaseImportLoader {
                         targetSession.getItem(path).remove();
                     }
                 }
-                
+
                 // persist modifications now
                 defaultSession.save();
 
@@ -720,7 +719,7 @@ public class Loader extends BaseImportLoader {
                     "Failure to rollback uninstaling initial content for bundle {}",
                     bundle.getSymbolicName(), re);
             }
-            
+
             for (Session session : createdSessions.values()) {
                 session.logout();
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 03/28: SLING-1395 - adding support for multi-valued properties

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 7e16c918135f85a65971ec33ec39014baecb7fdb
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Feb 19 02:46:55 2010 +0000

    SLING-1395 - adding support for multi-valued properties
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@911681 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/jcr/contentloader/internal/DefaultContentCreator.java     | 6 +++++-
 .../apache/sling/jcr/contentloader/internal/readers/JsonReader.java | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index 961cdf1..eecb203 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -388,7 +388,11 @@ public class DefaultContentCreator implements ContentCreator {
             }
 
         } else {
-            node.setProperty(name, values, propertyType);
+            if (propertyType == PropertyType.UNDEFINED) {
+                node.setProperty(name, values);
+            } else {
+                node.setProperty(name, values, propertyType);
+            }
         }
     }
 
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
index 1e65518..b2bb316 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
@@ -92,6 +92,8 @@ public class JsonReader implements ContentReader {
     private static final Pattern jsonDate = Pattern.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}[-+]{1}[0-9]{2}[:]{0,1}[0-9]{2}$");
     private static final String REFERENCE = "jcr:reference:";
     private static final String PATH = "jcr:path:";
+    private static final String NAME = "jcr:name:";
+    private static final String URI = "jcr:uri:";
 
     private static final Set<String> ignoredNames = new HashSet<String>();
     static {
@@ -235,6 +237,8 @@ public class JsonReader implements ContentReader {
         } else if (object instanceof String) {
             if (name.startsWith(REFERENCE)) return PropertyType.REFERENCE;
             if (name.startsWith(PATH)) return PropertyType.PATH;
+            if (name.startsWith(NAME)) return PropertyType.NAME;
+            if (name.startsWith(URI)) return PropertyType.URI;
             if (jsonDate.matcher((String) object).matches()) return PropertyType.DATE;
         }
 
@@ -245,6 +249,8 @@ public class JsonReader implements ContentReader {
     protected String getName(String name) {
         if (name.startsWith(REFERENCE)) return name.substring(REFERENCE.length());
         if (name.startsWith(PATH)) return name.substring(PATH.length());
+        if (name.startsWith(NAME)) return name.substring(NAME.length());
+        if (name.startsWith(URI)) return name.substring(URI.length());
         return name;
     }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 28/28: [maven-scm] copy for tag org.apache.sling.jcr.contentloader-2.1.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 9c3c2e8e916368aa0234adbbeb981847d3b58b0d
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Mon Sep 6 14:58:34 2010 +0000

    [maven-scm] copy for tag org.apache.sling.jcr.contentloader-2.1.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.contentloader-2.1.0@993056 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 06/28: SLING-1411 Add replaceAccessControlEntry method to AccessControlUtil Thanks to Ray Davis for the contribution.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit ca5b19b5380dd9f7c8c9bc2bbab246cd524a7a90
Author: Eric Norman <en...@apache.org>
AuthorDate: Sat Feb 27 02:02:09 2010 +0000

    SLING-1411 Add replaceAccessControlEntry method to AccessControlUtil
    Thanks to Ray Davis for the contribution.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@916893 13f79535-47bb-0310-9956-ffa450edef68
---
 .../internal/DefaultContentCreator.java            | 136 ++-------------------
 1 file changed, 13 insertions(+), 123 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index eecb203..9882ca3 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -18,6 +18,13 @@
  */
 package org.apache.sling.jcr.contentloader.internal;
 
+import org.apache.jackrabbit.api.security.principal.PrincipalManager;
+import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.Group;
+import org.apache.jackrabbit.api.security.user.User;
+import org.apache.jackrabbit.api.security.user.UserManager;
+import org.apache.sling.jcr.base.util.AccessControlUtil;
+
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.security.MessageDigest;
@@ -26,11 +33,9 @@ import java.security.Principal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -47,18 +52,6 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
-import javax.jcr.security.AccessControlEntry;
-import javax.jcr.security.AccessControlList;
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.security.AccessControlPolicy;
-import javax.jcr.security.AccessControlPolicyIterator;
-import javax.jcr.security.Privilege;
-
-import org.apache.jackrabbit.api.security.user.Authorizable;
-import org.apache.jackrabbit.api.security.user.Group;
-import org.apache.jackrabbit.api.security.user.User;
-import org.apache.jackrabbit.api.security.user.UserManager;
-import org.apache.sling.jcr.base.util.AccessControlUtil;
 
 /**
  * The <code>ContentLoader</code> creates the nodes and properties.
@@ -810,120 +803,17 @@ public class DefaultContentCreator implements ContentCreator {
 			throws RepositoryException {
 		final Node parentNode = this.parentNodeStack.peek();
 		Session session = parentNode.getSession();
-
-		UserManager userManager = AccessControlUtil.getUserManager(session);
-		Authorizable authorizable = userManager.getAuthorizable(principalId);
-		if (authorizable == null) {
+		PrincipalManager principalManager = AccessControlUtil.getPrincipalManager(session);
+		Principal principal = principalManager.getPrincipal(principalId);
+		if (principal == null) {
 			throw new RepositoryException("No principal found for id: " + principalId);
 		}
-
 		String resourcePath = parentNode.getPath();
 
-		AccessControlManager accessControlManager = AccessControlUtil.getAccessControlManager(session);
-		AccessControlList updatedAcl = null;
-		AccessControlPolicy[] policies = accessControlManager.getPolicies(resourcePath);
-		for (AccessControlPolicy policy : policies) {
-		  if (policy instanceof AccessControlList) {
-		    updatedAcl = (AccessControlList)policy;
-		    break;
-		  }
-		}
-		if (updatedAcl == null) {
-		  AccessControlPolicyIterator applicablePolicies = accessControlManager.getApplicablePolicies(resourcePath);
-		  while (applicablePolicies.hasNext()) {
-		    AccessControlPolicy policy = applicablePolicies.nextAccessControlPolicy();
-		    if (policy instanceof AccessControlList) {
-		      updatedAcl = (AccessControlList)policy;
-		    }
-		  }
-		}
-		if (updatedAcl == null) {
-			throw new RepositoryException("Unable to find or create an access control policy to update for " + resourcePath);
-		}
-
-		Set<String> postedPrivilegeNames = new HashSet<String>();
-		if (grantedPrivilegeNames != null) {
-			postedPrivilegeNames.addAll(Arrays.asList(grantedPrivilegeNames));
+		if ((grantedPrivilegeNames != null) || (deniedPrivilegeNames != null)) {
+			AccessControlUtil.replaceAccessControlEntry(session, resourcePath, principal,
+					grantedPrivilegeNames, deniedPrivilegeNames, null);
 		}
-		if (deniedPrivilegeNames != null) {
-			postedPrivilegeNames.addAll(Arrays.asList(deniedPrivilegeNames));
-		}
-
-		List<Privilege> preserveGrantedPrivileges = new ArrayList<Privilege>();
-		List<Privilege> preserveDeniedPrivileges = new ArrayList<Privilege>();
-
-		//keep track of the existing Aces for the target principal
-		AccessControlEntry[] accessControlEntries = updatedAcl.getAccessControlEntries();
-		List<AccessControlEntry> oldAces = new ArrayList<AccessControlEntry>();
-		for (AccessControlEntry ace : accessControlEntries) {
-			if (principalId.equals(ace.getPrincipal().getName())) {
-				oldAces.add(ace);
-
-				boolean isAllow = AccessControlUtil.isAllow(ace);
-				Privilege[] privileges = ace.getPrivileges();
-				for (Privilege privilege : privileges) {
-					String privilegeName = privilege.getName();
-					if (!postedPrivilegeNames.contains(privilegeName)) {
-						//this privilege was not posted, so record the existing state to be
-						// preserved when the ACE is re-created below
-						if (isAllow) {
-							preserveGrantedPrivileges.add(privilege);
-						} else {
-							preserveDeniedPrivileges.add(privilege);
-						}
-					}
-				}
-			}
-		}
-
-		//remove the old aces
-		if (!oldAces.isEmpty()) {
-			for (AccessControlEntry ace : oldAces) {
-				updatedAcl.removeAccessControlEntry(ace);
-			}
-		}
-
-		//add a fresh ACE with the granted privileges
-		List<Privilege> grantedPrivilegeList = new ArrayList<Privilege>();
-		if (grantedPrivilegeNames != null) {
-		  for (String name : grantedPrivilegeNames) {
-			  if (name.length() == 0) {
-				  continue; //empty, skip it.
-			  }
-			  Privilege privilege = accessControlManager.privilegeFromName(name);
-			  grantedPrivilegeList.add(privilege);
-	    }
-		}
-		//add the privileges that should be preserved
-		grantedPrivilegeList.addAll(preserveGrantedPrivileges);
-
-		if (grantedPrivilegeList.size() > 0) {
-			Principal principal = authorizable.getPrincipal();
-			updatedAcl.addAccessControlEntry(principal, grantedPrivilegeList.toArray(new Privilege[grantedPrivilegeList.size()]));
-		}
-
-		//if the authorizable is a user (not a group) process any denied privileges
-		if (!authorizable.isGroup()) {
-			//add a fresh ACE with the denied privileges
-			List<Privilege> deniedPrivilegeList = new ArrayList<Privilege>();
-			if (deniedPrivilegeNames != null) {
-			  for (String name : deniedPrivilegeNames) {
-				  if (name.length() == 0) {
-					  continue; //empty, skip it.
-				  }
-				  Privilege privilege = accessControlManager.privilegeFromName(name);
-				  deniedPrivilegeList.add(privilege);
-			  }
-			}
-			//add the privileges that should be preserved
-			deniedPrivilegeList.addAll(preserveDeniedPrivileges);
-			if (deniedPrivilegeList.size() > 0) {
-				Principal principal = authorizable.getPrincipal();
-				AccessControlUtil.addEntry(updatedAcl, principal, deniedPrivilegeList.toArray(new Privilege[deniedPrivilegeList.size()]), false);
-			}
-		}
-
-		accessControlManager.setPolicy(resourcePath, updatedAcl);
 	}
 
 	/**

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 24/28: SLING-1613 Fixed and change the test pattern to include arrays.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 24b16f2ca85e978cbd5d9b8fc0c38fabf8ba733e
Author: Ian Boston <ie...@apache.org>
AuthorDate: Wed Jul 28 14:50:58 2010 +0000

    SLING-1613 Fixed and change the test pattern to include arrays.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@980080 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
index 2a8e599..68560ec 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
@@ -214,7 +214,7 @@ public class JsonReader implements ContentReader {
                 for (int i = 0; i < array.length(); i++) {
                     values[i] = array.get(i).toString();
                 }
-                final int propertyType = getType(name, values[0]);
+                final int propertyType = getType(name, array.get(0));
                 contentCreator.createProperty(getName(name), propertyType, values);
             } else {
                 contentCreator.createProperty(getName(name), PropertyType.STRING, new String[0]);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 04/28: SLING-1409 : ignoreImportProviders doesn't allow multiple values.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit a62f635c3f77b9488d83095f16f6e6836b119a81
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Feb 24 13:34:15 2010 +0000

    SLING-1409 : ignoreImportProviders doesn't allow multiple values.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@915786 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/jcr/contentloader/internal/PathEntry.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
index 64213c5..b9f4882 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java
@@ -142,7 +142,7 @@ public class PathEntry {
         this.ignoreImportProviders = new ArrayList<String>();
         final String expandValue = entry.getDirectiveValue(IGNORE_IMPORT_PROVIDERS_DIRECTIVE);
         if ( expandValue != null && expandValue.length() > 0 ) {
-            final StringTokenizer st = new StringTokenizer(expandValue, ",");
+            final StringTokenizer st = new StringTokenizer(expandValue, "/");
             while ( st.hasMoreTokens() ) {
                 this.ignoreImportProviders.add(st.nextToken());
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 15/28: SLING-1561 - changing destination of ROOT descriptor if path is specified in manifest entry

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 90b2827883cff37e059c26a1d05f00a251f37e8c
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Sat Jun 19 01:32:15 2010 +0000

    SLING-1561 - changing destination of ROOT descriptor if path is specified in manifest entry
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@956170 13f79535-47bb-0310-9956-ffa450edef68
---
 .../internal/DefaultContentCreator.java            | 32 +++++++++++-----------
 .../sling/jcr/contentloader/internal/Loader.java   | 17 ++++++------
 2 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index 0b96104..b1bc0e3 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -73,11 +73,11 @@ public class DefaultContentCreator implements ContentCreator {
     private final Map<String, List<String>> delayedReferences = new HashMap<String, List<String>>();
     private final Map<String, String[]> delayedMultipleReferences = new HashMap<String, String[]>();
 
-    private String defaultRootName;
+    private String defaultName;
 
-    private Node rootNode;
+    private Node createdRootNode;
 
-    private boolean isRootNodeImport;
+    private boolean isParentNodeImport;
 
     private boolean ignoreOverwriteFlag = false;
 
@@ -135,17 +135,17 @@ public class DefaultContentCreator implements ContentCreator {
 
     /**
      *
-     * If the defaultRootName is null, we are in ROOT_NODE import mode.
+     * If the defaultName is null, we are in PARENT_NODE import mode.
      * @param parentNode
-     * @param defaultRootName
+     * @param defaultName
      */
     public void prepareParsing(final Node parentNode,
-                               final String defaultRootName) {
+                               final String defaultName) {
         this.parentNodeStack.clear();
         this.parentNodeStack.push(parentNode);
-        this.defaultRootName = defaultRootName;
-        this.rootNode = null;
-        isRootNodeImport = defaultRootName == null;
+        this.defaultName = defaultName;
+        isParentNodeImport = defaultName == null;
+        this.createdRootNode = null;
     }
 
     /**
@@ -173,8 +173,8 @@ public class DefaultContentCreator implements ContentCreator {
     /**
      * Get the created root node.
      */
-    public Node getRootNode() {
-        return this.rootNode;
+    public Node getCreatedRootNode() {
+        return this.createdRootNode;
     }
 
     /**
@@ -231,11 +231,11 @@ public class DefaultContentCreator implements ContentCreator {
             if ( this.parentNodeStack.size() > 1 ) {
                 throw new RepositoryException("Node needs to have a name.");
             }
-            name = this.defaultRootName;
+            name = this.defaultName;
         }
 
-        // if we are in root node import mode, we don't create the root top level node!
-        if ( !isRootNodeImport || this.parentNodeStack.size() > 1 ) {
+        // if we are in parent node import mode, we don't create the root top level node!
+        if ( !isParentNodeImport || this.parentNodeStack.size() > 1 ) {
             // if node already exists but should be overwritten, delete it
             if (!this.ignoreOverwriteFlag && this.configuration.isOverwrite() && parentNode.hasNode(name)) {
                 parentNode.getNode(name).remove();
@@ -281,8 +281,8 @@ public class DefaultContentCreator implements ContentCreator {
             }
 
             this.parentNodeStack.push(node);
-            if ( this.rootNode == null ) {
-                this.rootNode = node;
+            if ( this.createdRootNode == null ) {
+                this.createdRootNode = node;
             }
         }
     }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index 2675d58..b52fb82 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -392,11 +392,10 @@ public class Loader {
             return;
         }
 
-        // potential root node import/extension
-        URL rootNodeDescriptor = importRootNode(parent.getSession(), bundle, path);
-        if (rootNodeDescriptor != null) {
-            processedEntries.put(rootNodeDescriptor,
-                parent.getSession().getRootNode());
+        // potential parent node import/extension
+        URL parentNodeDescriptor = importParentNode(parent.getSession(), bundle, path, parent);
+        if (parentNodeDescriptor != null) {
+            processedEntries.put(parentNodeDescriptor, parent);
         }
 
         while (entries.hasMoreElements()) {
@@ -549,7 +548,7 @@ public class Loader {
             this.contentCreator.prepareParsing(parent, toPlainName(name));
             nodeReader.parse(resourceUrl, this.contentCreator);
 
-            return this.contentCreator.getRootNode();
+            return this.contentCreator.getCreatedRootNode();
         } catch (RepositoryException re) {
             throw re;
         } catch (Throwable t) {
@@ -807,9 +806,9 @@ public class Loader {
 
     /**
      * Imports mixin nodes and properties (and optionally child nodes) of the
-     * root node.
+     * parent node.
      */
-    private URL importRootNode(Session session, Bundle bundle, String path)
+    private URL importParentNode(Session session, Bundle bundle, String path, Node parent)
     throws RepositoryException {
         final Descriptor descriptor = getRootNodeDescriptor(bundle, path);
         // no root descriptor found
@@ -818,7 +817,7 @@ public class Loader {
         }
 
         try {
-            this.contentCreator.prepareParsing(session.getRootNode(), null);
+            this.contentCreator.prepareParsing(parent, null);
             descriptor.nodeReader.parse(descriptor.rootNodeDescriptor, this.contentCreator);
 
             return descriptor.rootNodeDescriptor;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 08/28: SLING-1457 SLING-1458 - enable support for specifying the position of an ACE (within the ACL) when it is added/updated

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 2a30280e53f132026e0c5662d31cd532247a5d59
Author: Eric Norman <en...@apache.org>
AuthorDate: Thu Mar 25 18:34:30 2010 +0000

    SLING-1457 SLING-1458 - enable support for specifying the position of an ACE (within the ACL) when it is added/updated
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@927532 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/jcr/contentloader/internal/ContentCreator.java      | 11 ++++++++++-
 .../jcr/contentloader/internal/DefaultContentCreator.java     |  5 +++--
 .../sling/jcr/contentloader/internal/readers/JsonReader.java  |  4 +++-
 .../sling/jcr/contentloader/internal/JsonReaderTest.java      |  9 +++++----
 .../jcr/contentloader/internal/readers/XmlReaderTest.java     |  3 ++-
 5 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentCreator.java
index 6d25b51..9f49b64 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentCreator.java
@@ -162,8 +162,17 @@ public interface ContentCreator {
      * @param principal the user or group id for the ACE
      * @param grantedPrivileges the set of privileges to grant the principal
      * @param deniedPrivileges the set of privileges to deny the principal (for users only)
+     * @param order specifies the position of the ACE in the containing ACL. (may be null)
+     *         Value should be one of these:
+     *         <table>
+     * 			<tr><td>first</td><td>Place the target ACE as the first amongst its siblings</td></tr>
+	 *			<tr><td>last</td><td>Place the target ACE as the last amongst its siblings</td></tr>
+	 * 			<tr><td>before xyz</td><td>Place the target ACE immediately before the sibling whose name is xyz</td></tr>
+	 * 			<tr><td>after xyz</td><td>Place the target ACE immediately after the sibling whose name is xyz</td></tr>
+	 * 			<tr><td>numeric</td><td>Place the target ACE at the specified index</td></tr>
+	 *         </table>
      * @throws RepositoryException
      */
-    void createAce(String principal, String [] grantedPrivileges, String [] deniedPrivileges )
+    void createAce(String principal, String [] grantedPrivileges, String [] deniedPrivileges, String order )
     throws RepositoryException;
 }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index 9882ca3..eb628c8 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -799,7 +799,8 @@ public class DefaultContentCreator implements ContentCreator {
 	 * @see org.apache.sling.jcr.contentloader.internal.ContentCreator#createAce(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[])
 	 */
 	public void createAce(String principalId,
-			String[] grantedPrivilegeNames, String[] deniedPrivilegeNames)
+			String[] grantedPrivilegeNames, String[] deniedPrivilegeNames,
+			String order)
 			throws RepositoryException {
 		final Node parentNode = this.parentNodeStack.peek();
 		Session session = parentNode.getSession();
@@ -812,7 +813,7 @@ public class DefaultContentCreator implements ContentCreator {
 
 		if ((grantedPrivilegeNames != null) || (deniedPrivilegeNames != null)) {
 			AccessControlUtil.replaceAccessControlEntry(session, resourcePath, principal,
-					grantedPrivilegeNames, deniedPrivilegeNames, null);
+					grantedPrivilegeNames, deniedPrivilegeNames, null, order);
 		}
 	}
 
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
index b2bb316..2a8e599 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
@@ -427,8 +427,10 @@ public class JsonReader implements ContentReader {
 			}
 		}
 
+		String order = ace.optString("order", null);
+		
 		//do the work.
-		contentCreator.createAce(principalID, grantedPrivileges, deniedPrivileges);
+		contentCreator.createAce(principalID, grantedPrivileges, deniedPrivileges, order);
     }
 
 }
diff --git a/src/test/java/org/apache/sling/jcr/contentloader/internal/JsonReaderTest.java b/src/test/java/org/apache/sling/jcr/contentloader/internal/JsonReaderTest.java
index ad90a46..bf63883 100644
--- a/src/test/java/org/apache/sling/jcr/contentloader/internal/JsonReaderTest.java
+++ b/src/test/java/org/apache/sling/jcr/contentloader/internal/JsonReaderTest.java
@@ -276,16 +276,17 @@ public class JsonReaderTest {
     			"  {" +
     			"    \"principal\" : \"groupname2\"," +
     			"    \"granted\" : [\"jcr:read\"]," +
-    			"    \"denied\" : [\"jcr:write\"]" +
+    			"    \"denied\" : [\"jcr:write\"]," +
+    			"    \"order\" : \"first\"" +
     			"  }" +
     			"]" +
     			"}";
         this.mockery.checking(new Expectations() {{
         	allowing(creator).createNode(null, null, null); inSequence(mySequence);
 
-            allowing(creator).createAce("username1",new String[]{"jcr:read","jcr:write"},new String[]{}); inSequence(mySequence);
-            allowing(creator).createAce("groupname1",new String[]{"jcr:read","jcr:write"},null); inSequence(mySequence);
-            allowing(creator).createAce("groupname2",new String[]{"jcr:read"},new String[]{"jcr:write"}); inSequence(mySequence);
+            allowing(creator).createAce("username1",new String[]{"jcr:read","jcr:write"},new String[]{}, null); inSequence(mySequence);
+            allowing(creator).createAce("groupname1",new String[]{"jcr:read","jcr:write"},null, null); inSequence(mySequence);
+            allowing(creator).createAce("groupname2",new String[]{"jcr:read"},new String[]{"jcr:write"}, "first"); inSequence(mySequence);
             allowing(creator).finishNode(); inSequence(mySequence);
         }});
         this.parse(json);
diff --git a/src/test/java/org/apache/sling/jcr/contentloader/internal/readers/XmlReaderTest.java b/src/test/java/org/apache/sling/jcr/contentloader/internal/readers/XmlReaderTest.java
index bc40cec..89f6eec 100644
--- a/src/test/java/org/apache/sling/jcr/contentloader/internal/readers/XmlReaderTest.java
+++ b/src/test/java/org/apache/sling/jcr/contentloader/internal/readers/XmlReaderTest.java
@@ -145,7 +145,8 @@ public class XmlReaderTest extends TestCase {
         }
 
 		public void createAce(String principal,
-				String[] grantedPrivileges, String[] deniedPrivileges)
+				String[] grantedPrivileges, String[] deniedPrivileges,
+				String order)
 				throws RepositoryException {
 		}
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 22/28: SLING-1592 - using the ws:/path notation in the uninstall-paths node property.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 51f92ec816f230334f85a7783a02ef1fa7906b65
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Jul 8 21:22:00 2010 +0000

    SLING-1592 - using the ws:/path notation in the uninstall-paths node property.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@961945 13f79535-47bb-0310-9956-ffa450edef68
---
 .../internal/DefaultContentCreator.java            | 18 ++++----
 .../sling/jcr/contentloader/internal/Loader.java   | 48 ++++++++++++++++++----
 2 files changed, 50 insertions(+), 16 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
index 57af6c1..97bf1b9 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java
@@ -264,9 +264,7 @@ public class DefaultContentCreator implements ContentCreator {
 
                 // no explicit node type, use repository default
                 node = parentNode.addNode(name);
-                if ( this.createdNodes != null ) {
-                    this.createdNodes.add(node.getPath());
-                }
+                addNodeToCreatedList(node);
                 if ( this.importListener != null ) {
                 	this.importListener.onCreate(node.getPath());
                 }
@@ -274,9 +272,7 @@ public class DefaultContentCreator implements ContentCreator {
 
                 // explicit primary node type
                 node = parentNode.addNode(name, primaryNodeType);
-                if ( this.createdNodes != null ) {
-                    this.createdNodes.add(node.getPath());
-                }
+                addNodeToCreatedList(node);
                 if ( this.importListener != null ) {
                 	this.importListener.onCreate(node.getPath());
                 }
@@ -474,6 +470,12 @@ public class DefaultContentCreator implements ContentCreator {
         resolveReferences(node);
     }
 
+    private void addNodeToCreatedList(Node node) throws RepositoryException {
+        if ( this.createdNodes != null ) {
+            this.createdNodes.add(node.getSession().getWorkspace().getName() + ":" + node.getPath());
+        }
+    }
+
     private String getAbsPath(Node node, String path) throws RepositoryException {
         if (path.startsWith("/")) return path;
 
@@ -740,9 +742,7 @@ public class DefaultContentCreator implements ContentCreator {
                     return false;
                 }
                 final Node n = node.addNode(token, newNodeType);
-                if ( this.createdNodes != null ) {
-                    this.createdNodes.add(n.getPath());
-                }
+                addNodeToCreatedList(n);
                 if ( this.importListener != null ) {
                 	this.importListener.onCreate(node.getPath());
                 }
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index 53e9b86..4e01752 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -660,19 +660,44 @@ public class Loader extends BaseImportLoader {
         return (item.isNode()) ? (Node) item : null;
     }
 
-    private void uninstallContent(final Session session, final Bundle bundle,
+    private void uninstallContent(final Session defaultSession, final Bundle bundle,
             final String[] uninstallPaths) {
+        final Map<String, Session> createdSessions = new HashMap<String, Session>();
+        
         try {
             log.debug("Uninstalling initial content from bundle {}",
                 bundle.getSymbolicName());
             if ( uninstallPaths != null && uninstallPaths.length > 0 ) {
-                for(final String path : uninstallPaths) {
-                    if ( session.itemExists(path) ) {
-                        session.getItem(path).remove();
+                for(String path : uninstallPaths) {
+                    final Session targetSession;
+                    
+                    final int wsSepPos = path.indexOf(":/");
+                    if (wsSepPos != -1) {
+                        final String workspaceName = path.substring(0, wsSepPos);
+                        path = path.substring(wsSepPos + 1);
+                        if (workspaceName.equals(defaultSession.getWorkspace().getName())) {
+                            targetSession = defaultSession;
+                        } else if (createdSessions.containsKey(workspaceName)){
+                            targetSession = createdSessions.get(workspaceName);
+                        } else {
+                            targetSession = createSession(workspaceName);
+                            createdSessions.put(workspaceName, targetSession);
+                        }
+                    } else {
+                        targetSession = defaultSession;
+                    }
+
+                    if ( targetSession.itemExists(path) ) {
+                        targetSession.getItem(path).remove();
                     }
                 }
+                
                 // persist modifications now
-                session.save();
+                defaultSession.save();
+
+                for (Session session : createdSessions.values()) {
+                    session.save();
+                }
             }
 
             log.debug("Done uninstalling initial content from bundle {}",
@@ -682,14 +707,23 @@ public class Loader extends BaseImportLoader {
                 + bundle.getSymbolicName(), re);
         } finally {
             try {
-                if (session.hasPendingChanges()) {
-                    session.refresh(false);
+                if (defaultSession.hasPendingChanges()) {
+                    defaultSession.refresh(false);
+                }
+                for (Session session : createdSessions.values()) {
+                    if (session.hasPendingChanges()) {
+                        session.refresh(false);
+                    }
                 }
             } catch (RepositoryException re) {
                 log.warn(
                     "Failure to rollback uninstaling initial content for bundle {}",
                     bundle.getSymbolicName(), re);
             }
+            
+            for (Session session : createdSessions.values()) {
+                session.logout();
+            }
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 01/28: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit 7b5fd0e52c689ebeb16b9c10f693ac059352ba93
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Feb 12 17:45:45 2010 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@909522 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index ae95f18..6215a69 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,7 @@
     </parent>
 
     <artifactId>org.apache.sling.jcr.contentloader</artifactId>
-    <version>2.0.6</version>
+    <version>2.0.7-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Initial Content Loader</name>
@@ -36,9 +36,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.contentloader-2.0.6</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.contentloader-2.0.6</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.jcr.contentloader-2.0.6</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/contentloader</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-contentloader] 20/28: SLING-1589 DefaultContentImporter service doesn't have a pretty name/description

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git

commit d7d3007569b9117c46242be7b8f8fdd5eac39b24
Author: Eric Norman <en...@apache.org>
AuthorDate: Mon Jul 5 23:14:14 2010 +0000

    SLING-1589 DefaultContentImporter service doesn't have a pretty name/description
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@960730 13f79535-47bb-0310-9956-ffa450edef68
---
 .../internal/DefaultContentImporter.java           |  2 +-
 .../OSGI-INF/metatype/metatype.properties          | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java
index b1c14e9..a958345 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java
@@ -52,7 +52,7 @@ import org.slf4j.LoggerFactory;
  *                description="%content.import.service.description"
  * @scr.property name="service.vendor" value="The Apache Software Foundation"
  * @scr.property name="service.description"
- *               value="Apache Sling Contnet Importer Service"
+ *               value="Apache Sling JCR Content Import Service"
  * @scr.service interface="org.apache.sling.jcr.contentloader.ContentImporter"
  */
 public class DefaultContentImporter extends BaseImportLoader implements JcrContentHelper, ContentImporter {
diff --git a/src/main/resources/OSGI-INF/metatype/metatype.properties b/src/main/resources/OSGI-INF/metatype/metatype.properties
new file mode 100644
index 0000000..ba32413
--- /dev/null
+++ b/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -0,0 +1,29 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you 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.
+#
+
+#
+# This file contains localization strings for configuration labels and
+# descriptions as used in the metatype.xml descriptor generated by the
+# the Sling SCR plugin
+
+#
+# Default content import service implementation
+content.import.service.name=Apache Sling JCR Content Import Service
+content.import.service.description=Import content into the repository by parsing the supplied content stream.
+

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.