Page tree
Skip to end of metadata
Go to start of metadata

Introduction

With the introduction of light development, users may do many powerful things such as decorations, have their configuration in FileSystemResourceOrigin with YAML, etc. 

This document is about moving this one step ahead and allow users to bootstrap content via FileSystemResourceOrigin as part of the ticket  DEV-246 - Getting issue details... STATUS

Further reasoning and explanation can be found in the links below;

 

A dummy implementation of the solution can be found in https://git.magnolia-cms.com/projects/PLATFORM/repos/main/commits?until=refs/heads/showcase/DEV-246-ilgun.

Proposed Solution

User will be able to specify a folder in 'magnolia.properties' file and this folder will be observed by Magnolia. For initial solution we might just bootstrap whatever comes in , however, in later stages we might need to notify user with the import request, hence, pulse should be sufficient for the use case. Likewise publication request, user should be able to accept or deny a import request.

For the first step, We can use DirectoryWatcherService for observation of the folder, it already proves the necessary API. Once we have the update, simply delegating to DataTransporter#executeBootstrapImport() would do the trick for us.

Data Format of Content Files

I would propose default JCR views for the data format. We will be supporting both views since import function can already handle them both, only we have to have a mechanism to export content as document view and JCR already provides it as well.

In addition, we do not need to change anything for the import case since we already support document view files. Same entry point as System view, javax.jcr.Workspace#importXML

  • We do not need to handle any conversion while importing and exporting.
  • Easy implementation.
  • Especially Document view is quite simple and readable.

Document View vs System View

Pros

  • Looks very similar to JCR content.
  • Less verbose and readable than System View (428 vs 71 lines see the samples below).

Cons

  • Not designed to handle large binary files.
  • Not supporting multi value properties, will get the first value encountered.

Document View

 Click here to show

