Work with CMIS API object types
Define custom object types as extensions of snx:file.Custom types are imported and exported using the IBM WAS wsadmin client. These commands are extensions of the Files administrative commands. After starting the client, the Files administrative commands are accessed by issuing:
execfile("filesAdmin.py")
Custom object typed Definitions
Custom object type definitions are described in an XML document that conforms to the CMIS object type syntax.Single-value properties
The following property types can be added as custom properties to the social file object:
- Boolean
- Integer
- Datetime
- Decimal
- String
- URI
There are limitations on the number of custom properties that can be applied to a custom object type definition. In addition, there are restrictions on the number of properties that can be marked as queryable or orderable when used in CMIS query operations.
These restrictions are as follows:
Type Total available Total queryable or orderable Maximum length string (short) 25 3 64 string (medium) 15 2 256 string (long) 5 0 1024 string (extra long) 1 0 4000 integer 25 2 N/A decimal 25 2 N/A datetime 15 5 N/A boolean 25 N/A N/A
Note: URI properties are stored as strings, and therefore are bound by the string constraints.
Multivalue properties
Custom object type definitions can also contain properties that can have multiple values; however this ability is restricted to medium length strings. Multivalue properties cannot be marked as queryable or orderable.
Translatable strings
Labels and descriptions for any custom property must be supplied using the support in customizing user interface strings in Lotus Connections.
To provide your strings, override the com.ibm.lconn.files.strings.cmis file bundle.
Sample object type definition
The following is a sample object type definition for sharing photos.
<?xml version="1.0" encoding="UTF-8"?> <cmisra:type xsi:type="cmis:{http://docs.oasis-open.org/ns/cmis/core/200908/}cmisTypeDocumentDefinitionType" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:lcmis="http://www.ibm.com/xmlns/prod/sn/cmis" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"> <cmis:id>f0d01111-9b21-4dd8-b8be-8825631cb84b</cmis:id> <cmis:localName>photo</cmis:localName> <cmis:localNamespace>photo</cmis:localNamespace> <lcmis:displayNameKey>custom_photo_title_key</lcmis:displayNameKey> <cmis:queryName>custom:photo</cmis:queryName> <lcmis:descriptionKey>custom_photo_summary_key</lcmis:descriptionKey> <cmis:baseId>cmis:document</cmis:baseId> <cmis:parentId>snx:file</cmis:parentId> <cmis:creatable>true</cmis:creatable> <cmis:fileable>false</cmis:fileable> <cmis:queryable>true</cmis:queryable> <cmis:fulltextIndexed>false</cmis:fulltextIndexed> <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> <cmis:controllablePolicy>false</cmis:controllablePolicy> <cmis:controllableACL>false</cmis:controllableACL> <cmis:versionable>false</cmis:versionable> <cmis:contentStreamAllowed>required</cmis:contentStreamAllowed> <cmis:propertyStringDefinition> <cmis:id>68ff2a2d-730d-449b-8106-246db07c6180</cmis:id> <cmis:localName>event</cmis:localName> <cmis:localNamespace>event</cmis:localNamespace> <lcmis:displayNameKey>custom_event_title_key</lcmis:displayNameKey> <cmis:queryName>custom:event</cmis:queryName> <lcmis:descriptionKey>custom_event_summary_key</lcmis:descriptionKey> <cmis:propertyType>string</cmis:propertyType> <cmis:cardinality>single</cmis:cardinality> <cmis:updatability>readwrite</cmis:updatability> <cmis:inherited>false</cmis:inherited> <cmis:required>true</cmis:required> <cmis:queryable>true</cmis:queryable> <cmis:orderable>true</cmis:orderable> <cmis:openChoice>false</cmis:openChoice> <cmis:maxLength>64</cmis:maxLength> </cmis:propertyStringDefinition> <cmis:propertyDateTimeDefinition> <cmis:id>81cc747e-3d3b-4d74-95e1-7545960bfffd</cmis:id> <cmis:localName>date</cmis:localName> <cmis:localNamespace>date</cmis:localNamespace> <lcmis:displayNameKey>custom_date_title_key</lcmis:displayNameKey> <cmis:queryName>custom:date</cmis:queryName> <lcmis:descriptionKey>custom_date_summary_key</lcmis:descriptionKey> <cmis:propertyType>datetime</cmis:propertyType> <cmis:cardinality>single</cmis:cardinality> <cmis:updatability>readwrite</cmis:updatability> <cmis:inherited>false</cmis:inherited> <cmis:required>true</cmis:required> <cmis:queryable>true</cmis:queryable> <cmis:orderable>true</cmis:orderable> <cmis:openChoice>false</cmis:openChoice> <cmis:resolution>time</cmis:resolution> </cmis:propertyDateTimeDefinition> <cmis:propertyStringDefinition> <cmis:id>9471dbc6-3a69-4b11-b446-6df14664c3c4</cmis:id> <cmis:localName>vehicle</cmis:localName> <cmis:localNamespace>vehicle</cmis:localNamespace> <lcmis:displayNameKey>custom_vehicle_title_key</lcmis:displayNameKey> <cmis:queryName>custom:vehicle</cmis:queryName> <lcmis:descriptionKey>custom_vehicle_summary_key</lcmis:descriptionKey> <cmis:propertyType>string</cmis:propertyType> <cmis:cardinality>single</cmis:cardinality> <cmis:updatability>readwrite</cmis:updatability> <cmis:inherited>false</cmis:inherited> <cmis:required>false</cmis:required> <cmis:queryable>true</cmis:queryable> <cmis:orderable>true</cmis:orderable> <cmis:openChoice>false</cmis:openChoice> <cmis:maxLength>64</cmis:maxLength> </cmis:propertyStringDefinition> <cmis:propertyStringDefinition> <cmis:id>565ddabe-f937-4010-b790-0d0202c1733d</cmis:id> <cmis:localName>chapter</cmis:localName> <cmis:localNamespace>chapter</cmis:localNamespace> <lcmis:displayNameKey>custom_chapter_title_key</lcmis:displayNameKey> <cmis:queryName>custom:chapter</cmis:queryName> <lcmis:descriptionKey>custom_chapter_summary_key</lcmis:descriptionKey> <cmis:propertyType>string</cmis:propertyType> <cmis:cardinality>single</cmis:cardinality> <cmis:updatability>readwrite</cmis:updatability> <cmis:inherited>false</cmis:inherited> <cmis:required>true</cmis:required> <cmis:queryable>false</cmis:queryable> <cmis:orderable>true</cmis:orderable> <cmis:openChoice>false</cmis:openChoice> <cmis:maxLength>64</cmis:maxLength> </cmis:propertyStringDefinition> </cmisra:type>
Import object type
The Files application must be restarted after an object type has been imported before the new object type can be accessed and used by the system. The command to import an object type is:
FilesObjectTypeService.importType("objectType.xml")Where objectType.xml is the path and name to an XML file containing the object type definition.
Export object type
The command to export an object type is:
FilesObjectTypeService.exportType("objectType.xml", "f0d01111-9b21-4dd8-b8be-8825631cb84b")Where objectType.xml is the path and name of the file that will be written containing the XML definition of the exported object type.
The parameter f0d01111-9b21-4dd8-b8be-8825631cb84b is the ID of the object type to be exported. In this example, this value is the ID of the sample photo type described above.
Delete object type
The Files application must be restarted after an object type has been deleted. An object type can only be deleted if there are not any files of that type. Before deleting the object type make sure to delete all files of that type including emptying the trash. The command to delete an object type is:
FilesObjectTypeService.deleteType("f0d01111-9b21-4dd8-b8be-8825631cb84b")Where f0d01111-9b21-4dd8-b8be-8825631cb84b is the ID of the object type to be deleted.
In this example, this value is the ID of the sample photo type described above.
Browse object types
This command lists the custom object types that have been previously imported. The command to browse the defined object types is:
FilesObjectTypeService.browseTypes()
Parent topic
Administer Files
Related tasks
Customize product strings
Create fields for custom media gallery object types