Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

template driven development? Re: Rebol Server Pages

 [1/13] from: petr:krenzelok:trz:cz at: 7-Oct-2002 8:27


Andrew Martin wrote:
>Here's %Test.rsp, a example Rebol Server Pages file: ><html>
<<quoted lines omitted: 10>>
></body> ></html>
uhm, well - what's that? :-) Such kind of code it totally unacceptable to me :-) I hope build-markup does not work that way??? Do you really like the mixture of Rebol code and html that way? What will be the result? Your visual editor will show both strings unless you upload your page and let it be processed in production environment, where rebol is installed. What is more - as shown above - I can't imagine cooperation of web-designer with scripter - we would have to be very close one to each other on a daily basis and create mixtures of our work. My idea is to find out better way - something like template driven, modular design. I want web-designer to only mark some sections for me, and according to them I would load and run certain code. I want to give web designer maximal expression freedom, if possible. Displaying date or time is a simple task, what I will probalby need is to generate some database query results, whatever the database is (initially rebol objects text files). My idea is that my friend does compelete design, including table, where results are displayed. The table will have one example element in it, so my friend will still be able to see, how does result of his code looks like in visual editor, but he will mark sections for me, e.g. <!--[table_1]-->, so I will be able to look at my code repository to look, if there is any code named section called "table_1". Now the only question left for me to decide is - how complex such system I want to be? Design examples: Let's suppose typical news site with table columnar desing (http://www.ann.lu , http://www.amiga.org ) 1) Designer creates table layout and also desing of first item, marks table and first item sections, e.g. <!--[Title]-->.....<!--[/Title]--> or something like that, for my script to know where to enter db query results. That is the simplest case, where I don't need to solve if there is 1 or 10 results and everything gets iterated and displayed on one site 2) there can be of course the case where there is e.g. more than 20 results, and we want to display just first 10 and then some "Next" button 3) even more complicated case, where designer creates e.g. two columnar design? He/she would have to specify me some additional info though, e.g. <!--[Table_1 [2 10]]--> or even <!--[Table_1 [varX varY]]--> where both variables could be user's selection on website As for 2) and 3): A) I am not sure it is worth the effort B) So really noone thinks in the same terms as me? Why should I care what design designer chooses? I want my code to operate independently of design, if possible. Maybe some XML systems already solve such abstraction? C) I am not sure I can inteligently enough cover the practical needs and if in the end such system would not bring more complication than needed ... but I think I will try it anyway ... Chris was so kind and provided me with few links. For those interested: http://www.webreference.com/dlab/9809/modular.html http://www.webreference.com/dlab/9809/ Articles are old, but many ideas still valid ... Any other pointers or ideas will be appreciated :-) Cheers, -pekr-

 [2/13] from: al:bri:xtra at: 7-Oct-2002 21:43


