Monday 15 April 2019

CMIS: How to create secondary type?


It is very simple using CMIS work bench. Below step-by-step procedure explains how to create secondary type ‘abcOrganization’ and add properties to this secondary type.

Step 1: Open cmis work bench.

Step 2: From the tool bar, click on the button ‘Types’.



Step 3: Select any existing secondary type and save the type definition as JSON.


Step 4: Update the downloaded json in step 3 as per your needs.

abcSecondaryType.json
{
 "id": "abc:secondaryType",
 "localName": "abc:secondaryType",
 "localNamespace": "http:\/\/apache.org",
 "displayName": "abc:secondaryType",
 "queryName": "abc:secondaryType",
 "description": "Builtin InMemory type definition abc:secondaryType",
 "baseId": "cmis:secondary",
 "parentId": "cmis:secondary",
 "creatable": false,
 "fileable": false,
 "queryable": true,
 "fulltextIndexed": false,
 "includedInSupertypeQuery": true,
 "controllablePolicy": false,
 "controllableACL": false,
 "typeMutability": {
  "create": true,
  "update": true,
  "delete": true
 },
 "propertyDefinitions": {
  "abc:contactUs": {
   "id": "abc:contactUs",
   "localName": "abc:contactUs",
   "displayName": "Secondary String Property",
   "queryName": "abc:contactUs",
   "description": "Contact us for any queries",
   "propertyType": "string",
   "cardinality": "single",
   "updatability": "readwrite",
   "inherited": false,
   "required": false,
   "queryable": true,
   "orderable": true,
   "openChoice": false
  },
  "abc:help": {
   "id": "abc:help",
   "localName": "abc:help",
   "displayName": "Secondary Integer Property",
   "queryName": "abc:help",
   "description": "You will get documentation here",
   "propertyType": "integer",
   "cardinality": "single",
   "updatability": "readwrite",
   "inherited": false,
   "required": true,
   "queryable": true,
   "orderable": true,
   "openChoice": false
  }
 }
}


Step 5: Click on the button ‘Create Type’ -> Load Type Definition from JSON.


Upload the ‘abcSecondaryType.json’ file that we created in step 4.

Once you uploaded, you can able to see the custom secondary type.



Previous                                                 Next                                                 Home

No comments:

Post a Comment