Digging Web center Services Part I: Content Presenter

On October 12, 2013, in Oracle ADF, Oracle WebCenter, by vaibhav

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. http://smconsultants.in/2013/01/installing-webcenter-extension-for-jdeveloper11g.html 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 : http://smconsultants.in/2013/03/configure-web-center-content-in-jdeveloper-to-leverage-out-ofbox-web-center-functionality-part-i.html 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 listbased 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 format: 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 : http://smconsultants.in/2013/03/configure-web-center-content-in-jdeveloper-to-leverage-out-ofbox-web-center-functionality-part-i.html#comment-4993 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 :

So, now 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 : ${‘UCM#dDocName:VAIBHAV-PC_444000606,UCM#dDocName:VAIBHAV-PC_444000201, UCM#dDocName:VAIBHAV-PC_444000608′} 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.

Oracle ADF Online and Classroom Training Oracle Application Development Framework (Oracle ADF) is a mature and comprehensive Java EE development framework available to application developers. ADF uses visual tools to rapidly generate and maintain full-stack

Java EE applications. It enables users to focus on the features of the actual application and not the underlying technology stack. This course is aimed at developers who need to build Java EE applications using Oracle ADF. Participants of this training will use Oracle JDeveloper 11g to build, test and deploy an end-to-end web application. Training Duration 4 Weeks Who Can Benefit Oracle Forms Developers Oracle OA Framework Developers ERP Professionals/Consultants Java/J2EE Developers Course Contents Introduction to JDeveloper 11g and ADF, Exploring JDeveloper,Database Scheme Design,Data Modeling with ADF Business Components,Entity Objects and Associations,View Objects and View Links,Application Modules,Programmatically Modifying Default Behavior,Business Validation,Introduction to User Interface Technologies,Understanding ADF Data bindings,Understanding ADF Task Flows,Enriching the Page Content,Understanding Layout Basics,Ensuring Reusability,Implementing Page Navigation,Handling Application Events,Managing and Validating Data,Transaction Management,Troubleshooting ADF Applications, Deploying ADF Applications (Web Logic).

Courses offered at SMC We deal with Oracle Fusion Middleware comprising of Oracle ADF, SOA/BPEL, AIA, APEX, OAF, Web center 11g, service bus 11g, performance tuning training,oracle ODI,oracle workflow. Why should you prefer learning at SMC? First two classes are absolutely FREE!

Facilitated with Experienced and Real Time expert trainers! Real Time Development Environment with Source Control and Remote Database Two way interactive mode(Trained many aspirants from India, USA, U.K, China etc) Post training support via chat, email, forum available 24*7 online help is provided – we attend to your every query Students have the option to record the session Online lab facility with 64GB RAM Server

For Online registration and other queries
Contact : Mr. Rajesh
India : +91.80 19490782 USA : +1.650.585.2312 Mail id:smconsultants.in@gmail.com Website : http://smconsultants.in/training-schedulecomplete-list

Trainers please contact us at : trainers@smconsultants.inHurry up ,seats gets filled.registration done on criteria of first come first serve basis

Sign up to vote on this title
UsefulNot useful