pekr wrote:
> uhm, well - what's that? :-) Such kind of code it totally unacceptable to
me :-) I hope build-markup does not work that way??? 'Build-markup works the same way, but doesn't allow block! values to be separated by HTML tags and plain text. It also requires each expression within the "<%" and "%>" to be "complete", not separated likes 'RSP allows.
> Do you really like the mixture of Rebol code and html that way?
Of course not. That's why I went to eText, ML dialect and naked objects concept. Along the way I was forced to discard the HTML page designer. :) But I didn't miss him. :)
> What will be the result? Your visual editor will show both strings unless
you upload your page and let it be processed in production environment, where rebol is installed. Some kind of marker will have to be visible to the designer, otherwise they can't see it and move it around? :-/ I'm a bit confused here.
> Displaying date or time is a simple task, what I will probably need is to
generate some database query results, whatever the database is (initially rebol objects text files). My idea is that my friend does compelete design, including table, where results are displayed. The table will have one example element in it, so my friend will still be able to see, how does result of his code looks like in visual editor, but he will mark sections for me, e.g. <!--[table_1]-->, so I will be able to look at my code repository to look, if there is any code named section called "table_1". Oh, you mean something like this, perhaps: <html> <head> <title>{{Test}</title> </head> <body> <%hide [ Data: [ ; This is like results of query. "L1 Foo Stuff" "L1 Bar Stuff" "L2 Foo Stuff" "L2 Bar Stuff" ] ]%> <h1>Test</h1> <% random/seed now either random true [ %> Have a <b>nice</b> day! <% ] [ %> Have a <b>lousy</b> day! <% ] %><br/> The date and time now is: <% now %>.<br/> <table> <tr><th>Foo</th><th>Bar</th></tr> <%map Data func [Foo Bar] [reform [%> <tr><td><%Foo%></td><td><%Bar%></td></tr> <%]]%> </table> </body> </html> And here's the results: {<html> <head> <title>^{^{Test^}</title> </head> <body> <h1>Test</h1> Have a <b>nice</b> day! <br/> The date and time now is: 7-Oct-2002/21:36:57+13:00 .<br/> <table> <tr><th>Foo</th><th>Bar</th></tr> <tr><td> L1 Foo Stuff </td><td> L1 Bar Stuff </td></tr> <tr><td> L2 Foo Stuff </td><td> L2 Bar Stuff </td></tr> </table> </body> </html> } Now all your designer has to do is keep this: <%map Data func [Foo Bar] [reform [%> to the left of the first example row, and keep this: <%]]%> to the right of the first example row, and put these: <%Foo%> and: <%Bar%> where the contents of the columns are meant to go. I don't think that would be too hard?! :) The only time your effort needs to change if the number of columns changes, but then that implies that the database is changing as well... Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [3/13] from: jason:cunliffe:verizon at: 7-Oct-2002 3:16


> uhm, well - what's that? :-) Such kind of code it totally unacceptable > to me :-) I hope build-markup does not work that way??? Do you really > like the mixture of Rebol code and html that way? What will be the > result? Your visual editor will show both strings unless you upload your > page and let it be processed in production environment, where rebol is > installed.
hmm.. I tend to agree. But always people have so many different needs and workflow styles. To each his/her own tool. The more options exist for REBOL the better I think.. Personally, I prefer Olivier Auverlot's approach. You may too. I like it because it cleanly separates REBOL code from the html. It just goes cleanly within <rebol></rebol> tags. But, if the progammer wants/needs to mix code and presentation stuff within, of course they still can. Also there is now new session handling, a very direct syntax for cgi variables [GET or POST] and libraries can be loaded securely adn clenly to keep inline code concise and readable, without sacrificing feature scope.. http://www.rebolfrance.org/projets/magic/magic110.zip ./Jason

 [4/13] from: al:bri:xtra at: 9-Oct-2002 16:42


Jason wrote:
> Personally, I prefer Olivier Auverlot's approach. You may too. I like it
because it cleanly separates REBOL code from the html. It just goes cleanly within <rebol></rebol> tags. Be aware when using Magic, that the Rebol expression between the <rebol></rebol> tags must be complete! This can be seen in the 'parse code for magic, quoted below: until [ either found? find m-page "<rebol>" [ parse m-page [ copy m-code to "<rebol>" m-mark: ( if not none? m-code [ prin m-code ] m-page: copy m-mark parse m-page [ thru "<rebol>" copy m-code thru "</rebol>" m-mark: ( if error? m-err: try [ do m-code ] [ m-error (mold disarm m-err) ] m-page: copy m-mark ) ] ) ] ] [ prin m-page true ] ] Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [5/13] from: yeksoon:myrealbox at: 9-Oct-2002 13:22


At 03:16 AM 10/7/2002 -0400, you wrote:
>Personally, I prefer Olivier Auverlot's approach. You may too. >I like it because it cleanly separates REBOL code from the html. It just goes
<<quoted lines omitted: 6>>
>http://www.rebolfrance.org/projets/magic/magic110.zip >./Jason
This also reminds me of Enhydra's XMLC ( http://www.enhydra.org ). XMLC is one of the thing that solves the problem with embedding other languages within the HTML codes. The clean separation between "UI" and "logic" allows for different teams (UI and logic) to work in parallel once they have agreed on the use of certain naming conventions. Perhaps we can learn from XMLC to see how we can incorporate some of the features in one of the frameworks. YS

 [6/13] from: al:bri:xtra at: 9-Oct-2002 21:33


