Hello
Alfresco Share v5.2.f
Alfresco Community v5.2.0
alfresco-community-installer-201707-win-x64.exe
.
1) I made a model, aspect & property in Alfresco Share (myModel >>> myAspect >>> some properties)
.
2) When creating properties I set the Data Types to d:int
3) Turns out now I need a d.text data type instead. So I deactivated the model & changed data type to d:text
4) now I used Share to go to the file, added the aspect & set the property value to "fgesgd" - to a random string
.
All fine so far.
.
Problem!
When you open up CMIS workbench & look at the properties (see the image in the attachment) then the type is still set to integer. And when you try to set the property programmatically you get a following error:
"Property 'sam:samCaseId' is a integer property. Expected type '<BigInteger, Byte, Short, Integer, Long>' but received a 'java.lang.String' property.",
.
I also tried to delete the property & create it anew with text data type, tried to delete the model & it still thinks it is an integer.
Hire is an example code I used to create new test file, add aspect & set property value to a string value:
Session cmisSession = alfrescoCmisSessionService.getSession();
Folder folder = (Folder) cmisSession.getObject("c86a2c67-8b4d-482d-98db-74a1b7ea7203");
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, "testfile");
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
Document doc = folder.createDocument(properties, null, null);
List<Object> aspects = doc.getProperty("cmis:secondaryObjectTypeIds").getValues();
aspects.add("P:sam:Metadata");
HashMap<String, Object> props = new HashMap<String, Object>();
props.put("cmis:secondaryObjectTypeIds", aspects);
doc.updateProperties(props);
properties.put("sam:samCaseId", "testvalue");
doc.updateProperties(properties);