Flex with Zend MVC
hello there, I have a site that used the Zend MVC. I will
like to replace the current front end of the site with Flex. I am
new to Flex and I am not sure how this thing should be done. I
follow several tutorial on Flex and Zend PHP but none of them
making use of the built in MVC - where
nameofAction correspond to
nameofView. If someone can refer me to an example I will
appreciate it.
I don't have any experience with Spring MVC but I was using
JBoss with Blaze-DS without a problem.
so my next question is, can you make a echo to work??
eg, make a function that returns the input string back to the
flex client.
Ries
Similar Messages
-
Flex and Zend amf deployment resolved with proper solution
Hi All,
Although, I personally do not like using Zend for these issues itself. However, I faced this issue first time with flex 4.0 version when everyone used to run into
channel disconnected error. you can find the link for that post here:
http://forums.adobe.com/message/3366991.
Now, with flash builder 4.6, things have changed slightly and so the deployment process. So, here are the right set of steps to be followed :
1. after developing your flash project, export the release build(I assume if you are a flex user, you should know these steps already)
2. Now, check your release folder, you must have got some files with amfconfig.ini and gateway.php and just one folder named history.
3. copy all these files into a new folder say "My Release Build".
4. Now, step 1 is get Zend framework in place, to achieve that:
there are different ways. some will say : "make sure zend must already installed on your production server." that is an alternative but most likely, the easier way to do this is : search your www(root folder on localhost),you will find a folder with name ZendFramework. Copy this folder to "My Release Build"
5. Now, the services that you have used in your flex project, go to debug folder of your project which should be in your www(root folder on localhost) with name "yourprojectname-debug". copy services folder from this debug folder to "My Release Build"
6. Now, open your amfconfig.ini from "My Release Build" and edit and make it look like following:
[zend]
webroot = http://www.yourwebsite.com
;you can edit above webroot to match the root folder of your website or use . to make it point to root.
zend_path = ./ZendFramework/library
[zendamf]
amf.production = true
amf.directories[]= services
thats it. your amf config is fine.
7. edit gateway.php:
Now, remove everything from gateway.php and copy this as it is there:
<?php
ini_set("display_errors", 1);
$dir = '.';
$webroot = $_SERVER['DOCUMENT_ROOT'];
$configfile = "amf_config.ini";
//default zend install directory
$zenddir = $webroot. '/ZendFramework/library';
//Load ini file and locate zend directory
if(file_exists($configfile)) {
$arr=parse_ini_file($configfile,true);
if(isset($arr['zend']['webroot'])){
$webroot = $arr['zend']['webroot'];
$zenddir = $webroot. '/ZendFramework/library';
if(isset($arr['zend']['zend_path'])){
$zenddir = $arr['zend']['zend_path'];
// Setup include path
//add zend directory to include path
set_include_path(get_include_path().PATH_SEPARATOR.$zenddir);
// Initialize Zend Framework loader
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
// Load configuration
$default_config = new Zend_Config(array("production" => false), true);
$default_config->merge(new Zend_Config_Ini($configfile, 'zendamf'));
$default_config->setReadOnly();
$amf = $default_config->amf;
// Store configuration in the registry
Zend_Registry::set("amf-config", $amf);
// Initialize AMF Server
$server = new Zend_Amf_Server();
$server->setProduction($amf->production);
if(isset($amf->directories)) {
$dirs = $amf->directories->toArray();
foreach($dirs as $dir) {
// get the first character of the path.
// If it does not start with slash then it implies that the path is relative to webroot. Else it will be treated as absolute path
$length = strlen($dir);
$firstChar = $dir;
if($length >= 1)
$firstChar = $dir[0];
if($firstChar != "/"){
// if the directory is ./ path then we add the webroot only.
if($dir == "./"){
$server->addDirectory($webroot);
}else{
$tempPath = $webroot . "/" . $dir;
$server->addDirectory($tempPath);
}else{
$server->addDirectory($dir);
// Initialize introspector for non-production
if(!$amf->production) {
$server->setClass('Zend_Amf_Adobe_Introspector', '', array("config" => $default_config, "server" => $server));
$server->setClass('Zend_Amf_Adobe_DbInspector', '', array("config" => $default_config, "server" => $server));
// Handle request
echo $server->handle();
Now, upload your "My Release Build folder to your production server webroot"
case 1: if you get "channel disconnected error, you have made some mistake and your path for zend or services folder is not right."
In above case, "ZendFramework folder and services folder with all of other release files". To find out what is wrong, open this url :
http://www.yourwebsite.com/gateway.php. if you see this lovely string there : "Zend Amf Endpoint". consider your are through with zend settings on server
otherwse you will see relative errors.
2. After fixing this step, try run your website, you will land into this error :
Class “yourcorrectclassname” does not exist: Plugin by name ‘Classname’ was not found in the registry; used paths:
: /home1/messoftc/public_html/oc/services/
#0 /home1/messoftc/public_html/ZendFramework/library/Zend/Amf/Server.php(553): Zend_Amf_Server->_dispatch(‘fxnname’, Array, ‘classname’)
#1 /home1/messoftc/public_html/ZendFramework/library/Zend/Amf/Server.php(629): Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http))
#2 /home1/messoftc/public_html/oc/gateway.php(69): Zend_Amf_Server->handle()
#3 {main}
Now, this is a zend framework bug, it does not automatically detect the php classes in your services folder,those who have run into this, must have googled hard to find the solution and this bug is also logged officially on zend server jira log.
so, what is the solution? simple and effective. open your gateway.php file from "My Release Build"
Add this little line :
$server->addDirectory(dirname(__FILE__) . '/services/');
after this line :
$server->setProduction($amf->production);
reupload this file to your production, you should see your Flex, Zend, php & Mysql in action.
Here is a sample link I have created :
http://www.eiws.co.in/testzend.html
you may also visit the endpoint file:
http://eiws.co.in/gateway.php
If anyone still faces this issue, can contact me at [email protected].
Credits: "To all developers who share their knowledge with everyone and google and thousands of blogs who provide a medium to share this knowledge"Richard Bates of flexandair.com figured it out. In my php.ini file, I had the memory limit set at 8M. After, changing it to 32M, it worked. Thank you, Richard!
-Laxmidi -
Hi Friends
I'm developing Flex with java using Blaze-DS under the
Spring MVC. I've problem in using Jboss, Based on BlazeDS
Installation guide
http://opensource.adobe.com/wiki/display/blazeds/Installation+Guide
configure the jboss with Flex.There is no problem with Flex running
in Jboss but it couldn't establish connection and business logic
with java, The Jboss server couldn't through any errors. These same
war file run under the tomcat server. So please help me to solve
this problem.
Thanks&Regrads
PrakasamI don't have any experience with Spring MVC but I was using
JBoss with Blaze-DS without a problem.
so my next question is, can you make a echo to work??
eg, make a function that returns the input string back to the
flex client.
Ries -
I used these instructions:
http://www.seanhsmith.com/2010/03/29/flex-for-free-setting-up-the-flex-4-sdk-with-eclipse- ide/
to get started with Flex SDK.
I do not get any intellisence. I could run some small mxml scripts. Any one else working this way? I need more resources to work in this environment.I don't have any experience with Spring MVC but I was using
JBoss with Blaze-DS without a problem.
so my next question is, can you make a echo to work??
eg, make a function that returns the input string back to the
flex client.
Ries -
Does anyone have any pointers on how I can integrate Flex with Drools. I want to build a sample app (for my own learning experience) that will integrate Flex with this Open Source Rule Engine. Can anyone point me to a website or book?
Thanks!I don't have any experience with Spring MVC but I was using
JBoss with Blaze-DS without a problem.
so my next question is, can you make a echo to work??
eg, make a function that returns the input string back to the
flex client.
Ries -
Hi ,
I am new in flex.
Actually i make a flex with php desktop application. There are two problems which i am not getting:
a.) I make three module which i load on tab navigator click . These mudules working fine . But when i make this project export relese build to make .exe file . These modules not added in installation file.
i.e after installation i have to copy these modules .swf file in program files where the application installed. So i want to know is there is any method so that module added in the .exe file so that they by default goes at the
time of installation of exe.
b.) I use php services in this project and when i insatlled the application to system its not working untill i add the the project service php file and zend frame work folder on user wamp . Is there any method that all these happen by default at the time of insatllation.Hi,
AIR is best suited to be a client application.
P.S: Since you are using PHP, you may want to take a look at
amfphp so that you can use AMF to speed up data transfer between
your AIR app and the PHP server. -
Please help me, I need to use Flex with CF
Hi everyone,
I am starting to retract my brain from an intense 2 days to
figure out how to use Flex with Coldfusion. I am using Coldfusion 8
Beta (this part is good, don't need help for CF itself). I am also
using Flex Builder 2 (with chart but this not the topic). I
installed FDS 2.5 before to install ColdFusion 8 but I think CF8
have is own FDS or something like that... anyway, it might help to
mention it!
Well, I tried HTTPService, RemoteObject, WebSer vice -
NOTHING WORKS!!! Argh! Did I mention I spent 2 days? ;-)))
Well, I start with the basic: a login form with an email (as
a username) and a password to be validated. I have a CFC to do the
validation and return a simple message (string): "OK' when it is
valid and a custom message when it is not valid; depending if it is
the password and/or the email which is not valid.
I always got an error. Since the error is different depending
of the method I use, I will explain the latest method I used in
this message and try to concentrate on that method specifically!
The method is WebService and here is the error:
faultCode:Server.Error.Request
faultString:'HTTP request error'
faultDetail: 'Error: [IOErrorEvent type="ioError"
bubbles:false cancelable=false eventPhase=2
text="Error #2032: Stream Error .
URL=http://localhost:8501/iDashboard/login.cfc"].
URL: http://localhost:8501/iDashboard/login.cfc'
Any help will be very useful!!!
Thank'sCyber,
This may be what you are looking for. It worked well for me.
Flex is sweet, but with the number of people confused about setup
with CF they sure aren't making any friends.
Flex/ColdFusion
setup -
Integration of Adobe Flex with SAP Web Dynpro ABAP
I am new to adobe flex development. i am following a tutorial prepared by
Mr. Karthikeyan Venkatesan (Infosys Technologies Limited) Integration of Adobe Flex with SAP Web Dynpro ABAP-for ABAPers
He used flex 3 to develop the flex application. i am using flex 4 downloaded from adobe(At a time Build release I used low version only 3.5). I followed all the steps. At a time of Run the data was not came.
How to fetch the data?
Please Guide how to proceed.Hi Laxmikanth,
For Adebo Flex help..
Please go through Thomas tutorial..
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10989ef6-968c-2b10-50a9-eb34a5267163&overridelayout=true
and ...
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/307b434f-ff32-2b10-e885-991247270480?quicklink=index&overridelayout=true
Hope it might helps you
Thanks,
Kris. -
Hi
I am new to flex and i have a knowledge on jsf .We got a requriment to integrate the flex with jsf .
I googled and i developed the sample application using the fiji (Exadel ) .
When i an running the application in the jboss I GOT EMPTY page then after deselecting the check box of 'blockjavascript' in the browser
am able to see the swf file in the page
can any one help me..
My Project
The mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="1024" height="715" xmlns:ns1="*">
<mx:Form x="22" y="47" width="1200" height="680">
</mx:Form>
<mx:Button x="22" y="5" label="This is Prapansolution" width="280"/>
</mx:Application>
The .jsp
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:fiji="http://exadel.com/fiji"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets"
version="2.0">
<f:view><h:form id="myForm">
<fiji:swf src="/faces/FirstFlexApp.swf" id="demonew" bgcolor="#FFFFFF" width="820" height="480">
<f:param name="text1" value="Hello" />
</fiji:swf> </h:form></f:view>"vikbar" <[email protected]> wrote in
message
news:gb0tug$7je$[email protected]..
> Hi Amy,
>
> Isnt the HistoryManager approach more specific to Flex
application i.e if
> user
> is just navigating with in the flex application? In my
case the user will
> navigate between a JSF page which does not have any SWF
file and the
> another
> one which has swf file embedded. Now everytime when the
suer moves to the
> flex
> embedded JSF page from the Non Flex JSF page these are
the steps which are
> always going to happen :
>
> 1.) System Manager will get initialized and will create
PreLoader
> instance.
> 2.) The preLoader will then try to download the swf
file. Now since this
> is
> the second time the user is coming back to the flex page
so the broswer
> would
> have already cached this swf, so Preloader will skip the
downloading
> swf/RSl
> step and hence you wont see any initialization progress
bar.
>
> 3.) New Application object will get instantiated and
will go through its
> whole
> lifecycle.
>
> So, I guess historyManager approach will work only if
the user stays on
> the
> flex application only and navigates with in flex
application itself(so in
> that
> case if the user clicks back then it knows which flex
component or view to
> display), but in my case user will completely move away
from flex page to
> a
> JSF page and then will try to come back.
>
You'd need to put the right stuff in the url to make it work,
just like if
you were calling a page that's expecting GET params. I don't
really use the
HistoryManager, so you'll need to either look into this
yourself or ask
someone who knows more about it.
HTH;
Amy -
Hi I'am new to Flex, I like to get started using Flex,
ActionScript3 using Eclipse IDE.. Iam looking for some tutorial or
workshop article how to get Flex with Eclipse IDE.Hi,
Are you talking about using the Flex Plugin or the Flex_SDK?
Not sure about the plugin but you can check out my post on
what I had to do to get the sdk to work with Eclipse 3.3 at
http://www.plentifuldesigns.com/?p=13
Hope this helps
- Keith -
Hi,
Can we develop a JSPDynPage component, using Adobe Flex as the UI instead of using HTMLB? (by embedding flex components in the jsp file). Is it possible to call methods in other java files from a flex application?
Did anyone try to develop a JSPDynPage component this way?
Regards,
SudhirHi,
Pls check out these links below for this info -
Adobe Flex with RFC -
Binding Data through function module in adobe to display charts
How to connect to SAP Database from a Adobe flex application?
Adobe flex and Sap
Adobe Flex within SAP NetWeaver Developer
Regards
Lekha -
Using Flex with Microsoft Project
I am absolutely brand new to FLEX. What I saw on the Adobe
site was a data chart that could be drilled down to expose
additional layers of "contriburory detail" for the master graph.
What I am wondering is if it is possible to do something
similar using Micrsoft Project Data as the basis. MS Project will
allow users to save the file as XML. So, all the data should be
available in a form understandable to FLEX.
Here's the tricky part (and I can add more detail if needed).
Project will create a summary line (at some level of indentue) and
show you a calculated %Complete such as 47%. So, level of indenture
1 I have the major summary tasks of the project at various status
of %Complete. I believe FLEX can make some type of bar or pie chart
out of that for me. What I want to do is click on a "Level1"
indenture and have it expose the Level2 indure that contributes to
that 47%. Then drill on one of the Level2's to Level3 .... to Level
"n".
This needs to be accomplished in "stand alone" fashion so the
ultimate user can launch a desktop application and tell the
application the name of the Microsoft Project XML file. We will not
be able to use Client/Server ... client side only with the file
located either locally or at least on a network drive.
Can this be done? Has anyone looked at a MS Project XML
schema to see if there is sufficeint information available?
OK, now the blunt truth. It ain't %Complete that I care
about. What I care about is BCWS, BCWP, ACWP, %Complete, and a few
other parameters. These are the "Earned Value Fields". If you do
not know what they are, don't worry about it just now .... it is
really all just time phased data.
Can anyone give me some advice or an opinion? TIA.
JimHi,
Pls check out these links below for this info -
Adobe Flex with RFC -
Binding Data through function module in adobe to display charts
How to connect to SAP Database from a Adobe flex application?
Adobe flex and Sap
Adobe Flex within SAP NetWeaver Developer
Regards
Lekha -
Hi all,
Can anybody provide me with any document that involves integration of Adobe Flex with R/3 RFCs. I have tried SAP Integration woth Adobe Flex in form of Web Services, and it is working fine. Please help.
Regards,
GitaHI,
U can try this code using Adobe Flex 2. BAPI_FLIGHT_GETLIST is used as example.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
public function fault_getAll(event:FaultEvent):void
Alert.show(event.fault.faultString);
public function result_getAll(event:ResultEvent):void
Alert.show(dsCol.toString());
public function Test():void
ws.BAPI_FLIGHT_GETLIST.send();
]]>
</mx:Script>
<mx:XMLListCollection id="dsCol" source="{ws.BAPI_FLIGHT_GETLIST.lastResult.FLIGHT_LIST.item}"/>
<mx:WebService id="ws" useProxy="false" showBusyCursor="true"
wsdl="http://XXX.XX.XX.XX:8080/sap/bc/soap/wsdl11?services=BAPI_FLIGHT_GETLIST&style=rpc_enc" >
Here XXX.XX.XX.XX - is nothing but Ip address and 8080 is port Number.
<mx:operation name="BAPI_FLIGHT_GETLIST"
resultFormat="e4x" result="result_getAll(event)" fault="fault_getAll(event)" >
<mx:request>
<AIRLINE>AIR</AIRLINE>
<DESTINATION_FROM></DESTINATION_FROM>
<DESTINATION_TO></DESTINATION_TO>
<MAX_ROWS>10</MAX_ROWS>
<DATE_RANGE>
<item>
<SIGN>I</SIGN>
<OPTION>GT</OPTION>
<LOW>20000101</LOW>
<HIGH></HIGH>
</item>
</DATE_RANGE>
<EXTENSION_IN></EXTENSION_IN>
<FLIGHT_LIST></FLIGHT_LIST>
<EXTENSION_OUT></EXTENSION_OUT>
<RETURN></RETURN>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:Button x="116" y="146" label="Button" click="Test()"/>
<mx:DataGrid x="52" y="176" width="601" height="135" dataProvider="">
<mx:columns>
<mx:DataGridColumn headerText="AIRLINEID" dataField="AIRLINEID"/>
<mx:DataGridColumn headerText="AIRLINE" dataField="AIRLINE"/>
<mx:DataGridColumn headerText="CONNECTID" dataField="CONNECTID"/>
<mx:DataGridColumn headerText="FLIGHTDATE" dataField="FLIGHTDATE"/>
</mx:columns>
</mx:DataGrid>
</mx:Application> -
Hi,
I'm new to both flex and adf technologies. It would be helpful if anyone brief the possibility of using flex with ADF.
And also it'll be helpful if someone helps out with any links of tutorials or documentation regarding to use flex with ADF.
Thanks in advance,
Parameswari
Edited by: user12952392 on May 24, 2010 6:13 AMHi Shay,
Thanks for the reply.
In our case we will be getting pre-designed Flex UI pages with separate components. We have to logic in Business Layer to do the CRUD operations with displaying of Graphs.
Just read Edwin Biemond [http://biemond.blogspot.com/2008/07/crud-operations-in-flex-with-adf-bc.html] posts on the same. (integration using Adobe livecycle or blazeDS).
But still not sure how to manage and maintain this whole stack for an application having 50+ pages.
So bit curious how to start the same.
I have posted the same in [http://forums.adobe.com/thread/646720?tstart=0] Flex forum also. Hope to get the reply soon
Thanks. -
Flex with Hibernate using HTTP
Hi All,
am new to Flex. Can any one post a simple code on Flex with
Hibernate using HTTP , i mean connecting to database using
Hibernate and invoking the hibernate by using the HTTP service.
can we have a sequence like
Flex(MXML)->JSP->Hibernate->Database .Is it possible?
Thanks in Advance> can we have a sequence like
Flex(MXML)->JSP->Hibernate->Database .Is it possible?
That's exactly what you're going to have and it certainly is
possible. (Replace the JSP with Servlet, Struts Action, JSF or
whatever)
Usually you'll send data back -- output to JSP or write to
HttpServletResponse object -- in XML or JSON format. The data would
be delivered to the result event of the HTTService in Flex. If it
fails for some reason, the fault event of HTTService class would be
invoked.
The important thing to realize about Flex is that it cannot
directly connect to a DB; you need a server side action that would
get data from wherever write it to response. It's more like Ajax
calls to a JSP/Servlet.
ATTA
Maybe you are looking for
-
FILE receive adapter deleted the empty file --Biztalk
Hi Team Using scheduled task job, I put an xml file to Biztalk receive location path which has parameters(we can say as trigger file to output some results) and cannot be empty any time....But somehow not always...at times Biztalk receive adapter ass
-
Hello all. I was trying to burn an album of less than 100Mb to a CD, all I get was this error message: Burn Failed The burn to the MATSHITA DVD-R UJ-845 drive failed. The device failed to calibrate the laser power for this media How? How can I solve
-
How can I transfer numbers to new mac
I have a MacBookPro and would like to transfer indervidual programs to my new MacBookAir. Numbers, Aperture, Clean my Mac and Pages. I do not want to use Migration Assistant as I can not pick items. I do not want to transfer everything. Is it also po
-
Hi, i've a table with 4 columns which have different datatypes. My insert form only shows one of them whichever is the right datatype. The problem is when the user inserts into a integer field letters and he press the button cancel (there are two but
-
I wonder if it is possible to give a name to the main Panel of a ScriptUI so the tab of that window and the name appearing in the window menu is not "yourscriptname.jsx" ?