Skip to main content

developerWorks >  Lotus  >  Forums  >  Lotus Web Content Management  >  developerWorks

Dynamic menu using JSP component    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is answered.

Permlink Replies: 21 - Pages: 2 [ 1 2 | Next ] - Last Post: Nov 11, 2009 5:37 PM Last Post By: nitsvault
kriss_sanju

Posts: 103
Registered: Jul 12, 2007 08:38:47 AM
Dynamic menu using JSP component
Posted: Oct 22, 2008 03:28:16 AM
 
Click to report abuse...   Click to reply to this thread Reply
Hi,
I am rendering menu component using JSP component.
The jsp code is as follows:

<%@ taglib uri="/WEB-INF/tld/wcm.tld" prefix="wcm" %>
<wcm:initworkspace user="<%= request.getUserPrincipal() %>"/>
<%RenderingContext context = (RenderingContext)request.getAttribute(Workspace.WCM_RENDERINGCONTEXT_KEY);
String currentPath = context.getPath();

String subPath1 = currentPath.substring(currentPath.indexOf("/")+1);
String subPath2 = subPath1.substring(subPath1.indexOf("/"),subPath1.lastIndexOf("/"));

String currentLibrary ="Sample WCM";
Map myparams = new HashMap();
myparams.put("sitearea", currentLibrary+subPath2);
%>
<wcm:setExplicitContext path="<%=currentPath%>" requestParameters="<%=myparams%>"/>
<wcm:libraryComponent name="menu" library="Sample WCM" />

In the menu component Design menu search result I have written the following code:

<placeholder tag="titlelink"/>

But it is not working.
I am getting 404 error.

Please help me in this issue.
EricMorentin

Posts: 100
Registered: Mar 13, 2008 05:18:46 PM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 05:25:19 AM   in response to: kriss_sanju in response to: kriss_sanju's post
 
Click to report abuse...   Click to reply to this thread Reply
Which part is giving you a 404? does the menu render at all? or are you seeing a problem with the setExplicitContext call?

If the menu is rendering does the referenced content have a authoring to presentation template mapping?

What do you see in the portal logs?
kriss_sanju

Posts: 103
Registered: Jul 12, 2007 08:38:47 AM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 06:46:32 AM   in response to: EricMorentin in response to: EricMorentin's post
 
Click to report abuse...   Click to reply to this thread Reply
Menu is rendering but when I am clicking the titlelink it is giving 404 error.

The referenced content has presentation and authoring template map.

This is the error I am getting when I am clicking on content title link.

Error 404: SRVE0190E: File not found: /category.jsp/Sample WCM/unilever/skincleaningandcare/testcontent2
metkhoo

Posts: 138
Registered: Mar 23, 2007 09:59:56 AM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 07:22:26 AM   in response to: kriss_sanju in response to: kriss_sanju's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi,
It appears to me that the current context is the problem here. By setting it explicitly the menu seems to think internal memory URL's should be generated with the explicitly set context.

At the start of the code, you appear to have a current rendering context in the "context" object. My question to you is : why are you using

<wcm:setExplicitContext path="<%=currentPath%>" requestParameters="<%=myparams%>"/>

?
Best regards
/Marcus
kriss_sanju

Posts: 103
Registered: Jul 12, 2007 08:38:47 AM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 07:36:12 AM   in response to: metkhoo in response to: metkhoo's post
 
Click to report abuse...   Click to reply to this thread Reply
Yes you are true no need of setting explicit context.

Now I have removed it used the following code:

<wcm:initworkspace user="<%= request.getUserPrincipal() %>"/>
<%RenderingContext context = (RenderingContext)request.getAttribute(Workspace.WCM_RENDERINGCONTEXT_KEY);
String currentPath = context.getPath();
String subPath1 = currentPath.substring(currentPath.indexOf("/")+1);
String subPath2 = subPath1.substring(subPath1.indexOf("/"),subPath1.lastIndexOf("/"));
String subPath3 = subPath2.substring(subPath2.lastIndexOf("/"));
String currentLibrary ="Sample WCM";
Map myparams = new HashMap();
myparams.put("sitearea", currentLibrary+subPath2);
%>
<wcm:libraryComponent name="menu" library="Sample WCM" />

