Reusing a HCSP Region Template in Site Studio for External Applications

Site Studio for External Applications (SSXA) is part of the new WCM offering in UCM 11g. Basically, it allows you to develop and deliver web sites externally from UCM, but still take advantage of the same site definition, templating, and in-context editing/workflow you get from traditional Site Studio sites. John Brunswick has a great getting started post on its many benefits.

One of its benefits is being able to re-use assets that were created in the earlier 10gR4 version of UCM and Site Studio. Data files, Element Definitions, and Region Definitions are some of the assets that work in both platforms and can be edited in either Site Studio Designer or JDeveloper. But when it comes to the templates like Region Templates and Subtemplates, that's where they diverge. In Site Studio Designer, templates are built as .hcsp pages that use Idoc Script. This is because they are executed and delivered directly in UCM. In SSXA and JDeveloper, they are developed as .jsp(x) pages where they are executed and delivered straight out of the WebLogic Server (WLS) application.

But what if you wanted to re-use those .hcsp Region Templates or Subtemplates in SSXA? You might have a lot of logic already written in them. Well, you can't bring them over directly because WLS won't know how to render the Idoc Script. But there is a handy way to proxy that template into your SSXA application so that the snippet of HTML is first computed on the UCM side and then delivered directly. This way SSXA won't need to know how to render the template...it will have already be done. Here are the basic steps:

In a site in JDeveloper, create a new Region Template. Associate it with the Region Definition that has been defined and which has an HCSP Region Template already created in Site Studio that has all the display logic.

create_region_template.png

Click on the Source tab of the new Region Template and go to the Site Studio Component Pallet. Add a new empty line above the closing </jsp:root> tab and add the 'IdcService' tag from the pallet. For the Service, enter 'WCM_PLACEHOLDER' and for the var enter 'wcmPlaceholder'.

addService.png

Now we need to add some parameters to the service. Add a new line below the wcm:idcService line and in the Site Studio Component Pallet, select 'IdcParameter'. For the Name, enter 'dataFileDocName' and for the Value, enter '${wcmContext.placeholder.dataFile}'. What this means is it will take the Content ID of the data file associated with the placeholder and pass it along in this value.

