From: David King <dk...@ketralnis.com>
Date: Fri, 16 Nov 2007 17:54:44 -0800
Local: Fri, Nov 16 2007 8:54 pm
Subject: Re: [erlyweb-list] Re: <title>s and other non-component data
>> Would it make sense to hack in a return value from the controller I really like the component system, so I'd definitely like to get >> function? Something like: >> {return_with_meta,[{title,"Foo"},{link_rel,"next",link_to_page_2()}], >> [{data,"foo"}, >> {ewc,...}]} >> (with a better name, since "return_with_meta" doesn't sound all that >> great to me). But then I'm not sure how one could extract that from >> the rendered view. Maybe pass only the second tuple-item to the view, >> and pass both the first item and the second to the controller. Many >> many questions. I'll have to think about it some more. > I think that's a very good idea. There may be issues if multiple > subcomponents return the same metadata (or at least the same keys), > but then I guess ErlyWeb will just pick the first one. There are also > questions regarding how the metadata will be passed around (should it > be passed to a components siblings and or only its parents?) -- I'll > have to think about it and make sure all the bases are covered. your feedback on my ideas since it's already going in a good direction. I wouldn't expect the siblings to be guaranteed to receive it (since Since the yaws_arg is being re-vamped anyway, maybe this should be Otherwise, you end up all of the components doing something like this: show(A,Foo) {return_with_meta,[{ewc,func,[NewA,Foo]}], (once again, with better names than return_with_meta and add_meta) I haven't looked at the contents of the yaws_arg, but if it's tagged show(A,Foo) Since erlyweb already knows to check the returned list for {ewc} and show(A,Foo) (this was has my implicit-passing of yaws_args, but it's not Personally, I like the last option, but it looks like it would Any other ideas? How does that last one look? >>> Btw, just curious, what parts of ErlyWeb are you rewriting?
>> [...] >> Mostly large swaths of erlydb and erlydb_mnesia (in ways that make it >> work better with mnesia, but that make it incompatible with other >> DBMSs, which of course the current incarnation avoids). I may end up >> having to revert this if mnesia can't handle millions of objects, >> with which it seems to be having trouble once they start to become >> larger objects than simple tuples. I've hacked in a few return and >> 'EXIT' handlers from controller functions for special circumstances, >> like when I want to return a 400- or 500-level HTTP response along >> with other information. I might try to hack in some WebDAV handling >> stuff, as I'm considering writing a desktop client for my app in the >> future and that seems the easiest way to get the data to and from the >> desktop client. I haven't decided what that's going to look like yet. >> It looks like I may be hacking in a return value to return extended >> information to parent controller functions, like <title> tags. but I >> want to decide how it should work, first. It sounds like it's just >> not a concern to the two biggest users of erlyweb > If you want to contribute this feature (or any other feature that you > Yariv >>> Yariv >>> On Nov 16, 2007 10:19 AM, David King <dk...@ketralnis.com> wrote: >>>> erlyweb uses a component system for rendering pages. It makes >>>> [{data,post:title(Post)}, >>>> The view function then looks like: >>>> <%@ show([Title,Contents,Comments]) %> >>>> I really like this, because it allows me to separate the view-logic >>>> I see that Vimagi doesn't set <title> tags (neither <http:// >>>> It isn't limited to <title>s (for instance, I may want to alert the You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||