Skip to Content
Technical Articles
Author's profile photo Jacky Liu

Query folders base on created secondary type on folders of BTP document management service

In the blog Create Automatic UI using Custom Secondary Types using Document Management Service by Tapishnu Sengupta, the method of creating secondary type for Document Management Integration Option has been stated . One of our customers want to use this method to tags  folders by function like Sales, Finance, Purchase, etc  and then query the folders base on Secondary Type.  In this blog , I will demo the steps in this blog and hope it will help :

Prerequisite:

1, You have created service instance and service key for BTP Document Management Service integration Option(BTP SDM) in BTP cockpit subaccount .

2,You have installed postman and Apache Chemistry CMIS Workbench .

 

Step 1, Get service key information from BTP cockpit .

 

Step 2 get access token by using service key Oauth2 information in Postman

Step 3, connect to BTP SDM repositary  with Chemistry CMIS Work Bench .

 

Step 4 , Create  Secondary type with Json file .

Prepare json file

{ 

    "id": "functiongroup", 

    "localName": "Function Group", 

    "localNamespace": null, 

    "displayName": "Function Group", 

    "queryName": "functiongroup", 

    "description": "Function Group", 

    "baseId": "cmis:secondary", 

    "parentId": "cmis:secondary", 

    "creatable": true, 

    "fileable": true, 

    "queryable": true, 

    "fulltextIndexed": false, 

    "includedInSupertypeQuery": true, 

    "controllablePolicy": false, 

    "controllableACL": false, 

    "typeMutability": { 

        "create": true, 

        "update": true, 

        "delete": true 

    }, 

    "propertyDefinitions": { 

        "function": { 

            "id": "functiongroup", 

            "localName": "Function Group", 

            "displayName": "Function Group", 

            "queryName": "functiongroup", 

            "description": "Function Group", 

            "propertyType": "string", 

            "cardinality": "single", 

            "updatability": "readwrite", 

            "inherited": true, 

            "required": false, 

            "queryable": true, 

            "orderable": true, 

            "openChoice": true 

        } 

    } 

} 

create secondary type by using the json file

Created secondary type

Step 5, Assign secondary type for folder

 

Step 6, Maintain function group for folder

Step 7, query folders base on function group

The following is the query statement :

SELECT * FROM cmis:folder JOIN functiongroup on cmis:folder.cmis:objectId = functiongroup.cmis:objectId WHERE functiongroup.functiongroup = ‘sales’

 

The Ends

 

Best Regards!

 

Jacky Liu

 

 

 

 

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Neethu Shaji
      Neethu Shaji

      Nice Blog Jacky 🙂