Export and Import View Schema

Document created by resplin Employee on Jun 6, 2015
Version 1Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



ImportExport
Back to Export and Import





Introduction


This section describes the XML Alfresco Repository Export and Import View.

That is XML documents with the following namespace.
xmlns:view='http://www.alfresco.org/view/repository/1.0


Schema Overview


ACP Repository View Shema is a description of the aspects, acl, properties, and associations of the nodes within a Repository View Export.

Its probably easiest to learn by looking at a few examples.

The format is XML and starts with the standard XML conventions and definition of the namespace prefixes which are definined in the data dictionary.

The format contain an optional 'metadata' element as the first element.
Containing   


  • exportBy : xs:string
  • exportDate : xs:dateTime
  • exporterVersion: xs:string
  • exportOf: xs:string

It then consists of a sequence of elements representing the nodes contained by the view, with each node in its own prefixed namespace.    The element name in the export file corresponds to the type name of the node.  For example 'cm:folder'.

For each node there are optionally elements for aspects, acl, properties and associations.

'Aspects'
Aspects are a list of the qualified aspect names.

'ACL'

'Properties'
Properties are a list of the qualified property names.

Properties can contain either a simple string value, an mltext value or a 'values' element for a multi-valued field.

'Associations'

Associations may include other node elements to form a tree of nodes corresponding to a nested file folder view.


Schema details


meta data element


Schema



<xs:element name='metadata'>
  <xs:complexType>
    <xs:sequence>
      <xs:element ref='view:exportBy' maxOccurs='1' minOccurs='0'/>
      <xs:element ref='view:exportDate' maxOccurs='1' minOccurs='0'/>
      <xs:element ref='view:exporterVersion' maxOccurs='1' minOccurs='0'/>
      <xs:element ref='view:exportOf' maxOccurs='1' minOccurs='0'/>
      </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name='exportBy' type='xs:string'/>
<xs:element name='exportDate' type='xs:dateTime'/>
<xs:element name='exporterVersion' type='xs:string'/>
<xs:element name='exportOf' type='xs:string'/>

example output


node


The node elements within the schema are typed according to their type within Alfresco so,  for example a space within alfresco appears as an element cm:folder.    If you had a node of type 'mynamespace:thing' then that's what the element would be called in the repository view format.



example

<cm:folder>
</cm:folder>


aspects


acl


properties


property values


Properties can contain either a simple string value, an mltext value or a 'values' element for a multi-valued field.




<xs:element name='value'>

<xs:complexType mixed='true'>
<xs:attribute name='datatype' form='qualified' type='xs:NMTOKEN'/>
<xs:attribute name='isNull' form='qualified' type='xs:boolean'/>
</xs:complexType>
</xs:element>

<xs:complexType name='view.values'>

<xs:sequence>
<xs:element ref='view:values'/>
</xs:sequence>
</xs:complexType>

<xs:element name='values'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='view:value'/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name='mlvalue'>
<xs:complexType mixed='true'>
<xs:attribute name='locale' use='required' form='qualified' type='xs:string'/>
</xs:complexType>
</xs:element>

associations


Schema Examples


View Export


The following example is output froduced from the 'Export' of a Company Home folder within Alfresco 3.3




<view:view
xmlns:view='http://www.alfresco.org/view/repository/1.0'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' >

  <view:metadata>
    <view:exportBy>admin</view:exportBy>
    <view:exportDate>2010-04-16T11:28:50.453+01:00</view:exportDate>
    <view:exporterVersion>3.3.0 (G @build-number@)</view:exporterVersion>
    <view:exportOf>/app:company_home</view:exportOf>
  </view:metadata>

  <cm:folder xmlns:cmis='http://www.alfresco.org/model/cmis/1.0/cd07'
