Topic
  • 2 replies
  • Latest Post - ‏2012-10-01T14:11:17Z by DimitriM
DimitriM
DimitriM
3 Posts

Pinned topic Theme development issue

‏2012-09-28T11:36:19Z |
Hi,

I was recently asked to alter a Portal theme to remove WebDAV resources and replace them by static resources because it would be easier. I did this with a tutorial that could be found here: http://www.digitalseance.com/blog.jsp?action=viewpost&postid=25. It is a portal 7 tutorial and I used it for a portal 8 theme and it seemed to work.
However, when changing the layout of a page (or by creating a new page), I get the "Error 404: There is no content available." error. I had to enable trace logging for exceptions to see the error, and when looking at the stacktrace I noticed the following:
Caused by: com.ibm.wps.resolver.data.exceptions.URIProcessingIOException: EJCBD0021E: De URI res:myTheme/themes/html/myTheme/layout.html] en de parameters [] kunnen niet worden verwerkt: SRVE0190E: File not found: /themes/html/myTheme/layout.html
at com.ibm.wps.resolver.resource.ResourceDataSourceFactory.newSource(ResourceDataSourceFactory.java:1003)
at com.ibm.portal.resolver.helper.CORDataSourceFactoryEx.newSource(CORDataSourceFactoryEx.java:53)
at com.ibm.wps.state.accessors.url.ResourceUrlAccessorOnRequest.getResourceURL(ResourceUrlAccessorOnRequest.java:302)
... 81 more
Caused by: java.io.FileNotFoundException: SRVE0190E: File not found: /themes/html/myTheme/layout.html
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor._processEDR(DefaultExtensionProcessor.java:893)
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.processEDR(DefaultExtensionProcessor.java:874)
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:434)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1027)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1384)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:193)
at com.ibm.wps.resolver.resource.RequestDispatcherDataSource.dispatch(RequestDispatcherDataSource.java:305)
at com.ibm.wps.resolver.resource.RequestDispatcherDataSource.initHeaders(RequestDispatcherDataSource.java:453)
at com.ibm.wps.resolver.resource.RequestDispatcherDataSource.reset(RequestDispatcherDataSource.java:598)
at com.ibm.wps.resolver.resource.ResourceDataSourceFactory.createRequestDispatcherDataSource(ResourceDataSourceFactory.java:538)
at com.ibm.wps.resolver.resource.ResourceDataSourceFactory.createRequestDispatcherDataSource(ResourceDataSourceFactory.java:696)
at com.ibm.wps.resolver.resource.ResourceDataSourceFactory.newSource(ResourceDataSourceFactory.java:954)
... 83 more
(sorry for the Dutch message, it's saying that it can't process the URI and parameters given)
As you can see it's looking for "layout.html" at res:myTheme/themes/html/myTheme/layout.html and at this location there is no layout.html. I have no clue why Portal is looking inside the "res:myTheme/themes/html/myTheme" directory, because in the layouts.json file I placed the following content:

