applet requesting cache item - please help
Hi, Can anybody help me please - I've reviewed tonnes of documentation for days but cannot find the answer. I'm developing a module that displays a Java applet and at the same time prepares data for the applet. This data is stored using cache_set(). The applet then requests this data using a separate call... and my problem is -- in the program that provides this data to the applet, I do not know how can I connect to the database. I assume I need to include bootstrap.inc and a couple of other scripts, but all my experiments failed. Can you please give me some hints as to what is the proper way to to this, or can you point me to a page or module that has employed this technique. I really would not bother you if I could find it myself. I hope somebody answers. Cheers, Tomas
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tomas J. Fulopp schrieb:
Hi,
Can anybody help me please - I've reviewed tonnes of documentation for days but cannot find the answer.
I'm developing a module that displays a Java applet and at the same time prepares data for the applet. This data is stored using cache_set().
The applet then requests this data using a separate call... and my problem is -- in the program that provides this data to the applet, I do not know how can I connect to the database. I assume I need to include bootstrap.inc and a couple of other scripts, but all my experiments failed.
Can you please give me some hints as to what is the proper way to to this, or can you point me to a page or module that has employed this technique.
I really would not bother you if I could find it myself. I hope somebody answers.
Looking at cron.php should give you an idea. Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG84MFfg6TFvELooQRAlq7AJ96Cy6XXuulSJdrfP7Hm3EdE7ZOSACglFfp kNnsE7ny2R4J2YqVEk4OsR8= =Y7Q2 -----END PGP SIGNATURE-----
Thanks, Gerhard and Steven. Seems like a way to go; I should've thought about cron, yes. Tomas Gerhard Killesreiter wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Tomas J. Fulopp schrieb:
Hi,
Can anybody help me please - I've reviewed tonnes of documentation for days but cannot find the answer.
I'm developing a module that displays a Java applet and at the same time prepares data for the applet. This data is stored using cache_set().
The applet then requests this data using a separate call... and my problem is -- in the program that provides this data to the applet, I do not know how can I connect to the database. I assume I need to include bootstrap.inc and a couple of other scripts, but all my experiments failed.
Can you please give me some hints as to what is the proper way to to this, or can you point me to a page or module that has employed this technique.
I really would not bother you if I could find it myself. I hope somebody answers.
Looking at cron.php should give you an idea.
Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFG84MFfg6TFvELooQRAlq7AJ96Cy6XXuulSJdrfP7Hm3EdE7ZOSACglFfp kNnsE7ny2R4J2YqVEk4OsR8= =Y7Q2 -----END PGP SIGNATURE-----
Quoting "Tomas J. Fulopp" <tomi@vacilando.org>:
Thanks, Gerhard and Steven. Seems like a way to go; I should've thought about cron, yes.
I needed to do something similar this week. I created local/bin and local/include directories to keep the Drupal root clean. In a common.inc file I included the following function. <code> /** * Include the Drupal bootstrap file after ensuring it exists where expected. */ function drupalize() { while (!@stat('./includes/bootstrap.inc')) { chdir ('..'); } include_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } </code> Feel free to use as you see fit. Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
You can just include bootstrap.inc, then call drupal_bootstrap (http://api.drupal.org/api/function/drupal_bootstrap/5) to your required level of bootstrapping. On 21/09/2007, Tomas J. Fulopp <tomi@vacilando.org> wrote:
Hi,
Can anybody help me please - I've reviewed tonnes of documentation for days but cannot find the answer.
I'm developing a module that displays a Java applet and at the same time prepares data for the applet. This data is stored using cache_set().
The applet then requests this data using a separate call... and my problem is -- in the program that provides this data to the applet, I do not know how can I connect to the database. I assume I need to include bootstrap.inc and a couple of other scripts, but all my experiments failed.
Can you please give me some hints as to what is the proper way to to this, or can you point me to a page or module that has employed this technique.
I really would not bother you if I could find it myself. I hope somebody answers.
Cheers,
Tomas
-- Regards Steven Jones
Have you considered using a http request to a menu hook or xml rpc -----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Tomas J. Fulopp Sent: 21 September 2007 09:30 To: development@drupal.org Subject: [development] applet requesting cache item - please help Hi, Can anybody help me please - I've reviewed tonnes of documentation for days but cannot find the answer. I'm developing a module that displays a Java applet and at the same time prepares data for the applet. This data is stored using cache_set(). The applet then requests this data using a separate call... and my problem is -- in the program that provides this data to the applet, I do not know how can I connect to the database. I assume I need to include bootstrap.inc and a couple of other scripts, but all my experiments failed. Can you please give me some hints as to what is the proper way to to this, or can you point me to a page or module that has employed this technique. I really would not bother you if I could find it myself. I hope somebody answers. Cheers, Tomas Get more involved with Teachers TV by becoming an Associate. Access new features, invitations to events, sneak previews and latest news and updates. Interested? Visit www.teachers.tv/associates Think before you print. Consider the environment and only print emails when really necessary. This email and any attached files may contain views or opinions which, unless specifically stated, do not necessarily represent those of Teachers TV, Educational Digital Management Ltd, or EducationDigital Ltd. This email and any attached files are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error, please notify us immediately.
Yes, some folks don't know, but if you put a callback item in hook_menu for your module, and then have that function do direct prints, rather than php calls, you can get a very similar affect. Agreed its a matter of style, but I like this approach better than bootstrapping drupal directly. This is the way that most of the AJAX calls in drupal work. Dave On Sep 21, 2007, at 4:29 AM, Olatunde Sowobi wrote:
Have you considered using a http request to a menu hook or xml rpc
-----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Tomas J. Fulopp Sent: 21 September 2007 09:30 To: development@drupal.org Subject: [development] applet requesting cache item - please help
Hi,
Can anybody help me please - I've reviewed tonnes of documentation for days but cannot find the answer.
I'm developing a module that displays a Java applet and at the same time
prepares data for the applet. This data is stored using cache_set().
The applet then requests this data using a separate call... and my problem is -- in the program that provides this data to the applet, I do
not know how can I connect to the database. I assume I need to include bootstrap.inc and a couple of other scripts, but all my experiments failed.
Can you please give me some hints as to what is the proper way to to this, or can you point me to a page or module that has employed this technique.
I really would not bother you if I could find it myself. I hope somebody
answers.
Cheers,
Tomas
Get more involved with Teachers TV by becoming an Associate. Access new features, invitations to events, sneak previews and latest news and updates. Interested? Visit www.teachers.tv/associates
Think before you print. Consider the environment and only print emails when really necessary.
This email and any attached files may contain views or opinions which, unless specifically stated, do not necessarily represent those of Teachers TV, Educational Digital Management Ltd, or EducationDigital Ltd. This email and any attached files are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error, please notify us immediately.
participants (6)
-
David Metzler -
Earnie Boyd -
Gerhard Killesreiter -
Olatunde Sowobi -
Steven Jones -
Tomas J. Fulopp