xmlns:act='http://www.alfresco.org/model/action/1.0'
xmlns:app='http://www.alfresco.org/model/application/1.0'
xmlns:ver='http://www.alfresco.org/model/versionstore/1.0'
xmlns:inwf='http://www.alfresco.org/model/workflow/invite/nominated/1.0'
xmlns:mix='http://www.jcp.org/jcr/mix/1.0'
xmlns:jcr='http://www.jcp.org/jcr/1.0'
xmlns:wcm='http://www.alfresco.org/model/wcmmodel/1.0'
mlns:lnk='http://www.alfresco.org/model/linksmodel/1.0'
xmlns:wcmwf='http://www.alfresco.org/model/wcmworkflow/1.0'
xmlns:rule='http://www.alfresco.org/model/rule/1.0'
xmlns:fm='http://www.alfresco.org/model/forum/1.0'
xmlns:imwf='http://www.alfresco.org/model/workflow/invite/moderated/1.0'
xmlns:emailserver='http://www.alfresco.org/model/emailserver/1.0'
xmlns:ver2='http://www.alfresco.org/model/versionstore/2.0'
xmlns:imap='http://www.alfresco.org/model/imap/1.0'
xmlns:trx='http://www.alfresco.org/model/transfer/1.0'
xmlns:nt='http://www.jcp.org/jcr/nt/1.0'
xmlns:view='http://www.alfresco.org/view/repository/1.0'
xmlns:d='http://www.alfresco.org/model/dictionary/1.0'
xmlns:alf='http://www.alfresco.org'
xmlns:blg='http://www.alfresco.org/model/blogintegration/1.0'
xmlns:cmiscustom='http://www.alfresco.org/model/cmis/custom'
xmlns:stcp='http://www.alfresco.org/model/sitecustomproperty/1.0'
xmlns:wf='http://www.alfresco.org/model/workflow/1.0'
xmlns:usr='http://www.alfresco.org/model/user/1.0'
xmlns:cm='http://www.alfresco.org/model/content/1.0'
xmlns:ia='http://www.alfresco.org/model/calendar'
xmlns:sv='http://www.jcp.org/jcr/sv/1.0'
xmlns:dl='http://www.alfresco.org/model/datalist/1.0'
xmlns:wca='http://www.alfresco.org/model/wcmappmodel/1.0'
xmlns:sys='http://www.alfresco.org/model/system/1.0'
xmlns:bpm='http://www.alfresco.org/model/bpm/1.0'
xmlns:rn='http://www.alfresco.org/model/rendition/1.0'
xmlns:custom='custom.model'
xmlns:reg='http://www.alfresco.org/system/registry/1.0'
xmlns:module='http://www.alfresco.org/system/modules/1.0'
xmlns:st='http://www.alfresco.org/model/site/1.0'
xmlns='' view:childName='app:dictionary'>
    <view:aspects>
      <cm:titled></cm:titled>
      <cm:auditable></cm:auditable>
      <sys:referenceable></sys:referenceable>
      <app:uifacets></app:uifacets>
    </view:aspects>
    <view:acl view:inherit='false'>
      <view:ace view:access='ALLOWED'>
        <view:authority>GROUP_EVERYONE</view:authority>
        <view:permission>Consumer</view:permission>
      </view:ace>
    </view:acl>
    <view:properties>
      <cm:description>
        <view:mlvalue view:locale='en_GB'>User managed definitions</view:mlvalue>
      </cm:description>
      <app:icon>space-icon-default</app:icon>
      <sys:node-uuid>1d3124fe-27f0-458a-b8d0-24924a7a36d3</sys:node-uuid>
      <sys:node-dbid>14</sys:node-dbid>
      <cm:title>
        <view:mlvalue view:locale='en_GB'>Data Dictionary</view:mlvalue>
      </cm:title>
      <cm:created>2010-03-31T12:23:51.718+01:00</cm:created>
      <cm:modifier>System</cm:modifier>
      <cm:modified>2010-03-31T12:23:51.734+01:00</cm:modified>
      <cm:creator>System</cm:creator>
      <sys:store-protocol>workspace</sys:store-protocol>
      <cm:name>Data Dictionary</cm:name>
      <sys:store-identifier>SpacesStore</sys:store-identifier>
    </view:properties>
    <view:associations>
      <cm:contains>
        <cm:folder view:childName='app:space_templates'>
          <view:aspects>
            <cm:titled></cm:titled>
            <cm:auditable></cm:auditable>
            <sys:referenceable></sys:referenceable>
            <app:uifacets></app:uifacets>
          </view:aspects>
          <view:acl></view:acl>
          <view:properties>
            <cm:description>
              <view:mlvalue view:locale='en_GB'>Space folder templates</view:mlvalue>
            </cm:description>
            <app:icon>space-icon-default</app:icon>
            <sys:node-uuid>826d501c-c615-4a79-a802-e01117d8ee7a</sys:node-uuid>
            <sys:node-dbid>15</sys:node-dbid>
            <cm:title>
              <view:mlvalue view:locale='en_GB'>Space Templates</view:mlvalue>
            </cm:title>
            <cm:created>2010-03-31T12:23:51.781+01:00</cm:created>
            <cm:modifier>System</cm:modifier>
            <cm:modified>2010-03-31T12:23:51.828+01:00</cm:modified>
            <cm:creator>System</cm:creator>
            <sys:store-protocol>workspace</sys:store-protocol>
            <cm:name>Space Templates</cm:name>
            <sys:store-identifier>SpacesStore</sys:store-identifier>
          </view:properties>
          <view:associations>


TRUNCATED -----


People Import


The following xml file (people.xml) represents a list of People...


<view:view 
  xmlns:d='http://www.alfresco.org/model/dictionary/1.0'
  xmlns:cm='http://www.alfresco.org/model/content/1.0'
  xmlns:view='http://www.alfresco.org/view/repository/1.0'>

<cm:person view:childName='cm:person'>
    <cm:userName>fredb</cm:userName>
    <cm:firstName>Fred</cm:firstName>
    <cm:lastName>Bloggs</cm:lastName>
    <cm:middleName></cm:middleName>
    <cm:email>fredb@alfresco.org</cm:email>
</cm:person>
<cm:person view:childName='cm:person'>
    <cm:userName>sues</cm:userName>
    <cm:firstName>Sue</cm:firstName>
    <cm:lastName>Sanderson</cm:lastName>
    <cm:middleName></cm:middleName>
    <cm:email>sues@alfresco.org</cm:email>
</cm:person>
</view:view>


Attachments

    Outcomes