1 2 3 Previous Next 38 Replies Latest reply on Feb 17, 2005 6:50 AM by arturasb

    Trouble - hadcoded MIME type and restrictions

    arturasb

      Hi.

      I want to share my experience related to the portal.

      Today I finally joined to the portal's development process and I changed the ContentTypeInterceptor to the one which is more sofisticated. It takes into account User Agent.

      With the Firefox+UserAgentSwitcher I changed user agent to the
      "Nokia6100" which resulted into quite nice exception:

      java.lang.IllegalArgumentException: Content type not accepted
       at org.jboss.portal.portlet.impl.RenderResponseImpl.setContentType(RenderResponseImpl.java:68)
       at org.jboss.portal.core.portlet.user.UserPortlet.doView(UserPortlet.java:126)
       at org.jboss.portlet.JBossPortlet.doDispatch(JBossPortlet.java:169)
       at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:159)
       at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:233)
       at org.jboss.portal.portlet.invocation.DispatcherInterceptor.invokeRequest(DispatcherInterceptor.java:143)
       at org.jboss.portal.portlet.invocation.DispatcherInterceptor.invoke(DispatcherInterceptor.java:171)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.portlet.cms.CMSInterceptor.invoke(CMSInterceptor.java:78)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.portlet.invocation.PreferencesInterceptor.invoke(PreferencesInterceptor.java:93)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.component.ContextDispatcherInterceptor$InvokeNextCommand.execute(ContextDispatcherInterceptor.java:94)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.portal.server.servlet.CommandServlet.doGet(CommandServlet.java:51)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
       at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:552)
       at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
       at org.jboss.portal.server.invocation.component.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:58)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.invocation.AccessControlInterceptor.invoke(AccessControlInterceptor.java:125)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.component.ModeInterceptor.invoke(ModeInterceptor.java:37)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.invocation.ConstrainedWindowStateInterceptor.invoke(ConstrainedWindowStateInterceptor.java:51)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.component.ParametersInterceptor.invoke(ParametersInterceptor.java:70)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.component.CacheInterceptor.invoke(CacheInterceptor.java:74)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:239)
       at org.jboss.portal.server.Component.invoke(Component.java:127)
       at org.jboss.portal.server.invocation.portal.MainDispatcherInterceptor.invoke(MainDispatcherInterceptor.java:159)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.portal.WurflBasedContentTypeInterceptor.invoke(WurflBasedContentTypeInterceptor.java:52)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.invocation.ViewInterceptor.invoke(ViewInterceptor.java:58)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.invocation.UserContextInterceptor.invoke(UserContextInterceptor.java:90)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:239)
       at org.jboss.portal.server.PortalServer.invoke(PortalServer.java:195)
       at org.jboss.portal.server.servlet.AbstractMainServlet.invoke(AbstractMainServlet.java:58)
       at org.jboss.portal.core.servlet.CoreServlet.process(CoreServlet.java:201)
       at org.jboss.portal.core.servlet.CoreServlet.invoke(CoreServlet.java:187)
       at org.jboss.portal.server.servlet.AbstractMainServlet.doGet(AbstractMainServlet.java:53)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.jboss.portal.core.servlet.TransactionFilter$1.run(TransactionFilter.java:78)
       at org.jboss.portal.common.transaction.Demarcator.requiresNew(Demarcator.java:52)
       at org.jboss.portal.core.servlet.TransactionFilter.doFilter(TransactionFilter.java:74)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
       at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
       at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
       at java.lang.Thread.run(Thread.java:534)
      
      
      
      
      
      null
      
      
      
      
      
      
      java.lang.IllegalArgumentException: Content type not accepted
       at org.jboss.portal.portlet.impl.RenderResponseImpl.setContentType(RenderResponseImpl.java:68)
       at org.jboss.portal.core.portlet.cms.CMSPortlet.doView(CMSPortlet.java:65)
       at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:51)
       at org.jboss.portal.core.portlet.cms.CMSPortlet.render(CMSPortlet.java:149)
       at org.jboss.portal.portlet.invocation.DispatcherInterceptor.invokeRequest(DispatcherInterceptor.java:143)
       at org.jboss.portal.portlet.invocation.DispatcherInterceptor.invoke(DispatcherInterceptor.java:171)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.portlet.cms.CMSInterceptor.invoke(CMSInterceptor.java:78)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.portlet.invocation.PreferencesInterceptor.invoke(PreferencesInterceptor.java:93)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.component.ContextDispatcherInterceptor$InvokeNextCommand.execute(ContextDispatcherInterceptor.java:94)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.portal.server.servlet.CommandServlet.doGet(CommandServlet.java:51)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
       at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:552)
       at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
       at org.jboss.portal.server.invocation.component.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:58)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.invocation.AccessControlInterceptor.invoke(AccessControlInterceptor.java:125)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.component.ModeInterceptor.invoke(ModeInterceptor.java:37)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.invocation.ConstrainedWindowStateInterceptor.invoke(ConstrainedWindowStateInterceptor.java:51)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.component.ParametersInterceptor.invoke(ParametersInterceptor.java:70)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.component.CacheInterceptor.invoke(CacheInterceptor.java:74)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:239)
       at org.jboss.portal.server.Component.invoke(Component.java:127)
       at org.jboss.portal.server.invocation.portal.MainDispatcherInterceptor.invoke(MainDispatcherInterceptor.java:159)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.invocation.portal.WurflBasedContentTypeInterceptor.invoke(WurflBasedContentTypeInterceptor.java:52)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.invocation.ViewInterceptor.invoke(ViewInterceptor.java:58)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.core.invocation.UserContextInterceptor.invoke(UserContextInterceptor.java:90)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:214)
       at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:239)
       at org.jboss.portal.server.PortalServer.invoke(PortalServer.java:195)
       at org.jboss.portal.server.servlet.AbstractMainServlet.invoke(AbstractMainServlet.java:58)
       at org.jboss.portal.core.servlet.CoreServlet.process(CoreServlet.java:201)
       at org.jboss.portal.core.servlet.CoreServlet.invoke(CoreServlet.java:187)
       at org.jboss.portal.server.servlet.AbstractMainServlet.doGet(AbstractMainServlet.java:53)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.jboss.portal.core.servlet.TransactionFilter$1.run(TransactionFilter.java:78)
       at org.jboss.portal.common.transaction.Demarcator.requiresNew(Demarcator.java:52)
       at org.jboss.portal.core.servlet.TransactionFilter.doFilter(TransactionFilter.java:74)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
       at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
       at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
       at java.lang.Thread.run(Thread.java:534)
      


      Then I decided to look for the hardcoded MIME type "text/plain" in the cource code. Here you have the file list:

      AdminPortlet.java, TestPortlet.java, DefaultPortlet.java, CMSPortlet.java, AdminCMSPortlet.java, RolePortlet.java, UserPortlet.java, CoreServlet.java, ForumsPortlet.java, SessionInspectorServlet.java, PortletServlet.java, TestUserInformationPortlet.java, TestSessionPortlet.java, TestSecurityPortlet.java, TestSecuredProtocolPortlet.java, TestResourceBundlePortlet.java, TestRedirectPortlet.java, TestPortletPreferencesPortlet.java, TestPortletModePortlet.java, TestPortlet.java, TestHelloWorldPortlet.java, TestDispatcherPortlet.java, TestCachedContentPortlet.java, PortletMetaDataTestCase.java, CrossContextSessionServlet.java, CrossContextSessionPortlet.java, ContentTypesTestCase.java, TestExceptionDuringActionPortlet.java, WurflBasedContentTypeInterceptor.java, MainDispatcherInterceptor.java, ContentTypeInterceptor.java


      Well, I believe we need to remove this from the code ASAP. I also believe that the portal is the one which dictates MIME type.
      Good people of Portal ;), what do you think about this disaster ;) ?

      Best regards,
      Arturas

      P.S.: sorry for those big pieces of code...

        • 1. Re: Trouble - hadcoded MIME type and restrictions

          1. What content-type is your user agent expecting? text/wml, or something to that effect?

          2. The cms portlet should be able to serve non text/html, text, but doesn't presently. Note, it does not serve binaries. Those have to be served from the servlet level.

          3. To serve wap content, we'd probably have to take the user agent in to account. I've never worked with wap/wml serving, so any input would be appreciated, Arturas.

          • 2. Re: Trouble - hadcoded MIME type and restrictions

            Great job Arturas, indeed you are right, for now we have focused on text/html so far.

            We have to add other mime types to the portlets we have currently. First we have to add your code and add support for portlets in the portal-2.0/portlet stuff. Then once it works we add it to the core.

            • 3. Re: Trouble - hadcoded MIME type and restrictions
              arturasb

               

              1. What content-type is your user agent expecting? text/wml, or something to that effect?


              The content type for the WML is "text/vnd.wap.wml".

              2. The cms portlet should be able to serve non text/html, text, but doesn't presently. Note, it does not serve binaries. Those have to be served from the servlet level.


              I think the portlet must be invisible if it doesn't support the current MIME type.

              3. To serve wap content, we'd probably have to take the user agent in to account. I've never worked with wap/wml serving, so any input would be appreciated, Arturas.


              I'm glad to help the team. I'm coding the new content type interceptor and I'm going to provide you guys with that. My idea is:

              1. Only the portal can set the MIME type.
              2. Other parts of portal (pages, portlets) uses portal's MIME type.
              3. Pages and portlets declares MIME types it can handle. Pages and portlets are not displayed if the current MIME type is not supported.

              For that reason we need to remove all setContentType('text/html').

              Regards,
              Arturas

              • 4. Re: Trouble - hadcoded MIME type and restrictions
                arturasb

                 

                We have to add other mime types to the portlets we have currently. First we have to add your code and add support for portlets in the portal-2.0/portlet stuff. Then once it works we add it to the core.


                Can you tell me what parts belongs to the portal's core ? I can try to clean up it. I have also noticed there are plenty of HTML in the code - we need to remove it also ansd ASAP.

                Arturas

                • 5. Re: Trouble - hadcoded MIME type and restrictions

                  arturas, you are right on all points and this is actually what the spec says.

                  1. yes the portal decides the mime type and this is what the content type interceptor does.

                  2. show only the portlet that can produce this mime type and declare it. it is done in portlet.xml in the support tag

                  3. today our portlet are not designed for that : the portlet should do a response.getContentType and according to that content type do q switch/case

                  4. we will go in that direction, BUT this is not the priority of the project today. So the migration is going to be done step by step. Today we have more important priorities. So keep cool we're doing it, but in a controlled
                  manner

                  5. you forget something, the dispatching to the aggregqtor (theme) must also be based on the content type. Today it will do HTML

                  • 6. Re: Trouble - hadcoded MIME type and restrictions

                    jboss-portal-2.0/server and jboss-portal-2.0/portlet is the implementation of JSR-168

                    jboss-portal-2.0/core is core

                    • 7. Re: Trouble - hadcoded MIME type and restrictions
                      arturasb

                      Hi Julien.

                      I just sent my new content type interceptor to you - please, check your e-mail box.

                      Regards,
                      Arturas

                      • 8. Re: Trouble - hadcoded MIME type and restrictions

                        got it, I'll take care of that.

                        thanks

                        • 9. Re: Trouble - hadcoded MIME type and restrictions

                          I have integrated your work in the codebase today. Thanks for the contrib.

                          I think that now we need an interceptor that is going to select the portlet according that mime type. Each portlet advertise the mime types it can server, so at the end the portlet on the page are those that support the mime type that has been decided as content type for the request.

                          Makes sense ?

                          • 10. Re: Trouble - hadcoded MIME type and restrictions
                            arturasb

                            Hello Julien.

                            I have integrated your work in the codebase today. Thanks for the contrib.

                            You're welcome ;).
                            I think that now we need an interceptor that is going to select the portlet according that mime type. Each portlet advertise the mime types it can server, so at the end the portlet on the page are those that support the mime type that has been decided as content type for the request.
                            Makes sense ?


                            Yes, that makes sense. May I participate ;) in those changes ?

                            P.S.: how can I connect to the CVS with IBM's WebSphere Application Developer (Eclipse based) - I'm behind a proxy server ?

                            • 11. Re: Trouble - hadcoded MIME type and restrictions

                              yes, you should work on that I think. This should be done as a an interceptor placed after the ViewInterceptor. It needs to iterate all the windows selected for this request and retain only those who can produce the selected content type.

                              On the Window object you can get the Instance and on the Instance you can get the Component object.

                              On that Component object you have a method getContentTypes() which returns a plugin of the component responsible for managing the associations between component and content types.

                              • 12. Re: Trouble - hadcoded MIME type and restrictions
                                arturasb

                                 

                                This should be done as a an interceptor placed after the ViewInterceptor. It needs to iterate all the windows selected for this request and retain only those who can produce the selected content type.

                                On the Window object you can get the Instance and on the Instance you can get the Component object.

                                On that Component object you have a method getContentTypes() which returns a plugin of the component responsible for managing the associations between component and content types.


                                Questions:
                                1. Can we say "window=page" ?

                                2. How will we deal with composition of page ? I have suggested to dislplay links to portlets instead of portlets itself in those cases when we have WML, cHTML and xHTML. This meen that not only certain portlets are included into a page, but the page itself looks differently depending on user agent's prefered markup .

                                3. How about making a plugin or even portal's service which would provide WURFL's functionality to all parts (pages, portlets, etc.) of portal ? HAR? SAR ?

                                • 13. Re: Trouble - hadcoded MIME type and restrictions
                                  arturasb

                                   

                                  On that Component object you have a method getContentTypes() which returns a plugin of the component responsible for managing the associations between component and content types.


                                  In addition also I would like to set the preferred markup for the portal together with the MIME type. Pages and portlets will get it from the request. What do you think is the best way to set this attribute to the portal ?

                                  • 14. Re: Trouble - hadcoded MIME type and restrictions

                                    actually portlet has to use the request.getResponseContentType() to know which mime type has been decided for that request.

                                    1 2 3 Previous Next