YS wrote:
> This also reminds me of Enhydra's XMLC ( http://www.enhydra.org ). XMLC is
one of the thing that solves the problem with embedding other languages within the HTML codes.
> The clean separation between "UI" and "logic" allows for different teams
(UI and logic) to work in parallel once they have agreed on the use of certain naming conventions.
> Perhaps we can learn from XMLC to see how we can incorporate some of the
features in one of the frameworks. Here's some HTML copied from the draw poker demo: <HEAD> <TITLE>Welcome to Larry and Daryl's EnhyDraw! poker</TITLE> </HEAD> <html> <head> <title>Welcome to Larry and Daryl's Enhydra Poker!</title> </head> Two head sections in the same page? With two different titles? Here's some more HTML copied from the FormUpload page: <FORM name="myForm" enctype="multipart/form-data" method=POST action=FormUpload.po> <INPUT type=hidden name=theFileName> <H2>Input1: </H2><INPUT type=text name=input1 size=30> <H2>Upload: </H2><INPUT type=file name=upload size=30> <P><H2>Submit: </H2><INPUT type=submit name=submit size=30 onClick="setFileName()"> </FORM> They're using presentation markup (H2 tags) for input labels? There's no closing tags for the page; the "</FORM>" isn't followed by closing tags for the "<body>" and "<html>" tags. Also, they're using uppercase for tag names which isn't XML compatible, and not all attribute values are quoted. But the above is probably because they're using visual web page design tools to create/maintain the pages, and because they've not got all the content from the program (content like title tag content is expressed outside the program). Presumably these problems would be fixed by using a XML-compatible visual web page design tool? pekr might be interested in this page: http://barracuda.enhydra.org/cvs_source/Barracuda/docs/comp/high_level_overv iew.html and looking for: Q: How does the BTemplate work? The concept of using id attributes to tell the parsing program where to get the data from can be easily implemented in Rebol, once one has a adequate HTML parser. :) Except that in the examples, it's changed to using the class attribute instead. :-\ Here's an example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html id="HelloWorld"> <head><title class="Dir::Get_Data.HelloWorld.Title">[Title]</title></head> <body style="font-family: Georgia, Arial, Times New Roman" bgcolor="#FFFFFF"> <h2 class="Dir::Get_Data.HelloWorld.Title">[Title]</h2> <p class="Dir::Get_Data.HelloWorld.Descr">[Descr]</p> <p class="Dir::Get_Data.HelloWorld.Header">[Nav Header goes here]</p> <p>Here's our third shopping list:<br></p> <table summary="foo"> <tr class="Dir::Iterate_Start.Groceries Dir::Iterate_Next.Groceries"> <td bgcolor="#8080FF"> <font color="#FFFFFF"> <span class="Dir::Get_Data.Groceries.RowCntr">1</span>. <strong><span class="Dir::Get_Data.Groceries.Item">Corn</span></strong> (<span class="Dir::Get_Data.Groceries.Qty">3 cans</span>) </font> </td> </tr> <tr class="Dir::Iterate_Next.Groceries"> <td> <em> <span class="Dir::Get_Data.Groceries.RowCntr">2</span>. <strong><span class="Dir::Get_Data.Groceries.Item">Peas</span></strong> (<span class="Dir::Get_Data.Groceries.Qty">4 bags</span>) </em> </td> </tr> <tr class="Dir::Iterate_End.Groceries Dir::Discard" bgcolor="#8080FF"> <td><font color="#FFFFFF">3. <strong>Bannanas</strong> (1 bunch)</font></td> </tr> <tr class="Dir::Discard"> <td><strong>...</strong></td> </tr> </table> <p class="Dir::Get_Data.HelloWorld.Footer" align="center">[Footer goes here]</p> </body> </html> I wonder is pekr would be happier with this? :) The equivalent in Rebol would replace "::" with "/", and "." with "/". Except that I think the example above is faulty. I'm under the impression that the presentation stuff will vanish, as it's replaced? :-\ I could well be wrong. But that's enough rambling from me. Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [7/13] from: brett:codeconscious at: 9-Oct-2002 23:56


