[Portal] JSR-168 examples
Hello, I am having troubles with getting JSR-168 portlet samples running in the portal demo. They still display "The coplet Portlet-1 is currently not available." in the portlet window and write exception in the log: 2004-02-16 19:39:29 WARN(2004-02-16) 19:39.29:974 [portal ] (/cocoon/samples/portal/portal) Thread-17/AbstractCopletAdapter: Unable to get content of coplet: Portlet-1 org.xml.sax.SAXException: Portlet couldn't be loaded: testsuite.TestPortlet1 These instructions are given in the portal demo in order to run JSR-168 portlet samples: >The Cocoon portal supports portlets conforming to the JSR-168. The JSR-168 contains a >sample that uses the testsuite from the Jakarta-Pluto project. >These samples only work if you follow these installation instructions: > o Get the jakarta pluto project and install it into Tomcat (Test Pluto now). > o Install Cocoon as a web application in Tomcat and remove the Pluto webapp. > o Start Tomcat and run the Cocoon portal demo. You should now see two portlets. So I obtained last sources from jakarta-pluto project, started maven (rc1) fullDeployment, which installed pluto container into my Tomcat (4.1.27). New directories pluto and testsuite were created under %TOMCAT%\webapps. Pluto samples work when accessing http://localhost/pluto/portal. Now I am using the new release cocoon-2.1.4 running on WinXP platform and I configured Tomcat to deploy cocoon samples in %TOMCAT%\webapps\cocoon21.xml: ... and they are not working. I tried to delete pluto (according to 2nd point of instructions) from %TOMCAT%webapps, but they are still not working. Tell me please, what am I doing wrong and why the removal of pluto webapplication is needed. Thank you, Michal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Portal] JSR-168 examples
> -Original Message- > From: Carsten Ziegeler [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 17, 2004 9:00 AM > To: [EMAIL PROTECTED] > Subject: RE: [Portal] JSR-168 examples > > > > -Original Message----- > > From: DURDINA Michal [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 16, 2004 7:50 PM > > To: [EMAIL PROTECTED] > > Subject: [Portal] JSR-168 examples > > > > Hello, > > I am having troubles with getting JSR-168 portlet samples > > running in the portal demo. They still display "The coplet > > Portlet-1 is currently not available." in the portlet window > > and write exception in the log: > > 2004-02-16 19:39:29 WARN(2004-02-16) 19:39.29:974 > > [portal ] (/cocoon/samples/portal/portal) > > Thread-17/AbstractCopletAdapter: Unable to get content of > > coplet: Portlet-1 > > org.xml.sax.SAXException: Portlet couldn't be loaded: > > testsuite.TestPortlet1 > > > > These instructions are given in the portal demo in order to > > run JSR-168 portlet samples: > > >The Cocoon portal supports portlets conforming to the > > JSR-168. The JSR-168 contains a sample that uses the > > testsuite from the Jakarta-Pluto project. > > >These samples only work if you follow these installation > > instructions: > > > o Get the jakarta pluto project and install it into Tomcat > > (Test Pluto now). > > > o Install Cocoon as a web application in Tomcat and remove > > the Pluto webapp. > > > o Start Tomcat and run the Cocoon portal demo. You should > > now see two portlets. > > > > So I obtained last sources from jakarta-pluto project, > > started maven (rc1) fullDeployment, which installed pluto > > container into my Tomcat (4.1.27). New directories pluto and > > testsuite were created under %TOMCAT%\webapps. Pluto samples > > work when accessing http://localhost/pluto/portal. > > > > Now I am using the new release cocoon-2.1.4 running on WinXP > > platform and I configured Tomcat to deploy cocoon samples in > > %TOMCAT%\webapps\cocoon21.xml: > > > docBase="D:\cocoon-2.1.4\build\webapp\" reloadable="true" > debug="1"/> > > > > ... and they are not working. > > > > I tried to delete pluto (according to 2nd point of > > instructions) from %TOMCAT%webapps, but they are still not working. > > > > Tell me please, what am I doing wrong and why the removal of > > pluto webapplication is needed. > > > First, deleting the pluto webapp is not really needed, but it's > the webapp itself is not needed as you use Cocoon as the portal > engine. > > Now, the problem is that you didn't deploy Cocoon as a war but added > a context definition and "mounted" an external directory. > Unfortunately, > this doesn't work in Pluto, you have to deploy Cocoon into the > Tomcat webapps directory. > > Carsten > Ok, I moved build/webapp to %TOMCAT_HOME%\webapps and renamed it to cocoon21. I started Tomcat and when typed username and password into portal demo, following messaged appeared 2 times in Tomcat log: 2004-02-18 18:35:32 ERROR (2004-02-18) 18:35.32:967 [portal ] (/cocoon21/samples/portal/auth) Thread-16/LogServiceImpl: org.apache.pluto.invoker : PortletInvokerImpl.action() - Unable to find RequestDispatcher. After click on the JSR-168 tab pane, empty boxes appeared (instead of "The coplet TestPortlet-1 is currently not available" as before) and same message appeared in the Tomcat log + 2004-02-18 18:35:52 WARN(2004-02-18) 18:35.52:669 [portal ] (/cocoon21/samples/portal/portal) Thread-16/AbstractCopletAdapter: Unable to get content of coplet: TestPortlet-1 I tried to set cocoon webapp to be crossContext by placing cocoon21.xml in the %TOMCAT_HOME%\webapps but this makes things even worse and I am getting back to original exception as when cocoon weapp was mounted from outside %TOMCAT%\webapps. Is anyone else from cocoon users experiencing this problem? Thanks for help. Michal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[portal] pluto testsuite exception
Hi, I tried jakarta-pluto testsuite samples (JSR-168 sample portlets) to run within cocoon in portal engine sample. After some struggling with Tomcat configuration I accomplished the first page of testsuite portlet displayed in the JSR-168 tab. But after click to the Next button, NPE occured in testsuite in test2.jsp when getSupportedPortletModes() was called. Is cocoon portal engine providing implementation for portalContext.getSupportedPortletModes()? What other issues are known limiting the run of JSR-168 portlets under cocoon portal ? Thanks in advance, Michal 2004-03-03 18:03:22 ApplicationDispatcher[/testsuite] Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) ... - Root Cause - java.lang.NullPointerException at org.apache.pluto.util.Enumerator.(Enumerator.java:87) at org.apache.pluto.core.impl.PortalContextImpl.getSupportedPortletModes(PortalContextImpl.java:100) at org.apache.jsp.test2_jsp._jspService(test2_jsp.java:179) ... 2004-03-03 18:03:22 ApplicationDispatcher[/testsuite] Servlet.service() for servlet TestPortlet2 threw exception javax.servlet.ServletException at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:285) at org.apache.pluto.core.PortletServlet.doPost(PortletServlet.java:188) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.pluto.core.PortletServlet.service(PortletServlet.java:178) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498) at org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:149) at org.apache.pluto.invoker.impl.PortletInvokerImpl.render(PortletInvokerImpl.java:101) at org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:137) at org.apache.cocoon.portal.coplet.adapter.impl.PortletAdapter.streamContent(PortletAdapter.java:185) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT: Authentificating user with server managed security
Title: OT: Authentificating user with server managed security Hello cocooners, this is little bit off topic of the Cocoon domain itself. This question applies to Servlets in general. I am trying to authentificate the user for Cocoon that is already authentificated in another web application (running in .net platform). I do not want the user to type the user name and his password again, rather I would like to "reuse" the existing login from .net application. For this purpose there will be a web service on the .net side, that will authentificate and authorize session beeing created by Java server. Communication would flow like this: - from .net application a request with user (user's .net session id) will be sent to Java application - Java application uses this .net session id to authentificate the user using provided web service - if authentification succeeded the user will be authentificated also in Java server and will be allowed to enter protected content residing in Java application I want to use some standard server side security mechanism (JAAS or Tomcat realm). JAAS module or Tomcat Realm would communicate with web service. Its input should be session id from .net platform, the result should be user principal and his roles. I want this because I want my application to behave transparent to any authentification method - the application uses programatic security using HTTPServletRequest getUserPrincipal() and isUserInRole() methods. It seems now that I am forced to use one of the authentification mechanisms specified in Servlets specification when wanting the server managed authentification in Java server: - HTTP BASIC Authentification - Form Based Authentification But now I am stuck in that, because I have no clue how to simulate any of these authentification methods by simple HTTP POST explicitly called by the client. This first HTTP POST (or GET) with request parameter containing existing .net session id should be our entry point to our Java application. Has anyone experienced given or similar problem or has anyone has some clue about how to solve this puzzle? Thanks for any help, Michal
HTML escaping in XML
Title: HTML escaping in XML Hello, I know this is probably frequently answered problem, but I am also sure than you can provide realy fast answer :) I need to insert HTML markup (as text) in my XSP page and expecting the serializer not to escape <,> characters for <> What am I doing wrong? Thank you, Michal Pipeline: XSP: // HTMLInsert String hi = ""; this.characters(hi);
RE: HTML escaping in XML
Title: RE: HTML escaping in XML Ok :) I can also answer my question. The trick is to disable output escaping for HTML markup. I could not disable output escaping by modifing properties in because only relating property is 'cdata-section-elements'. This property produces CDATA directives (output = ) in the resulting stream, what is not correctly recognized by HTML browser and the content of the page look as follows: HTMLInsert]] (]] is not wanted content) The only way I found is to interleave XSLT transformer in the pipeline like this In the test.xsl must then be specified disable-output-escaping="yes" on xsl:value-of as follows Warning!: If the HTML markup does not conform to XML, next pipeline element must be only serilizer (HTML, Text), because after transforming with test.xsl, the result is no longer valid XML. For example this will not work: Michal > -Original Message- > From: DURDINA Michal [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 06, 2003 9:44 AM > To: [EMAIL PROTECTED] > Subject: HTML escaping in XML > > > Hello, > I know this is probably frequently answered problem, but I am > also sure than you can provide realy fast answer :) > > I need to insert HTML markup (as text) in my XSP page and > expecting the serializer not to escape <,> characters for <> > What am I doing wrong? > > Thank you, > Michal > > Pipeline: > > > > > > XSP: > > // HTMLInsert > String hi = > ""; > this.characters(hi); > > > > > __ Informacia od NOD32 1.550 (20031104) __ > > Tato sprava bola preverena systemom NOD32 pre Exchange. > http://www.eset.sk > > >
Custom protocol for ResourceReader
Title: Custom protocol for ResourceReader Hello! I am considering to use ResourceReader for accessing a stream gathered from backend system. This stream will be either pdf or xls - the backend provides these two formats. I am considering to create my own protocol implementation for the reader, that would provide access to the stream, that I get in the action. Action and reader will probably communicate via specific request attribute. Sitemap fragment: Do you think this is a good idea? Does you know any better mechanism, how to pass a stream from the action directly to the HTTPResponse bypassing any pipeline? I am using Cocoon 2.0.4 for this time. Thank you for thinking over. Michal PS: Excerpt from ResourceReader.java (C2.0.4) ... public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); this.inputSource = this.resolver.resolve(super.source); } ...
RoleFilterTransformer (or before I go for lunch)
Title: RoleFilterTransformer (or before I go for lunch) Hi, I am trying to use RoleFilterTransformer to filter elements in my xml according to Container Managed user roles (accessible via request.isUserInRole()). Either I am really missing something or this component doesn't work as expected. Try this: test.xml: el1 el2 el3 then output is (user has roles rpt080viewer,rpt090viewer): el1 el2 el3 But I would expect this output: el1 el3 What the hack is that? RoleFilterTransformer doesn't even produce a valid xml (missing block closing element). Looking to sources of RoleFilterTransformer it extends FilterTransformer. I have no clue why, beacause FilterTransformer doesn't provide anything that could be extended by RoleFilterTransformer. All functionality is so simple, that it is all contained in the source of RoleFilterTransformer. Can you please give any explanation to this? Is anyone using RoleFilterTransformer at all? Thank you, Michal http://apache.org/cocoon/role-filter/1.0";> el1 el2 el3 http://apache.org/cocoon/role-filter/1.0";> el1 el2 el3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]