[转]Using CMIS query in Content Query navigation model
2011-05-27 09:31
573 查看
published by Yannick on 18 March, 2011 - 22:15
One of the new features in WebCenter PS3 is the new navigation model. It allows you build dynamic models . You can add all kinds of resources in the navigation model like external links, pages from your portal, taskflows, portals, content from a content server and so on.
When your portal is content driven, you definitly want the ability to add links to different items based upon some criteria instead of adding all the content manually. This can be achieved by adding a content query to your navigation model. A content query is based upon the CMIS standard. CMIS stands for Content Management Interoperability Services which is a standard for improving the interoperability between different content management servers. For example Alfresco, IBM, Microsoft, SAP,... support this standard.
CMIS has its own query language which looks a lot like the SQL language used in databases. At first sight a CMIS query can look somewhat difficult.
Before you can add a content query, you first need to create a connection to the content query. In JDeveloper right click the connections and select Content Repository from the New context menu.
Select Oracle content Server for the repository type and fill in the correct parameters for your server:
Before explaining the content query in detail we will first add it to a navigation model. Make sure you have created a WebCenter Portal application. Open the default-navigation-model.xml from the oracle/webcenter/portalapp/navigations folder.
Select the default-navigation-model node and press the add button.
Select the Content Query.
In the Repository field you need to select the content repository. Press the browse button so you can easily select the correct connection:
Specify a title which will be the root node for your query. The results in the query will be shown as children of this node.
Now we can start explaining the query...
I will give a few examples of queries and explain them in detail:
Show all content in a specific folder
If you want to add all the items from a specific folder you need to use following query:
This query will return all the items from the folder with the specified ID. I still don't know if there is a query so we can use the path instead of the folder id. This query is not that good because when you migrate from a development environment to test or production environment, you have to make sure the ID's of the folders don0t change or the query will not work. A disadvantage of the CMIS query field is that you cannot use expression language to build dynamic queries...
Show all content with a specific term in the name
If you for example want to create a Jobs node in your portal and you want to include all the documents that has Job in its name than you would use following query:
Using any metadata field in the query
You can use any metadata field in your query. Suppose you have create a custom metadata field that contains a productID and you want to show all the documents for that product:
Again... Because you can't use expression language the ProductID needs to be hardcoded and is not dynamic...
Also notice that that the query is case sensitive so if you have defined the ProductID field in your UCM as productId than you need to use xproductId instead of xProductID.
List of common properties of the cmis:document object
cmis:createdBy is the name of the author which maps to dDocAuthor
cmis:lastModifiedBy is the name of the user who made the last modification to the document. This field is mapped to dDocCreator.
cmis:creationDate is the creation date which maps to the dCreateDate field
cmis:lastModificationdate maps to dLastModifiedDate
cmis:name maps to the name. dOriginalName when used in cmis:document ad dCollectionName when used in cmis:folder
cmis:contentStreamMimeType contains the mime type which maps to dFormat
cmis:objectId contains the id of the document which maps to dDocName
cmis:objectTypeId contains the name of the UCM profile.
One of the new features in WebCenter PS3 is the new navigation model. It allows you build dynamic models . You can add all kinds of resources in the navigation model like external links, pages from your portal, taskflows, portals, content from a content server and so on.
When your portal is content driven, you definitly want the ability to add links to different items based upon some criteria instead of adding all the content manually. This can be achieved by adding a content query to your navigation model. A content query is based upon the CMIS standard. CMIS stands for Content Management Interoperability Services which is a standard for improving the interoperability between different content management servers. For example Alfresco, IBM, Microsoft, SAP,... support this standard.
CMIS has its own query language which looks a lot like the SQL language used in databases. At first sight a CMIS query can look somewhat difficult.
Before you can add a content query, you first need to create a connection to the content query. In JDeveloper right click the connections and select Content Repository from the New context menu.
Select Oracle content Server for the repository type and fill in the correct parameters for your server:
Before explaining the content query in detail we will first add it to a navigation model. Make sure you have created a WebCenter Portal application. Open the default-navigation-model.xml from the oracle/webcenter/portalapp/navigations folder.
Select the default-navigation-model node and press the add button.
Select the Content Query.
In the Repository field you need to select the content repository. Press the browse button so you can easily select the correct connection:
Specify a title which will be the root node for your query. The results in the query will be shown as children of this node.
Now we can start explaining the query...
I will give a few examples of queries and explain them in detail:
Show all content in a specific folder
If you want to add all the items from a specific folder you need to use following query:
SELECT * FROM cmis:document WHERE IN_TREE('/ucm/IDC:Folder/988901828852000401')
This query will return all the items from the folder with the specified ID. I still don't know if there is a query so we can use the path instead of the folder id. This query is not that good because when you migrate from a development environment to test or production environment, you have to make sure the ID's of the folders don0t change or the query will not work. A disadvantage of the CMIS query field is that you cannot use expression language to build dynamic queries...
Show all content with a specific term in the name
If you for example want to create a Jobs node in your portal and you want to include all the documents that has Job in its name than you would use following query:
SELECT * FROM cmis:document WHERE cmis:name LIKE 'Job%'
Using any metadata field in the query
You can use any metadata field in your query. Suppose you have create a custom metadata field that contains a productID and you want to show all the documents for that product:
SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xProuctID = 15
Again... Because you can't use expression language the ProductID needs to be hardcoded and is not dynamic...
Also notice that that the query is case sensitive so if you have defined the ProductID field in your UCM as productId than you need to use xproductId instead of xProductID.
List of common properties of the cmis:document object
cmis:createdBy is the name of the author which maps to dDocAuthor
cmis:lastModifiedBy is the name of the user who made the last modification to the document. This field is mapped to dDocCreator.
cmis:creationDate is the creation date which maps to the dCreateDate field
cmis:lastModificationdate maps to dLastModifiedDate
cmis:name maps to the name. dOriginalName when used in cmis:document ad dCollectionName when used in cmis:folder
cmis:contentStreamMimeType contains the mime type which maps to dFormat
cmis:objectId contains the id of the document which maps to dDocName
cmis:objectTypeId contains the name of the UCM profile.
相关文章推荐
- Sending HTML content in an email using PHP
- [ReactVR] Render Custom 3D Objects Using the Model Component in React VR
- sharepoint ECMA using a custom contentType to creating a list in SubSite
- Create Google Maps directions in PeopleSoft using Related Content
- Enter Query Mode Search Tricks Using Enter_Query Built-in in Oracle Forms
- Using Post_Query Trigger in Oracle Forms
- Subquery typo with using in(转)
- Creating and Using a New Content Type in SharePoint 2007(zhuan:http://www.sharepointproconnections.com/article/sharepoint-portal
- Content Query Web Part VS the Content Search Web Part in SharePoint
- Target-Driven Visual Navigation In Indoor Scenes Using DRL 讲解
- Content indexing in Django using Apache Tika
- [转]Finding a query in UCM using the query builder
- Using zend-navigation in your Album Module
- Using DbContext in EF 4.1 Part 1: Introduction and Model 学习摘要
- 博客园博客自动生成三级目录(generate three levels content using JS in cnblogs)
- Creating a 2D Active Shape Model in ITK Using PCA
- Query Recommendation using Query Log in Search Engines
- Model View Controller (MVC) Using C#, Delegates and Events in .NET
- [Vue +TS] Use Two-Way Binding in Vue Using @Model Decorator with TypeScript
- Using a date for a datetime field in a SOQL Query [duplicate]