{ localizationPackageName:'com.ibm.bundles', localizationBundleName:'Shelf', identifier:'label', items: [
{'label':'Home','url':ibmCfg.themeConfig.themeWebDAVBaseURI+'layout-templates/Home/','id':'Home','thumbnail':ibmCfg.themeConfig.themeRootURI+'/layout-templates/Home/icon.gif','help':''},
{'label':'Content en Sidebar','url':ibmCfg.themeConfig.themeWebDAVBaseURI+'layout-templates/ContentSidebar/','id':'ContentSidebar','thumbnail':ibmCfg.themeConfig.themeRootURI+'/layout-templates/ContentSidebar/icon.gif','help':''},
{'label':'Content en Sidebar Multiple','url':ibmCfg.themeConfig.themeWebDAVBaseURI+'layout-templates/ContentSidebarMultiple/','id':'ContentSidebarMultiple','thumbnail':ibmCfg.themeConfig.themeRootURI+'/layout-templates/ContentSidebarMultiple/icon.gif','help':''},
{'label':'Content en Sidebar Multiple','url':ibmCfg.themeConfig.themeWebDAVBaseURI+'layout-templates/Categories/','id':'Categories','thumbnail':ibmCfg.themeConfig.themeRootURI+'/layout-templates/Categories/icon.gif','help':''}
]
}
It is able to find the layouts provided (so the configuration is working I suppose) and the icons are loaded as well, so I personally think this configuration should work.
To use the theme, I import the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<request build="wp800CF01_001_54" type="update" version="8.0.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_8.0.0.xsd">
<portal action="locate">
<skin action="update" active="true" context-root="/myTheme" default="true" domain="rel" objectid="ZK_3112H901I09H60IJOVFAIJ30G1" resourceroot="mySkinHidden" type="default" uniquename="mySkinHidden">
<localedata locale="nl">
<title>Intranet Skin - Hidden</title>
<description/>
</localedata>
<parameter name="com.ibm.portal.skintype" type="string" update="set"><![CDATAtemplate]></parameter>
<parameter name="com.ibm.portal.friendly.name" type="string" update="set"><![CDATAmySkinHidden]></parameter>
<parameter name="com.ibm.portal.skin.template.ref" type="string" update="set"><![CDATAres:myTheme/skins/html/mySkinHidden/]></parameter>
</skin>
<theme action="update" active="true" context-root="/myTheme" default="false" domain="rel" objectid="ZJ_3112H901I09H60IJOVFAIJ3066" resourceroot="myTheme">
<localedata locale="nl">
<title>Intranet Theme</title>
<description/>
</localedata>
<allowed-skin skin="ZK_3112H901I09H60IJOVFAIJ30G1" update="set"/>
<parameter name="com.ibm.portal.themetype" type="string" update="set"><![CDATACSA2]></parameter>
<parameter name="com.ibm.portal.friendly.name" type="string" update="set"><![CDATAmyTheme]></parameter>
<parameter name="com.ibm.portal.theme.dnd.sources" type="string" update="set"><![CDATAibmDndColumn:com.ibm.pb.dnd.layout.LayoutColumnSource:vertical,ibmDndRow:com.ibm.pb.dnd.layout.LayoutRowSource:horizontal]></parameter>
<parameter name="com.ibm.portal.layout.template.href" type="string" update="set"><![CDATAres:myTheme/themes/html/myTheme/layout-templates/ContentSidebar/]></parameter>
<parameter name="resourceaggregation.profile" type="string" update="set"><![CDATAhttp://profiles/profile_full.json]></parameter>
<parameter name="com.ibm.portal.theme.template.ref" type="string" update="set"><![CDATAres:myTheme/themes/html/myTheme/]></parameter>
</theme>
</portal>
<status element="all" result="ok"/>
</request>

If I recall correctly, changing the layouts is using the com.ibm.portal.layout.remplate.href parameter to use the correct path, and this should be correct. After the exception (explained before) occurs, the <content></content> tags of the page are rendered empty (without a body) and that's why the "404: No content available" error is displayed.

So my question is, does anyone have a clue why portal is looking inside the res:myTheme/themes/html/myTheme directory to locate the layout.html in stead of looking inside the other directories like myTheme/themes/html/myTheme/layout-templates/<name layout>?

Thanks in advance,
Dimitri
Updated on 2012-10-01T14:11:17Z at 2012-10-01T14:11:17Z by DimitriM
  • DimitriM
    DimitriM
    3 Posts

    Re: Theme development issue

    ‏2012-10-01T14:10:35Z  
    I "bypassed" the issue by removing static resources for layout templates. After some research it became clear that more people are experiencing it. If what I found is correct, Portal is parsing the com.ibm.portal.layout.template.href on a strange way.
    When creating a page or changing the layout, it will split the value of this parameter on the last slash ('/') so it will get "res:myTheme/themes/html/myTheme/layout-templates/ContentSidebar/" and "". It will then check if the directory (the first part of the splitted string) exists, and if it does, it will concatenate the com.ibm.portal.theme.template.ref parameter together with the second part of the splitted string and layout.html.

    So, if you remove the trailing slash from the layout template, it will check for a directory "res:myTheme/themes/html/myTheme/layout-templates/" (which exists), and will then use the directory: "res:myTheme/themes/html/myTheme/" + "ContentSidebar" + "/layout.html", which would give me: "res:myTheme/themes/html/myTheme/ContentSidebar/layout.html", which obviously doesn't exist, since it left away the "layout-templates" directory.

    If you leave the trailing slash, you would get "res:myTheme/themes/html/myTheme + "" + "/layout.html", which would give me "res:myTheme/themes/html/myTheme/layout.html". This explains why I was getting the following error "Caused by: java.io.FileNotFoundException: SRVE0190E: File not found: /themes/html/myTheme/layout.html".

    So, we tried a few hours trying to bypass this parsing issue, but concluded that it is not worth the time and placed the layout templates on WebDAV and tried again (and it worked).
  • DimitriM
    DimitriM
    3 Posts

    Re: Theme development issue

    ‏2012-10-01T14:11:17Z  
    Look at my comment for more information about bypassing this issue.