Posted by lelizondo on February 7, 2012 at 6:28am
Just to let everyone know about a project I started a while ago. Drupanium is a distribution and an app with code and documented examples on how to integrate Drupal, Services and Titanium Studio.
There's also some documentation about the Services REST API.
I hope you like it.
Comments
Wow! Thanks for sharing!
Wow! Thanks for sharing!
ig: @thejaspher
tw: @jaspher
Very cool, great work!
Very cool, great work!
Nice work!
Nice work!
| Flexible business applications with ERPAL Platform
Great work
Will be giving it a try these next few days. Just what is needed!
Bitchin!
I got this up and running in about 15 minutes over a burrito?!
Test Devices?
What devices is everyone using?
I had to switch some of the xhr setRequestHeader lines in order to get the build to work on my Android 2.3.3 device. Even with that, I can't seem to log in through the Android app. I don't get any messages or anything when I enter my api.drupanium.org username/password and hit login.
XHR setRequestHeader
Firstly, thanks a lot Luis for making this distro available, great work!
I too am interested in getting this working on Android. What changes did you make to get this functioning?
I have made a brief post on Drupanium, where I have documented some of my findings so far.
Any help is greatly appreciated.
Paul
Open source, open mind
I haven't really tested it
I haven't really tested it with Android. With iOS you shouldn't have any problems.
Luis
Well done
Looks great - cant wait to try it
Thanks for your work on this
Gregg
This is exactly what i was
This is exactly what i was looking for. Great.
Great! Login issue
Thank you! This project is the best kickstrat..
I am working with the Iphone and having error each time I am trying to Log-in.
How can I solve this?
Amir Taiar | Partner & CTO at Reasonat
Thanks.I just got news that
Thanks.
I just got news that Titanium changed the API and Drupanium is broken in some circunstances.
This happens with D6 (and probably with D7 too).
This also happens with POST operations (login is a POST operation).
The problem is not a Services/Drupal thing (I checked with Poster).
You can solve the problem by moving the xhr.setRequestHeader after xhr.open and before xhr.send
Something like this:
var xhr = Titanium.Network.createHTTPClient({timeout: 5000});
xhr.onload = function() {
// do something
}
xhr.open(type, uri);
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");
xhr.send();
Luis
[Drupal 7] I have guessed you
[Drupal 7]
I have guessed you are talking aboit the login.js file.
So I have modified it this way:
<?php
// Open the connection using POST
xhr.open("POST",url);
xhr.setRequestHeader('Content-Type','application/json; charset=utf-8');
// Send the connection and the user object as argument
xhr.send(user);
?>
Is that what you mean?
Cause it's yet not working...
Thank you!
Amir Taiar | Partner & CTO at Reasonat
Do you have plan on commit
Do you have plan on commit this changes soon?
Since I guess there must be more.
Amir Taiar | Partner & CTO at Reasonat
Join Drupanium community now!
Hello guys! drupanium.org community is now open for collaboration! Please help us out by committing updates in github. Let's try to reach more users to get this project going! We have great plans for drupanium! I've joined the drupanium team to help luis in this project but we are looking for more motivated developers to be part of the project.
Announcing Drupanium framework!
We are evolving the drupanium project into a framework for titanium sdk. Visit the blog for more information!
drupanium.org/blog
Drupanium framework (First Look)
You can have a first look at the drupanium framework being developed (screencast). Please contribute back with code fixes, improvements and suggestions.
http://drupanium.org/blog/utneon/drupanium-framework-first-look-screencast
Can't login on Android
I have an app working fine on IOS where the user can login, but on Android when the user logs in a Session is returned as normal but after that i just get errors like
[INFO][TiHttpClient( 1267)] (TiHttpClient-16) [4,64534] Sending error Unauthorized: Access denied for user 0 "anonymous"
as if I'm not actually logged in. I'm at a complete loss as to what's going on and why it's not working.
Has anyone had any success with loging in on Android?
user/login.json
Hello marcus178,
Check out this gist for an example I got working with Android using D6 and Services 3.
I went through the same headache you're probably going through. It appears you can only send the user login credentials as a standalone HTTP POST request, and you must wait for the response before you send a request to create content or view privileged node, etc. Titanium seems to do pretty well managing the session cookie automagically, but it took me a while to figure out that Drupal won't recognize the app as logged in until after it has time to return the login response.
You could do this by having separate windows in your app, one to login and another to post or view content, etc. I fake it in my example by using the setTimout() method instead, only for demo purposes, with all data getting dumped to the console.
Also, in my example I use custom events to pass the data asynchronously, but I've since learned that callback functions would be a better technique.
Let us know if you make progress. Hope this helps.
Bob
Thanks for the response. One
Thanks for the response. One of the problems I have found is that when using
xhr.setRequestHeader('Content-Type','application/json; charset=utf-8');
which is alway recommended I can't login, i get an error of
[INFO][TiHttpClient( 489)] (TiHttpClient-4) [2,19108] Sending error Not Acceptable: There is no user with ID login.
If I remove it I can login.
Also I run system/connect.json when the app starts to detect if the user is already logged in and on android it always returns a uid of 0
Partly resolved
OK I have managed to get system/connect.json working by sending the cookie header like this
xhr.open("POST", url);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.setRequestHeader("Cookie", Titanium.App.Properties.getString("userSessionName") + '=' + Titanium.App.Properties.getString("userSessionId"));
xhr.send();
However if I try the same thing for example to logout, I just get an error saying the user isn't logged in even though they are
http://drupanium.org seems to
http://drupanium.org seems to be down (12/20/14)
Anietie Ekanem
Social Niche Guru Inc.
http://SocialNicheGuru.com
http://facebook.com/SocialNicheGuru
drupanium.org down
Seems like the owner of the project is not supporting the project anymore.