08-28-2012 10:33 AM
Alfresco 4.0e CE on Windows 7 64-bit;
apache-chemistry-opencmis-client 0.7.0 & alfresco-opencmis-extension 0.3
<?xml version="1.0" encoding="UTF-8"?>
<model name="dm:demoModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– File goes in shared/classes/alfresco/extension –>
…
<!– Imports are required to allow references to definitions in other models –>
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
<import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl" />
</imports>
<!– Sites Namespace –>
<namespaces>
<namespace uri="http://www.alfresco.org/model/gdomodel/1.0" prefix="dm" />
</namespaces>
<!– Custom aspects –>
<aspects>
<aspect name="dm:dossier">
<title>Dossier</title>
<properties>
<property name="dm:dossiertype">
<title>Dossiertype</title>
<type>d:text</type>
</property>
<property name="dm:dossiernummer">
<title>Dossiernummer</title>
<type>d:text</type>
</property>
</properties>
</aspect>
</aspects>
</model>
Map<String, Object> cmisProperties = new HashMap<String, Object>();
String documentType = null;
String aspectType = null;
for( DMSObjectEigenschap eigenschap : eigenschappen ) {
if( eigenschap.getEigenschap().equals(EigenschapType.DOCUMENT_TYPE) ) {
documentType = "D:" + eigenschap.getWaarde();
} else if( eigenschap.getEigenschap().equals(EigenschapType.DOSSIER_TYPE) ) {
aspectType ="P:dm:dossier";
cmisProperties.put("dm:dossiertype", eigenschap.getWaarde());
} else if( eigenschap.getEigenschap().equals(EigenschapType.DOSSIER_NUMMER) ) {
cmisProperties.put("dm:dossiernummer", eigenschap.getWaarde());
}
}
cmisProperties.put(PropertyIds.OBJECT_TYPE_ID,
(documentType == null ? CMISConstants.CMIS_BASETYPE_DOC : documentType)
+ (aspectType == null ? "" : "," + aspectType));
cmisProperties.put(PropertyIds.NAME, naam);
ContentStream contentStream = …
Document newDoc = ((Folder) destinationFolder)
.createDocument(cmisProperties, contentStream, VersioningState.MAJOR);
09-24-2012 10:48 AM
10-30-2012 10:49 AM
03-08-2013 03:57 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.