myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Jurado" <cjura...@jhu.edu>
Subject RE: Trinidad Chart
Date Tue, 20 Mar 2012 18:25:25 GMT
Hey Scott,

 

  Just thought I'd pass you an update.  I think the problem is in the
component's ability to access the resources.  When I copy some of the
JavaScript files out of the .jar and put them in the application's folder,
and configure Liferay to point to them, I'm starting to see progress.  In
the page elements I'm not getting the embedded chart and can see the license
info.  The chart itself doesn't display yet but there's now a lot more in
the page source than there was, so presumably there are still resources it
can't get at.  I do have the resource servlet configured per the
instructions in the Trinidad wiki, so I'm not sure what exactly the problem
is.

 

Just for giggles, I took a PrimeFaces chart and was working with it, and I
got it to display by using this same approach.  It seems the resource
servlet in PrimeFaces is also being blocked somehow by Liferay.  I guess at
this point the trick is to see how the PortletFaces guys are making the
ICEFaces resources available and see if I can apply that approach to this.

 

Chris

 

From: Scott O'Bryan [mailto:darkarena@gmail.com] 
Sent: Monday, March 19, 2012 2:06 PM
To: MyFaces Development
Subject: Re: Trinidad Chart

 

I think using 3.0 should be fine.  There is no 'spec' for a JSF 2 Portlet
bridge yet, so it will remain in alpha until a spec is done.

Sent from my iPhone


On Mar 19, 2012, at 11:00 AM, Christian Jurado <cjurado2@jhu.edu> wrote:

I've started a new thread at the PortletFaces Bridge forum.  It also occurs
to me that the MyFaces PortletBridge 3.0 I'm using is still in the Alpha
version so  that may be all there is to it.  I'd rather not revert back to
JSF 1.2 to do this if I can avoid it, but that's what I'd have to do if I
back down to MyFaces PortletBridge 2.0.  I'll keep you posted if someone
replies.

 

From: Scott O'Bryan [mailto:darkarena@gmail.com] 
Sent: Monday, March 19, 2012 12:43 PM
To: MyFaces Development
Subject: Re: Trinidad Chart

 

Well, liferay and ICEFaces have a tight coupling.  At one point they had
their own bridge, but I think now they use the bridge at Apache which was
written around Trin/Sun JSF examples.  I know Neil did a lot of work with
the ICEFaces/Liferay integration with the Apache Bridge so maybe he could
answer that further.  In any case, if liferay requires you to configure the
resources, you should be able to do that, although I'm not sure that's your
problem.  All of the Trin resources go through a special servlet which
aggregates our JavaScript content and is able to Steve it back to the
browser.  In other words, if the request can reach the servlet, the servlet
should be able to take over from there.

Sent from my iPhone


On Mar 19, 2012, at 10:32 AM, Christian Jurado <cjurado2@jhu.edu> wrote:

Liferay portlets require an additional configuration file, which contains
elements for defining where the JavaScript and css elements are for the
portlet application.  Since the JavaScript for these components is part of
their .jar, there's no direct way to configure that.  Having said that, I
know ICEFaces works with Liferay 6 through the PortletFaces Bridge, so
somehow that bridge has a way to handle that problem, because it was created
with Liferay 6 in mind.  My understanding is that PortletFaces Bridge may be
tightly enough coupled to ICEFaces that it wouldn't work with another
library like Trinidad, but I don't know that for sure and finding out is my
next step.

 

From: Scott O'Bryan [mailto:darkarena@gmail.com] 
Sent: Monday, March 19, 2012 12:03 PM
To: MyFaces Development
Subject: Re: Trinidad Chart

 

Hmm.  Not really.  I'm wondering why liferay would prevent JavaScript from
loading though.

Sent from my iPhone


On Mar 19, 2012, at 9:38 AM, Christian Jurado <cjurado2@jhu.edu> wrote:

Hey Scott, 

 

Thanks, I worded my question poorly but that's the gist.  

 