<snipped amusing bugged HTML examples> ... ...
> pekr might be interested in this page: >
http://barracuda.enhydra.org/cvs_source/Barracuda/docs/comp/high_level_overv
> iew.html > > and looking for: > Q: How does the BTemplate work? > > The concept of using id attributes to tell the parsing program where to
get
> the data from can be easily implemented in Rebol, once one has a adequate > HTML parser. :)
...
> I wonder is pekr would be happier with this? :) The equivalent in Rebol
I certainly would not be happier with that. :^) Re HTML. I wonder - is there any point worrying about HTML for new projects. My impression is that XHTML (XML) would be better as working documents for a designer to manipulate going forward and the XMLC and Baracuda approach of incorporating symbols into the source document is the right way to go. However, I really don't know if the tools are supportive of this yet - maybe a designer can jump in here and comment. I also don't really know if XMLC and Baracuda have designed their respective embedded symbols simply enough for an end-user. I agree with the point about RSP being an unsuitable format for working with a designer. In my view it is equivalent to a serialised script and therefore might have value in potentially being a sort of compiled form generated from some other more user-friendly specification/model. I'd like a nice REBOL specific solution to this issue as well (I want to rebuild codeconscious.com in a more context aware way than the string approach I'm using now). I envisage that I'll use XML (XHTML + something) as a editing space for my page design. The page design will be sucked up and transformed to some sort of REBOL model or dialect. I'll then need a processing model (hopefully the same dialect) that can bind my content to these page designs and finally something to emit the markup. bind my content is so easy to write, but I know it will be hard to design a context model (engine) for page/site generation. Of course there'll be other user-agents (REBOL/View, and new ones) to worry about too. ...dream.........dream dream dream......la la la :^) Regards, Brett.

 [8/13] from: jason:cunliffe:verizon at: 9-Oct-2002 10:46


I've been looking into XSLT a lot recently, thanks to working with Leo. LEO http://personalpages.tds.net/~edream/front.html ..and wondering where REBOL fits in that scheme of things, and thinkin that a native version of Leo written in Rebol woudl be a wionderful thing. In many resepcts I think XSLT does what Brett is dreaming of. Meanwhile my recent research dug up some fascinating papers on the outer limits of XML: Extreme Markup Languages 2002 Stumbled onto some intense headwringing stuff... [warning: take you your vitamins and wear a helmet!] http://alliance.org/papers/extreme02/authors.html Includes some wonderful papers by Wendell Piez Beyond the "descriptive vs. procedural" distinction. Presented at Extreme Markup Languages 2001. http://alliance.org/papers/extreme02/html/2001/Piez01/EML2001Piez01.html Human and Machine Sign Systems. Presented at Extreme Markup Languages 2002. http://alliance.org/papers/extreme02/html/2002/Piez01/EML2002Piez01.html ...and here's something which I think may be very interesting in the future for REBOL LMNL, the Layered Markup and Annotation Language Welcome to the LMNL site. A limen is an entranceway or threshold. LMNL, pronounced "liminal", is an experimental approach to digital text encoding that supports, in SGML/XML terms, overlapping elements (ranges in LMNL) and structured attributes (annotations in LMNL). http://www.lmnl.org/index.html http://www.idealliance.org/papers/extreme02/author-pkg/2002/Tennison02/EML2002Te nnison02.zip ./Jason

 [9/13] from: jason:cunliffe:verizon at: 9-Oct-2002 11:02


