AnsweredAssumed Answered


Question asked by gfiacchi on Apr 3, 2012
Latest reply on Apr 20, 2012 by gfiacchi
Hi all i'm totally new to Alfresco, or better i've read thousands of articles, but still i've problems in doing what i need.

My situation is: i'm trying to use Alfresco as a CMS to store my contents and posts that i will use in my application.

I'm developing a Flex application and the main features i need are:
- Retrieve the posts and related comments contents.
- Beeing able to insert custom content (both posts and comments)
- Search through all the "blog" contents

Since now i've tried both RESTful and WebService API.

I've tried the first way using the FLEX-SDK provided by the Alfresco project with some changes, but what i'm actually able to do is just make GET calls. I think i can get both posts.
private function searchPosts():void{
            // Create the web script object
            var url:String = "http://localhost:28080/alfresco/service/api/blog/site/first-site/blog/posts";
            var webScript:WebScriptService = new WebScriptService(url, WebScriptService.GET, onSearchSuccess, onLoginFailure, true);
            webScript.ticket = this._ticket;
            webScript.resultFormat = "text";
            // Execute the web script
Then i tried to make POST calls but there a couldn't figure out which parameters i have to pass: for example if i want to make a new post this is the code i'm using:
var url:String = "http://localhost:28080/alfresco/service/api/blog/site/first-site/blog/posts";
            var webScript:WebScriptService = new WebScriptService(url, WebScriptService.POST, onSearchSuccess, onLoginFailure, true);

but obviously to execute the call i need to pass the parameters, i think at least title, content, description, name…
But i couldn't find a sort of code reference where this parameters are defined.
Could you tell me if is there something like this?
I also downloaded the FlexSpaces project but it actually uses custom webscripts.

Then i tried with the WebServices API using Java. I figured out how to search for my contents and actually i could retrieve the posts and using the PARENT seach also the comments. But the resultsets that the call returned do not include the real content of the posts and blogs. They provide a sort of link to the content (also a simple html/plain):
row 0: {}content = contentUrl=store://2012/2/6/10/28/6e54d336-f1b8-4d3e-bb02-bf80d161a234.bin|mimetype=text/html|size=23|encoding=UTF-8|locale=it_

Is there a way to get the bytes of the content?

Thanks in advance.
I will appreciate every kind of suggetion!!!