Using Rules & Profiles To Drive Custom Pages

One of the great features of UCM is the ability to create dynamically rendered pages and be able to simply check them in to have them work. These include the Hypertext Content Server Template (HCST), Hypertext Content Server Page (HCSP), and Hypertext Content Server Form (HCSF). Each one is a combination of HTML and IdocScript for server-side rendering. The HCSFs are meant for on-line form data entry (which in-turn create HCSPs with that data embedded). And HCSTs and HCSPs are meant as more general display pages. The main difference between them being HCSPs are indexed (and thus need the <!--$ --> Idoc syntax) and HCSTs are not.

With these dynamic pages, you can go so far as to create your own custom check-in, search, and content information page. And what's nice is that you don't need a full-blown component to do it. You simply create your file, check it in, and then clicking on the web location will execute and display it.

CustomPage.jpg

I would definitely recommend checking out Bex's The Definitive Guide to Stellent Content Server Development book for great examples on how to create your own custom pages.

But let's say you have a custom Search or Info page and you want to incorporate it into the standard pages in UCM. So at that point do you need to create a custom component that will modify the services or navigation so that the custom page is used instead? Do you need to overwrite all the places that the standard page is used to use the custom page instead? With a few tweaks to your Rules and Profiles, you don't have to.

So what you want to do is create a Rule that will include a Side Effect which will incorporate the custom page.


  • Check in your custom page and copy the web location.

  • In the Configuration Manager applet, create a new Rule.

  • Turn on the 'Use rule activation condition' and click the Edit... button.

  • Depending on what type of custom page you are defining, you may want to create a condition to only activate on that particular action. In my example, it's on the 'Content information' action.

  • Click on the Side Effects tab and enter the Key and value of:


       Key: urlTemplate

       Value: (relative path to your custom page) (e.g. /idc/groups/public/documents/document/he000744.hcst)



  • Include that Rule in a particular Profile or make it Global

By passing in the 'urlTemplate' parameter, that tells Content Server to use that particular page instead of the standard template for display.

CustomDocInfo.jpg

So because it's executed in the Rule/Profile, there is no need to modify the standard links and navigation to use it.

Special thanks to Ed Bryant for sending me this tip!

Comments:

will HCSP/F/T pages still be viable in 11g? Will IDOC be deprecated?

Posted by serona on January 21, 2010 at 09:46 AM CST #

Yes. Dynamic pages, components, and IdocScript will still be available in UCM 11g.

Posted by kyle.hatlestad on January 22, 2010 at 07:37 AM CST #

Awesome, tip, Kyle. I was just pondering this possibility the other day and really appreciate you and Ed passing it along.

Posted by carren on January 22, 2010 at 02:08 PM CST #

This is indeed an awesome tip! It's exactly what we need for several of our projects. Thanks to you and Ed Bryant!

Posted by Don Glascock on January 28, 2010 at 01:30 AM CST #

hi,I wanna know whether this one only works for HSCT file? if I wanna change the url of check-in to the project's check-in page, can I use this one?? Regards,

Posted by crystal on March 18, 2010 at 07:24 PM CDT #

Crystal, The idea behind this approach is to use a dynamic file (HCST/HCSP) page to act as a completely customized page and not rely on a component to do it. I'm not sure I know what you mean about changing the URL of the check-in page to the project's check in page. Can you go into detail in your use-case? Thanks, Kyle

Posted by kyle.hatlestad on March 30, 2010 at 05:27 AM CDT #

Hey Kyle, can this be done with files extension .idoc? Lets say I want to make global to everyone that customized search template you created in a previous blog in which you created an idoc file to add in the template, would that work for this? cheers,

Posted by malky on September 08, 2010 at 04:07 AM CDT #

Hey malky, Well, the resource includes can be put in an .idoc file (which is what it is for). But you will still need an .hcst or .hcsp page to pull in that .idoc file (using the docLoadResourceIncludes function). You can't call an .idoc file directly for display. It needs to be a display template. But if your goal is to make this page global to everyone, it already is. If users have access to the security group that the .hcst is in, they'll all be able to make use of it Thanks, -Kyle

Posted by kyle.hatlestad on September 08, 2010 at 05:10 AM CDT #

Thanks for your response Kyle. I think that search result template you created was very neat and seeing this post I thought it would be really nice to use this to make it global without requiring each user make those changes in the search template, so the plan would be to skip that. So as you just mentioned I'd still need the hcsp or hcst to do the dynamic page for everyone in the rules, since those files take idoc do you think it would work if I embed the idoc in the hcst? if not would you tell me why you think it would not work? Thanks,

Posted by malky on September 08, 2010 at 07:08 AM CDT #

Hey Malky, Ah, now I understand. You want to use this approach so people don't have to configure their own search results template. No, I'm afraid that won't work. This approach allows you to define the Search page...not the search results page. Profiles aren't used as part of search result pages. The only way to modify the search results page is to create a component that adds or modifies the standard ones....or for users to create their own custom one that I outlined in the other post. Thanks, -Kyle

Posted by kyle.hatlestad on September 08, 2010 at 08:20 AM CDT #

Ah that's wot I thought. Thanks Kyle, your posts are awesome.

Posted by malky on September 09, 2010 at 12:12 AM CDT #

Any chance you would share the hcst file/code pictured above? I love the concept of tabs separating the information. How did you get the metadata to separate from status, links and revision history? Thanks, Jonathan

Posted by Jonathan on September 29, 2010 at 09:46 AM CDT #

Hey Jonathan, Sure thing. my_doc_info.hcst. It uses the YUI library to create the tabs on the page. And although it uses the YUI library that comes with UCM, it does reference a skin that is normally not published to UCM's weblayout directory. So you'll want to copy the folder ucm_dir\custom\YahooUserInterfaceLibrary\build\tabview\assets\skins and place that in the ucm_dir\weblayout\resources\yui\tabview\assets directory for it to work. Thanks, Kyle