Still I am getting the same error.

EricMorentin

Posts: 100
Registered: Mar 13, 2008 05:18:46 PM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 07:39:33 AM   in response to: kriss_sanju in response to: kriss_sanju's post
 
Click to report abuse...   Click to reply to this thread Reply
Which version of WCM are you using?
kriss_sanju

Posts: 103
Registered: Jul 12, 2007 08:38:47 AM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 07:42:17 AM   in response to: EricMorentin in response to: EricMorentin's post
 
Click to report abuse...   Click to reply to this thread Reply
portal version is 6.0.0.0
EricMorentin

Posts: 100
Registered: Mar 13, 2008 05:18:46 PM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 07:46:21 AM   in response to: kriss_sanju in response to: kriss_sanju's post
 
Click to report abuse...   Click to reply to this thread Reply
What are the contents of your \PortalServer\version\wcm.component file
kriss_sanju

Posts: 103
Registered: Jul 12, 2007 08:38:47 AM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 07:59:16 AM   in response to: EricMorentin in response to: EricMorentin's post
 
Click to report abuse...   Click to reply to this thread Reply
The content of <wps-root>\version\wcm.component file is

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE component PUBLIC "componentId" "component.dtd">
<component build-date="2006/07/18 at 9:00:06 EST" build-version="Build 298.0" name="Web_Content_Management" spec-version="6.0"/>
EricMorentin

Posts: 100
Registered: Mar 13, 2008 05:18:46 PM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 07:59:37 AM   in response to: EricMorentin in response to: EricMorentin's post
 
Click to report abuse...   Click to reply to this thread Reply
Are you rendering in a portlet or direct to WCM?

What is the HTML being produced? (get this from IE)
kriss_sanju

Posts: 103
Registered: Jul 12, 2007 08:38:47 AM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 08:18:00 AM   in response to: EricMorentin in response to: EricMorentin's post
 
Click to report abuse...   Click to reply to this thread Reply
Attachment source.html (44.7 KB)
I am rendering in Web Content Viewer portlet which is placed on a portal page.

I am calling that jsp using jsp component.

I have attached the page source.
EricMorentin

Posts: 100
Registered: Mar 13, 2008 05:18:46 PM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 08:26:48 AM   in response to: kriss_sanju in response to: kriss_sanju's post
 
Click to report abuse...   Click to reply to this thread Reply
I would highly recommend upgrading to 6.0.1.4 (It will make it easier for me to help as well)

http://www-01.ibm.com/support/docview.wss?uid=swg24020016

It honestly looks like you are hitting a bug in the JSP component (I can not reproduce this on the 6.1.0.1 version of WCM, I will try and find a 6.0.x build somewhere to try)
kriss_sanju

Posts: 103
Registered: Jul 12, 2007 08:38:47 AM
Re: Dynamic menu using JSP component
Posted: Oct 22, 2008 08:43:09 AM   in response to: EricMorentin in response to: EricMorentin's post
 
Click to report abuse...   Click to reply to this thread Reply
Thank you very much .
I will upgrade and I will do it.
kriss_sanju

Posts: 103
Registered: Jul 12, 2007 08:38:47 AM
Re: Dynamic menu using JSP component
Posted: Nov 07, 2008 04:22:10 AM   in response to: kriss_sanju in response to: kriss_sanju's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi,
I have upgraded WCM to version 6.0.1.2 and portal server to version 6.0.1.1.
Still I am getting the same problem.

Please help me if you find any solution.

thanks & regards,
Kishore Kumar Reddipalli
IBM Certified Application Developer
IBM Certified Solution Developer

metkhoo

Posts: 138
Registered: Mar 23, 2007 09:59:56 AM
Re: Dynamic menu using JSP component
Posted: Nov 11, 2008 04:02:18 AM   in response to: kriss_sanju in response to: kriss_sanju's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi,
Is there any reason you can't upgrade to 6.0.1.4?
/Marcus

Point your RSS reader here for a feed of the latest messages in all forums