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

gzunigainfo2000
Champ in-the-making
Champ in-the-making
Mr Steve
can you help me?

I want to know is how to make a massive load by cifs or ftp or another upload method in alfresco, which allows me to rescue (in the search in alfresco) the indexes of the images or files contained in the file of the type xml or txt.

That is to say that if I massive upload 1000 images to alfresco thru cifs massive upload for example and I load this file xml or txt with its respective indexes (example: vat number, id number,owner etc) this will associate to each and everyone of the files that i mass uploaded allowing me to do a search to the file i need or request.


Thanks you.


Gonzalo.

stevereiner
Champ in-the-making
Champ in-the-making
You could make a new webscript based on an upload webscript (such as the one in flexspaces) and use the uploaded content (xml or text) from the call to the webscript to set attributes.

Steve

gzunigainfo2000
Champ in-the-making
Champ in-the-making
Mr Steve
Thanks for all your posts indeed you have been a real good help, thanks again.

I have another question or big doubt…

Ive used your webscripts in flexspaces and it work just fine to guide me, but the thing is that, i want to massive upload to alfresco in one time(1 click) 10.0000 files or more, not one by one.

I understood the logic of the download of 1 file, is the logic for massive load and download the same ? (all files in one time(1 click), 10.0000 files or more)

In this moment i am trying to generate this webscript, is this the way ? if not, please guide me.

Thanks again

Gonzalo Zuñiga.

stevereiner
Champ in-the-making
Champ in-the-making
One thing with with that many files, not on the webscript/serverside, but on the clientside. For example from flex/actionscript can browse and get many files at once, but need to not do the FileRefence.upload calls in parallel. Instead do them sequentially (start next one only after previous one completes).
Steve

gzunigainfo2000
Champ in-the-making
Champ in-the-making
Mr Steve,
Im recently taken the massive download subject in flex…
Ill tell you what i have and ask you please:
The Alfresco has a massive download that generates a .ACP file, this one contains a folder with the images and a XML with the metadata.
This massive downloads are from the Alfresco spaces that a user chooses.

Steve,  is it possible to create this same methology in FLEX?
Could it be that from FLEX, call the webscript that realizes the .ACP?

Thanks for all the previous posts, indeed a great help.

Regards!

stevereiner
Champ in-the-making
Champ in-the-making
You could write a webscript using the javascript api for actions and call the export action

http://wiki.alfresco.com/wiki/JavaScript_API#Actions_API

You can look at how the export dialog invokes the "export" action or the whole repo export action "repository-export"
http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/web-client/source/jav...

export action
http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/repository/source/jav...

whole repo export action
http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/repository/source/jav...

(could use some points over on the right)

Steve

gzunigainfo2000
Champ in-the-making
Champ in-the-making
Mr Steve,
This is a greaaaat post indeed!
just what i needed really, thaks a million once again for responding.
I will get right on it and ill tell you how it went for me.
thanks a million once again Mr Steve.


Gonzalo Zuñiga.

shamabbas
Champ in-the-making
Champ in-the-making
Hi all,
I need some help please. I want to use Alfresco webservices and APIs to use its file uploading and retrieving system with my flex application.
Can I? and How? and for this What Alfresco Services and APIs are suppose to use? I read your this post "Alfresco + Flex".
I think that I can get help from here.
NOTE: I just want to use Document management system (upload+retrieve > files).
Please reply me as soon as possible. I want to build it as quick as can.
Thanks in advance. I really hope you'll help me out.

Thanks

Sham

shamabbas
Champ in-the-making
Champ in-the-making
Thanks for quick response.
I'm trying to understand but couldn't get properly. I'm actually very new in flex+alfresco even in java. But i want to work in this. I guess you meant that to import this CMISspace and it will generate actionscript for alfresco webservices and then to use them just need a function call in java etc?
Sorry lil confused.