Posted by kyle.hatlestad on October 01, 2010 at 06:06 AM CDT #

Great post Kyle, works like a charm

Posted by Tal on December 14, 2010 at 08:33 PM CST #

Hi, Kyle --

We're now ready to use this cool trick to replace the search page for a specific content profile.

However, when I try to override a profile's search page to supply our custom search page (which is currently just Bex's example from his book), I still get the profile's search page. I've tried removing the rule's activation conditions, and now the search results page and the checkin page use this custom search form (which is truly entertaining :-) but the search page itself still does not. I've tried everything I can think of to find an error message or other fault, but have come up empty.

Is Ed's cool trick known to work for replacing the actual search page itself?

Thanks for your time!

Don

Posted by Don on June 20, 2011 at 03:34 AM CDT #

Hey Don,

I didn't notice this before, but it looks like the search page doesn't honor the 'urlTemplate' parameter. Or any other parameter to redirect it's template. Because it uses the GET_DOC_PAGE service, it uses the template defined with the Page parameter. So if you need a new search page, it looks like having a custom component to overwrite the template would be required.

Thanks,
-Kyle

Posted by guest on June 20, 2011 at 07:39 AM CDT #

Thanks, Kyle, for the quick reply on an old topic. It may not have been the answer I was looking for, but knowing the facts is always the goal.

Don

Posted by Don on June 20, 2011 at 07:52 AM CDT #

Hello,

Will something like this work on UCM 11g R1 for search result pages/templates?

Posted by Shannara on September 12, 2011 at 11:02 AM CDT #

Hey Shannara,

No, I'm afraid not. This only works for the check-in or update pages. You'd need a custom component to modify the search result pages.

Thanks,
-Kyle

Posted by Kyle Hatlestad on September 14, 2011 at 06:01 AM CDT #

Good Morning,

Is there a way to change the content, etc in the 11g, Classic View (search result) file/template.

I am trying to stay away from the custom control creation as much as possible.

Posted by Shannara on September 21, 2011 at 05:20 AM CDT #

Hello Shannara,

Yes, the content within the Classic View in search results can be changed with the Web Layout Editor applet. Go to Options -> Query Results Pages and edit the StandardResults. The Text1 field is for the link and Text2 is for the bottom description.

Thanks,
-Kyle

Posted by Kyle Hatlestad on September 21, 2011 at 06:13 AM CDT #

Hi Kyle,
I followed the steps and created a custom checkin page and upon checking in the document using that page its throwing an error: "The content item was not successfully checked in. The authorization token is invalid. It has either expired or is not appropriate for the current request.
You may need to reload an earlier page in order to proceed."

can u please thro some light on this ..sorry if that's a simple question as i'm stll in the initial learning phase.

Posted by Gary on May 11, 2012 at 06:24 AM CDT #

Hey Gary,

Yes, if this is on 11g, there is a new security filter that has been added on all forms called the IdcToken. This needs to be passed on all form submissions. You can add this to your form fields with the include:

<$include idc_token_form_field$>

Thanks,
-Kyle

Posted by guest on June 12, 2012 at 09:34 AM CDT #

Hi..Can we prevent some of custom matadata values to be checked in though user enters the value for them??

Posted by Amullya on June 14, 2012 at 07:16 AM CDT #

Hello Amullya,

A bit of an unusual request, but you can clear values from metadata even if the user has entered something. Simply create a Rule and include your metadata field. For the 'Is derived field", go to custom and enter <$dprDerivedValue=""$>. That will clear the value before it is checked in.

Thanks,
-Kyle

Posted by Kyle Hatlestad on June 14, 2012 at 08:36 AM CDT #

Hi Kyle,
Thanks for reply..But its not working..The matadata value doesnt get clear...Please reply..
Thanks,
Amullya.

Posted by Amullya on June 14, 2012 at 10:50 PM CDT #

Kyle,

Can this technique be used for desktop integration too? My requirement is to be able to read a view based on some information passed into the check-in screen then populate other fields from the results. I was thinking I could build a custom template to do this then call it from a profile rule using this technique. Do you think there is any chance of this working before I try it?

Bill

Posted by guest on June 27, 2012 at 11:52 AM CDT #

Bill,

I have not tried it so I can't say for sure, but I don't see why not. These screens presented in desktop integration are using the same profile page templates as the web UI, minus the extra header/footer.

Thanks,
-Kyle

Posted by Kyle Hatlestad on July 06, 2012 at 10:47 AM CDT #

Hey Kyle,
Can you please elaborate about the option of creating a custom component in order to modify the search resutl page ?

Thank you
Liora

Posted by Liora on October 15, 2012 at 07:26 AM CDT #

Hello Liora,

Yes, custom components are used to modify the behavior or interface of UCM/WebCenter Content. It allows you to override the standard code without changing it directly and support future upgrades. Component Architecture is described in the online guide here: http://docs.oracle.com/cd/E23943_01/doc.1111/e10807/part4_customize_comp.htm#sthref522. It's very similar between 10g and 11g. Oracle University also has a course in component architecture called "Oracle WebCenter Content 11g: Content Server Customization". The custom component can override the standard resources of the search results page to display it as needed.

Thanks,
-Kyle

Posted by Kyle Hatlestad on October 15, 2012 at 09:26 AM CDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Kyle Hatlestad is a Solution Architect in the WebCenter Architecture group (A-Team) who works with WebCenter Content and other products in the WebCenter & Fusion Middleware portfolios. The WebCenter A-Team blog can be found at: https://blogs.oracle.com/ ateam_webcenter/

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today