4 Replies Latest reply on Jun 10, 2013 3:39 AM by nl

    Initial content not working?

    nl Newbie

      Hi,

       

      just had a quick check on the new version and noticed that a new repository is not sourced with the initial content file.

       

      {code}

      {

      "name" : "repository",

          "jndiName" : "jcr/Test Repository",

          "transactionMode" : "none",

          "monitoring" : {

              "enabled" : false

          },

      "workspaces" : {

              "default" : "default",      

              "allowCreation" : true,

              "initialContent" : {

                  "default" : "modeshape-initial-content-files.xml"

              }

          }

      {code}

       

      with xml file

       

      {code:xml}

      <?xml version="1.0" encoding="UTF-8"?>

      <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dmsmix="http://www.mycompany.com/dms/mix/1.0">

          <files jcr:mixinTypes="dmsmix:publishArea" jcr:primaryType="nt:folder" dmsmix:autoremove="false" />

          <rules jcr:mixinTypes="dmsmix:adminArea" jcr:primaryType="nt:folder" dmsmix:autoremove="false" />

      </jcr:root>

      {code}

       

      Stepping through the code with a debugger I noticed that the ininital import is not performed because the workspace change is not empty(?). The following code in WorkspaceCache.java fails:

       

       

      {code}

      /**

           * Checks if this ws cache is empty. An empty cache is considered when the only node key under root is the system key.

           *

           * @return {@code true} if the system key is the only key under root, {@code false} other wise.

           */

          public boolean isEmpty() {

              CachedNode root = getNode(getRootKey());

              // expect there to be 1 child under root - the system key

              return root.getChildReferences(this).size() == 1;       <-- in my case it is 0.

          }

      {code}

       

      Any help on this?

       

      Thanks, Niels