<?xml version="1.0" encoding="UTF-8"?>
<privacy jcr:primaryType="mgnl:page" jcr:uuid="cd96f78d-1d5c-4f6b-b00d-765d0d59f6da" hideInNav="false"
  jcr:created="2016-07-28T09:30:25.805+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
  mgnl:created="2015-02-02T20:58:43.044+01:00" mgnl:createdBy="superuser"
  mgnl:lastActivated="2016-07-28T09:30:30.717+02:00" mgnl:lastActivatedBy="superuser"
  mgnl:lastModified="2015-06-18T17:48:33.104+02:00" mgnl:lastModifiedBy="superuser"
  mgnl:template="travel-demo:pages/standard" title="Privacy Policy" title_de="Datenschutz &amp; Privatsphäre"
  xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mgnl="http://www.magnolia.info/jcr/mgnl"
  xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:rep="internal" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fn="http://www.w3.org/2005/xpath-functions"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions"
  xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:jcrfn="http://www.jcp.org/jcr/xpath-functions/1.0">
  <main jcr:primaryType="mgnl:area" jcr:uuid="9d1c2d9d-f28b-4cb1-82ca-5443c8abdb29"
    jcr:created="2016-07-28T09:30:25.805+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
    mgnl:created="2015-02-02T21:30:49.947+01:00" mgnl:createdBy="superuser"
    mgnl:lastActivated="2015-10-25T10:17:30.983+01:00" mgnl:lastActivatedBy="superuser"
    mgnl:lastModified="2015-02-02T21:30:49.947+01:00" mgnl:lastModifiedBy="superuser">
    <_x0030_ jcr:primaryType="mgnl:component" jcr:uuid="55e1a39e-dcd3-48c6-9370-530f98ae4a5d"
      headline="Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
      headlineLevel="big" jcr:created="2016-07-28T09:30:25.805+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
      mgnl:created="2015-02-25T17:16:08.308+01:00" mgnl:createdBy="superuser"
      mgnl:lastActivated="2015-10-25T10:17:30.983+01:00" mgnl:lastActivatedBy="superuser"
      mgnl:lastModified="2015-02-25T17:16:08.308+01:00" mgnl:lastModifiedBy="superuser"
      mgnl:template="travel-demo:components/textImage" text="&lt;p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?&lt;/p>             "/>
    <_x0030_0 jcr:primaryType="mgnl:component" jcr:uuid="ef10aa25-37c7-4808-b046-639d0e06b76a"
      headline="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
      headlineLevel="medium" jcr:created="2016-07-28T09:30:25.806+02:00" jcr:createdBy="admin"
      mgnl:activationStatus="true" mgnl:created="2015-02-25T17:16:38.410+01:00" mgnl:createdBy="superuser"
      mgnl:lastActivated="2015-10-25T10:17:30.983+01:00" mgnl:lastActivatedBy="superuser"
      mgnl:lastModified="2015-02-25T17:16:38.410+01:00" mgnl:lastModifiedBy="superuser"
      mgnl:template="travel-demo:components/textImage" text="&lt;p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p>             "/>
    <_x0030_1 jcr:primaryType="mgnl:component" jcr:uuid="3c7b8fa0-9682-4a6e-b244-a5a733df848d"
      headline="At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga."
      headlineLevel="small" jcr:created="2016-07-28T09:30:25.806+02:00" jcr:createdBy="admin"
      mgnl:activationStatus="true" mgnl:created="2015-02-25T17:17:15.345+01:00" mgnl:createdBy="superuser"
      mgnl:lastActivated="2015-10-25T10:17:30.983+01:00" mgnl:lastActivatedBy="superuser"
      mgnl:lastModified="2015-02-25T17:17:15.345+01:00" mgnl:lastModifiedBy="superuser"
      mgnl:template="travel-demo:components/textImage" text="&lt;p>Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Mum's the word.&lt;/p>             "/>
  </main>
  <footer jcr:primaryType="mgnl:area" jcr:uuid="018320a0-17a4-4f63-a437-e5ce2950cae9"
    jcr:created="2016-07-28T09:30:25.806+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
    mgnl:created="2015-06-03T20:23:52.672+02:00" mgnl:createdBy="superuser"
    mgnl:lastActivated="2015-10-25T10:17:30.984+01:00" mgnl:lastActivatedBy="superuser"
    mgnl:lastModified="2015-06-18T17:48:33.104+02:00" mgnl:lastModifiedBy="superuser">
    <footer1 jcr:primaryType="mgnl:area" jcr:uuid="a53b6f70-d9a3-4463-8dfc-73ff8930801b"
      jcr:created="2016-07-28T09:30:25.807+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
      mgnl:created="2015-06-03T20:23:52.708+02:00" mgnl:createdBy="superuser"
      mgnl:lastActivated="2015-10-25T10:17:30.984+01:00" mgnl:lastActivatedBy="superuser"
      mgnl:lastModified="2015-06-03T20:23:52.708+02:00" mgnl:lastModifiedBy="superuser"/>
    <footer2 jcr:primaryType="mgnl:area" jcr:uuid="0419f241-a851-4e75-a5ab-2b6c46d06fa1"
      jcr:created="2016-07-28T09:30:25.808+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
      mgnl:created="2015-06-03T20:23:53.920+02:00" mgnl:createdBy="superuser"
      mgnl:lastActivated="2015-10-25T10:17:30.984+01:00" mgnl:lastActivatedBy="superuser"
      mgnl:lastModified="2015-06-03T20:23:53.920+02:00" mgnl:lastModifiedBy="superuser"/>
    <footer3 jcr:primaryType="mgnl:area" jcr:uuid="57cfe6be-9973-45e5-bd90-9b3defa405a4"
      jcr:created="2016-07-28T09:30:25.808+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
      mgnl:created="2015-06-03T20:23:54.019+02:00" mgnl:createdBy="superuser"
      mgnl:lastActivated="2015-10-25T10:17:30.984+01:00" mgnl:lastActivatedBy="superuser"
      mgnl:lastModified="2015-06-03T20:23:54.019+02:00" mgnl:lastModifiedBy="superuser"/>
    <footer4 jcr:primaryType="mgnl:area" jcr:uuid="c11e355e-67f6-437b-89be-5d3a94648cb7"
      jcr:created="2016-07-28T09:30:25.809+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
      mgnl:created="2015-06-03T20:23:54.080+02:00" mgnl:createdBy="superuser"
      mgnl:lastActivated="2015-10-25T10:17:30.984+01:00" mgnl:lastActivatedBy="superuser"
      mgnl:lastModified="2015-06-03T20:23:54.080+02:00" mgnl:lastModifiedBy="superuser"/>
    <lastLinks jcr:primaryType="mgnl:area" jcr:uuid="e1f3c977-3dfd-4241-9961-3c3989b69257"
      jcr:created="2016-07-28T09:30:25.809+02:00" jcr:createdBy="admin" mgnl:activationStatus="true"
      mgnl:created="2015-06-18T17:48:33.111+02:00" mgnl:createdBy="superuser"
      mgnl:lastActivated="2015-10-25T10:17:30.984+01:00" mgnl:lastActivatedBy="superuser"
      mgnl:lastModified="2015-06-18T17:48:33.111+02:00" mgnl:lastModifiedBy="superuser"/>
  </footer>
</privacy>

 

System View

 Click here to show

