cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco + Flex

gzunigainfo2000
Champ in-the-making
Champ in-the-making
Hello, im working with flex and i want to use the webservice of alfresco.
i have the following code that works with the flex-sdk alfresco.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mxSmiley Frustratedcript>
   <![CDATA[
      import mx.rpc.http.HTTPService;
      import mx.collections.ArrayCollection;
      import org.alfresco.framework.service.webscript.FailureEvent;
      import mx.controls.Alert;
      import org.alfresco.framework.service.webscript.WebScriptService;
      import org.alfresco.framework.service.webscript.SuccessEvent;
      import mx.rpc.AsyncToken;
      
      public var _ticketSmiley Frustratedtring = "esto da error";
      public var webservice:WebScriptService;
      //
      private function load():void
      {
         //http://127.0.0.1:8080/alfresco/faces/jsp/dashboards/container.jsp
         //http://myserver:8080/alfresco/service/api/login
         var urlxSmiley Frustratedtring = "http://localhost:8080/alfresco/service/api/login";
         webservice = new WebScriptService(urlx,WebScriptService.GET,onLoginSuccess,onLoginFaulire,false);
         var paramSmiley Surprisedbject = new Object();
         param.u = "admin";
         param.pw = "admin";
         webservice.execute(param);

      }
      public function onLoginSuccess(eventSmiley FrustrateduccessEvent):void
      {
         this._ticket = event.result.ticket;
      }
      public function onLoginFaulire(event:FailureEvent):void
      {
         var codeSmiley Frustratedtring = event.fault.faultCode;
         var messageSmiley Frustratedtring = event.fault.faultString;
         var detailsSmiley Frustratedtring = event.fault.faultDetail;
         
         Alert.show(code);
         Alert.show(message);
         Alert.show(details);
      }
   
      public function verticket():void
      {
         Alert.show(this._ticket);
      }
   ]]>
</mxSmiley Frustratedcript>

<mx:Text id="text" text=""/>
<mx:Button label="llamar a alfresco" click="load()" x="158" y="185"/>
<mx:Button  label="ver el ticket" click="verticket()" x="431" y="185"/>
</mx:Application>



This code gives me the ticket (nike sign) from alfresco.
I would like to know how i can do a search to bring the files that alfresco has.
i have the application of alfresco installed and with the same i called a pair of files.

HOW CAN I DO TO BRING AND SHOW THOSE FILES ON FLEX?


thank you.
21 REPLIES 21

stevereiner
Champ in-the-making
Champ in-the-making
CMIS Spaces already has the generated ActionScript for the CMIS SOAP web services api. Note that I found I had to modify the the generated code to get working with CMIS. Also I had only hooked up to the UI and modified the navigation and search services.

For the regular Alfresco specific SOAP web services, you can use the same generation tool in FlexBuilder I used to generate the actionscript for CMIS:
http://www.flexlive.net/?p=79

Also if it doesn't have to be done thru soap webservices,  FlexSpaces already has code for upload / download using  web scripts REST apis

shamabbas
Champ in-the-making
Champ in-the-making
Hi stevereiner,
Thanks alot for the help. I was trying to upload file through java application but i got authentication failed exception. I asked for help but no help from anywhere yet. I'm also new in flex so il try and follow the guidline to work in flex.so thanks for that. And If you can help me about java code too then please do so. You can see my other post with name "to upload file into alfresco server (with java web service) "
Thanks alotz..

sham