ooops sorry bad urls. Please try instead:
> Extreme Markup Languages 2002 > Stumbled onto some intense headwringing stuff... [wear a helmet!] > http://alliance.org/papers/extreme02/authors.html
http://idealliance.org/papers/extreme02/authors.html
> Includes some wonderful papers by > > Wendell Piez > > Beyond the "descriptive vs. procedural" distinction. > Presented at Extreme Markup Languages 2001. > http://alliance.org/papers/extreme02/html/2001/Piez01/EML2001Piez01.html
http://idealliance.org/papers/extreme02/html/2001/Piez01/EML2001Piez01.html
> Human and Machine Sign Systems. > Presented at Extreme Markup Languages 2002. > http://alliance.org/papers/extreme02/html/2002/Piez01/EML2002Piez01.html
http://idealliance.org/papers/extreme02/html/2002/Piez01/EML2002Piez01.html
> ...and here's something which I think is very interesting in the future for > REBOL > > Welcome to the LMNL site. A limen is an entranceway or threshold. LMNL, > pronounced "liminal", is an experimental approach to digital text encoding
that
> supports, in SGML/XML terms, overlapping elements (ranges in LMNL) and > structured attributes (annotations in LMNL). > http://www.lmnl.org/index.html >
http://www.idealliance.org/papers/extreme02/author-pkg/2002/Tennison02/EML2002Te nnison02.zip

 [10/13] from: al:bri:xtra at: 10-Oct-2002 16:32


Here's a site that has another take on "high style" design: http://philip.greenspun.com/panda/ Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [11/13] from: petr:krenzelok:trz:cz at: 10-Oct-2002 12:37


Brett Handley wrote:
>Re HTML. I wonder - is there any point worrying about HTML for new projects. >
Well, Brett - all my project will be Rebol based. Rebol is cool, right? But - one of our "output devices" is gonna be web-portal. What can we do about it? Nothing. I have several complaints here: - rebol cross platform principle is no more valid, sorry. We can hear Linux folks complaints that here or there View doesn't work correctly, not to mention non-existance of MacOSX port. What about Amiga, BeOS, or more valid PS2, Java-based, Tao etc. environments? I KNOW that RT is just few ppl and they can't do it all themselves - but that's just it - the reality! - there would have to be different model of distribution too. Some kind of Rebol player, self-maintanance. Download rebol and provide user with very easy installation. Don't ask him for proxy etc. set-up, if he surely has correct proxy set-up in his Windows setttings etc. I think that with preprocessor and rebol packages, we are relatively near. We just need to solve Rebol's own upgrade capability - which should not be a problem at all. But if Rebol will not be treated as kind of system plug-in - you will not get mass adoption, and in such case, I can't Replace html presentation by Rebol ....
>My impression is that XHTML (XML) would be better as working documents for a >
ah, so you talked about HTML vs XHTML? Well, so forget my above comments, although they are still valid in some point :-)
>designer to manipulate going forward and the XMLC and Baracuda approach of >incorporating symbols into the source document is the right way to go. >However, I really don't know if the tools are supportive of this yet - maybe >a designer can jump in here and comment. I also don't really know if XMLC >and Baracuda have designed their respective embedded symbols simply enough >for an end-user. >
I will look into barracude too to see what it does offer. My friend is far from being profi-level designer. But I work with what I've got - no chance to do web design myself anyway :-)
>I agree with the point about RSP being an unsuitable format for working with >a designer. In my view it is equivalent to a serialised script and therefore
<<quoted lines omitted: 5>>
>as a editing space for my page design. The page design will be sucked up and >transformed to some sort of REBOL model or dialect.
I don't want to invent yet-another-aproach-to-build-websites. I want let designer his/her freedome to use tools which exist - FrontPage, DreamWeaver, etc. So the only suitable path for me is - custom tags, specific API (e.g. dialect), which will be handled on server ...
> I'll then need a >processing model (hopefully the same dialect) that can bind my content to >these page designs and finally something to emit the markup. >
I don't want to bother with emiting markup at all if possible ...
>"bind my content" is so easy to write, but I know it will be hard to design >a context model (engine) for page/site generation. Of course there'll be >other user-agents (REBOL/View, and new ones) to worry about too. > >...dream.........dream dream dream......la la la :^) >
:-)) -pekr-

 [12/13] from: petr:krenzelok:trz:cz at: 10-Oct-2002 12:21


