Hi David

Now this is a little bit unexpected. I actually double checked before
posting and now, the portlet modes are loaded as expected.
The only difference is: Now I'm on a different location and I'm
connected to the internet.

But the Portlet still complains with the same error. Because now we're
comparing EDIT (portlet.xml) and edit (PortletMode.EDIT).

I just checked the schema contained in the spec and it says:
Portlet modes. The specification pre-defines the following values as
valid portlet mode constants: "edit", "help", "view". Portlet mode
names are not case sensitive. Used in: custom-portlet-mode, supports.
(Page 85, Lines 47-51)

So I'd do this:
Index: 
pluto-container/src/main/java/org/apache/pluto/core/impl/ActionResponseImpl.java
===================================================================
--- 
pluto-container/src/main/java/org/apache/pluto/core/impl/ActionResponseImpl.java
   (Revision 345641)
+++ 
pluto-container/src/main/java/org/apache/pluto/core/impl/ActionResponseImpl.java
   (Arbeitskopie)
@@ -235,7 +235,8 @@
             SupportsDD sup = (SupportsDD)supports.next();
             Iterator modes = sup.getPortletModes().iterator();
             while(modes.hasNext()) {
-                if (modes.next().equals(mode.toString())) {
+                String test = (String) modes.next();
+                if (test.equalsIgnoreCase(mode.toString())) {
                     return true;
                 }
             }



Now everything works fine.


Patrick


2005/11/19, David H. DeWolf <[EMAIL PROTECTED]>:
> portlet xml looks ok:
>
> <supports>
>    <mime-type>text/html</mime-type>
>    <portlet-mode>VIEW</portlet-mode>
>    <portlet-mode>EDIT</portlet-mode>
> </supports>
>
> this defines that your portlet supports the VIEW and the EDIT modes for
> the text/html mime type.  the fact that SupportsDD.portletModes only
> contains text/html is because this is the only mime type you've
> declared.  That said, edit should work fine and I'm not sure why it's
> not -- unless you're also setting the content type to something other
> than text/html.
>
> Can you look at your debugger and tell me if text/html is associated
> with both of the defined modes or if the EDIT is absent?
>
> Thanks,
>
>
> David
>
>
> Patrick Huber wrote:
> > Hi
> >
> > I'm currently working on a test portlet and trying to get the edit
> > mode working. My portlet.xml appears to be fine.
> >
> > The flow is this:
> > - i click on an action url
> > - processAction sets the portlet mode to edit
> > - i get an error:
> > javax.portlet.PortletModeException: Can't set this PortletMode
> > org.apache.pluto.core.impl.ActionResponseImpl.setPortletMode(ActionResponseImpl.java:108)
> >       
> > net.swisstech.portlet.test.jsr168.JSR168Portlet.processAction(JSR168Portlet.java:59)
> >       org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:170)
> >       org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:113)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >       org.apache.pluto.core.PortletInvoker.invoke(PortletInvoker.java:156)
> >       org.apache.pluto.core.PortletInvoker.action(PortletInvoker.java:84)
> >       
> > org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:179)
> >       
> > org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:102)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >
> >
> > So, I started the debugger to find out some more about this error and got 
> > this:
> > - ActionResponseImpl checks wether a requested mode is in the list of
> > defined modes from the portlet.xml file. If this is not the case, the
> > above exception is thrown.
> > - In my case, SupportsDD.portletModes only contains "text/html"
> > - After some more debugging, I found
> > AbstractCastorDescriptorService.readInternal. The unmarshalled object
> > "object" also only contains the mime-type.
> > - I've had a look at castor-portlet-xml-mapping.xml but can't tell if
> > it's correct since I've never used castor myself.
> >
> > So is there something wrong with my portlet.xml (I think it's fine /
> > see attachment)? Or is it the castor config?
> >
> > Thanks
> > Patrick
> >
> > --
> > "I love deadlines. I like the whooshing sound they make as they fly
> > by." -- Douglas Adams
> >
> >
> > ------------------------------------------------------------------------
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <portlet-app
> >       xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
> >       version="1.0"
> >       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >       
> > xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd 
> > http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";>
> >
> >       <portlet>
> >               <description>A JSR168 Test Portlet</description>
> >               <portlet-name>JSR168Portlet</portlet-name>
> >               <display-name>JSR168Portlet</display-name>
> >
> >               
> > <portlet-class>net.swisstech.portlet.test.jsr168.JSR168Portlet</portlet-class>
> >
> >               <expiration-cache>0</expiration-cache>
> >
> >               <supports>
> >                       <mime-type>text/html</mime-type>
> >                       <portlet-mode>VIEW</portlet-mode>
> >                       <portlet-mode>EDIT</portlet-mode>
> >               </supports>
> >
> >               <supported-locale>en</supported-locale>
> >
> >               <portlet-info>
> >                       <title>The JSR168Portlet</title>
> >                       <short-title>JSR168 Portlet</short-title>
> >                       <keywords>JSR168, Portlet, Test</keywords>
> >               </portlet-info>
> >
> >       </portlet>
> >
> > </portlet-app>
>
>


--
"I love deadlines. I like the whooshing sound they make as they fly
by." -- Douglas Adams

Reply via email to