.NET – Add documents in Alfresco DMS using Aspects and dotCMIS

This example shows how to add documents in Alfresco by using aspects and dotCMIS. If you’re not familiar with creating custom models in Alfresco, this step-by-step tutorial is a good starting point: Step-By-Step – Creating a custom model with Alfresco.

dotCMIS doesn’t provide built-in support for Alfresco aspects. But there is a way to do that manually by creating extended CMIS elements.

CUSTOMMODEL.XML

The customModel.xml file contains the model for our example project. Our custom model considers the following aspects:

  • Constraints
  • Aspects
  • Types

Constraints

In the constraints section, we define a list of currency values that are valid for the attributes.

Aspects

Aspects are a feature of Alfresco and could be understood as global attribute sets. Apsects can be added and removed for each object in Alfresco. Aspects can be defined on folder or document level.

In our example, the aspects section contains two different aspects. One aspect contains default attributes and the other aspect defines attributes which are used by the content-type “invoice”.

Types

In this section, we define three different node types: Standard, Invoice and Contract. The node type “standard” is as well the base type for invoices and contracts, which means, invoices and contracts inherit all attributes defined by “standard”.

Here is our custum model:

.NET CODE

After setting up Alfresco with our new custom model, we’re ready to implement the required code in .NET.  These are the classes we need to add new documents to Alfresco’s document storage via CMIS with dotCMIS. dotCMIS can be downloaded directly from Apache Chemistry project web site.

 

Tags: , , , , ,

KOMMENTAR(E) (1)

  • m
    Jun 29, 2016., 21:26 • Antworten

    hi where do I save customModel.xml? thank you

HINTERLASSE EINEN KOMMENTAR

lädt
×