AnsweredAssumed Answered

dotCMIS custom type property fails for Integers

Question asked by amcd on Aug 20, 2014
Latest reply on Nov 7, 2014 by mbortonus
I'm utilizing the atompub CMIS 1.0 binding to Alfresco 4.2.f and can successfully create a document by utilizing a custom content type and set "text" custom type properties…but the same code fails to set custom properties for integers. Other than that, the documents are successfully created.

Has anyone ever experienced this? Below are further details on my setup:

C# code:
  file1props = new Dictionary<String, Object>();
            file1props[PropertyIds.ObjectTypeId] = "cmis:document";
            file1props[PropertyIds.Name] = sourceFile.Name;
            file1props[PropertyIds.ObjectTypeId] = "D:tcm:doc";
            file1props["tcm:year"] = 2014;

           

            using (var fileStream = sourceFile.OpenRead())
            {
                var contentStream = new DotCMIS.Data.Impl.ContentStream();
                //contentStream.MimeType = "application/pdf";
                contentStream.MimeType = "image/tiff";
                contentStream.Stream = fileStream;
                contentStream.Length = fileStream.Length;
                //this._testSession.CreateDocument(properties, this._testSession.CreateObjectId(myFolder.Id), contentStream, null);
                DotCMIS.Client.IDocument createdDocument = myFolder.CreateDocument(file1props, contentStream, null);
            }

Custom Model:
<?xml version="1.0" encoding="utf-8"?> <model name="tcm:TheCustomModel" xmlns="http://www.alfresco.org/model/dictionary/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <description>Custom Content Model trial 6</description> <author>amcd</author> <version>1.0</version> <imports> <import prefix="d" uri="http://www.alfresco.org/model/dictionary/1.0'/> <import prefix="cm" uri="http://www.alfresco.org/model/content/1.0'/> </imports> <namespaces> <namespace uri="http://www.thecompanieswebsite.com/model/TheCustomModel/1.0" prefix="tcm" /> </namespaces> <types> <type name="tcm:doc"> <title>doc</title> <parent>cm:content</parent> <properties> <property name="tcm:year"> <title>year</title> <type>d:int</type> <mandatory>true</mandatory> </property> </properties> <mandatory-aspects> <aspect>cm:versionable</aspect> </mandatory-aspects> </type> </types> </model>

Outcomes