<?xml version="1.0" encoding="UTF-8"?>
<sv:node sv:name="privacy" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>mgnl:page</sv:value>
  </sv:property>
  <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
    <sv:value>mix:lockable</sv:value>
  </sv:property>
  <sv:property sv:name="jcr:uuid" sv:type="String">
    <sv:value>cd96f78d-1d5c-4f6b-b00d-765d0d59f6da</sv:value>
  </sv:property>
  <sv:property sv:name="hideInNav" sv:type="Boolean">
    <sv:value>false</sv:value>
  </sv:property>
  <sv:property sv:name="jcr:createdBy" sv:type="String">
    <sv:value>admin</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
    <sv:value>true</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:created" sv:type="Date">
    <sv:value>2015-02-02T20:58:43.044+01:00</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:createdBy" sv:type="String">
    <sv:value>superuser</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
    <sv:value>2016-07-28T09:04:20.680+02:00</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
    <sv:value>superuser</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:lastModified" sv:type="Date">
    <sv:value>2015-06-18T17:48:33.104+02:00</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
    <sv:value>superuser</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:template" sv:type="String">
    <sv:value>travel-demo:pages/standard</sv:value>
  </sv:property>
  <sv:property sv:name="title" sv:type="String">
    <sv:value>Privacy Policy</sv:value>
  </sv:property>
  <sv:property sv:name="title_de" sv:type="String">
    <sv:value>Datenschutz &amp; Privatsphäre</sv:value>
  </sv:property>
  <sv:node sv:name="main">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>mgnl:area</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
      <sv:value>mix:lockable</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:uuid" sv:type="String">
      <sv:value>9d1c2d9d-f28b-4cb1-82ca-5443c8abdb29</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:createdBy" sv:type="String">
      <sv:value>admin</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
      <sv:value>true</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:created" sv:type="Date">
      <sv:value>2015-02-02T21:30:49.947+01:00</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:createdBy" sv:type="String">
      <sv:value>superuser</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
      <sv:value>2015-10-25T10:17:30.983+01:00</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
      <sv:value>superuser</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:lastModified" sv:type="Date">
      <sv:value>2015-02-02T21:30:49.947+01:00</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
      <sv:value>superuser</sv:value>
    </sv:property>
    <sv:node sv:name="0">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:component</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>55e1a39e-dcd3-48c6-9370-530f98ae4a5d</sv:value>
      </sv:property>
      <sv:property sv:name="headline" sv:type="String">
        <sv:value>Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</sv:value>
      </sv:property>
      <sv:property sv:name="headlineLevel" sv:type="String">
        <sv:value>big</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:createdBy" sv:type="String">
        <sv:value>admin</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:created" sv:type="Date">
        <sv:value>2015-02-25T17:16:08.308+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:createdBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
        <sv:value>2015-10-25T10:17:30.983+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModified" sv:type="Date">
        <sv:value>2015-02-25T17:16:08.308+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:template" sv:type="String">
        <sv:value>travel-demo:components/textImage</sv:value>
      </sv:property>
      <sv:property sv:name="text" sv:type="String">
        <sv:value>&lt;p&gt;Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?&lt;/p&gt;
            </sv:value>
      </sv:property>
    </sv:node>
    <sv:node sv:name="00">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:component</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>ef10aa25-37c7-4808-b046-639d0e06b76a</sv:value>
      </sv:property>
      <sv:property sv:name="headline" sv:type="String">
        <sv:value>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</sv:value>
      </sv:property>
      <sv:property sv:name="headlineLevel" sv:type="String">
        <sv:value>medium</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:createdBy" sv:type="String">
        <sv:value>admin</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:created" sv:type="Date">
        <sv:value>2015-02-25T17:16:38.410+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:createdBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
        <sv:value>2015-10-25T10:17:30.983+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModified" sv:type="Date">
        <sv:value>2015-02-25T17:16:38.410+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:template" sv:type="String">
        <sv:value>travel-demo:components/textImage</sv:value>
      </sv:property>
      <sv:property sv:name="text" sv:type="String">
        <sv:value>&lt;p&gt;Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
            </sv:value>
      </sv:property>
    </sv:node>
    <sv:node sv:name="01">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:component</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>3c7b8fa0-9682-4a6e-b244-a5a733df848d</sv:value>
      </sv:property>
      <sv:property sv:name="headline" sv:type="String">
        <sv:value>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</sv:value>
      </sv:property>
      <sv:property sv:name="headlineLevel" sv:type="String">
        <sv:value>small</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:createdBy" sv:type="String">
        <sv:value>admin</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:created" sv:type="Date">
        <sv:value>2015-02-25T17:17:15.345+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:createdBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
        <sv:value>2015-10-25T10:17:30.983+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModified" sv:type="Date">
        <sv:value>2015-02-25T17:17:15.345+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:template" sv:type="String">
        <sv:value>travel-demo:components/textImage</sv:value>
      </sv:property>
      <sv:property sv:name="text" sv:type="String">
        <sv:value>&lt;p&gt;Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Mum's the word.&lt;/p&gt;
            </sv:value>
      </sv:property>
    </sv:node>
  </sv:node>
  <sv:node sv:name="footer">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>mgnl:area</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
      <sv:value>mix:lockable</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:uuid" sv:type="String">
      <sv:value>018320a0-17a4-4f63-a437-e5ce2950cae9</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:createdBy" sv:type="String">
      <sv:value>admin</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
      <sv:value>true</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:created" sv:type="Date">
      <sv:value>2015-06-03T20:23:52.672+02:00</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:createdBy" sv:type="String">
      <sv:value>superuser</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
      <sv:value>2015-10-25T10:17:30.984+01:00</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
      <sv:value>superuser</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:lastModified" sv:type="Date">
      <sv:value>2015-06-18T17:48:33.104+02:00</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
      <sv:value>superuser</sv:value>
    </sv:property>
    <sv:node sv:name="footer1">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:area</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
        <sv:value>mix:lockable</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>a53b6f70-d9a3-4463-8dfc-73ff8930801b</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:createdBy" sv:type="String">
        <sv:value>admin</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:created" sv:type="Date">
        <sv:value>2015-06-03T20:23:52.708+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:createdBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
        <sv:value>2015-10-25T10:17:30.984+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModified" sv:type="Date">
        <sv:value>2015-06-03T20:23:52.708+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
    </sv:node>
    <sv:node sv:name="footer2">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:area</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
        <sv:value>mix:lockable</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>0419f241-a851-4e75-a5ab-2b6c46d06fa1</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:createdBy" sv:type="String">
        <sv:value>admin</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:created" sv:type="Date">
        <sv:value>2015-06-03T20:23:53.920+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:createdBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
        <sv:value>2015-10-25T10:17:30.984+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModified" sv:type="Date">
        <sv:value>2015-06-03T20:23:53.920+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
    </sv:node>
    <sv:node sv:name="footer3">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:area</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
        <sv:value>mix:lockable</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>57cfe6be-9973-45e5-bd90-9b3defa405a4</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:createdBy" sv:type="String">
        <sv:value>admin</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:created" sv:type="Date">
        <sv:value>2015-06-03T20:23:54.019+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:createdBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
        <sv:value>2015-10-25T10:17:30.984+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModified" sv:type="Date">
        <sv:value>2015-06-03T20:23:54.019+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
    </sv:node>
    <sv:node sv:name="footer4">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:area</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
        <sv:value>mix:lockable</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>c11e355e-67f6-437b-89be-5d3a94648cb7</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:createdBy" sv:type="String">
        <sv:value>admin</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:created" sv:type="Date">
        <sv:value>2015-06-03T20:23:54.080+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:createdBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
        <sv:value>2015-10-25T10:17:30.984+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModified" sv:type="Date">
        <sv:value>2015-06-03T20:23:54.080+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
    </sv:node>
    <sv:node sv:name="lastLinks">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:area</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
        <sv:value>mix:lockable</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>e1f3c977-3dfd-4241-9961-3c3989b69257</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:createdBy" sv:type="String">
        <sv:value>admin</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:created" sv:type="Date">
        <sv:value>2015-06-18T17:48:33.111+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:createdBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivated" sv:type="Date">
        <sv:value>2015-10-25T10:17:30.984+01:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastActivatedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModified" sv:type="Date">
        <sv:value>2015-06-18T17:48:33.111+02:00</sv:value>
      </sv:property>
      <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
        <sv:value>superuser</sv:value>
      </sv:property>
    </sv:node>
  </sv:node>
