ACP

cancel
Showing results for 
Search instead for 
Did you mean: 

ACP

tpage
Alfresco Employee
0 0 6,349

ImportExport
ACP (Alfresco Content Package)

Export and Import


Alfresco Content Package (ACP) File Format


An Alfresco Content Package (otherwise known as an ACP file) is a single file
(with an extension of .acp) that bundles together the meta-data and content files
for the information to be transported.

An ACP file is simply a ZIP archive whose structure is as follows:



/<packagename>.xml
/<packagename>/
   contentNNN.pdf
   contentNNN.txt
   ...

The packagename is assigned on export.

<packagename>.xml contains an xml rendition of the contained Repository Nodes.  There is no restriction as to what types of information can be transported
but typically a bundle will contain Folders and Files.  Other types of information may include
Forums, Rules, Preferences, Tasks - anything that is described by a Repository Content Model.

The XML conforms to the Export and Import View Schema which describes the transported
nodes in terms of their types, aspects, properties, associations and permissions.
Content properties are handled specifically where the binary content of the property is held
in a seperate file under the packagename directory of the ZIP archive and the xml
contains a reference to the file.

Although the Repository provides different ways to create an ACP file (i.e. Export), it is also possible
to manually create one via any means.  This is very useful for system to system integration.


Simple Example


The following is an example of the XML export of a space containing one file.



  <view:view xmlns:view='http://www.alfresco.org/view/repository/1.0'>
- <view:metadata>
  <view:exportBy>admin</view:exportBy>
  <view:exportDate>2009-11-10T14:50:24.835Z</view:exportDate>
  <view:exporterVersion>3.2.0 (beta2 @build-number@)</view:exporterVersion>
  <view:exportOf>/app:company_home/app:guest_home</view:exportOf>
  </view:metadata>
- <cm:content xmlns:cmis='http://www.alfresco.org/model/cmis/0.6' 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' xmlns: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: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: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: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: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='cm:MountainLion6.jpg'>
- <view:aspects>
  <cm:auditable />
  <cm:titled />
  <sys:referenceable />
  <cm:author />
  </view:aspects>
  <view:acl />
- <view:properties>
- <cm:description>
  <view:mlvalue view:locale='en_US' />
  </cm:description>
  <sys:node-uuid>ce6123ce-2658-4d7d-9ba1-f10c0fbde822</sys:node-uuid>
  <sys:node-dbid>9659</sys:node-dbid>
  <cm:content>contentUrl=mark\content0.jpg|mimetype=image/jpeg|size=36410|encoding=UTF-8|locale=en_GB_</cm:content>
- <cm:title>
  <view:mlvalue view:locale='en_US'>MountainLion6.jpg</view:mlvalue>
  </cm:title>
  <cm:author />
  <cm:created>2009-11-10T14:28:56.179Z</cm:created>
  <cm:modifier>admin</cm:modifier>
  <cm:modified>2009-11-10T14:29:04.913Z</cm:modified>
  <cm:creator>admin</cm:creator>
  <sys:store-protocol>workspace</sys:store-protocol>
  <cm:name>MountainLion6.jpg</cm:name>
  <sys:store-identifier>SpacesStore</sys:store-identifier>
  </view:properties>
  </cm:content>
  </view:view>



Import UUID Bindings


Within an ACP file each node may be decorated with its unique ID (known as UUID).  On import, a node with the same UUID
may already exist in the destination Repository.  The import process is informed what to do in such scenarios by
specifying one of the following 'UUID bindings' (the mechanism for specifying depends on how the import is initiated and are described later
in this document):

CREATE_NEW

This binding always creates a new node in the destination Repository based on the information held in the ACP file
and allocates a new UUID.

CREATE_NEW_WITH_UUID

This binding always creates a new node with the UUID as specified in the ACP file (if one is specified, otherwise a new
UUID is allocated).

REMOVE_EXISTING

This binding determines if an existing node in the Repository with the same UUID already exists.  If so, the import process
first deletes the existing node and then creates the new node in the location as specified during the import process.  If an existing node does not exist, it just creates the new node as if CREATE_NEW had been chosen.

REPLACE_EXISTING

This binding determines if an existing node in the Repository with the same UUID already exists.  If so, the import process
first deletes the existing node and then creates a new node in the same location as the one just deleted.  If an existing node does not exist, it just creates the new node as if CREATE_NEW had been chosen.

UPDATE_EXISTING

This binding determines if an existing node in the Repository with the same UUID already exists.  If so, the import process
updates the existing node with information held in the ACP file.  If an existing node does not exist, it just creates the new node as if CREATE_NEW had been chosen.

THROW_ON_COLLISION

This binding determines if an existing node in the Repository with the same UUID already exists.  If so, the import process
stops with an exception.