By rajesh | October 12, 2013 | 0 Comment
Here comes some good and important Oracle webcenter services. Let’s say this one, Content Presenter is the most frequently used and I would not say easy to tweak with.
Definitely, Using this service is one thing and playing it for different needs is entirely different.
So, Content Presenter is one of the integral part of Document Services.
Content Presenter enables you to precisely customize the selection and presentation of content in a WebCenter Portal application.
The Content Presenter task flow is available only when the connected content repository is Content Server.
Webcenter Document Services provides end user with a lot of services to manage their documents from back end repository on to their front end, Portal.
Like, Document Explorer, Manager, Navigator, document upload, document viewer, Folder View, List Viewer, Mini Properties, Properties, Recent Documents, and Document Version History.
Oh, Few more points to mentioned at this moment only, All these Oracle webcenter services are nothing but the task flows and need not to say the bounded task flows.
Which you can utilize as per your business requirement, strictly with the available parameter options only.
Yes, like every other product, Oracle webcenter do have certain limitations. All these webcenter services do have few limitations. I will explore these in this and few forthcoming posts.
For now, I will start with the Content Presenter.
The basic pre-requisites for all these webcenter services is to include Oracle webcenter extension in your jdeveloper.
Please refer this published post which will lead you on this process.
As soon as you will be through this blog, you will see all these task flows and default data controls in your Resource palette.
You will be able to see something like this :
Okay, So, what now.
Very primary prerequisite for Content Presenter to work is to have a successful connection to Oracle content server. How,
Please follow this link, which will lead you to achieve the same :
And what’s now :
Not much actually, you just need to focus on the motive of this Post, that is to explore Content presenter.
For that, you need to scroll down the list of available task flows and you will be able to see all document services downwards.
So, let’s take content presenter to begin with.
Let me take it in general first and explore what all the options available in that.
To do so, create a JSF page and drag and drop document service content presenter on that page from your resource palette.
You will get an option to drop it as a region or as a dynamic region, that will be totally depends on your business requirement and way of implementation.
For now, we will stick to static region only for implementation sake.
You will be able to see this dialog :
So, just to explore all these options, let me give you few lines about all and finally we will see in depth of the main parameter.
1) TaskflowID is nothing but the only unique ID for this taskflow, you can keep it blank or else you can fill it as per your project nomenclature.
2) The display template category ID to use in rendering results for multiple content items. This ID may reference the default template category for an out-of-the-box display template.
3) The display template view ID to use in rendering results for single content items. Enter the view ID of a template that is configured in the Resource Manager for a specific content type, or for list-based templates by category ID.
Just to add, above two options can contain, default as well as the customer views as well, which will be your page template like you want to render your content.
4) Another is DatasourceType : These are all available options for this parameter and based on this, value for datasource will get changed.
■dsTypeSingleNode: A single content item. If you want your component to fetch only single content from your content server.
■ dsTypeFolderContents: The contents of a folder. If at all you want to show all content stored with in a folder in content server.
■ dsTypeQueryExpression: The results of a query. A bit customization. If at all you got an expertize on expression language and want to write down your own query to fetch content from repository.
■ dsTypeMultiNode: An ordered list of content items. This option will tweak if you want to show more than one file by using single content presenter.
■ dsTypeScenarioResults: The results of the specified scenario. If at all you have implemented some sort of scenario at your Weblogic server end, you will be able to show result of that scenario by using this content presenter.
So, for this post scope, I will cover Single node and folder content options and will leave rest to you.
Try different options and if you will face any issues with any option, do reply me and I will provide you the solution. Do not worry about that.
Now that you have decided the DSType, decide your data source then, how.
See this, format will remain generic but will get tweaked based on DSType choice.
5) The data source of the content. The value depends on the value of datasourceType:
■ When datasourceType=dsTypeSingleNode, set datasource to a single document node identifier in the
connection_name[your connection to repository in jdeveloper]#dDocName[your meta data name or service name in content server]:content_id[the unique ID for the content]
■ When datasourceType=dsTypeFolderContents, set datasource to a single folder node identifier in the format:
connection_name#dCollectionID[Service name in content server]:collection_id[Folder ID for that specific folder in content server].
So, Let’s give this a try and find out , will we will be able to get it.
For first, have a successful connection to your oracle content server in your jdeveloper.
You can follow this if you want to :
You will get all contribution folders of content server in jdeveloper.
Case I => Let’s configure our content presenter for a single item first.
See this screen shot :
taskflowID – blank.
I just want to show single content for now so I would choose single node datasource type.
As a result of that, I created the URL string in datasource parameter.
For content ID and the service name, refer your content server details or consult your UCM Administrator.
Other parameters are optional and I have already design my JSF page so I do not want this content to get render in some specific template.
We will be good to go for now. Say okay.
Run your page to see the results.
You will be able to see your content in your taskflow with few other meta data related to the content.
All these metadata you need to maintain in your repository.
See like this :
Case II = > let’s try to make representation for a folder.
Similar steps, but instead of using content ID we will use folder ID.
And need not to say, a different metadata or service name from content server.
Same steps we need to follow.
Drag and drop a content presenter on your JSF page as a region and it will show you the dialog with all the parameters.
Now we know that if we want to show all the contents which are there present in content server, we need to use foldertype datasourceType.
And also, we need to modify our datasource URL as well, with collection ID[folder ID] and collection name service name.
See this screen shot, will help you to get it perfectly :
Now, It’s all done.
Run your page to see the output :
So, for your better view, I have created both the regions in a panel tabbed view.
In one tab, I have dropped a region to show all content from a folder.
And in another tab, I have dropped a region to show details for a single content.
Case III => Let’s try to fetch content from Repository based on a Query
Now, a brief about the query first.
If at all you want to write down your custom queries to fetch the documents from your content server, these queries would be CMIS queries.
These are nothing but the queries in expression language, just like the Database queries.
The only parameter will get tweaked is our datasourceType and datasource.
So, Let’s have a look at the parameters, how you need to set if you want to write down your CMIS queries. See this screen shot :
If When datasourceType=dsTypeQueryExpression, set datasource to a CMIS search expression.
Take a very small example of query :
select * from cmis:document where cmis:name like \’%tomer%\’
connectionName=connection_name#select * from cmis:document where cmis:createdBy = \’weblogic\’
Note: If connectionName is not specified, then the primary connection will be used.
You see, now, you do not need to give your CMIS query in expression. Give it as it is.
Say okay for now and save your page.
Run it to see the outcome.
Something like this will pops up :
Try to write down as much as customized queries you will be able to write.
Test this functionality at full and utilize the same as well.
Now, Last scenario.
Case IV => Let’s try to fetch Multiple contents from Repository
For this, what you need to do, again only two things,
When datasourceType=dsTypeMultiNode, set datasource to a set of comma-delimited document node
identifiers in the format:
connection_name#dDocName:content_id, connection_name#dDocName:content_id, …
Let’s have a look at the task flow parameter dialog :
You will need to configure like this :
What I have tried in this case is, I tried to pick three Documents based on their unique ID , stored in the content server.
So, my final Datasource string will looks something like this :
Configure your mutinode content presenter and play with it as much as you can.
Now, run the page and you will be able to see something like this :
So, now you see we have configured our content presenter based on all available options or parameters.
This, Content presenter is a part of document services of oracle webcenter in jdeveloper.
In my next post, I will explore all other available document services and how one should configure to utilize the same.
Here is sample application for you to start with, use it, customize it and explore it more :
Refer contentpresenter.jspx to start with this.