1 2 3 Previous Next 38 Replies Latest reply on Feb 17, 2005 6:50 AM by arturasb Go to original post
      • 15. Re: Trouble - hadcoded MIME type and restrictions
        arturasb

         

        "julien@jboss.com" wrote:
        actually portlet has to use the request.getResponseContentType() to know which mime type has been decided for that request.


        Truth, but markup!=MIME. For example:

        Markup MIME
        --------------------------------------
        html text/html
        chtml text/html
        xhtml text/html
        wml text/vnd.wap.wml

        This meens, we have the same MIME for different markups. In fact, portlet would "like" to know what markup is expected by the current User Agent and it would form the corresponding content.
        We have the tag. It's rendered in different way in WML and cHTML/xHTML. There are more difference(, and so on), quite small but important . My idea is to provide portlets with all information which can be important when the content is rendered. So, I think we could provide this info in a header. What do you think about it ?


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

           


          This meens, we have the same MIME for different markups. In fact, portlet would "like" to know what markup is expected by the current User Agent and it would form the corresponding content.
          We have the br tag. It's rendered in different way in WML and cHTML/xHTML. There are more difference(input, body and so on), quite small but important . My idea is to provide portlets with all information which can be important when the content is rendered. So, I think we could provide this info in a header. What do you think about it ?


          Well, my example tags were taken into account by the forumin my previous post ;) .

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

            what are the differences between CHTML and others (HTML and XHTML) ?

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

               

              what are the differences between CHTML and others (HTML and XHTML) ?


              Most of those differences are related to markup tags and their attributes - it depends how device renders certain tag and it's attributes. Some devices simply ignores the rest part of content if "unsupported" combination is found. Please, take a look at this refference, here you'll find most of differences with markups:

              http://wurfl.sourceforge.net/java/refguide.php

              That's why I would like to provide portlets with additional info regarding markups preferred by certain User Agent.

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

                so the best place would be the request properties under a specific key

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

                   

                  so the best place would be the request properties under a specific key


                  Where can I look for an example ? I mean, the existing portal's code.

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

                    I have addd support for the preferred markup in the code base.
                    Look at the test portlet example in the core.

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

                       

                      I have addd support for the preferred markup in the code base.
                      Look at the test portlet example in the core.


                      Thank you Julien.

                      P.S.: could you recommend a way how to connect to the CVS repository if I'm behind the proxy ? Can I do that with Eclipse ?

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

                        unfortunately I have no solutions for this
                        we should make the nightly CVS available for download as we did for nukes.

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

                           

                          "julien@jboss.com" wrote:
                          unfortunately I have no solutions for this
                          we should make the nightly CVS available for download as we did for nukes.


                          Is this available already ?

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

                            Hi Julien.

                            "julien@jboss.com" wrote:
                            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.


                            Well, it seems I need more information on selecting right components accorting to their supported MIME type.

                            1. I get the request :

                            PortalRequest request = (PortalRequest)invocation.getAttachment(AttachmentKey.PORTAL_REQUEST);


                            2. Then I get the window :
                            Window window = (Window)invocation.getAttachment(AttachmentKey.WINDOW);


                            3. After that I get the MetaDataHolder :

                            MetaDataHolder mdh = window.getInstance.getComponent().getPlugin(plugin).getMetaData();


                            Question #1 - what is the correct value of "plugin" ?
                            Question #2 - how to check the MIME type supported by the concrete component of the wondow ?

                            Please, explane the idea in more details. All information is quite fragmented and it is difficult to get the whole picture.

                            Thank you in avance.

                            Cheers,
                            Arturas



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

                              so you have the window, you do getInstance then getComponent.

                              once you have the component you look for the plugin org.jboss.portal.server.PortalConstants.PLUGIN_PREFS

                              there you have an instance of org.jboss.portal.server.plugins.mode.ContentTypes you can use the method isContentTypeSupported that checks if the component supports a specific content type

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

                                 

                                so you have the window, you do getInstance then getComponent.

                                once you have the component you look for the plugin org.jboss.portal.server.PortalConstants.PLUGIN_PREFS

                                there you have an instance of org.jboss.portal.server.plugins.mode.ContentTypes you can use the method isContentTypeSupported that checks if the component supports a specific content type


                                Thanks Julien, that's pretty clear. One more question - how do I exclude the component if it doesn't support the current MIME type ? What is the technique ?

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

                                  look at the org.jboss.portal.core.invocation.ViewInterceptor, I think you should integrate here because this is the place that the view is built.

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

                                    Is the single <mime-type> tag per portlet allowed ?

                                    2005-02-15 15:36:21,072 DEBUG [org.jboss.portal.core.deployment.builder.CorePortletBuilder] Configured security for portlet UserPortlet with class org.jboss.portal.core.metadata.ModelMetaData
                                    2005-02-15 15:36:21,072 DEBUG [org.jboss.portal.core.deployment.builder.CorePortletBuilder] Configured security for portlet CMSPortlet with class org.jboss.portal.core.metadata.SecurityRuleSetMetaData
                                    2005-02-15 15:36:21,072 ERROR [org.jboss.portal.server.deployment.WebAppAdapter] Starting failed portal:service=Deployer,type=Adapter
                                    java.lang.IllegalArgumentException: Too many children
                                     at org.jboss.portal.common.util.XML.getSingleChild(XML.java:186)
                                     at org.jboss.portal.portlet.deployment.builder.PortletBuilder.buildContentTypesMetaData(PortletBuilder.java:462)
                                     at org.jboss.portal.portlet.deployment.builder.PortletBuilder.buildPortletMetaData(PortletBuilder.java:221)
                                     at org.jboss.portal.portlet.deployment.builder.PortletBuilder.build(PortletBuilder.java:150)
                                     at org.jboss.portal.core.deployment.builder.CorePortletBuilder.build(CorePortletBuilder.java:42)
                                     at org.jboss.portal.server.deployment.SimpleDeploymentReactor.build(SimpleDeploymentReactor.java:127)
                                     at org.jboss.portal.server.deployment.SimpleDeploymentReactor.build(SimpleDeploymentReactor.java:134)
                                     at org.jboss.portal.server.deployment.SimpleDeploymentReactor.build(SimpleDeploymentReactor.java:134)
                                     at org.jboss.portal.server.deployment.SimpleDeploymentReactor.process(SimpleDeploymentReactor.java:101)
                                     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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
                                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                                     at $Proxy33.process(Unknown Source)
                                     at org.jboss.portal.server.deployment.WebAppAdapter.deploy(WebAppAdapter.java:49)
                                     at org.jboss.portal.server.deployment.WebAppIntercepter.startService(WebAppIntercepter.java:193)
                                     at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
                                     at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:172)
                                     at org.jboss.portal.server.util.Service.start(Service.java:73)
                                     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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
                                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                                     at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:908)
                                     at $Proxy0.start(Unknown Source)
                                     at org.jboss.system.ServiceController.start(ServiceController.java:416)
                                     at org.jboss.system.ServiceController.start(ServiceController.java:438)
                                     at org.jboss.system.ServiceController.start(ServiceController.java:438)
                                     at org.jboss.system.ServiceController.start(ServiceController.java:438)
                                     at org.jboss.system.ServiceController.start(ServiceController.java:438)
                                     at org.jboss.system.ServiceController.start(ServiceController.java:438)
                                     at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
                                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                     at java.lang.reflect.Method.invoke(Method.java:324)
                                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
                                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                                     at $Proxy4.start(Unknown Source)
                                     at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
                                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
                                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
                                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
                                     at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
                                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                     at java.lang.reflect.Method.invoke(Method.java:324)
                                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
                                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                                     at $Proxy8.deploy(Unknown Source)
                                     at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
                                     at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
                                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
                                     at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
                                     at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
                                     at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
                                     at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                     at java.lang.reflect.Method.invoke(Method.java:324)
                                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
                                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                                     at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
                                     at $Proxy0.start(Unknown Source)
                                     at org.jboss.system.ServiceController.start(ServiceController.java:416)
                                     at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
                                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                     at java.lang.reflect.Method.invoke(Method.java:324)
                                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
                                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                                     at $Proxy4.start(Unknown Source)
                                     at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
                                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
                                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
                                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
                                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
                                     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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
                                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
                                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                                     at $Proxy5.deploy(Unknown Source)
                                     at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
                                     at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
                                     at org.jboss.Main.boot(Main.java:151)
                                     at org.jboss.Main$1.run(Main.java:405)
                                     at java.lang.Thread.run(Thread.java:534)
                                    2005-02-15 15:36:21,087 WARN [org.jboss.system.ServiceController] Problem starting service portal:service=Deployer,type=Adapter