Re: [WebDNA] maybe silly suggestion? [founditems]
This WebDNA talk-list message is from 2015
It keeps the original formatting.
numero = 111925
interpreted = N
texte = All great food for thought (as usual) Brian=85 and your example below =takes clues from OOP (in the context of what we can deliver with WebDNA =anyway).These ideals are harking on more =93advanced=94 programming concepts =(encapsulation, inheritance, etc..) which not everyone will get, =especially those that have not worked in other languages. The idea is =not only separation of code, but encapsulation of data, code-reuse, =etc..=20Anytime this sort of thing is discussed, I think it needs to be thought =about in the context of standardizedprogramming styles (MVC, OOP features, etc.)=85 especially for =attracting existing developers to WebDNA.Unfortunately, understanding these concepts to the point of anything =that resembles a good implimentation is just not something WSC is =equipped to do at the moment (no offense to WSC).=20Keeping programming styles out of it and the discussion limited to =saving found item sets=85I personally think, since there currently exists workarounds, WSC has =enough higher (more easily understood) priorities that would keep them =busy until they can hire the right people they need to make steps that =involve these kinds of changes for =93contemporary programming ideals=94.=20=Right now, your Table example, or even writing data sets to a file or a =variable, works.=20Personally, I get excited when people like you (and Brian Burton, etc..) =start commenting on the forum. ;-) Now we just need to hear from people =like John peacock, Bob minor, Jay, John, grant, scott, etc.. All you =guys helped me advance in server-side web programming in some fashion.=20=my .02=A2DonovanJust a side note.. I certainly think that OOP (and even MVC) is not =necessarily necessary in most of the projects being created in the Web =Programming world. Many would say different... especially .NET schooled =people. ;-) But it is over-kill in many cases IMO. Sometimes you just =want the ability to easily display and edit some data from a table. ;-)On Jan 15, 2015, at 1:41 PM, iPhonzie@G
wrote:> Chris -> I think I addressed your question briefly before:>=20> "Internal to the WebDNA engine, this may well leverage the same code =as [table] - the [savefounditems] could create a private table and =[listfounditems] could execute a generic unranked search of that table=94>=20> So a saved found item set would essentially be a private table, that =the engine has access to but the developer can only access via =[listfounditems].>=20> I do similar things with currently available syntax in some cases, but =it=92s messy and could be much more efficient done in the WebDNA engine.>=20> Here=92s the example using tables (sans performance optimizations):>=20> [table name=3Dnamepeople&fields=3D[listfields =people.db][fieldname],[/listfields]][/table]> [search =db=3Dpeople.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1=&max=3D25]> [if [numfound]=3D0][then]> [DO ERROR STUFF]> [/then][else]> [founditems]> [append table=3Dnamepeople][listfields people.db][showif =[index]>1]&[/showif][fieldname]=3D[url][interpret][[fieldname]][/interpret=][/url][/listfields][/append]> [/founditems]> [/else][/if]> [/search]>=20> [table name=3Dcitypeople&fields=3D[listfields =people.db][fieldname],[/listfields]][/table]> [search =db=3Dpeople.db&eqcitydatarq=3D[city]&allhit=3D1&lastnamesort=3D1&firstname=sort=3D2&max=3D25]> [if [numfound]=3D0][then]> [DO ERROR STUFF]> [/then][else]> [founditems]> [append table=3Dcitypeople][listfields people.db][showif =[index]>1]&[/showif][fieldname]=3D[url][interpret][[fieldname]][/interpret=][/url][/listfields][/append]> [/founditems]> [/else][/if]> [/search]>=20> [function name=3Dshowpeople]> > [search =table=3D[params_string]&nefirstnamedatarq=3D_bogus_&rank=3Doff]> [founditems]> > | [index]] | > [firstname] | > [lastname] | > [city] | > [any field in people.db] | >
> [/founditems]> [/search]>
> [/function]>=20> =85>=20> People named [firstname]:> [showpeople namepeople]>=20> People from [city]:> [showpeople citypeople]>=20>=20> =97 Brian Fries>=20> On January 15, 2015 at 11:16:15 AM, christophe.billiottet@webdna.us =(christophe.billiottet@webdna.us) wrote:>=20>> It seems to me a little complicated: let=92s take your example=20>>=20>> [search =people.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1&max=3D=25]=20>> [if [numfound]=3D0][then]=20>> [DO ERROR STUFF]=20>> [/then][else]=20>> [savefounditems namepeople]=20>> [/else][/if]=20>> [/search]=20>>=20>>=20>> This is fine for a two columns database, but if the database includes =10 columns, is [savefounditems] supposed to store everything? what =should be the format of the data stored? how would it be sorted by =[showpeople namepeople]=20>>=20>> we could do that instead of [savefounditems namepeople]:=20>>=20>> [text]name[index]=3D[firstname],[/text]=20>>=20>>=20>> which will give us=20>>=20>> name1=3DJim,name2=3DBob,name3=3DChris,name4=3DBrian=20>>=20>>=20>>=20>> - chris=20>>=20>>=20>>=20>>=20>>=20>>=20>>=20>>=20>> > On 15 Jan 2015, at 21:27, iPhonzie@G wrote:=20>> >=20>> > I really like the idea of [savefounditems] / [displayfounditems] =(or maybe [listfounditems] for consistency with other looping context =names).=20>> >=20>> > Chris, if your [sto] concept is about persistent globally available =values, then I don=92t think that applies to the need here - the saved =results generally only need to persist for the life of the current page.=20=>> >=20>> > Internal to the WebDNA engine, this may well leverage the same code =as [table] - the [savefounditems] could create a private table and =[listfounditems] could execute a generic unranked search of that table=20=>> >=20>> > With [savefounditems], you could save several sets of searches on =the same database, such as =93peoplenameddave=94 and ==93peoplefromalbuquerque=94, gathered at the top of your page with =appropriate error responses, etc. Later in the display portion of your =page you could call a common function to display HTML tables of Daves =and Albequerqians.=20>> >=20>> > So, given a page with formvariables =93firstname=94 and =93city=94, =the top of your code could do:=20>> >=20>> > [search =people.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1&max=3D=25]=20>> > [if [numfound]=3D0][then]=20>> > DO ERROR STUFF]=20>> > [/then][else]=20>> > [savefounditems namepeople]=20>> > [/else][/if]=20>> > [/search]=20>> >=20>> > [search =people.db&eqcitydatarq=3D[city]&allhit=3D1&lastnamesort=3D1&firstnamesort=3D=2&max=3D25]=20>> > [if [numfound]=3D0][then]=20>> > DO ERROR STUFF]=20>> > [/then][else]=20>> > [savefounditems citypeople]=20>> > [/else][/if]=20>> > [/search]=20>> >=20>> > [function name=3Dshowpeople]=20>> > =20>> > [listfounditems [params_string]]=20>> > =| [index]] | [firstname] | [lastname] | [city] | [any field in people.db] |
=20>> > [/listfounditems]=20>> >
=20>> > [/function]=20>> >=20>> > Later in the display code you could do:=20>> >=20>> > People named [firstname]:=20>> > [showpeople namepeople]=20>> >=20>> > People from [city]:=20>> > [showpeople citypeople]=20>> >=20>> >=20>> > =97 Brian Fries=20>> >=20>> > On January 15, 2015 at 9:55:07 AM, Terry Wilson =(terry@terryfic.com) wrote:=20>> >=20>> >> Or just put the search parameters in a variable up top to retrieve =as needed with showifs. This is quite handy for repurposing found items =loops, such as a nicely formatted table of info that is sorted by =various fields (just discussed this a few days ago). This has the added =benefit of letting you keep constants like eventdatetype=3Ddate, max=3D25,= etc in the actual search code to keep your parameters easier to read =and manage. This would certainly put your controller logic separate from =your display code.=20>> >>=20>> >> [showif =[somesearch]=3Dt][text]searchforwhat=3Ddb=3Dallthethings.db&blahblahblah[/=text][/showif]=20>> >> [showif =[someothersearch]=3Dt][text]searchforwhat=3Ddb=3Dallthethings.db&blahblahb=lah[/text][/showif]=20>> >>=20>> >> [search [searchforwhat]&max=3D25&lastnamesort=3D1]=20>> >>=20>> >> >=20>> >> >=20>> >> > On Jan 14, 2015, at 2:57 PM, Brian Burton =wrote:=20>> >> >=20>> >> >> to help separate my controller logic from my display code it =would be awesome to have a shortcut like:=20>> >> >> [search db=3Dallthethings.db&blahblahblah][savefounditems =name=3Dpeoplenameddave][/search]=20>> >> >>=20>> >> >>=20>> >> >>=20>> >> >>=20>> >> >> then later in the page, where i=92m rendering the html=20>> >> >> [displayfounditems use=3Dpeoplenameddave] html things =[/displayfounditems]=20>> >> >>=20>> >> >>=20>> >> >>=20>> >> >> I know it looks like it=92s not saving that much code, but I =can see switching which search I want in the controller, and still being =able to use a universal founditems loop lower in the code. Also the =ability to reuse search results (if needed) without doing the same =search again.=20>> >> >>=20>> >> >> ok, feel free to start telling me how you can do this with a =table (you=92re missing the point) or how we don=92t need more tags or =whatever :)=20>> >> >>=20>> >> >>=20>> >> >> -Brian B. Burton=20>> >>=20>> > --------------------------------------------------------- This =message is sent to you because you are subscribed to the mailing list . =To unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us=20>>=20>> ---------------------------------------------------------=20>> This message is sent to you because you are subscribed to=20>> the mailing list .=20>> To unsubscribe, E-mail to: =20>> archives: http://mail.webdna.us/list/talk@webdna.us=20>> Bug Reporting: support@webdna.us=20> --------------------------------------------------------- This message =is sent to you because you are subscribed to the mailing list . To =unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us
Associated Messages, from the most recent to the oldest:
All great food for thought (as usual) Brian=85 and your example below =takes clues from OOP (in the context of what we can deliver with WebDNA =anyway).These ideals are harking on more =93advanced=94 programming concepts =(encapsulation, inheritance, etc..) which not everyone will get, =especially those that have not worked in other languages. The idea is =not only separation of code, but encapsulation of data, code-reuse, =etc..=20Anytime this sort of thing is discussed, I think it needs to be thought =about in the context of standardizedprogramming styles (MVC, OOP features, etc.)=85 especially for =attracting existing developers to WebDNA.Unfortunately, understanding these concepts to the point of anything =that resembles a good implimentation is just not something WSC is =equipped to do at the moment (no offense to WSC).=20Keeping programming styles out of it and the discussion limited to =saving found item sets=85I personally think, since there currently exists workarounds, WSC has =enough higher (more easily understood) priorities that would keep them =busy until they can hire the right people they need to make steps that =involve these kinds of changes for =93contemporary programming ideals=94.=20=Right now, your Table example, or even writing data sets to a file or a =variable, works.=20Personally, I get excited when people like you (and Brian Burton, etc..) =start commenting on the forum. ;-) Now we just need to hear from people =like John peacock, Bob minor, Jay, John, grant, scott, etc.. All you =guys helped me advance in server-side web programming in some fashion.=20=my .02=A2DonovanJust a side note.. I certainly think that OOP (and even MVC) is not =necessarily necessary in most of the projects being created in the Web =Programming world. Many would say different... especially .NET schooled =people. ;-) But it is over-kill in many cases IMO. Sometimes you just =want the ability to easily display and edit some data from a table. ;-)On Jan 15, 2015, at 1:41 PM, iPhonzie@G wrote:> Chris -> I think I addressed your question briefly before:>=20> "Internal to the WebDNA engine, this may well leverage the same code =as [table] - the [savefounditems] could create a private table and =[listfounditems] could execute a generic unranked search of that table=94>=20> So a saved found item set would essentially be a private table, that =the engine has access to but the developer can only access via =[listfounditems].>=20> I do similar things with currently available syntax in some cases, but =it=92s messy and could be much more efficient done in the WebDNA engine.>=20> Here=92s the example using tables (sans performance optimizations):>=20> [table name=3Dnamepeople&fields=3D[listfields =people.db][fieldname],[/listfields]][/table]> [search =db=3Dpeople.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1=&max=3D25]> [if [numfound]=3D0][then]> [DO ERROR STUFF]> [/then][else]> [founditems]> [append table=3Dnamepeople][listfields people.db][showif =[index]>1]&[/showif][fieldname]=3D[url][interpret][[fieldname]][/interpret=][/url][/listfields][/append]> [/founditems]> [/else][/if]> [/search]>=20> [table name=3Dcitypeople&fields=3D[listfields =people.db][fieldname],[/listfields]][/table]> [search =db=3Dpeople.db&eqcitydatarq=3D[city]&allhit=3D1&lastnamesort=3D1&firstname=sort=3D2&max=3D25]> [if [numfound]=3D0][then]> [DO ERROR STUFF]> [/then][else]> [founditems]> [append table=3Dcitypeople][listfields people.db][showif =[index]>1]&[/showif][fieldname]=3D[url][interpret][[fieldname]][/interpret=][/url][/listfields][/append]> [/founditems]> [/else][/if]> [/search]>=20> [function name=3Dshowpeople]> > [search =table=3D[params_string]&nefirstnamedatarq=3D_bogus_&rank=3Doff]> [founditems]> > | [index]] | > [firstname] | > [lastname] | > [city] | > [any field in people.db] | >
> [/founditems]> [/search]>
> [/function]>=20> =85>=20> People named [firstname]:> [showpeople namepeople]>=20> People from [city]:> [showpeople citypeople]>=20>=20> =97 Brian Fries>=20> On January 15, 2015 at 11:16:15 AM, christophe.billiottet@webdna.us =(christophe.billiottet@webdna.us) wrote:>=20>> It seems to me a little complicated: let=92s take your example=20>>=20>> [search =people.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1&max=3D=25]=20>> [if [numfound]=3D0][then]=20>> [DO ERROR STUFF]=20>> [/then][else]=20>> [savefounditems namepeople]=20>> [/else][/if]=20>> [/search]=20>>=20>>=20>> This is fine for a two columns database, but if the database includes =10 columns, is [savefounditems] supposed to store everything? what =should be the format of the data stored? how would it be sorted by =[showpeople namepeople]=20>>=20>> we could do that instead of [savefounditems namepeople]:=20>>=20>> [text]name[index]=3D[firstname],[/text]=20>>=20>>=20>> which will give us=20>>=20>> name1=3DJim,name2=3DBob,name3=3DChris,name4=3DBrian=20>>=20>>=20>>=20>> - chris=20>>=20>>=20>>=20>>=20>>=20>>=20>>=20>>=20>> > On 15 Jan 2015, at 21:27, iPhonzie@G wrote:=20>> >=20>> > I really like the idea of [savefounditems] / [displayfounditems] =(or maybe [listfounditems] for consistency with other looping context =names).=20>> >=20>> > Chris, if your [sto] concept is about persistent globally available =values, then I don=92t think that applies to the need here - the saved =results generally only need to persist for the life of the current page.=20=>> >=20>> > Internal to the WebDNA engine, this may well leverage the same code =as [table] - the [savefounditems] could create a private table and =[listfounditems] could execute a generic unranked search of that table=20=>> >=20>> > With [savefounditems], you could save several sets of searches on =the same database, such as =93peoplenameddave=94 and ==93peoplefromalbuquerque=94, gathered at the top of your page with =appropriate error responses, etc. Later in the display portion of your =page you could call a common function to display HTML tables of Daves =and Albequerqians.=20>> >=20>> > So, given a page with formvariables =93firstname=94 and =93city=94, =the top of your code could do:=20>> >=20>> > [search =people.db&eqfirstnamedatarq=3D[firstname]&allhit=3D1&lastnamesort=3D1&max=3D=25]=20>> > [if [numfound]=3D0][then]=20>> > DO ERROR STUFF]=20>> > [/then][else]=20>> > [savefounditems namepeople]=20>> > [/else][/if]=20>> > [/search]=20>> >=20>> > [search =people.db&eqcitydatarq=3D[city]&allhit=3D1&lastnamesort=3D1&firstnamesort=3D=2&max=3D25]=20>> > [if [numfound]=3D0][then]=20>> > DO ERROR STUFF]=20>> > [/then][else]=20>> > [savefounditems citypeople]=20>> > [/else][/if]=20>> > [/search]=20>> >=20>> > [function name=3Dshowpeople]=20>> > =20>> > [listfounditems [params_string]]=20>> > =| [index]] | [firstname] | [lastname] | [city] | [any field in people.db] |
=20>> > [/listfounditems]=20>> >
=20>> > [/function]=20>> >=20>> > Later in the display code you could do:=20>> >=20>> > People named [firstname]:=20>> > [showpeople namepeople]=20>> >=20>> > People from [city]:=20>> > [showpeople citypeople]=20>> >=20>> >=20>> > =97 Brian Fries=20>> >=20>> > On January 15, 2015 at 9:55:07 AM, Terry Wilson =(terry@terryfic.com) wrote:=20>> >=20>> >> Or just put the search parameters in a variable up top to retrieve =as needed with showifs. This is quite handy for repurposing found items =loops, such as a nicely formatted table of info that is sorted by =various fields (just discussed this a few days ago). This has the added =benefit of letting you keep constants like eventdatetype=3Ddate, max=3D25,= etc in the actual search code to keep your parameters easier to read =and manage. This would certainly put your controller logic separate from =your display code.=20>> >>=20>> >> [showif =[somesearch]=3Dt][text]searchforwhat=3Ddb=3Dallthethings.db&blahblahblah[/=text][/showif]=20>> >> [showif =[someothersearch]=3Dt][text]searchforwhat=3Ddb=3Dallthethings.db&blahblahb=lah[/text][/showif]=20>> >>=20>> >> [search [searchforwhat]&max=3D25&lastnamesort=3D1]=20>> >>=20>> >> >=20>> >> >=20>> >> > On Jan 14, 2015, at 2:57 PM, Brian Burton =wrote:=20>> >> >=20>> >> >> to help separate my controller logic from my display code it =would be awesome to have a shortcut like:=20>> >> >> [search db=3Dallthethings.db&blahblahblah][savefounditems =name=3Dpeoplenameddave][/search]=20>> >> >>=20>> >> >>=20>> >> >>=20>> >> >>=20>> >> >> then later in the page, where i=92m rendering the html=20>> >> >> [displayfounditems use=3Dpeoplenameddave] html things =[/displayfounditems]=20>> >> >>=20>> >> >>=20>> >> >>=20>> >> >> I know it looks like it=92s not saving that much code, but I =can see switching which search I want in the controller, and still being =able to use a universal founditems loop lower in the code. Also the =ability to reuse search results (if needed) without doing the same =search again.=20>> >> >>=20>> >> >> ok, feel free to start telling me how you can do this with a =table (you=92re missing the point) or how we don=92t need more tags or =whatever :)=20>> >> >>=20>> >> >>=20>> >> >> -Brian B. Burton=20>> >>=20>> > --------------------------------------------------------- This =message is sent to you because you are subscribed to the mailing list . =To unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us=20>>=20>> ---------------------------------------------------------=20>> This message is sent to you because you are subscribed to=20>> the mailing list .=20>> To unsubscribe, E-mail to: =20>> archives: http://mail.webdna.us/list/talk@webdna.us=20>> Bug Reporting: support@webdna.us=20> --------------------------------------------------------- This message =is sent to you because you are subscribed to the mailing list . To =unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us
Donovan Brooke
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Bad creator codes which cause access denied error message (1997)
Moving Files (2000)
Sorting Date (2004)
PARAMETER vs. OPERATOR (was The BUG is BACK ...) (1998)
The beginning (1997)
problems with 2 tags (1997)
Re:Change WebDNA-Talk Mail due to no digest for 1wk (1997)
Bug or syntax error on my part? (1997)
[WebDNA] Cicada - WebDNA_CICADA_6.1.b02 - gratz and request...! (2009)
Re:What file? (1997)
Logging purchases (1997)
Trouble serving graphics on protected templates (1998)
Popup Menu Options (1998)
[WebDNA] Triggers.db wiped completely blank (2011)
'does not contain' operator needed ... (1997)
search for non-unique question (2001)
[ShowNext] feature in 2.0 (1997)
Append is limiting the Number of Characters written to db (fwd) (1998)
WebCat 5 Intranet Question (2003)
Large Database Options? (1999)