[Helma-user] Helma docs and first-restarts
Maksim Lin for technical support mailling lists
maksim_lin at ngv.vic.gov.au
Wed Mar 7 03:12:30 CET 2007
Hi Rowan,
I think I may understand what your queston is getting at.
I think what might be confusing you is that the "Root" object (and Root
prototype) are special - there is only one object of the Root prototype
and its defined for you by default to be at the url
http://hostname/myapp/
BUT for any other prototypes, for example say you define a Page
prototype, there is NO default mapping to a url, so even if you have a
Page/main.hac, typing in a url like:
http://hostname/myapp/page/ or http://hostname/myapp/Page will not do
anything.
In order to get the result you want, you need to create a mount-point
for your Page protoype in the Root prototype (which as I said is defined
by default already for you), so in Root/type.properties you would have
something like:
page = mountpoint(Page)
Which would then run Page/main.hac when you use the url
http://hostname/myapp/page/
See the doc here: http://helma.org/docs/guide/mapping/mountpoint/ for a
fuller explanation.
You will also see it talks about referencing objects of the protoype you
are using (in your case Page) because helma is like javascript;
object-oriented and so you normally would have multiple objects of a
particular prototype:
Eg.
Prototype: Users
Objects: homer (id=1), marge (id=2), bart(id=3)
Eg. Url: http://hostname/myapp/users/1/display
Would cause the Users/display.hac action to be executed with the "homer"
user object as its context.
Please note that you can safely ignore the whole object-oriented info
above if you just want a simple dynamic application without data
storage.
Hope that helps,
Maks.
________________________________
From: helma-user-bounces at helma.org [mailto:helma-user-bounces at helma.org]
On Behalf Of Rowan Kerr
Sent: Wednesday, 7 March 2007 11:56
To: Helma User Mailing List
Subject: Re: [Helma-user] Helma docs and first-restarts
On 6-Mar-07, at 4:45 PM, Chris Zumbrunn wrote:
> The simplest configuration would be to only add your actions to the
> HopObject prototype. If you do that, Root will automatically inherit
> anything you define there and so will any other page, since in Helma
> every "page" is a HopObject (or inherits from it).
So for, eg: "/page/edit" ... "page" would be a property of Root, and
"edit" would be Page/edit.hac?
Or does edit.hac have to be added to HopObject and then check
for the type of object that's being edited each time it's called?
(I know I set up a demo of this stuff a long time ago but my memory
is fuzzy).
>> It would be cool to be able to see all the default properties and
>> methods of each object (if any). I know HopObject has its own page,
>> but seems to be missing properties .. and lists only the methods.
>
> This should be complete:
>
> http://helma.zumbrunn.net/reference/HopObject.html
That looks much beefier :)
> Which kind of properties were you looking for? What feels missing?
Several places in the handbook/guide mention properties that are
required, or automatic such as _id, _name ... but those aren't reflected
in the docs.
Actually, I don't see the User or Root objects on your reference site...
It's silly stuff I guess, but it's stuff I keep stumbling over.
Thanks.
-Rowan
_______________________________________________
Helma-user mailing list
Helma-user at helma.org
http://helma.org/mailman/listinfo/helma-user
More information about the Helma-user
mailing list