2008-11-16:
[7:23] <jirkap> good morning, I have another question regarding type.properties...[7:25] <jirkap> I somehow understand its purpose.. but. Let's say i have [root] and its child is [sample]. Here comes the first question: (pastebin)[7:27] <jirkap> http://helma.pastebin.com/m78a26846[7:28] <jirkap> now, this is the only way to generate correct url (otherwise it throws ids)[7:30] <jirkap> now I want to connect Sample to mysql database and access data from it at root/sample/id[7:33] <jirkap> the question is: do I have to create a new prototype (folder), define type.properties for db in it and make a child of Sample out of it? Or can I just add db lines to type.properties in Sample?[7:35] <jirkap> The documentation is kind of confusing, I do not really understand how this works, what is chained with what.[9:41] <jirkap> noone?[9:41] <zumbrunn> hi jirkap[9:41] <jirkap> hi[9:42] <zumbrunn> just a second...[9:42] <jirkap> sure[9:44] <zumbrunn> ok, back ...reading now...[9:45] <zumbrunn> what is "Sample" in relation to the data in the db?[9:45] <zumbrunn> what do you have in the db? Samples?[9:46] <zumbrunn> then yes, you would map the sample prototype to the db[9:46] <jirkap> hmm, yes.[9:46] <zumbrunn> meaning you would add the db mappings to type.properties inside the Sample folder[9:47] <jirkap> along with 'name' which is needed to generate correct urls? So collection would be (Sample)?[9:47] <zumbrunn> (which, btw, you can also call "Sample.properties" instead of the generic type.properties, if you like/prefer)[9:47] <jirkap> good to know[9:49] <zumbrunn> I would probably map "name" to something in the db then[9:49] <zumbrunn> http://helma.zumbrunn.com/intro/dbmapping[9:50] <zumbrunn> or use another property as accessname[9:54] <jirkap> I'll try what you are suggesting, thanks. I'll probably get back here soon though :)[14:41] <jirkap> Chris> I guess there was a misunderstanding. I'll try to explain more carefully what I am trying to achieve:[14:43] <jirkap> [Sample] is a child HopObject of [Root]. Then I want the database HopObjects to be accessible for example at root/sample/id.[14:43] <zumbrunn> I'm guess you don't really have "Samples" in your db after all ;-)[14:43] <jirkap> :)[14:43] <zumbrunn> then you probably want them to be another prototype[14:44] <jirkap> yes, I do, but the problem is that 'sample' is more of a container[14:44] <jirkap> yep[14:44] <jirkap> the question is - do i have to create a new prototype folder?[14:44] <zumbrunn> yes, probably[14:45] <zumbrunn> I suggest you come up with more meaningful names to play with instead of sample and samples[14:45] <zumbrunn> because I think this is where you are confusing yourself unnecessarily[14:46] <jirkap> sorry[14:47] <zumbrunn> unless you are writing an app where you really collect samples or are sampling something :-)[14:48] <zumbrunn> in your app, root now inherits from Sample, right?[14:48] <jirkap> not anymore[14:48] <zumbrunn> ok, but maybe you could have a prototype called "Page"[14:48] <zumbrunn> and let root inherit from that[14:49] <zumbrunn> and then add a Page object to root called "samples"[14:49] <zumbrunn> (with a name property with the value "samples")[14:50] <zumbrunn> and then have a prototype called "Sample" which will be used for the objects you attach to that "samples" Page object[14:51] <jirkap> now I am really confused :)[14:51] <zumbrunn> sorry :-)[14:51] <jirkap> I will read it few more times now[14:52] <zumbrunn> what is Root inheriting from now?[14:53] <zumbrunn> (if you no longer specify an _extends value, it inherits from HopObject)[14:53] <jirkap> from nothing. It just has a _children = collection(Samples) line (+accessname).[14:53] <zumbrunn> ok[14:54] <zumbrunn> (from HopObject then)[14:54] <jirkap> yes[14:55] <zumbrunn> so, for what you want to do, the children of root are actually *containers* which contain Samples[14:56] <zumbrunn> you do not intend your /samples/ object to be a Sample[14:57] <zumbrunn> instead, you intend /samples/id/ to be a Sample, correct?[14:57] <jirkap> YES. BUT: there is only ONE, so I don't see much of a point having this as a prototype (separate folder), if it is only present once.[14:57] <jirkap> yes.[14:58] <jirkap> all I want is root/samples/id where id is a 'sample'retrieved from the db[15:00] <jirkap> so samples could be 'articles' or whatever, I am just trying things before I get to some real stuff.[15:00] <jirkap> I guess that is what mountpoints in type.properties are for, but not really sure[15:00] <zumbrunn> personally, I would work with an intermediate prototype, like "Page", to these "containers" pages[15:01] <zumbrunn> but yes, you could look at mountpoint or object mappings to implement the behavior you want[15:03] <zumbrunn> the problem then though is that requests to root/articles/ (without any article specified) won't have a prototype that can handle the request[15:04] <jirkap> hm, you are right. and I need that...[15:04] <zumbrunn> if you want full control over how you handle the requests on the intermediate level, then an intermediate prototype is the way to go in my opinion[15:05] <jirkap> ok, eh.. what's an intermediate prototype? A not really special one (generic)?[15:05] <zumbrunn> yes, or a very special one :-)[15:05] <zumbrunn> a generic one would be something like "Page", which you would use in many places[15:06] <zumbrunn> a very special one would be something like "ArticleList", of which you might then only have a single instance[15:09] <jirkap> that would be my case then (the second one). So it seems that is actually a way to work this out... I will have to make up more proper names then.[15:13] <jirkap> I mean - for a bigger application, is it normal to have like 20 prototypes?[15:13] <jirkap> (folders)[15:15] <zumbrunn> sure[15:16] <zumbrunn> http://code.google.com/p/antville/source/browse/#svn/trunk/code[15:17] <jirkap> ok :) great reference, thank you.[15:20] <jirkap> and one more thing - the difference between persistent & transient HopObject is that persistent are the prototype folders and transient are stored in database? I have not found any explanation of this[15:21] <zumbrunn> no, persistent are the ones store in the database[15:21] <jirkap> and transient?[15:22] <zumbrunn> stored in the database, basically means that they are attached to root or another object that is attached to root eventually[15:22] <zumbrunn> transient is one that isn't attached to another stored object yet[15:23] <zumbrunn> var foo = new HopObject();[15:23] <zumbrunn> foo is transient now[15:23] <zumbrunn> root.add(foo);[15:23] <zumbrunn> now foo is persisted[15:23] <jirkap> yes.[15:26] <jirkap> thanks[15:26] <zumbrunn> in other words, usually you see "transient HopObject" used in cases where something is done with a HopObject without that it has been made persisted[15:28] <jirkap> any examples? How can it be used without being attached to another object?[15:29] <zumbrunn> for example if it is used to collect data and render that data using special skins, but the collected data is thrown away after the request has been served
In the channel now:
Logs by date: