Hopbot log for 2007-12-02 - Helma IRC channel: #helma on irc.freenode.net

2007-12-02:

[0:17] <midnightmonster> how it going on ajax and data stores, phil?
[2:28] <Byron> hi
[2:28] <midnightmonster> hi
[2:28] <Byron> how can i send ajax requests with helma, i saw a little note about it on the wiki but now examples
[2:29] <midnightmonster> helma runs on the server, so doesn't send ajax requests. it receives them.
[2:30] <Byron> oh well http requests then
[2:30] <midnightmonster> it's helma.Http http://helma.zumbrunn.net/reference/helma.Http.html
[2:32] <Byron> hmmm thanks, im very new to this (used to the browser :)
[2:32] <midnightmonster> are you sure that's what you need to do, though? what's your use case?
[2:34] <midnightmonster> (you'll need to include the helma.Http lib in your app to use it, too)
[2:34] <Byron> well, i want to be able to query imdb and scape out descriptions/ratings reviews
[2:34] <midnightmonster> ok, yeah, that's it, then
[2:35] <Byron> hmm how would i do that (include it)
[2:36] <midnightmonster> in a folder called Global, make a file startstop.js (can be any name). add this: function onStart() { app.addRepository("modules/helma/Http.js"); }
[2:40] <Byron> wow thats cool, so i would just be able to call like helma.Http.getUrl() or something?
[2:41] <Byron> hmm helma is not defined
[2:41] <midnightmonster> well, you have to restart the app for onStart to take effect
[2:42] <Byron> yeah i did that (with the manage app)
[2:42] <midnightmonster> hang on...
[2:43] <Byron> i might be running this from the wrong place, i just put it in /app/Root/main.hac
[2:43] <midnightmonster> put what in Root/main?
[2:44] <midnightmonster> the onStart function needs to be in /app/Global/something.js
[2:44] <midnightmonster> your code that uses helma.Http can be anywhere
[2:44] <Byron> ah yeah i mean tried to call the function from root/main
[2:45] <Byron> oh well hmm
[2:45] <midnightmonster> it would be something like this, though:
[2:45] <midnightmonster> http = new helma.Http(); http.getUrl('http://whatever');
[2:46] <Byron> oh, my mistake i had "var foo = helma.Http.getUrl(...)"
[2:46] <Byron> let me try that
[2:48] <Byron> oh hmm that doesnt change the fact that helma is undefined :P
[2:49] <midnightmonster> you can app.addRepository more than once without harm. try calling it in your main.hac before you use it (in case it's not being run in onStart for some reason)
[2:50] <Byron> hmm still nothing :/
[2:52] <midnightmonster> post your code on the pastebin?
[2:52] <midnightmonster> and you have helma 1.6, right?
[2:53] <Byron> yeap
[2:54] <midnightmonster> http://helma.pastebin.com/ for posting code
[2:55] <Byron> http://helma.pastebin.com/m62a938f1
[2:56] <Byron> oh woops, getUrl returns a object doesnt it? :
[2:56] <midnightmonster> :-( dunno. looks good to me.
[2:56] <midnightmonster> yes
[2:56] <midnightmonster> that
[2:56] <midnightmonster> 's not your problem though
[2:56] <Byron> :(
[2:56] <Byron> something to do with my setup?
[3:00] <midnightmonster> i guess
[3:02] <midnightmonster> the 2-4th non-comment lines of Http.js are:
[3:02] <midnightmonster> if (!global.helma) {
[3:02] <midnightmonster> global.helma = {};
[3:02] <midnightmonster> }
[3:02] <midnightmonster> so it's hard to see how helma could be undefibed
[3:02] <midnightmonster> undefined
[3:03] <midnightmonster> do you have the javascript shell installed in your app?
[3:03] * Byron checks if the file exists
[3:04] <Byron> it does, is there a chance its not getting included?
[3:04] <midnightmonster> seems like somehow it must not be
[3:05] <midnightmonster> what platform are you on?
[3:05] <Byron> typeof Global returns undefined
[3:05] <Byron> ubuntu
[3:05] <midnightmonster> global lowercase
[3:06] <midnightmonster> (folder name uppercase, global object name lowercase)
[3:06] <midnightmonster> (or folder name capitalized, anyway)
[3:07] <Byron> oh ok it exists, typeof global.Helma === undefined
[3:07] <Byron> ah ok
[3:07] <midnightmonster> global.helma--lowercase again
[3:07] <Byron> :P
[3:07] <Byron> ok still undefined
[3:09] <Byron> do i need to add it (modules/helma) as a repo in the apps.properties ?
[3:10] <Byron> all i have for this app in apps.properties is the name of the app
[3:11] <Byron> is it possible this is specific to my platform?
[3:11] <midnightmonster> no--doesn't have to be added
[3:12] <midnightmonster> I have the equivalent (actually using helma/File.js) running on windows and fedora core 6
[3:12] <Byron> hmm
[3:12] <midnightmonster> try using helma/File.js
[3:12] <Byron> ok
[3:13] <Byron> yep, now global.helma is a object
[3:14] <midnightmonster> wacky
[3:16] <midnightmonster> if you do File first, then Http, does Http work?
[3:16] <midnightmonster> 'cause I just tried including Http and it works fine here, but I already had file
[3:17] <Byron> yeah
[3:17] <Byron> it works if i add the file repo before the http one :/
[3:18] <Byron> !
[3:18] <Byron> Http.js line 23 - app.addRepository('modules/core/Date.js');
[3:19] <midnightmonster> nothing odd about that
[3:19] <Byron> oh hehe
[3:20] <midnightmonster> lots of the modules depend on others. they addRepository them to be safe. it doesn't hurt to add the same repository twice.
[3:21] <Byron> but in Date.js it doesnt bother checking if global exists
[3:21] <Byron> or wont that matter?
[3:21] <midnightmonster> global always exists. nothing checks it. and Date always exists--built into JavaScript
[3:22] <midnightmonster> global is the equivalent of window on the client side
[3:22] <Byron> oh ok
[3:23] <midnightmonster> I gotta do something I get paid for. I'd say include File first for now and ask about this issue on the mailing list
[3:23] <Byron> ok, thanks for all the help! :)
[8:18] <philmaker> Anybody around?
[8:18] <zumbrunn> yep
[8:18] <philmaker> Hi zumbrunn
[8:19] <philmaker> I'm about to use Helma.zip to be able to list some Helma example code inline in Gobi pages.
[8:20] <philmaker> Basically upload a zip that has the examples and extract/refer to the source on the fly in Gobi.
[8:20] <philmaker> Just sharing.
[8:21] <zumbrunn> cool
[8:21] <philmaker> um, this: http://helma.zumbrunn.net/reference/core/helma/Zip.html
[8:22] <philmaker> Maybe I'm just procrastinating creating some more sample code. Could be.
[8:22] <zumbrunn> heh
[9:24] <philmaker> I should be able to call: var file = new helma.File(path); - if I have included modules/helma/File.js?
[9:24] <philmaker> in a .hac file?
[9:24] <philmaker> included in apps.properties, and calling from a a .hac file?
[9:26] <zumbrunn> that looks right, yes
[9:34] <philmaker> think I just needed to restart the app - think it's working now
[9:35] <philmaker> duh

 

 

In the channel now:

Logs by date: