Export and Import View Schema

From AlfrescoWiki

Jump to: navigation, search

Back to Export and Import

Contents

[edit] Introduction

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

[edit] Schema Overview

TODO:

[edit] Schema Examples

[edit] People Import

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

<?xml version="1.0" encoding="UTF-8"?>
<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>

which can be imported using the command line tool as follows...

import -user admin -pwd admin -store workspace://SpacesStore -path /sys:system/sys:people people.xml
  • Note: The <cm:username> element represents the username identifier used when authenticating with Alfresco
  • Note: People are imported into the special location /sys:system/sys:people

Note: The full command line (including classpath) is as follows...

java -cp classes;lib/repository.jar;lib/core.jar;lib/spring.jar;lib/jibx-run.jar;
lib/xpp3.jar;lib/commons-logging.jar;lib/ehcache-1.1.jar;lib/dom4j-1.6.1.jar;
lib/acegi-security-0.8.2.jar;lib/hibernate3.jar;lib/quartz.jar;lib/pdfbox-0.7.2.jar;
lib/poi-2.5.1.jar;lib/jooconverter.jar;lib/jid3lib-0.5.jar;lib/freemarker.jar;
lib/log4j-1.2.8.jar;lib/cryptix-jce-provider.jar;lib/commons-codec-1.2.jar;
lib/commons-dbcp-1.2.1.jar;lib/commons-pool.jar;lib/jta.jar;lib/mail.jar;
lib/activation.jar;lib/jug.jar;lib/commons-collections-3.0.jar;lib/cglib-nodep-2.1.jar;
lib/antlr-2.7.5H3.jar;lib/tm-extractors-0.4_patched.jar;lib/ridl.jar;lib/juh.jar;
lib/jurt.jar;lib/sandbox.jar;lib/jut.jar;lib/lucene-1.4.3.jar;
../../../common/lib/mysql-connector-java-3.1.10-bin.jar;lib/saxpath.jar;
lib/jaxen-1.1-beta-8.jar org.alfresco.tools.Import -user admin -pwd admin -store
workspace://SpacesStore -path /sys:system/sys:people people.xml</tt>