Add a second parameter with the Name of 'SSDoLinkEvaluation' and Value of 'True'. A third parameter with the Name of 'SSLinkUrlEvaluationPrefix' and Value the represents the root URL to UCM (e.g. http://server:16200/cs/). This will resolve URL paths to images and other objects that might be referenced in the HTML.

The forth and final parameter has the Name of 'placeholderDefinitionDocName' and will have the Placeholder Definition that contains the association between the Region Definition that you associated with in step 1 and the HCSP version of the Region Template in UCM. Many times, I'll just re-use the Placeholder Definition that I used in my traditional Site Studio site.

Once all of the parameters are in place, you need to remove the self closing '/' marker in the wcm:idcService tag and add a closing tag for it below the parameters.

Finally, you need to actually output resulting HTML coming back from that service call. For that, you simply need to add the line:

${wcmPlaceholder.localData.placeholderContent}

rt_code.png

The template is now done, so go ahead and save it.

Now you want to go to the Placeholder Definition within JDeveloper and add our Region Definition and our new Region Template.

ssxa_placeholder_def.png

That's it! Now we can go to our site, switch the content and select one based on our Region Definition and it should come through with the formatting defined in our HCSP Region Template.

ssxa_final_result2.png

Comments:

Hi Kyle, I am stuck in an issue. We are using WebDAV to checkin Assets in UCM. But If we try to checkin any filelarger than 2 GB, checkin fails. WebDAV throws an error. Is there any Size limitation ?

Posted by sandeep on January 24, 2011 at 09:25 AM CST #

Hello Sandeep, UCM does not impose any upload size limit. This is generally because of a limit on the web server that is hosting UCM. The Apache default limit is 2GB, so perhaps that is what you are using and running into. Apache does have a configuration entry to control that limit and increase it if you need to (http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody). Thanks, Kyle

Posted by kyle.hatlestad on January 25, 2011 at 02:35 AM CST #

Hi Kyle , Can we use weblogic workshop to create the region template. is it possible?

Posted by vikram on February 07, 2011 at 05:22 AM CST #

Hello Vikram, WebLogic Workshop in Eclipse? No, I'm afraid the Site Studio for External Applications plug-ins only support JDeveloper as an IDE. Thanks, Kyle

Posted by kyle.hatlestad on February 07, 2011 at 08:22 AM CST #

Kyle, We are just starting to use Site Studio to build out templates for our websites. Can you recommend which we should use? SSXA or Site Studio Designer?

Posted by Jill on February 25, 2011 at 07:45 AM CST #

With the release of UCM 11g PS3, the functionality from a web site building and contribution model are nearly identical. So I think the major factors to decide is a technology and deployment choice. Site Studio Designer will use Idoc Script as the scripting language which is a much simpler language then Java and JSTL. Many of the functions you would commonly use in site display are available as Idoc functions. But if your site is more "application" focused then it is content focused, then it probably makes more sense to go the SSXA route. Those application portions of the site can be easily incorporated into the site since it's basically a WebLogic application. Thanks, -Kyle

Posted by kyle.hatlestad on March 21, 2011 at 10:52 PM CDT #

Hi, I've been looking for SSXA plugin for Eclipse similar to JDeveloper, especially OEPE. Is any available? Thanks, Raja

Posted by Raj on March 27, 2011 at 05:54 PM CDT #

Hello Raja, No, I'm afraid not. The only SSXA plugin available is for JDeveloper. Thanks, -Kyle

Posted by kyle.hatlestad on March 28, 2011 at 02:20 AM CDT #

Hi Kyle,

I'm busy unpacking the SSXA demo site and the Oracle tutorial leaves out a lot of information, do you know if there is a more updated tutorial for SSXA, even better if someone has built a site in SSXA and has a better tutorial?

Thanks

Posted by kathy on July 05, 2011 at 11:41 PM CDT #

Hey Kathy,

Those are our two main sources for getting started with SSXA. Is there something specific you were hoping to see in the tutorial? I believe it is complete and covers building the assets and site from scratch. There is also a viewlet that covers creating a very simple site, but that is more minimal then the tutorial in documentation. It is available at http://download.oracle.com/otndocs/11gViewlets/GettingStartedWithSSXA/sseademo.swf. There is also formal training that covers SSXA in 11g as well. http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getcoursedesc?dc=D69295GC10.

Thanks,
-Kyle

Posted by guest on July 07, 2011 at 03:38 AM CDT #

Hi Kyle,

I wants to use SSXA, but don't want JDeveloper. is this possible use SSXA alone(without JDeveloper).

Thanks in advance,
kannan

Posted by kannan on September 12, 2011 at 06:08 PM CDT #

Hey Kannan,

No, I'm afraid not. The current version as of now (11g PS4) can only be built on applications built with JDeveloper and deployed on WebLogic Server.

But keep in mind the ability to surface content and editing capabilities does exist as services that can be called with different API's such as REST, Web Services, RIDC, CIS, etc. http://www.oracle.com/technetwork/middleware/webcenter/content/usingsitestudioinexternalapplicatio-1-129701.pdf . You don't need SSXA for that.

Thanks,
-Kyle

Posted by Kyle Hatlestad on September 14, 2011 at 12:16 PM CDT #

Hi Kyle!I have a strange problem :after the contributor adds in the page a placeholder with a subtemplate(CTRL+SHIFT+F5), it remains stuck in Contribution Mode?!What can be the reason?Thanks!

Posted by guest on March 18, 2013 at 02:43 PM CDT #

Sounds like that might be a product issue. You may want to contact support to have them look at that. One thing you can try if the CTRL+SHIFT+F5 keystroke does not work is to append ?SSContributor=false or ?SSContributor=true to force the switch between Contributor Mode or not.

Thanks,
-Kyle

Posted by Kyle Hatlestad on March 26, 2013 at 09:46 AM CDT #

Hi Kyle!
The problem was with the html code inside the HCSP, but now I am getting a weird behaviour.It seems that when certain users login to the CMS and try to submit a form to my custom component, which uses services to load the email adresses of the users from a specific alias and then sends a mail to that alias using InternetFunctions.sendMailTo(emailStr, m_emailTemplate, subject, this);,the email is sent two times.
But the tricky part is that the execution is strange.A normal flow SistemOutput would be something like this:
-load the addreses in one method
-call another method to send mail
but when the email is sent twice the output is:
-load the addreses in one method
-load the addreses in one method
-call another method to send mail
-call another method to send mail
Do you have any ideas?
Thanks!

Posted by guest on April 04, 2013 at 11:28 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