Andrew Martin wrote:
>pekr might be interested in this page: >http://barracuda.enhydra.org/cvs_source/Barracuda/docs/comp/high_level_overv
<<quoted lines omitted: 4>>
>the data from can be easily implemented in Rebol, once one has a adequate >HTML parser. :)
I don't want to parse html :-) My requirements are rather simply. Look, I don't know if it will be even possible, but I just try to find way of how to cooperate with web designer and preserve our both freedom of expression. So - thanks to all of you for input, appreciated ... now I will go and read some stuff, but my idea is for my friend to mark beginning and end of some section, which will mean what lays in between would have to follow some rules (but not too much restrictive), and will be processed by server-side engine (script). Each area requires different things - so it may be pretty simple, or more complex stuff. We will see. I may too, post an example of what I mean, once I have something ready. OTOH I may just come to conclusion, that it is not all that easy, and in such case, I will try to find another way for cooperation, but the last thing I am interested in currently is both - to replace my web-designer, and to let him learn rebol :-)
> <span class="Dir::Get_Data.Groceries.RowCntr">2</span>. ><strong><span class="Dir::Get_Data.Groceries.Item">Peas</span></strong>
<<quoted lines omitted: 3>>
>example above is faulty. I'm under the impression that the presentation >stuff will vanish, as it's replaced? :-\ I could well be wrong.
I don't know. I would go this way: <td width="432" height="21"><font face="Arial" size="2"><strong> Telefon:</strong> 558 357 845</font></td> <td width="432" height="21"><font face="Arial" size="2"><strong> Telefon:</strong><%phone-goes-here!%> 558 357 845<%/phone-goes-here!%></font></td> Well, - look - it can be incorrect aproach, right? I just don't know yet. I thought that I will let designer to do his design in wysiwyg tool, including some real life example of item or more items and "compose" it on server. Server side 'compose :-) So as for your example: <% random/seed now either random true [ %> Have a <b>nice</b> day! <% ] [ %> Have a <b>lousy</b> day! <% ] %> in my case would be: Have a <b><%what-day%>nice<%/what-day%><b> - designer will still get his display right - he will not mess rebol code that way - it is really terrible to have code cutted into pieces :-) - he doesn't have to wait for my code to arrive and to republish with each change I would made - I can adjust server-side engine (script) independently I hope I am more clear of what kind of cooperation I need? I dunno :-) I still made no work in that regard and it can show as plain nonsense, but I need to find out it myself to become "my" experience :-)
>But that's enough rambling from me. >
No rambling - in fact - I take it as some kind of brainstorming. Its just me who should apology for generating so many questions and email on ml ... Thanks once again, -pekr-

 [13/13] from: brett:codeconscious at: 11-Oct-2002 1:09


Hi Petr,
> >I'd like a nice REBOL specific solution to this issue as well (I want to > >rebuild codeconscious.com in a more context aware way than the string > >approach I'm using now). I envisage that I'll use XML (XHTML +
something)
> >as a editing space for my page design. The page design will be sucked up
and
> >transformed to some sort of REBOL model or dialect. > > > I don't want to invent yet-another-aproach-to-build-websites. I want let > designer his/her freedome to use tools which exist - FrontPage, > DreamWeaver, etc. So the only suitable path for me is - custom tags, > specific API (e.g. dialect), which will be handled on server ...
Yes were are talking about the exact same goals, although I am interested in various ways to build websites. I think integrating with a designer tool is important. I like the idea of the dialect/api/modules. Look for opportunities that the tools offer. For example, I know that Dreamweaver has a couple of reuse mechanisms built in (eg. library). Frontpage probably would too. Such library entries could possibly be more comfortable for your designer to use than manually entering special embedded codes. I can't remember now, but the library entries may also provide a sort of example view. Don't forget SSI (server side includes) in you considerations.
> > I'll then need a > >processing model (hopefully the same dialect) that can bind my content to > >these page designs and finally something to emit the markup. > > > I don't want to bother with emiting markup at all if possible ...
Hmm, on the other hand maybe we are not talking about the same goals :^) I guess a question you need to ask yourself is this - is your API/dialect going to "understand" the markup that the designer has created around it so that relates to specific tags as parent or child etc (some sort of document model) or is it going to simply treat the markup the designer creates as simply as a string like the new build-markup function or RSP does? I don't know if there are other possibilities. I doubt there's a magic solution - more likely a continum of sophistication vs a set of requirements :^) Regards, Brett.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted