| //////////////////////////////////////////////////////////////////////////////// |
| // |
| // Licensed to the Apache Software Foundation (ASF) under one or more |
| // contributor license agreements. See the NOTICE file distributed with |
| // this work for additional information regarding copyright ownership. |
| // The ASF licenses this file to You under the Apache License, Version 2.0 |
| // (the "License"); you may not use this file except in compliance with |
| // the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| // |
| //////////////////////////////////////////////////////////////////////////////// |
| /**
|
| * This is a generated class and is not intended for modification. To customize behavior
|
| * of this service wrapper you may modify the generated sub-class of this class - TwitterService.as.
|
| */
|
| package services.twitterservice
|
| {
|
| import com.adobe.fiber.core.model_internal;
|
| import com.adobe.fiber.services.wrapper.HTTPServiceWrapper;
|
| import mx.rpc.AbstractOperation;
|
| import mx.rpc.AsyncToken;
|
| import mx.rpc.http.HTTPMultiService;
|
| import mx.rpc.http.Operation;
|
| import valueObjects.Trends;
|
| import valueObjects.Tweets;
|
| import valueObjects.User;
|
|
|
| import com.adobe.serializers.json.JSONSerializationFilter;
|
| import com.adobe.serializers.xml.XMLSerializationFilter;
|
|
|
| [ExcludeClass]
|
| internal class _Super_TwitterService extends com.adobe.fiber.services.wrapper.HTTPServiceWrapper
|
| {
|
| private static var serializer0:JSONSerializationFilter = new JSONSerializationFilter();
|
| private static var serializer1:XMLSerializationFilter = new XMLSerializationFilter();
|
|
|
| // Constructor
|
| public function _Super_TwitterService()
|
| {
|
| // initialize service control
|
| _serviceControl = new mx.rpc.http.HTTPMultiService();
|
| var operations:Array = new Array();
|
| var operation:mx.rpc.http.Operation;
|
| var argsArray:Array;
|
|
|
| operation = new mx.rpc.http.Operation(null, "getTrends");
|
| operation.url = "http://api.twitter.com/1/trends.json";
|
| operation.method = "GET";
|
| operation.serializationFilter = serializer0;
|
| operation.resultType = valueObjects.Trends;
|
| operations.push(operation);
|
|
|
| operation = new mx.rpc.http.Operation(null, "getTweets");
|
| operation.url = "http://search.twitter.com/search.json";
|
| operation.method = "GET";
|
| argsArray = new Array("q","result_type");
|
| operation.argumentNames = argsArray;
|
| operation.serializationFilter = serializer0;
|
| operation.resultType = valueObjects.Tweets;
|
| operations.push(operation);
|
|
|
| operation = new mx.rpc.http.Operation(null, "getUserInfo");
|
| operation.url = "http://api.twitter.com/1/users/show.xml";
|
| operation.method = "GET";
|
| argsArray = new Array("screen_name");
|
| operation.argumentNames = argsArray;
|
| operation.serializationFilter = serializer1;
|
| operation.properties = new Object();
|
| operation.properties["xPath"] = "/";
|
| operation.resultType = valueObjects.User;
|
| operations.push(operation);
|
|
|
| _serviceControl.operationList = operations;
|
|
|
|
|
| preInitializeService();
|
| model_internal::initialize();
|
| }
|
|
|
| //init initialization routine here, child class to override
|
| protected function preInitializeService():void
|
| {
|
|
|
| }
|
|
|
|
|
| /**
|
| * This method is a generated wrapper used to call the 'getTrends' operation. It returns an mx.rpc.AsyncToken whose
|
| * result property will be populated with the result of the operation when the server response is received.
|
| * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
|
| * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
|
| *
|
| * @see mx.rpc.AsyncToken
|
| * @see mx.rpc.CallResponder
|
| *
|
| * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
|
| */
|
| public function getTrends() : mx.rpc.AsyncToken
|
| {
|
| var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getTrends");
|
| var _internal_token:mx.rpc.AsyncToken = _internal_operation.send() ;
|
| return _internal_token;
|
| }
|
|
|
| /**
|
| * This method is a generated wrapper used to call the 'getTweets' operation. It returns an mx.rpc.AsyncToken whose
|
| * result property will be populated with the result of the operation when the server response is received.
|
| * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
|
| * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
|
| *
|
| * @see mx.rpc.AsyncToken
|
| * @see mx.rpc.CallResponder
|
| *
|
| * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
|
| */
|
| public function getTweets(q:String, result_type:String) : mx.rpc.AsyncToken
|
| {
|
| var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getTweets");
|
| var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(q,result_type) ;
|
| return _internal_token;
|
| }
|
|
|
| /**
|
| * This method is a generated wrapper used to call the 'getUserInfo' operation. It returns an mx.rpc.AsyncToken whose
|
| * result property will be populated with the result of the operation when the server response is received.
|
| * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
|
| * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
|
| *
|
| * @see mx.rpc.AsyncToken
|
| * @see mx.rpc.CallResponder
|
| *
|
| * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
|
| */
|
| public function getUserInfo(screen_name:String) : mx.rpc.AsyncToken
|
| {
|
| var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getUserInfo");
|
| var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(screen_name) ;
|
| return _internal_token;
|
| }
|
|
|
| }
|
|
|
| }
|