I am testing webscripts (JSON) on Alfresco Community 2.1
I downloaded the ascorelib3 corelib90 (containing JSON funcionality) from http://code.google.com/p/as3corelib/ and configured it for Flexbuilder 3. However for some reason this corelib doesn't seem to work with Flex3? Does anybody have a corelib.swc compatible with flexbuilder3 that I can use to test my Alfresco JSON webscripts against and any tips on how to make this work.
Please read this Source Code License Agreement carefully before using the source code.
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license, to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute this source code and such derivative works in source or object code form without any attribution requirements.
The name "Adobe Systems Incorporated" must not be used to endorse or promote products derived from the source code without prior written permission.
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and against any loss, damage, claims or lawsuits, including attorney's fees that arise or result from your use or distribution of the source code.
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. –>
Error: Unexpected < encountered at com.adobe.serialization.json::JSONTokenizer/parseError()[C:\Documents and Settings\mchamber\My Documents\src\flashplatform\projects\corelib\trunk\src\actionscript3\com\adobe\serialization\json\JSONTokenizer.as:492] at com.adobe.serialization.json::JSONTokenizer/getNextToken()[C:\Documents and Settings\mchamber\My Documents\src\flashplatform\projects\corelib\trunk\src\actionscript3\com\adobe\serialization\json\JSONTokenizer.as:171] at com.adobe.serialization.json::JSONDecoder/nextToken()[C:\Documents and Settings\mchamber\My Documents\src\flashplatform\projects\corelib\trunk\src\actionscript3\com\adobe\serialization\json\JSONDecoder.as:88] at com.adobe.serialization.json::JSONDecoder()[C:\Documents and Settings\mchamber\My Documents\src\flashplatform\projects\corelib\trunk\src\actionscript3\com\adobe\serialization\json\JSONDecoder.as:63] at com.adobe.serialization.json::JSON$/decode()[C:\Documents and Settings\mchamber\My Documents\src\flashplatform\projects\corelib\trunk\src\actionscript3\com\adobe\serialization\json\JSON.as:81] at JSONExample/onJSONLoad()[C:\Documents and Settings\Administrator\My Documents\Flex Builder 3\JSONExample\src\JSONExample.mxml:51] at JSONExample/__service_result()[C:\Documents and Settings\Administrator\My Documents\Flex Builder 3\JSONExample\src\JSONExample.mxml:65] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\http\mxml\HTTPService.as:275] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:191] at mx.rpc::Responder/result()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:41] at mx.rpc::AsyncRequest/acknowledge()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] at DirectHTTPMessageResponder/completeHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:381] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete()
If you want to use Flex with Alfresco, you should start with the the small flex framework from the alfresco SVN ( head/root/modules/flex-sdk/framework) to provide login/logout/webscript infrastructure, and ACE ( head/root/modules/ace ) to provide an example of login/logout/search using the framework. Thats how I started.
I am pretty far along with both a Flex based Alfresco client and a Flex+AIR Alfresco client. I am using Flex 3.0, AIR 1.0, and the latest Alfresco 2.9.0C_dev via javascript webscripts. From google code: I didn't use corelib, I did use flexlib for tabs.
The alfresco flex-sdk works fine for the object result format of the flex mx.rpc.http.HTTPService. I had to change org.alfresco.framework.service.webscript.WebScriptService.as to work with the e4x result format of mx.rpc.http.HTTPService.
P.S. if using alfresco flex-sdk with HTTPService with non object result format, a quick workaround in src/org/alfresco/framework/service/webscript/WebScriptService.as onResultEvent() is to change from: if (event.result.response != null && to: if (this.resultFormat == "object" && event.result.response != null && (more changes would be needed to have status code checking for other formats)
New: Forgot to mention that in each of my ActionScript service classes set webScript.resultFormat ="e4x"; (where webScript is instance of org.alfresco.framework.service.webscript.WebScriptService, WebScriptService extends flex HTTPService)
The webservice URL i tested was broken (server down). I tested another json webservice (Yahoo) and my mxml application worked. So Flexbuilder and the corelib seems to be configured ok. I have however posted a new question about json and the folder.get webscript in this forum branch.