Forums

RSS RSS
RE: Anyone successfuly run a Flex Portlet? Flat View
Threads
I am evaluating the Liferay Portal, and Flex application support is one of the key criteria for success. While I have been able to success get a JSP/Struts portlet up and running, my flex web application (deployed as a JSP) runs independently but not as a portlet. The portal page just hangs and refuses to load completely. I cannot get anything useful from the logs.

If anyone has any working test code or pointers they can share, that will be greatly helpful!!

Thanks in advance!!

Anand
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
flex lifecycle
1/31/08 1:44 PM as a reply to Anand Pikle.
Hi,

if you only want to run precompiled flex applications with no remoting objects it is very eassy. Build a flash portlet and you have it; for instance you can build a JspPortlet with object and embed tags pointing to swf file url. You may code some lines to have flash respond to maximized, minimized portlet state.

If what you want is to have flex applications compiled on the fly and consume data from remote objects, you shoud have to use a flex data services framework. There are a few like Adobe lifecycle data services, BalzeDS, GraniteDS, Red5.

If you like to use Adobe lifecycle data services there is something done for you. You can have a look to Adobe lifecycle data services developer's guide in the paragraph: Integrating Flex Applications with Portal Servers.

Adobe lifecycle data services developers guide: integrating flex applications with portal servers

They provide a way to have a custom JspPortlet with on the fly compilation.

But unfortunately, it is not a complete solution, they have not provide a way to set a remote object in portlet-session scope or portlet-request scope, so if you define a remote object as session scope it will be accesible for every portlet who shares servlet session.

If you have problems with Adobe LCDS solution you can ask me.

Anyway, I encourage people with experience in flex applications embedded in portlets consuming remote objects to share his knowledge with us.

PD: it seems that flex is a kind of tabu in portal's world.
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
4/23/08 1:00 AM as a reply to Eduardo Arizcuren.
Hi

I've developed a simple flex portlet (I'm using flex 3)
(http://www.adobe. com/devnet/ flex/articles/ flex_portals_ 05.html)

But it didn't work on Liferay 4.4.2

If someone has a flex portlet working on liferay
Please send me.

Thanks in advance
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
4/23/08 5:28 AM as a reply to amal lehiani.
I recently was able to get a couple of Flex3 applications working and deployed as a portlet on 4.3.3 (they should work fine on 4.4.2) as well. One is a stand alone Flex app with no data services and the other is a simple RSS one that uses the open source BlazeDS to call a public web service and display news items. The only issue I have is that when you move around portal and come back to a page that has the flex app, it always reloads the flex app and reinitializes it.

I was planning to document the portlets and either put them up on my site and/or donate them to the community here. However, in the meantime if you let me know exactly what errors you are getting I should be able to help.

By the way, I found that I had to download and use the swfobject to embed the flex application inside the portlet. It is a great library and can be found at: http://code.google.com/p/swfobject

Let me know if I can help.
Thanks.
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
4/24/08 4:38 AM as a reply to Dan Sobotincic.
Hi

I'm working with the ext environment
I've added the flex ant lib folders from "lcds" to \ext\txt-web\docroot\WEB-INF
and I've changed my web.xml like this

<?xml version="1.0"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

<display-name>LiveCycle Data Services Samples</display-name>

<context-param>
<param-name>flex.class.path</param-name>
<param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value>
</context-param>


<!-- Http Flex Session attribute and binding listener support -->
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>

<!-- Http Flex Session attribute and binding listener support -->
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>

<!-- MessageBroker Servlet -->
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<display-name>MessageBrokerServlet</display-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<init-param>
<param-name>flex.write.path</param-name>
<param-value>/WEB-INF/flex</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<servlet-name>FlexMxmlServlet</servlet-name>
<display-name>MXML Processor</display-name>
<description>Servlet wrapper for the Mxml Compiler</description>
<servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.webtier.server.j2ee.MxmlServlet</param-value>
</init-param>
<init-param>
<param-name>webtier.configuration.file</param-name>
<param-value>/WEB-INF/flex/flex-webtier-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<servlet-name>FlexSwfServlet</servlet-name>
<display-name>SWF Retriever</display-name>
<servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.webtier.server.j2ee.SwfServlet</param-value>
</init-param>
<!-- SwfServlet must be initialized after MxmlServlet -->
<load-on-startup>2</load-on-startup>
</servlet>

<servlet>
<servlet-name>FlexForbiddenServlet</servlet-name>
<display-name>Prevents access to *.as/*.swc files</display-name>
<servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.webtier.server.j2ee.ForbiddenServlet</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>FlexInternalServlet</servlet-name>
<servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.webtier.server.j2ee.filemanager.FileManagerServlet</param-value>
</init-param>
<load-on-startup>10</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>MessageBrokerServlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>FlexMxmlServlet</servlet-name>
<url-pattern>*.mxml</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>FlexSwfServlet</servlet-name>
<url-pattern>*.swf</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>FlexForbiddenServlet</servlet-name>
<url-pattern>*.as</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>FlexForbiddenServlet</servlet-name>
<url-pattern>*.swc</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>FlexInternalServlet</servlet-name>
<url-pattern>/flex-internal/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>FlexTagLib</taglib-uri>
<taglib-location>/WEB-INF/lib/flex-bootstrap-jsp.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
</taglib>
</jsp-config>

</web-app>



There are no errors when I start tomcat
but the flex part of my portlet didn't appear

Thanks.
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
4/25/08 12:30 AM as a reply to Dan Sobotincic.
Hi

how to configure liferay for flex portlet :what are all the jars and packages necessary .

Thanks
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
5/13/08 8:44 PM as a reply to amal lehiani.
Hi all.
I want to embed MXML code into JSP file. Please tell me how to declare . I'm developing a flex portlet but I had a problem: I added flex-bootstrap.jar lib in to /WEB-INF/lib folder and I had error: Current URL /web/guest/home generates exception: Unable to read TLD "META-INF/taglib.tld" from JAR file "file:/C:/cvsroot/lportal/ext/servers/tomcat/webapps/ROOT/WEB-INF/lib/flex-bootstrap.jar": java.lang.NullPointerException.
taglib.tld is missing. Where can I download it?

Please help me. Thank you very much.
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
6/7/08 9:06 AM as a reply to Nguyễn Sinh Thành.
I have been able to embed a Flex swf file in a liferay portlet by using a library called SWFObject. Once you download the jar and put it into your jsp based portlet project I modify the view.jsp based on the documentation from SWF. It looks like:

<script type="text/javascript"
jQuery(
funtion() {
var so = new SWFObject("myswf.swf","MySWF","100%","700","7");
so.addParam("loo","true");
/* there is a bunch more addParam calls you can put here */
so.write("mycontent");
}
);
</script>

The only issue I still have is that everytime I navigate between portal pages it restarts my flex application. Anyone else figure that one out?
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
flex blazeds
11/17/08 9:31 AM as a reply to Dan Sobotincic.
On my Blog (http://fandry.blogspot.com), I have posted the steps necessary to create a Liferay Portlet with BlazeDS.
The Portlet access a public Web Service. I am using BlazeDS as a proxy for WebService access, but the configuration would work also for RPC/AMF, Messaging and HttpService data access.

The blog post URL is: http://fandry.blogspot.com/2008/11/liferay-portlets-using-blazeds.html

-Francois
Flag Flag
RE: Anyone successfuly run a Flex Portlet
flex flash
11/17/08 12:39 PM as a reply to Francois Andry.
So does anyone know if it is possible to prevent the flex/flash app from reloading between portal navigations?

TIA.
S.
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
11/19/08 7:45 AM as a reply to Francois Andry.
This blog is great, i sucessful integrated the flex portlet into liferay.

How can i read/acess the userid of the Liferay user in the flex mxml?
Flag Flag
RE: Anyone successfuly run a Flex Portlet
ajax flex shared object
11/19/08 3:42 PM as a reply to scott shealy.
Flex Application (*.swf) refreshing is not specific to portal technology. Anytime a user refresh the page of the browser,
the flex application will be refreshed. What you will need it to store the state of your application (every fields/states) in a
shared object (e.g. discussion on the subject).

If performance issues linked to shockwave files refresh are potenitally an issue for your application, you could consider using Ajax (via jquery which is part of Liferay) instead.
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
personalization
11/20/08 8:47 AM as a reply to 24kelly 24kelly 24kelly.
A good place to look at Personalization in Liferay is this LR forum/post post on getting User Attributes.

-Francois
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
2/7/09 12:33 PM as a reply to Anand Pikle.
We have very successfully integrated Flex and Liferay using BlazeDS using AMF ( not a fan of webservice speeds). You can check out one of the portlets at www.iasahome.org/web/home/repo.

The integration was very easy to implement and we plan to add full service builder support for it to our own implementation (sorry we cant share the code) but will be happy to help anyone wishing to do this successfully.
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
3/16/09 2:13 PM as a reply to Paul Timothy Preiss.
We (www.portletoasis.com) have successfully been able to create Flex portlets using GraniteDs (AMF channel) in Liferay. The great
thing about GraniteDs is that you can consume hibernate objects (annotated with EJB 3.0 annotations)
and fetch both eager/lazy associations from Flex. You also have the option of using Adobe LCDS on
a multi-core cpu server without charge; however, GraniteDs provides Seam integration as well
as Acegi Security.
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
3/26/09 5:13 AM as a reply to Richard Knight.
HI

I'm in the middle of a project, where I have to implement a reporting tool in Liferay with Flex and Granite.

The mayor problem is, that I have to do some authorization.
The preferred choice is, that when a user logs in to liferay, he can view this Flex Portlet, and I need to set up the UI with the account information. But I cannot get the actual logged-in user info from the FLex app. With Granite, I initiated a RemoteObject call, and on the Java side I can get the HTTPRequest, and Session (through GraniteContext), but those ones are not helping me, they're different types (the request is org.apache.catalina.connector.RequestFacade, or something). If I call the getRemoteUser with them, I always get null, but of course on the JSP wrapper, it works, because I believe the Portal specially made the request object that way from the original request, and basically, when I stdout the request and session content, I can see, they are totaly different (cookies are mostly the same though).

Either I need to get the correct servletRequest/portletRequest, which contains the appropriate info, or I need to write a huge amount of code, to create this with granite rather than getting the Tomcat object.


So, how could I obtain the logged in user with preferabbly a RemoteObject call ? Would it work with a HTTPService call (to a servlet, or JSP, and return the data back with XML)?


Bear in mind, I have very short knowledge in LifeRay, and I started to work in Flex & GraniteDS in February.
Using liferay-portal-tomcat-6.0-5.0.1, Flex3.0, and Granite 1.2.0


Thanks
Kutasi Zoltan
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
5/22/09 12:18 PM as a reply to Zoltan Kutasi.
Hi Zoltan,

The project ( liferay-portal-tomcat, Flex 3.0, and Granite 1.2.0) is interesting. Could you please give us any updates on your current project. I guess many projects will benefit a lot from your current project.

Thanks

Jonas Yuan
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
5/22/09 12:25 PM as a reply to Richard Knight.
Hi Richard,

Thank you. Where can we find your Flex portlets? It would be nice that you could share these Flex portlets.

Thanks

Jonas Yuan
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
flex flex portlet
6/13/09 9:01 AM as a reply to Jonas Yuan.
Hello,

I apologize for taking so long to respond. As it turns out, there has been a tremendous amount of progress made in ironing out the various nuances in Flex portlet development. We've come up with 2 primary courses examining how the portlet 168 and 286 specifications intersect with using Flex to create portlets. The classes will be offered in July/August. Here is a brief rundown:

Essential Flex Portlet Development (online)
- Portlet Architecture & a Hello World Flex Portlet
- User profile information & Portlet Preferences
- Standard Role-Based Portlet Security
- Using the Flex webtier compiler for dynamic content
- Accessing Liferay's SOAP services with JSR 286 features
- "serveResource" method, action urls, etc.
- Portlet Communication: session-information and public shared render parameters.
- JSR 286 portlet events

Advanced Flex Portlet Development (onsite, scheduleable)
- Fine-grained Portlet permissions with Liferay APIs
- Integrating Liferay's Spring services with Flex
- Advanced AJAX-based portlet communication with Flex-Flex portlets / Flex-other types of portlets
- Advanced server&client-side portlet communication with BlazeDs / Java.
- Spring & EJB 3.0 (lazy-init) integration using GraniteDs.

Note: This last approach allows for Flex-data binding, deeply nested object access in Flex, and first-class
Flex classes generated from Java classes.

Both classes will give a survey of various approaches to security, data-access, data-sharing, portlet preferences, etc. In general, the portlet-compliant case is examined first, then special attention is given to Liferay-specific approaches/APIs. You should be able
to walk away with a toolbox of approaches and boiler-plate code to accomplish various tasks. You should also have an idea of a suitable approach to use for your specific situation.

Thanks,
Richard
www.portletoasis.com
Flag Flag
RE: Anyone successfuly run a Flex Portlet?
7/16/09 6:27 AM as a reply to Richard Knight.
Hi Richard

Thank you so much!

Flex portlet looks good. Do you have any example for demo? Can I download your flex portlets and hot-deploy them in Liferay portal?

Thanks

Jonas Yuan
-----------------
Liferay Books
Liferay Portal 5.2/5.3 Systems Development
Liferay Portal 4.4/5.0 Enterprise Intranets
Flag Flag