PageBuilder2 theme architecture - Dynamic Content Spot

In the PageBuilder2 theme architecture - theme.html i mentioned that the theme.html makes use of concept of dynamic content spot. The basic concept is that the theme.html want to include .jsp page, since the .html page cannot directly add .jsp page since .jsp pages need servlet context to compile and execute, those .jsps are packaged in the PageBuilder2.war along with Default.jsp.



Ex. the theme.html wants to forward control to asa.jsp for generating active sight analytics(asa) related markup, so you can include that .jsp in the theme.html like this

<a rel="dynamic-content"
href="res:/PageBuilder2/themes/html/PageBuilder2.0/asa.jsp"></a>


But this approach has following problems

  • Reference by name abstracts the dynamic content away from the implementation. This is necessary if the theme needs to run on multiple runtimes, for example WebSphere Portal and IBM® Mashup Center. The portal implementation of the navigation tabs can be a JSP that contains portal specific code. The Mashup Center on the other hand cannot execute portal JSP code, but provides an iWidget instead.

  • Reference by name isolates the theme author from having to know the underlying code information. This is useful if the theme author is an HTML and CSS designer, but not a J2EE or JavaScript developer. The HTML and CSS developer needs to know only the list of named content spots and the simple syntax to add it. This developer can then write code without having to know JSP path names etc.



So in order to provide one more layer of indirection, WPS has WP_DynamicContentSpotMappings resource provider that lets you map a symbolic name to the location of .jsp like this




Now inside your theme.html you can refer to the asa.jsp like this

<a rel="dynamic-content" href="dyn-cs:id:asa@tl:oid:csa2.theme" />


The resolver framework takes care of finding the actual .jsp file from this symbolic name. Also if you start digging into the .jsp files you will notice that they also include other .jsps by using this type of syntax


<r:dataSource uri="dyn-cs:id:configGlobal@tl:oid:csa2.theme" escape="none">
<r:param name="pragma" value="cache"/>
</r:dataSource>
<r:dataSource uri="dyn-cs:id:configDynamic@tl:oid:csa2.theme" escape="none"/>

17 comments:

  1. Great stuff, thank you for your articles.

    From the docs it "seems" that you could also define dynamic content spot aliases at theme level in metadata.

    This should save time over the resource environment method.

    Unfortunately I couldn't figure out the correct way to do it.

    I'll go for a PMR and ask IBM.

    The reference is in this infocenter page:

    http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Working_with_dynamic_content_spots_wp7

    the last section is about using metadata.

    I tried this but got stuck. Webdav is always trashing away my changes.

    Any idea ?

    ReplyDelete
  2. I like to access WCM API in theme, like I wanted to show WCM navigation component in theme along with normal portlet navigation. It is possible?. pls send me reply on portallead@gmail.com

    ReplyDelete
  3. Take a look at http://wpcertification.blogspot.com/2010/10/using-custom-dynamic-content-spot-in.html for information on how to use dynamic content spot.

    I think you should be able to change the navigation related jsp to include your own content in navigation

    ReplyDelete
  4. I couldn't access those metadata files using webdav, neither through the /themelist/all URL nor the /fs-type1 URL. The wabdav get redirected all the time and cannot download those files. Does anyone else have the sense that webdav is not working properly with wp7?

    ReplyDelete
  5. hi, how do i create a new pagebuilder theme from the mashup theme. i understand that the existing pagebuilder theme is in "C:\IBM\WebSphere7\PortalServer\theme\wp.mashup.cc.theme\installedApps\wp.mashup.cc.theme.ear\PageBuilder2.war"
    i do not wish to edit the existing default.jsp file

    ReplyDelete
  6. It's interesting that many of the bloggers your tips helped to clarify a few things for me as well as giving... very specific nice content.java training in chennai | java training institutes in chennai | java j2ee training institutes in velachery

    ReplyDelete
  7. Really Great and useful piece of information.Thanks for sharing best Java Training in Chennai | Android Training in chennai

    ReplyDelete
  8. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.

    Vlsi Training in Chennai | Wcf Training in Chennai.

    ReplyDelete
  9. I wish to indicate because of you only to bail me out of this specific trouble. As a consequence of checking through the net and meeting systems that were not beneficial, I thought my life was finished.
    fire and safety course in chennai

    ReplyDelete
  10. I really love the theme/design of your website. Do you ever run into any browser compatibility problems?
    iosh course in chennai

    ReplyDelete