Closed (fixed)
Project:
DrupalGap
Version:
7.x-1.4
Component:
Module Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2013 at 22:51 UTC
Updated:
24 Jan 2014 at 03:09 UTC
Jump to comment: Most recent
Comments
Comment #1
doors commentedComment #2
doors commentedComment #3
tyler.frankenstein commentedOn the Drupal side of things, you need to implement a custom service resource. Here's an example:
http://drupalcode.org/sandbox/signalpoint/2068317.git/commit/f565f40
Then on the DrupalGap side of things, check out this page for an example:
https://github.com/signalpoint/pathfix/commit/582a52327c656400c23dc8ce96...
Essentially you need to create a JS object like the "DrupalGap Pathfix Services" example code above, so then you can call something like this in DrupalGap:
drupalgap.services.my_service_name.my_resource_name.call({success:function(result){alert(result);}})Please note, these are old commits and are no longer used in the sandbox module, but the code is still valid and will work.
Comment #4
doors commentedI had already sorted out the drupal module by looking at how the drupalgap module implementation.
Based on the Drupalgap Pathfix Services module I did my own module but I still am having some trouble understanding how it works.
This is my implementation:
The node will will have a unique text field that a user will scan and once they are the first person to scan it a record should be written to a table row so that another user cannot see the record and scan it and be assigned as the winner.
I want to send the unique code to my Drupal module via the Services module instead of the node id.
What is the best way to implement this?
Comment #5
tyler.frankenstein commentedStop by #drupal-drupalgap on IRC to discuss this further please.
Comment #6
doors commentedTyler I am a newbie to irc but I am on now and I see you online but I am not getting a response from you.
Comment #7
tyler.frankenstein commentedA complete example is available here: http://drupalgap.org/node/187
Comment #8
lipinponmala007 commentedHi
I followed the complete example @http://drupalgap.org/node/187
But In my case I have an argument to pass to the call back function
In my mymodule.services.inc
i have put
in my_module.resource.inc
in custum/mymodule.js in the directory
but my my_module.resource.inc i am not getting the $pid it is always empty.
am i am trying in a wrong way? Thanks in advance
Comment #9
lipinponmala007 commentedHi
Pleae consider this to be with the previous post
Here is i am trying to callthat service
Comment #10
lipinponmala007 commentedHI
Got it
using api_options.data = 'pid=' + options.pid
Comment #11
tyler.frankenstein commentedI've updated the documentation to include example code for DrupalGap 7.x-1.7-alpha mobile app dev kit and beyond:
http://drupalgap.org/node/189