</sv:node>

 

What has to be done?

  • Export as document view (a button would do), it is very straightforward to achieve since JCR is already having the functionality or automatic export mechanism depending on the decision.
  • Small tweaks to get necessity namespaces for Document view xml in order to import it later safely

Further Ideas

  • YAML, JSON support for content definitions.
  • No labels

1 Comment

  1. Basic documentation

    Module is at https://git.magnolia-cms.com/projects/MODULES/repos/content-importer/browse

    JIRA is at https://jira.magnolia-cms.com/projects/MGNLCI/

    It requires 5.4.6. It works if you drop the jar in - it has no other dependencies.

    Configuration

    To configure it, set a property in magnolia.properties:

    magnolia.content.bootstrap.dir=${magnolia.home}/importtest

    These paths must be set before starting up magnolia.

    LIMITATION

    Currently the watched directory must be the resources directory or a sub directory of it. (magnolia.resources.dir=${magnolia.home})

    NOTES

    Apparently the system will attempt to import all xml files in the configured directory or any subdirectory.

    As it relies on observation, you must add the files to a running system. Files that are simply present at startup will not be detected.

    Maybe, you must even be logged in when the file is added.

    Once a file is detected, a pulse notification will be created. A user can then "Assign" the pulse task to themselves, and then "Import" the content.

    Files must be in standard JCR export xml format. (system or document view)

    No log message informs you that the content importer is installed.

    No log messages indicate that files have been detected. (But you do get the pulse messages.)