Updated iUI Samples on GAE/Gaelyk

27 views
Skip to first unread message

Sean Gilligan

unread,
Sep 29, 2009, 4:44:48 AM9/29/09
to gae...@googlegroups.com
I thought this might be of interest so some on this list.

I've been using Gaelyk on GAE to publish the sample apps for the iUI
iPhone Microframework. I just finished updating to Gaelyk 0.2 and the
latest GAE Java SDK. I've also added support for HTML 5 offline
caching. All the work is open source under the New BSD license.

The site is at: http://iui-js.appspot.com/
The HTML 5 Music Sample is here:
http://iui-js.appspot.com/samples/music/music.html
There is a wiki page on the iUI site about GAE/Gaelyk:
http://code.google.com/p/iui/wiki/iUIOnGoogleAppEngine

The source is currently on bitbucket:
http://bitbucket.org/msgilligan/iui-040-prototype1/src/tip/web-app/
but should be merged into Google Code soon.

I used .gtpl to replace the .PHP files that were written by Joe Hewitt
(founder of iUI) The dynamic files are all extremely simple, but I'm
hoping the number and sophistication of the sample apps and test apps
will increase.

There are a handful of issue remaining (see the wiki page) but I thought
I'd share the work to date as an example of what can be done with
Gaelyk. I wrote a blog entry that explains why I chose Gaelyk:
http://code.msgilligan.com/2009/09/iui-on-google-app-engine-using-gaelyk.html
-- Although it doesn't mention that Guillaume did a good job explaining
it at Google I/O ;)

-- Sean

Guillaume Laforge

unread,
Sep 29, 2009, 4:48:28 AM9/29/09
to gae...@googlegroups.com
Sean, congrats on this updated sample app, which looks great!
It's always cool to see concrete usage of one's stuff ;-)

Guillaume
--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

Sean Gilligan

unread,
Sep 29, 2009, 5:56:13 AM9/29/09
to gae...@googlegroups.com
Guillaume Laforge wrote:
> Sean, congrats on this updated sample app, which looks great!
>

The Music sample app is actually starting to get a little long in the
tooth, but I thought it was a good app for my first experiment with HTML
5 cache manifest files. Interestingly, I wrote a little Groovy script
to generate it :)

> It's always cool to see concrete usage of one's stuff ;-)
>

Thanks for all your help with this stuff!

I've got two issues that I've got to check now that I'm on Gaelyk 0.2
and GAE SDK 1.2.5
1) I want to change the URL (but not the extension) of the .gtpl files
to .php
2) I want index.gtpl to be the default page at /

I tried both of these things with the earlier Gaelyk and GAE SDK 1.2.1
with no success. If there are any known issue, please let me know.
Otherwise, next chance I have to work on this, I'll be trying to collect
more info on what is going wrong.

Thanks, again!

-- Sean

Guillaume Laforge

unread,
Sep 29, 2009, 6:10:29 AM9/29/09
to gae...@googlegroups.com
On Tue, Sep 29, 2009 at 11:56, Sean Gilligan <se...@msgilligan.com> wrote:
> [...]
> I've got two issues that I've got to check now that I'm on Gaelyk 0.2
> and GAE SDK 1.2.5
> 1) I want to change the URL  (but not the extension) of the .gtpl files
> to .php

What kind of URL change? I'm not sure I follow.
As part of Gaelyk 0.2, I've updated the tutorial on the kind of things
we can do with URLs, thanks to some regex kingfu.
So be sure to have another look at that section, perhaps that'll help
you towards a solution.

> 2) I want index.gtpl to be the default page at /

I think by tweaking the welcome-file element in web.xml, you should be
able to achieve this.
This is what I'm doing on the Gaelyk website itself -- check the
source code on GitHub.

> I tried both of these things with the earlier Gaelyk and GAE SDK 1.2.1
> with no success.  If there are any known issue, please let me know.
> Otherwise, next chance I have to work on this, I'll be trying to collect
> more info on what is going wrong.

In the previous version, I had not documented the regex replacement
thingy, so you couldn't really guess how to do some custom URL
mapping.
Also, I know there's a difference between the dev mode and in
production mode, as they don't handle the directories / index file in
the same fashion, but details evade me right now (but something that
can work locally can fail once deployed... or the reverse... that's
why I say the details evade me)
And again, perhaps having a look at the welcome-file list in web.xml
may also help you.

Cheers,

Guillaume

>
> Thanks, again!

Sean Gilligan

unread,
Sep 29, 2009, 1:05:51 PM9/29/09
to gae...@googlegroups.com
Guillaume Laforge wrote:
> On Tue, Sep 29, 2009 at 11:56, Sean Gilligan <se...@msgilligan.com> wrote:
>
>> [...]
>> I've got two issues that I've got to check now that I'm on Gaelyk 0.2
>> and GAE SDK 1.2.5
>> 1) I want to change the URL (but not the extension) of the .gtpl files
>> to .php
>>
>
> What kind of URL change? I'm not sure I follow.
>

I want the URL "stats.php" to be resolved to the file "stats.gtpl" In
music.html I currently have a link to 'stats.gtpl', it was previously a
link to 'stats.php' but I had to change it to make it work with Gaelyk.
If I can change it back to 'stats.php' the exact same music.html file
can be used as sample code for both Gaelyk and PHP.

> As part of Gaelyk 0.2, I've updated the tutorial on the kind of things
> we can do with URLs, thanks to some regex kingfu.
> So be sure to have another look at that section
>

Will do.


>
>> 2) I want index.gtpl to be the default page at /
>>
>
> I think by tweaking the welcome-file element in web.xml, you should be
> able to achieve this.
>

I tried a while back and had problems (similar to what you describe below)

>
>> I tried both of these things with the earlier Gaelyk and GAE SDK 1.2.1
>> with no success. If there are any known issue, please let me know.
>> Otherwise, next chance I have to work on this, I'll be trying to collect
>> more info on what is going wrong.
>>
>
> In the previous version, I had not documented the regex replacement
> thingy, so you couldn't really guess how to do some custom URL
> mapping.
> Also, I know there's a difference between the dev mode and in
> production mode, as they don't handle the directories / index file in
> the same fashion, but details evade me right now (but something that
> can work locally can fail once deployed... or the reverse... that's
> why I say the details evade me)
>

I think this is what bit me. I do remember the behavior being different
between developer mode and deploy mode. When I have time to take a look
at it again, I'll let you know what i find.

Thanks for the pointers!

-- Sean

Guillaume Laforge

unread,
Sep 29, 2009, 2:47:17 PM9/29/09
to gae...@googlegroups.com
On Tue, Sep 29, 2009 at 19:05, Sean Gilligan <se...@msgilligan.com> wrote:
> [...]
> I want the URL "stats.php" to be resolved to the file "stats.gtpl"  In
> music.html I currently have a link to 'stats.gtpl', it was previously a
> link to 'stats.php' but I had to change it to make it work with Gaelyk.
> If I can change it back to 'stats.php' the exact same music.html file
> can be used as sample code for both Gaelyk and PHP.

The simplest solution is to rename all your .gtpl files to .php :-)
And declare that in the servlet mapping.

Otherwise, with the regex replacement thingy, I think it should work
with the template servlet as well, so it's worth a try.

> [...]

Sean Gilligan

unread,
Sep 30, 2009, 3:05:32 AM9/30/09
to gae...@googlegroups.com
Guillaume Laforge wrote:
> On Tue, Sep 29, 2009 at 19:05, Sean Gilligan <se...@msgilligan.com> wrote:
>
>> [...]
>> I want the URL "stats.php" to be resolved to the file "stats.gtpl" In
>> music.html I currently have a link to 'stats.gtpl', it was previously a
>> link to 'stats.php' but I had to change it to make it work with Gaelyk.
>> If I can change it back to 'stats.php' the exact same music.html file
>> can be used as sample code for both Gaelyk and PHP.
>>
>
> The simplest solution is to rename all your .gtpl files to .php :-)
> And declare that in the servlet mapping.
>
> Otherwise, with the regex replacement thingy, I think it should work
> with the template servlet as well, so it's worth a try.
>

I'll try the regex replacement thingy. It should let me keep things
simple for everyone.


music.html will use stats.php as the URL to access the stats page-fragment.
For developers using PHP, it will access the file stats.php
For developers using Gaeklyk it will access stats.gtpl

This can be run right out of the developers working directory for both
types of developers.

It should be pretty cool if I can get the regex's to work. (I probably
won't try until next week)

-- Sean

Reply all
Reply to author
Forward
0 new messages