|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
My turn now - props and questionsI finally have an opportunity to not just play with the Knop demo, but to use it for a practical purpose within a project.
I started from the very beginning with a fresh install of Knop from source via SVN on Google Code. It all went without a hitch thanks to the nice docs. Next I installed the Examples from Google into webroot/Examples. Those all went well, except for the 4-grid.lasso example. Data displays, but sorting and navigating have links that don't appear to function properly. I assume there is a conflict between the Examples and the default Knop installation? Specific issue: http://knop/Examples/4-grid.lasso Has the First Name column link of: http://knop/Examples/?-sort=firstname And the paging of records: Next >> http://knop/Examples/-page=2 Last >| http://knop/Examples/-page=3 Note that the default Demo installation of Knop and its navigation works properly. Next I have a few questions that I couldn't easily find in the Nabble list archive. Record Locking ---------------------------- To use Knop's record locking, one should add a lockfield to the table. However I am not clear about the default record locking procedure used in Knop, and how to implement it. Is it documented somewhere (other than trying to parse the code and make sense of it from within knop.lasso itself)? I would like record locking to be done by user, and to have a variable expiration time (between 5-120 minutes). Additionally if the user abandons modifying a record--either by cancel, navigating elsewhere in the application, logging out or just walking away from the computer--then the record lock should be removed. Here's sample sql for altering a table accordingly. alter table `mytable` add column `moddate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, add column `keyfield` varchar(255) not null, add column `lockfield` varchar(255) not null, add index `keyfield` (`keyfield`), add index `lockfield` (lockfield) ; I found some references to record locking in the knop_database API docs (help.lasso). -> clearlocks -> deleterecord -> getrecord -> lockfield -> lockvalue -> lockvalue_encrypted -> oncreate -> saverecord Form Fields and Fieldsets ---------------------------- I didn't see how to implement the following input parameters. -maxlength -tabindex -accesskey Also I wasn't clear on how to implement multiple fieldsets in a given form. I found how to do one fieldset per form: $form->renderform(-legend); Is this an example of multi-fieldsets per form? $form->addfield(-type=fieldset(-value='Shipping Address')); $form->addfield(-type=fieldset(-value='Billing Address')); User Password Recovery/Reset ---------------------------- I remember this being discussed, but I don't know whether any implementation was created. Does this critter exist? --steve -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <web@...> <http://www.StevePiercy.com/> -- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@...>. To unsubscribe, E-mail to: <knop-off@...> Send administrative queries to <knop-request@...> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/ |
|
|
Re: My turn now - props and questionsHi Steve!
Welcome aboard! I'm not going to attempt to answer all of your questions. I'll leave the trickier stuff to Johan. So this is only a semi help. 20 mar 2009 kl. 10.19 skrev Steve Piercy - Web Site Builder: > I started from the very beginning with a fresh install of Knop from > source via SVN on Google Code. It all went without a hitch thanks > to the nice docs. > > Next I installed the Examples from Google into webroot/Examples. > Those all went well, except for the 4-grid.lasso example. Data > displays, but sorting and navigating have links that don't appear to > function properly. I assume there is a conflict between the > Examples and the default Knop installation? > > Specific issue: > http://knop/Examples/4-grid.lasso > > Has the First Name column link of: > http://knop/Examples/?-sort=firstname > > And the paging of records: > Next >> > http://knop/Examples/-page=2 > Last >| > http://knop/Examples/-page=3 > > Note that the default Demo installation of Knop and its navigation > works properly. The links are constructed from the nav object. I haven't tried the Example files myself so I can't vouch for their function. But it looks like the nav object is expecting the 4-grid.lasso to be the default page for the Example folder. Double check the nav object to make sure it's configured the right way. > Next I have a few questions that I couldn't easily find in the > Nabble list archive. > > Record Locking > ---------------------------- > To use Knop's record locking, one should add a lockfield to the > table. However I am not clear about the default record locking > procedure used in Knop, and how to implement it. Is it documented > somewhere (other than trying to parse the code and make sense of it > from within knop.lasso itself)? > > I would like record locking to be done by user, and to have a > variable expiration time (between 5-120 minutes). Additionally if > the user abandons modifying a record--either by cancel, navigating > elsewhere in the application, logging out or just walking away from > the computer--then the record lock should be removed. > > Here's sample sql for altering a table accordingly. > > alter table `mytable` > add column `moddate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP > ON UPDATE CURRENT_TIMESTAMP, > add column `keyfield` varchar(255) not null, > add column `lockfield` varchar(255) not null, > add index `keyfield` (`keyfield`), > add index `lockfield` (lockfield) > ; > > I found some references to record locking in the knop_database API > docs (help.lasso). > -> clearlocks > -> deleterecord > -> getrecord > -> lockfield > -> lockvalue > -> lockvalue_encrypted > -> oncreate > -> saverecord Record locking is done automatically by the database object if you specify a lockfield in the database object: var('dExample' = knop_database( -database = $siteDB, -table = 'example', -username = $user, -password = $userpw, -keyfield = 'keyfield', -lockfield = 'lockfield')); This is then activated when the record is fetched: $dExample -> getrecord( ($fExample -> keyvalue), -lock, -user = $session_user -> userid); I don't know how to set the lock time. Haven't missed it either. There's some magic going on to unlock the field that I have no idea on how it happens. That's why you have to wait for Johans answers. :-) > > Form Fields and Fieldsets > ---------------------------- > I didn't see how to implement the following input parameters. > > -maxlength > -tabindex > -accesskey If you want input field params that's not supported directly by the form object you can use the -raw param. $fExample -> addfield( -type = 'text', -name = 'lastname', -dbfield = 'CSTMR_lastname', -label = $lang_ui -> lastname, -raw = 'maxlength="20"', -size=40); > Also I wasn't clear on how to implement multiple fieldsets in a > given form. I found how to do one fieldset per form: > > $form->renderform(-legend); That's to display only the legend part. But if you want one fieldset with a legend you can just set it in the form object: var( 'fExample' = knop_form( -formaction = ($nav -> url( 'demo')), -method = 'post', -database = $dExample, -actionpath = 'demo/edit', -legend = $lang_ui -> editdemo)); // This will create a fieldset with legend when you render the form. $fExample -> renderform( -start); > Is this an example of multi-fieldsets per form? > > $form->addfield(-type=fieldset(-value='Shipping Address')); > $form->addfield(-type=fieldset(-value='Billing Address')); Close. This is one way. Adding a legend will close the previous fieldset and add a new one: $fExample -> addfield( -type='legend', -value = 'My new fieldset'); or: $fExample -> addfield( -type='fieldset', -value = 'My new fieldset'); > User Password Recovery/Reset > ---------------------------- > I remember this being discussed, but I don't know whether any > implementation was created. Does this critter exist? As far as I know, no, it doesn't. I made my own implementation to deal with this. Code is kinda convoluted so I'm not prepared to go public, but I'm open for questions. :-) HDB Jolle -- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@...>. To unsubscribe, E-mail to: <knop-off@...> Send administrative queries to <knop-request@...> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/ |
|
|
Re: My turn now - props and questionsAt 12.32 +0100 2009-03-20, Jolle Carlestam wrote:
>I don't know how to set the lock time. Haven't missed it either. >There's some magic going on to unlock the field that I have no idea on how it happens. That's why you have to wait for Johans answers. :-) The lock is active for 30 minutes and this is currently hardcoded, but can be accessed (and changed accordingly) through knop_dabatase -> 'lock_expires'. It's specified in seconds. -- Johan Sölve [FSA Member, Lasso Partner] Web Application/Lasso/FileMaker Developer MONTANIA SOFTWARE & SOLUTIONS http://www.montania.se mailto:joh-n@... (spam-safe email address, replace '-' with 'a') -- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@...>. To unsubscribe, E-mail to: <knop-off@...> Send administrative queries to <knop-request@...> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/ |
|
|
Re: My turn now - props and questionsNice to see you're taking another stab at this!
At 02.19 -0700 2009-03-20, Steve Piercy - Web Site Builder wrote: >I started from the very beginning with a fresh install of Knop from source via SVN on Google Code. It all went without a hitch thanks to the nice docs. > >Next I installed the Examples from Google into webroot/Examples. Those all went well, except for the 4-grid.lasso example. Data displays, but sorting and navigating have links that don't appear to function properly. I assume there is a conflict between the Examples and the default Knop installation? > >Specific issue: >http://knop/Examples/4-grid.lasso > >Has the First Name column link of: >http://knop/Examples/?-sort=firstname > >And the paging of records: >Next >> >http://knop/Examples/-page=2 >Last >| >http://knop/Examples/-page=3 The Examples merely serve as specific illustrations for the whitepaper. They are not intended as fully functional implementations. So the links in 4-grid.lasso will most likely not work. You should concentrate on the demo package for a fully functional demo. >Record Locking >---------------------------- >To use Knop's record locking, one should add a lockfield to the table. However I am not clear about the default record locking procedure used in Knop, and how to implement it. Is it documented somewhere (other than trying to parse the code and make sense of it from within knop.lasso itself)? Not sure if it has been documented. The record locking is a hybrid between optimistic and pessimistic locking. This is totally inspired (i.e. stolen) from PageBlocks. For the duration of the lock (30 minutes), the user that claimed a lock has exclusive rights to the record. If another user loads the record using getrecord during that time, knop_database -> error_code will indicate that the record is already locked and it will not be possible to save the record. This is pessimistic locking. (error code 7010, see knop_base). After the lock has expired, the user that claimed the lock can still save his record as long as nobody else has claimed a lock for the record, but anyone is free to claim a new lock for the record and in that case the first user's lock is not valid anymore and he will not be able to save the record. But as long as nobody else has locked the record, the first user is free to save the record. This is (almost) optimistic locking. For a deeper explanation please see the excellent PageBlocks documentation. >I would like record locking to be done by user, and to have a variable expiration time (between 5-120 minutes). Additionally if the user abandons modifying a record--either by cancel, navigating elsewhere in the application, logging out or just walking away from the computer--then the record lock should be removed. No record locks will be actively removed by themselves. Since locks expire it's not really needed to remove them. When a user navigates to a list of records instead of saving a locked record, it's advisable to call ->clearlocks to let other users lock a record that was locked previously. >Form Fields and Fieldsets >---------------------------- >I didn't see how to implement the following input parameters. > > -maxlength > -tabindex > -accesskey Jolle covered this just right. >Also I wasn't clear on how to implement multiple fieldsets in a given form. I found how to do one fieldset per form: > > $form->renderform(-legend); More like $form->renderform(-legend='Shipping address'); This will create a fieldset around the rendered fields and output the legend You have three ways to work with fieldsets for a form. 1. When creating the form object you can specify -fieldset and/or -legend. Specifying just -fieldset will wrap the form in a fieldset with an empty legend (legend is always required in a fieldset according to html specs). Specifying a -egend will of course also create a fieldset. 2. When rendering the form you can specify -legend. This will create a fieldset and a legend for the rendered fields. 3. You can explicitly add a fieldset to the form object using ->addfield, just as other field types. A fieldset will be closed when adding another one, and you can close a fieldset explicitly wihtout opening a new one through ->addfield (-type='fieldset', -value=false); >Is this an example of multi-fieldsets per form? > > $form->addfield(-type=fieldset(-value='Shipping Address')); > $form->addfield(-type=fieldset(-value='Billing Address')); Almost, but rather like this > $form->addfield(-type=fieldset, -value='Shipping Address'); > $form->addfield(-type=fieldset, -value='Billing Address'); > >User Password Recovery/Reset >---------------------------- >I remember this being discussed, but I don't know whether any implementation was created. Does this critter exist? I think password reset functionality is too application specific to be covered by Knop. It's more like a module that can be developed and shared between Knop users but I don't see how it can be built into the Knop core. -- Johan Sölve [FSA Member, Lasso Partner] Web Application/Lasso/FileMaker Developer MONTANIA SOFTWARE & SOLUTIONS http://www.montania.se mailto:joh-n@... (spam-safe email address, replace '-' with 'a') -- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@...>. To unsubscribe, E-mail to: <knop-off@...> Send administrative queries to <knop-request@...> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/ |
|
|
Re: My turn now - props and questionsAt 12.32 +0100 2009-03-20, Jolle Carlestam wrote:
>>Also I wasn't clear on how to implement multiple fieldsets in a given form. I found how to do one fieldset per form: >> >> $form->renderform(-legend); > >That's to display only the legend part. But if you want one fieldset with a legend you can just set it in the form object: There's no such thing as "only the legend", neither in Knop nor in html spes. If Knop outputs a legend, it also creates a fieldset. -- Johan Sölve [FSA Member, Lasso Partner] Web Application/Lasso/FileMaker Developer MONTANIA SOFTWARE & SOLUTIONS http://www.montania.se mailto:joh-n@... (spam-safe email address, replace '-' with 'a') -- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@...>. To unsubscribe, E-mail to: <knop-off@...> Send administrative queries to <knop-request@...> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/ |
|
|
Re: My turn now - props and questions21 mar 2009 kl. 21.03 skrev Johan Solve:
>>> $form->renderform(-legend); >> >> That's to display only the legend part. But if you want one >> fieldset with a legend you can just set it in the form object: > > There's no such thing as "only the legend", neither in Knop nor in > html spes. If Knop outputs a legend, it also creates a fieldset. Muddy formulating. What I meant was that Knop_form will only render the legend/fieldset part of the form, not the rest. If you set a legend when creating the form it will get rendered without specifically calling it. I tend to use; $fExample -> renderform( -start); $fExample -> renderform( -excludetype = array( 'submit', 'reset')); $fExample -> renderform( -type = array( 'submit', 'reset')); $fExample -> renderform( -end); This renders the fieldset andlegend if I create one in the form object. Dividing it is so that I can have different formatting fo the different parts. Also allows me to insert other stuff within the form. I suspect a simple: $fExample -> renderform; would work as well. HDB Jolle -- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@...>. To unsubscribe, E-mail to: <knop-off@...> Send administrative queries to <knop-request@...> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/ |
|
|
Re: My turn now - props and questionsAt 23.22 +0100 2009-03-21, Jolle Carlestam wrote:
>21 mar 2009 kl. 21.03 skrev Johan Solve: > >>>> $form->renderform(-legend); >>> >>>That's to display only the legend part. But if you want one fieldset with a legend you can just set it in the form object: >> >>There's no such thing as "only the legend", neither in Knop nor in html spes. If Knop outputs a legend, it also creates a fieldset. > >Muddy formulating. What I meant was that Knop_form will only render the legend/fieldset part of the form, not the rest. That's not true. It will render the entire form, adding a surrounding fieldset around it. -- Johan Sölve [FSA Member, Lasso Partner] Web Application/Lasso/FileMaker Developer MONTANIA SOFTWARE & SOLUTIONS http://www.montania.se mailto:joh-n@... (spam-safe email address, replace '-' with 'a') -- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@...>. To unsubscribe, E-mail to: <knop-off@...> Send administrative queries to <knop-request@...> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/ |
| Free embeddable forum powered by Nabble | Forum Help |