Actually, I found a new clue.  In looking at the page source for the portlet
when displayed in Liferay I'm seeing a tag in it saying:

 

<noscript>This page uses JavaScript and requires a JavaScript enabled
browser.Your browser is not JavaScript enabled.</noscript>

 

So it looks like that old Liferay 6 JavaScript conflict is rearing its head.
I was thinking of trying to configure the portlet to point directly to any
script files in the Trinidad .jar files.  (Although I may need to pull them
out separately.)  Do you have any recommendations if I try that route?

 

Thanks,

Chris

 

From: Scott O'Bryan [mailto:darkarena@gmail.com] 
Sent: Monday, March 19, 2012 11:32 AM
To: MyFaces Development
Subject: Re: Trinidad Chart

 

I don't understand what your asking.  ExternalContextUtils is javadoc'd if
that's what you need.

Sent from my iPhone


On Mar 19, 2012, at 8:51 AM, Christian Jurado <cjurado2@jhu.edu> wrote:

Gotcha, thanks.

 

  I've been looking over the docs on the Trinidad components, such as
web.xml and Trinidad-config.xml options, and I don't see a complete listing
of all the possible settings and context parameters.  For example, on the
configuration page in the dev guide
(http://myfaces.apache.org/trinidad/devguide/configuration.html) it mentions
the org.apache.myfaces.trinidad.util.ExternalContextUtils.isPortlet, and
that's how I learned of it.  I also have been using the Facelets with
Trinidad page in the wiki but that doesn't seem like a fill listing either.
Can you point me toward such a listing if it exists?

 

Thanks,

Chris

From: Scott O'Bryan [mailto:darkarena@gmail.com] 
Sent: Monday, March 19, 2012 10:46 AM
To: MyFaces Development
Subject: Re: Trinidad Chart

 

I did the initial portal compatability project for trin.  I don't remember
doing anything specific for the chart component.

Sent from my iPhone


On Mar 19, 2012, at 8:12 AM, Christian Jurado <cjurado2@jhu.edu> wrote:

Hey Scott,

 

  What sort of mods do you mean?  Something to make it work better with the
bridge?

 

Chris

From: Scott O'Bryan [mailto:darkarena@gmail.com] 
Sent: Friday, March 16, 2012 8:23 PM
To: MyFaces Development
Subject: Re: Trinidad Chart

 

We don't use jquery, but instead have a homegrown system.  Most of the trin
components should work with the bridge, but I don't recall ever making mods
to the chart component.

Sent from my iPad


On Mar 16, 2012, at 12:53 PM, Christian Jurado <cjurado2@jhu.edu> wrote:

Hey Scott,

 

  Just as an update:  It works great as a stand-alone.  Will have to look
into the user agent.  Also, I know sometimes components that rely on JQuery
or other similar technologies sometimes have trouble in the Liferay 6
environment.

 

Chris

 

From: Scott O'Bryan [mailto:darkarena@gmail.com] 
Sent: Thursday, March 15, 2012 5:12 PM
To: MyFaces Development
Subject: Re: Trinidad Chart

 

No, I have no clue.  I know the chart component requires a valid user agent.
Maybe that's not getting propagated by liferay?

 

Also, does your Portlet work As a stand-alone test case?

Sent from my iPhone


On Mar 15, 2012, at 2:58 PM, Christian Jurado <cjurado2@jhu.edu> wrote:

Hello,

 

  I'm working on a portlet using MyFaces and Trinidad.  I have successfully
created a working hello world portlet using:

 

MyFaces 2.0

PortletBridge 3.0

Trinidad 2.0

 

The environment is 

 

Liferay 6.0.6 running on Tomcat 6.0.29

 

The portlet installs and runs fine, displaying a simple outputText control,
but the Trinidad Chart control doesn't display.  The value is set to a
backing bean that is being instantiated (debug statement in the constructor
outputs)  but no graphical display.

 

My faces-config.xml:

 

<?xml version="1.0" encoding="UTF-8"?>

<faces-config xmlns="http://java.sun.com/xml/ns/javaee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"

      version="1.2">

 

      <managed-bean>

            <managed-bean-name>chartBacking</managed-bean-name>

 
<managed-bean-class>com.jhu.cvrg.portal.dashboard.backing.ChartBacking</mana
ged-bean-class>

            <managed-bean-scope>request</managed-bean-scope>

      </managed-bean>

 

      <application>

 
<default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-
id>

      </application>

</faces-config>

 

My Trinidad-config.xml

 

<?xml version="1.0"?>

<trinidad-config xmlns="http://myfaces.apache.org/trinidad/config">

  <!-- Enable debug output -->

  <debug-output>true</debug-output>

</trinidad-config>

 

 

My view.xhtml:

 

<f:view 

      xmlns:c="http://java.sun.com/jsp/jstl/core"

      xmlns:f="http://java.sun.com/jsf/core"

      xmlns:h="http://java.sun.com/jsf/html"

      xmlns:ui="http://java.sun.com/jsf/facelets"

      xmlns:tr="http://myfaces.apache.org/trinidad"

      xmlns:trh="http://myfaces.apache.org/trinidad/html">

      <trh:head />

      <trh:body>

                  <h:outputText value="BOOYAH!"/>

                  <tr:chart id="chart" rendered="true"
value="#{chartBacking.chartModel}" type="line"/>

      </trh:body>

</f:view>

 

My web.xml:

 

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

      version="2.4">

      <servlet>

            <servlet-name>faces</servlet-name>

            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

            <load-on-startup>1</load-on-startup>

      </servlet>

      <servlet-mapping>

            <servlet-name>faces</servlet-name>

            <url-pattern>/faces/*</url-pattern>

      </servlet-mapping>

 

      <servlet>

            <servlet-name>resources</servlet-name>

 
<servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-c
lass>

      </servlet>

 

      <!-- This cannot be configured currently -->

      <servlet-mapping>

            <servlet-name>resources</servlet-name>

            <url-pattern>/adf/*</url-pattern>

      </servlet-mapping>

 

      <context-param>

            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

            <param-value>client</param-value>

      </context-param>

      <context-param>

 
<param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>

            <!-- TrinidadFaceletViewHander must be the alternate view
handler if SessionChangeManager 

                  is used -->

 
<param-value>org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletVie
wHandler</param-value>

      </context-param>

 

      <context-param>

            <!--Unfortunately, Facelets provides no hook for plugging the
PageResolver 

                  into the logic handling "facelets.VIEW_MAPPINGS". You
should leave "facelets.VIEW_MAPPINGS" 

                  unset and use
"org.apache.myfaces.trinidad.FACELETS_VIEW_MAPPINGS" instead. -->

 
<param-name>org.apache.myfaces.trinidad.FACELETS_VIEW_MAPPINGS</param-name>

            <param-value>*.xhtml</param-value>

      </context-param>

      

      <!--  More Trinidad Configuration -->

      <context-param>

 
<param-name>org.apache.myfaces.trinidad.security.FRAME_BUSTING</param-name>

            <param-value>never</param-value>

      </context-param>

      

      <context-param>

 
<param-name>org.apache.myfaces.trinidad.util.ExternalContextUtils.isPortlet<
/param-name>

            <param-value>true</param-value>

      </context-param>  

      

      <filter>

            <filter-name>trinidad</filter-name>

 
<filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-clas
s>

      </filter>

 

      <filter-mapping>

            <filter-name>trinidad</filter-name>

            <!-- This assumes that the FacesServlet has been registered -->

            <!-- under the name "faces" -->

            <servlet-name>faces</servlet-name>

      </filter-mapping>

 

      <listener>

 
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</lis
tener-class>

      </listener>

</web-app>

 

I'm getting no errors of any kind, yet all I see in the portlet view is the
value of the h:outputText, and the debug statement in my backing bean
outputs, so at least I know everything else is working. 

 

Any ideas?  

Chris

 


Mime
View raw message