cancel
Showing results for 
Search instead for 
Did you mean: 

Flex and Web Scripts

cedomir
Champ in-the-making
Champ in-the-making
Hi,
I need help on using Web Scripts in Flex (ActionScript). I managed to log in using examples in wiki, but when I try to issue another call to Web Script (ie. to create Space), I get error "Unable to execute web script because required ticket is not available from the AuthenticationService". Any pointer to examples etc. is appreciated.

public function alf_login():void
{
      var url:String = _alf_server_url + "alfresco/service/api/login";
      var webScript:WebScriptService = new WebScriptService(url, WebScriptService.GET, onLoginSuccess, onLoginFailure, false);
         
      var params:Object = new Object();
      params.u = "admin";
      params.pw = "admin";

      webScript.execute(params);
}

public function onLoginSuccess(event:SuccessEvent):void
{
   this._ticket = event.result.ticket;
}

public function create_space():void
{
   var url:String = _alf_server_url + _in_folder + "/children";
   var webScript:WebScriptService = new WebScriptService(url, WebScriptService.POST, onCreateSuccess, onCreateFailure, true);
         
   var params:Object = new Object();
   params.name = "Example";
   params.TypeId = "folder";

   webScript.execute(params);
}
4 REPLIES 4

cedomir
Champ in-the-making
Champ in-the-making
Ok, I solved ticker/authorization problem, but I can't make proper web script call to create space. Where can I find examples or tutorials on web script calls syntax from AS3 beside samples in ACE and Flexspaces projects?

Thanks in advace,
cedomir

mikeh
Star Contributor
Star Contributor
I suspect the FlexSpaces project is currently the best example of how to integrate Alfresco and Flex.

Maybe try sending a message to Steve via his website.

Mike

stevereiner
Champ in-the-making
Champ in-the-making
In flexspaces
look in for actionscript side:
FlexSpaces/src/org/integratedsemantics/flexspaces/control/delegate/webscript/FolderDelegate.as  function newSpace
and on the flexspaces webscript side:
integratedsemantics/space/createSpace.post.desc.xml createSpace.post.js  createSpace.post.xml.ftl

cedomir
Champ in-the-making
Champ in-the-making
Thank You for help.

Best regards,
Cedomir