This is a discussion and working group for anyone interested in the Services module and related modules. This module was created out of a need for a standardized solution of integrating external applications with Drupal, specifically Flash and Flex applications. Visit the issues page for all bug reports. Also visit the Services Handbook for information and examples.
browse services -> node.save
Hi,
I'm just starting out with the services stuff - I can follow the load/get of nodes and am quite happy with the screencasts on offer.
On the administration->site building->services->browse page, I'm trying to use the node service node.save - it requires a struct, which I'm guessing is an array but can't get it to work. I keep getting 'node not found'.
Here is what I input into the form: array('type'=>'page','title'=>'test title')
What should I be putting to make it work?
Read moreNEW Imgecache service : Triggering the creation of imagecache derivatives programmatically
Hello all,
This service force the creation of an image derivative with imagecache. Just pass the relative url of the image and the name of image cache preset.
The title and code is from Florian Lorétan. Read more from his blog:
http://happypixels.net/blog/triggering-creation-imagecache-derivatives-p...
It was so easy to make a service.
But what im looking for is to create presets on the fly, something like:
Scale (width=160, height=null , upscale: false)
Crop (width= 155, height= 160, xoffset= center, yoffset= center)
Flex: Image snapshot and File save service
i broke my head on this for few days (and broke anyone on this group's b##ls i guess..)
i got to a solution now and want to share:
i am on drupal 6.10, Services, amfphp.
I have a content type called PHOTOS with 1 image_field.
I need to save the image to server, store it into drupal, then finally create/edit the node to link the image file to it.
My starting point is very similar with keystr0k's @ http://groups.drupal.org/node/20549, with the difference that he's using DrupalSite.as class.
I tried keystr0k's method and it didnt work for me, and it was too complex to debug.
DrupalSite and Creating new nodes/updating nodes
I have tried everything i can think of to create a new node using the DrupalSite class from thirdavedesign and nothing works. I can get views, nodes, and other information just fine. However, when i try to login or save a node (new or update) it gives me a fail message(and not any details as to why/how it failed).
Read moresearch nodes service
I've created a search search service using drupalsite as below:
<?php
public function searchNodes(search_keys:String, callback:Function, data:Object = null, reload:Boolean = false):Boolean {
return startBlocking(callback, data, search_keys, 'search.nodes', search_keys, true);
}
?>if the search is successful it works fine - but when there are no search terms i'm getting php errors in my error log as below:
Module: Transfer Full nodes from a drupal site to another drupal site
Hello All,
I had been working for couple of days on a module that would allow me to transfer nodes from a Drupal Website to another drupal site (for now).
which includes a full node save along with terms,files and CCK extra fields.
its really been a headache since i started patching the method "taxonomy_node_save" in "taxonomy services";
i have done the step of save a node (piece of cake) but now into the terms problem hence the NID of the new transferred node needs to be send to the remote server.
ill keep you updated guys on it and might release a contribution soon.
Read moreuser.save and profile?
Hello all, this is my first post.
I'm working this the various services and Flex. I can get profile specific info with user.get, but I'm getting an access denied error when I try to save an update to that infomation.
Before I dig to far with this, is the user service supposed to be able to save profile information or would that require a custom module? I've edited the permissions quite a bit and I can't see anything obvious that I haven't already granted.
Just looking for a sanity check.
Thanks,
Derek
Views ans files datas
Hello,
I'm trying to build flash news with text and image, using CCK, Views, Services, AMFPHP and Drupalsite classes in a simple Flash AS3 document.
Everything work's fine except the files name and path.
When I call the views.get method in the Services Browser, I get this :
Array
(
[0] => stdClass Object
(
[nid] => 24
[node_data_field_news2_image_field_news2_image_fid] => 26
[node_data_field_news2_image_field_news2_image_list] => 1
[node_data_field_news2_image_field_news2_image_data] => a:1:{s:11:"description";s:0:"";}
[node_data_field_news2_image_nid] => 24
[node_type] => news2
)
[1] => stdClass Object
(
[nid] => 25
[node_data_field_news2_image_field_news2_image_fid] => 27
[node_data_field_news2_image_field_news2_image_list] => 1
[node_data_field_news2_image_field_news2_image_data] => a:1:{s:11:"description";s:0:"";}
[node_data_field_news2_image_nid] => 25
[node_type] => news2
)
)Flex DrupalSite, Services, and CCK ImageField
Can someone please help me figure out how to use node.save to save a node of a content type containing a CCK ImageField ? Here is the setup:
Flex 3, PHP, Drupal 6, Services (all sub-modules enabled), DrupalSite Flex Framework.
Drupal:
I've got a content type called "Photo" which contains the following fields: Title, Photo (ImageField), and Taxonomy.
Flex:
Read moreDrupalSite multiple service calls
Using DrupalSite to connect to services it seems you can only make one service call at a time.
I've made a new service called taxonomy.getTerm in the taxonomy_service.module - this uses taxonomy_get_term() to return a term. I have a need to load multiple terms for each node - so each node that i'm getting in flash uses this service i've made to get all the term data. Unfortunately the BLOCKING method in DrupalSite prevents you running multiple simultaneous service calls.
Is there a good reason for this, if not what's a good work around?
Read moreCaching Service Queries (XML-RPC)
In using a CDN to cache pages, but "POST" queries can't be cached. In using "GET" method, the cache network should be able to save the service from its unique url. Is there a way of loading a XML-RPC service using "GET" method, or a different server type I should use?
Currently I built a Flash AS2 app using XML-RPC services. I have to rebuild it now so it can be cached. Please HELP!
Thanks!
-Joe
DrupalSite and menu.get
Okay. I am looking at trying to expand on the ThirdAve drupalSite class so that i can get Menus from drupal to place in my flash version of the site. Is there any documentation on doing this?
So far what I have:
/*
getMenu: Get Drupal Created Menus for use in flash applications. *New AS 3.0 DrupalSite Class Function
*/
public function getMenu(mid:String, callback:Function, data:Object = null, reload:Boolean = false):Boolean
{
if (MENUS[mid] && MENUS[mid] is Object && !reload) {
Read more User Management from within Flash
Hello all! I'm having a little trouble finding detailed resources that explain how to manage users from inside a flash interface. I have a flash app that launches independent of Drupal, meaning the user can either access the flash system through Drupal or simply launch it by visiting a direct link. I want the user to be able to either login through the Drupal site or through the flash interface, so once the user is inside flash I need the system to check:
1) Is the user already logged in?
Read moreServices API Documentation
node.save
I had a very tough time finding what arguments were required by node.save... I finally guessed that a new node needed a "created" timestamp argument. Where should I post the following?
For new node creation be sure to set the creation time of the node:
var my_date:Date = new Date();
nodeObject.created = my_date.getTime();and for editing existing nodes, be sure to set the changed time of the node:
var my_date:Date = new Date();
nodeObject.changed = my_date.getTime()Extract data from services:views into flash datagrid, arrays
I'm successfully pulling data from services using views.getView:
var pc:PendingCall = views.getView("courselist");I'm able to populate a datagrid like this:
myDG.dataProvider = re.result;and I can map fields directly to columns in the datagrid.
I am also pulling selected fields when a user selects a row from the data grid:
//Create listener object from recordset
var listListener:Object = new Object();
listListener.change = function(evt_obj:Object) {
selected_dg_txt.text = myDG.selectedItem["title"];
body_txt.htmlText = myDG.selectedItem["body"];
price_txt.text = "$ "+myDG.selectedItem["list_price"];
var created_date = myDG.selectedItem["created"];
};
// Add listener.
myDG.addEventListener("change", listListener);Release - DrupalXmlRpc.Net
Greetings everyone. I just released the first version of my DrupalXmlRpc.Net project at SourceForge.Net and can be found at: http://sourceforge.net/projects/drupalxmlrpc/ .
The framework contains the "footwork" to easily connect to Drupal's XmlRpc Service with minimal amount of code. I hope you find it useful. For more information on it as well as some code snippets, please visit http://www.molinesoftware.com
Read moreServices data bloat and potential solutions
Short context: We've been developing apps for the mobile phones (3G, EDGE, etc) and it's clear there's a need to make the data sent to the devices as concise as possible, otherwise it results in a poor user experience because of long loading times due to waiting for the data.
As a result, we've passed on using traditional Drupal methodologies like node_load because functions like that can return a large amount of data, which isn't suitable. Obviously, this isn't a good situation either way.
Read moreServices code sprint at Drupalcon DC
The services maintainers will be holding a code sprint on Saturday, March 7 at Drupalcon, as part of the greater code sprint scheduled for that day. I am hoping to take an axe to the issue queue and clean things up there, and I know there will be some discussion of future plans for authentication and oAuth as well. If you will be at Drupalcon and are interested in Services, please come feel free to come by and lend a hand, or hands, on your keyboard :) I'm sure there will be plenty to do.
Read moreService search.nodes and i18n
hi,
I have a multilingual site built with i18n.
When i do a normal search, my site searchs for the nodes with the defined language and it is ok.
But, when i do a search trougth services, using search.nodes, the service returns only the nodes with the main language, the others never show up, even if I change the language.
Is there a way to correct this issue?
or at least, to add a field as argument to look for a specifed language in node's language field?
thanks in advance.
ps:
i posted here also: http://drupal.org/node/382406
Send system paths with swfAddress module
I'm using swfAddress module to manage paths in Flash. I'm having trouble passing the system path.
If i type in an aliased URL like mysite.com/event/event-name i want to tell flash that i'm really looking at mysite.com/node/2
I'm using SWFAddress.getValue in my as3 and that always shows the url as its displayed in the address bar (without the mysite.com bit or the hash - if the hash is present). SWFAddress suggests it can send the alias or system path, but i'm not seeing that. I've tried with and without the Path module and PathAuto turned on.
Read more