![](/style/images/good.png)
![](/style/images/bad.png)
Query folders base on created secondary type on folders of BTP document manageme...
source link: https://blogs.sap.com/2022/08/28/query-folders-base-on-created-secondary-type-on-folders-of-btp-document-management-service/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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 helps :
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 .
![35-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/35-2.png)
![36-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/36-2.png)
Step 2 get access token by using service key Oauth2 information in Postman
![37-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/37-2.png)
![38-3.png](https://blogs.sap.com/wp-content/uploads/2022/08/38-3.png)
Step 3, connect to BTP SDM repositary with Chemistry CMIS Work Bench .
![39-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/39-2.png)
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
![40-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/40-2.png)
Created secondary type
![41-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/41-2.png)
Step 5, Assign secondary type for folder
![42-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/42-2.png)
![43-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/43-2.png)
Step 6, Maintain function group for folder
![44-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/44-2.png)
Step 7, query folders base on function group
![45-2.png](https://blogs.sap.com/wp-content/uploads/2022/08/45-2.png)
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
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK