project page: http://drupal.org/sandbox/redsd/1404920
git repository: http://git.drupal.org/sandbox/redsd/1404920.git
drupal: 7
I created this module in a effort to reduce time spent on setting up a method that allows other websites and/or mobile systems to communicate with drupal websites. I hope I can help other people making this easier.
The module allows to connect your own function to methodes, that can then be called through the JSON-RPC connection. A user can only make a connection if he has a valid user account and the right role that is connected to the service.
The modules allows other modules to easily extend on methodes, so developer can focus on writing their modules that need to cooperate with the JSON-RPC methodes. An module is included that allows to view, load, save and delete nodes. Use this as an example on how to extend the module.
This modules differs from the services module, since it's only focussed on JSON-RPC and works out of the box. Also I tried to keep it easy for other developers to create there own modules that allow them to interact with other devices/websites.
I separated the roles of the user from the roles of the JSON-RPC client, this way, if needed a user won't be able to access a drupal admin but still could have access to the JSON-RPC methods.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drupalcs-result-1413020.txt | 22.11 KB | chertzog |
Comments
Comment #1
chertzogThere are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
Comment #2
chertzogComment #3
redsd commented-Okay I cleanend up the master branch
-Added a readme.txt to the other module
-renamed the functions
-removed old cvs tag
The code sniffer thing I can't fix, it tells me I can't use t() in description in menu, but drupal documentation recommends using t() in description. The other error is that I need to use 2 spaces in a array however this will make the code look like a mess since it needs to be more then 2 spaces.
I will look in the other whitespaces warnings/errors.
Comment #4
redsd commentedOkay fixed everything that was indicated PAReview.sh, however the program keeps saying there are files in the master branch.
I checked in git, using: "git ls-tree -r --name-only master" and this indicates that only the README.txt is present.
Comment #5
operinko commentedThere are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
Source: http://ventral.org/pareview - PAReview.sh online service
Those files can be seen here:
Manual review:http://drupalcode.org/sandbox/redsd/1404920.git/tree/refs/heads/master
Comment #6
redsd commentedI was a bit low on time last month or so.
I experienced some problems with Git not getting my files deleted from master,
however I finnaly succeeded so only the readme file is present in the master branch now.
This I don't understand, what is wrong with the menu items, I compared them with other drupal modules and I don't seem to be missing anything.
Comment #7
operinko commentedIt has to do with your use of base_path() in hook_form().
http://api.drupal.org/api/drupal/includes!common.inc/function/base_path/7
Returns the base URL path (i.e., directory) of the Drupal installation.
So:
http://example.com returns "/" because the path is empty.
Simple fix (don't know if it's the best fix, but works for me):
Add:
global $base_url; to the top of the hook_form() function.
Edit $url variable to:
$url = $base_url . base_path() . current_path();
Comment #8
operinko commentedChanging to needs work, since the links are still broken (atleast for me).
Comment #9
redsd commentedThank you operinko, I didn't noticed this is as problem, changed the url layout to your example.
Comment #10
acobot commentedGreat module,
1. I think more instruction about how to extend the API should be added.
2. Why there is only a POST request method allowed, I think GET method is commonly used, for example fetching the data from server and render in web page. Others are PUT/DELETE
3. I think the methods list should be kept private.
Regards
Comment #11
redsd commentedI like those ideas,
I could make it an option how to (not) show the method list, this way all available methods can be shown in the way the users wants to.
Comment #12
operinko commentedSorry for not checking back earlier, have been busy with work.
Possibly due to the latest changes you've done, code review throws some errors.
http://ventral.org/pareview/httpgitdrupalorgsandboxredsd1404920git
1.) Do not use t() in hook_menu(). You've done so on 6 lines in simple_json_rpc_server.module
2.) You've got a bunch of comments that are longer than 80 chars, split them on multiple lines.
3.) Comments should always end in a full stop. Also, function docblock short description should be on one line.
4.) Make sure you have a space between operator and it's variables (wrong example: if($something) & correct example: if ($something))
5.) Also, your indentation is faulty in some places (simple_json_rpc_server.module and simple_json_rpc_server_node.module).
Apart from those issues found with an automated code review, I couldn't find any problems during a manual code crawl & test.
Fix those, and it's RTBC by me :)
Comment #13
redsd commentedDue to my personal live has cought up with me, I will hope to find sometime in the near future to continue this. For now I can't get the time nor the feel to start it up again.
Comment #14
patrickd commentedOkay, feel free to come back whenever you like !
Comment #15
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.