User Tools

Site Tools


pracro:pracro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
pracro:pracro [2008/11/25 08:46] devapracro:pracro [2011/12/02 08:32] deva
Line 1: Line 1:
 ======Pracro - Praxis Macro system ====== ======Pracro - Praxis Macro system ======
-====Roadmap====+=====New concepts===== 
 +[[pracro:post-commit-hook]]\\ 
 +[[pracro:course]]\\ 
 +[[pracro:praxisd]]\\ 
 +[[pracro:acl]]\\ 
 +[[pracro:template_concept_redesign]] 
 +=====Upgrade from old to new database structure===== 
 +Remove duplicate entries from fieldnames table: 
 +<code> 
 +delete from fieldnames where ctid not in (select max(dup.ctid) from fieldnames as dup group by dup.name); 
 +</code> 
 + 
 +Remove duplicates from fields: 
 +<code> 
 +delete from fields where ctid not in (select max(dup.ctid) from fields as dup group by dup.transaction, dup.name, dup.value); 
 +</code> 
 + 
 +<code> 
 +ALTER TABLE transactions RENAME TO transactions_old; 
 +</code> 
 + 
 +<code> 
 +CREATE TYPE session_status AS ENUM ('active', 'idle', 'committed'); 
 +</code> 
 +=====Roadmap=====
 See the [[pracro:roadmap]] page for details on how and when releases are made. See the [[pracro:roadmap]] page for details on how and when releases are made.
 +
 +=====Widgets=====
 +See the [[pracro:widgets]] page for design details on new widgets.
 +
 +=====Database=====
 +See the [[pracro:database]] page for database layout notes.
 +
 +=====Random Stuff=====
 +[[Devas corner]]\\
 +[[Senators corner]]
 +
 +====Open/Close logic====
 +GOALS:
 +  * Only one open macro at any point of time.
 +  * Not possible to close an unchanged macro by saving it.
 +  * Warn the user if an unsaved macro is about to be collapsed.
 +When clicking on the expand/collapse button (the one with the ± on it) or on the title/line on top of the macro resume, the macro will be expanded.\\
 +Initially the 'Commit' button will be disabled, and stay that way until the user changes something in the macro.
 +The only exception to this is if the macro is loaded, prefilled with commit-able data, ie. data from Pentominos or other external sources, that simply needs to be committed to the database without further actions of the user.\\
 +When the commit button (or optionally abort button) is clicked, the macro will be collapsed, and its data either committed to the server, or thrown away.\\
 +If the expand/collapse button, or the title/line on the top of the macro is clicked, the macro will enter an 'about to collapse' mode:\\
 +If the macro contains no changes, it will simply be collapsed.\\
 +If the macro contains unsaved data, the user will be prompted to save these data and collapse, ignore the changes and collapse or stay open and do nothing.\\
 +If another macro is already open when the expansion is about to be initiated, the already open macro will enter 'about to collapse' mode. If the stay open option is selected, the new about to expand macro will stay collapsed.
  
 ====Types==== ====Types====
Line 22: Line 70:
 The user corrects the error and clicks "Store".\\ The user corrects the error and clicks "Store".\\
 The new journal entry is committed with the //reason-text// prepended on a separate line. The new journal entry is committed with the //reason-text// prepended on a separate line.
- 
- 
- 
- 
- 
-====Pseudo widget==== 
-<code xml> 
-<pseudo name="foobar" layout="hbox" format="foo ${a}${b} bar"> 
-  <label caption="a:"/> 
-  <lineedit name="a"/> 
-  <label caption="b:"/> 
-  <lineedit name="b"/> 
-</pseudo> 
-</code> 
-The pseudo widget encapsulates a number of widgets in a single widget, producing their result value through a format string.\\ 
-When ''getValue'' is called on the pseudo widget it constructs its result string by parsing the format string, and replacing every ''${foobar}'' occurrence with the corresponding ''getValue'' call to the ''foobar'' widget.\\ 
-It does not as such make any sense to ''setValue'' on the pseudo widget, and the only reasonable thing to do when ''setValue'' is called, is to ignore it.\\ 
-The contained (named) widgets will not be stored independently in the database.\\ 
-\\ 
-//Is it possible to split a result string into its original subvalues using regexp?//\\ 
-<code> 
-format="foo ${a} ${b} bar." 
-value="foo I am Sir Lancelot 42 bar." 
-regexp="^foo ($1) ($2) bar.$" 
-</code> 
-In general, no. But if format contain only a single value, or if the values are separated by uniquely definable patterns, then it might be possible. 
-<code> 
-format="foo ${a} bar." 
-value="foo I am Sir Lancelot bar." 
-regexp="^foo ($1) bar.$" 
- 
-format="foo ${a} splatterplask ${b} bar." 
-value="foo I am Sir Lancelot splatterplask 42 bar." 
-regexp="^foo ($1) splatterplask ($2) bar.$" 
-</code> 
-In the latter this requires the input fields to no contain the string "splatterplask" otherwise it will confuse the regexp matcher.\\ 
-\\ 
-The entire regexp match scenario might be implemented and activated through an attribute ''use_regexp_set_value'' or something the like. So the user only enables it when absolute certain that it makes sense for the contained widgets and their format string. 
- 
-====Combobox alternative widget==== 
-<code xml> 
-<altcombobox name="somefield" layout="vbox"> 
-  <item caption="Name1" value="Value1"/> 
-  <item caption="Name2" value="Value2"/> 
-  <item caption="Name3" value="Value3"/> 
-  <altitem caption="Name4" value="Value4" layout="hbox" innerwidget="bar"> 
-    <label caption="Bar:"/> 
-    <lineedit name="bar" value="custom value"/> 
-  </altitem> 
-</altcombobox> 
-</code> 
-This code will produce a combobox with 4 values. The fourth value being "Name4" which will active the ''bar'' lineedit, and use its value as the combobox value.\\ 
-The lineedit and its label will be put below the combobox (due to the vbox layout attribute of the altcombobox) and the label and lineedit will be positioned horizontally (due to the hbox layout attribute of the altitem tag).\\ 
-When the altitem is selected, the lineedit is active, and its value is defining the value of the outer altcombo.\\ 
-When reloading the value from the db, it will first try to match the value against all items, and if that fails, it will set the value to "Name4", and cal setValue on the inner widget (''bar''). 
- 
-====Alternative widget==== 
-**OBSOLETE** 
-Two format strings. One for each widget set. 
-<code xml> 
-<alt name="somefield"> 
-  <primary format="blah ${foo} blah"> 
-    <lineedit name="foo"/> 
-  </primary> 
-  <secondary format="doh ${bar} aah"> 
-    <lineedit name="bar"/> 
-  </secondary> 
-</alt> 
-</code> 
-Creates the data: 
-<code> 
-somefield="blah ${foo|foo's value} blah" 
-</code> 
-which can be used later to determine which of the alternatives were used, given that the fields in primary and secondary do not contain overlapping names. 
  
 ====Open Questions==== ====Open Questions====
Line 139: Line 113:
 If the ''$'' is put just before a ''{''''{'' or ''[''''['', the ''$'' will be rendered as a ''$''. If the ''$'' is put just before a ''{''''{'' or ''[''''['', the ''$'' will be rendered as a ''$''.
  
-====Lib docs====+=====Lib docs=====
   * http://www.lua.org/manual/5.1   * http://www.lua.org/manual/5.1
   * http://www.xml.com/lpt/a/555   * http://www.xml.com/lpt/a/555
   * http://pqxx.org/devprojects/libpqxx/doc/development/Reference   * http://pqxx.org/devprojects/libpqxx/doc/development/Reference
  
-====Procedure==== +=====Procedure===== 
-===Request===+====Request====
 Initially the server receives a request from the client.\\ Initially the server receives a request from the client.\\
 The request contains a course and a macro.\\ The request contains a course and a macro.\\
Line 155: Line 129:
 The final xml are generated accordingly and sent back to the client. The final xml are generated accordingly and sent back to the client.
  
-===Commit===+====Commit====
 The server receives a commit from the client, containing all fields and their values.\\ The server receives a commit from the client, containing all fields and their values.\\
 The server puts all field/value pairs in the db, all connected to a transaction id.\\ The server puts all field/value pairs in the db, all connected to a transaction id.\\
Line 161: Line 135:
 The resume is sent to the upload server. The resume is sent to the upload server.
  
-====Error handling====+=====Error handling=====
 All server output is cached prior to sending. Upon error a special error macro window is generated and sent to the client, containing a description of the error, and a close button.\\ All server output is cached prior to sending. Upon error a special error macro window is generated and sent to the client, containing a description of the error, and a close button.\\
 All errors should be prevented/worked around if possible.\\ All errors should be prevented/worked around if possible.\\
 All actions already taken, should be rolled back. In order to do this, all external transmissions must be made last, bacause they are not necessarily possible to roll back. All actions already taken, should be rolled back. In order to do this, all external transmissions must be made last, bacause they are not necessarily possible to roll back.
  
-====Connection lifespan====+=====Connection lifespan=====
 A connection is made to the server at first request. It is kept alive for the entire session, i.e. during commit and possible following requests (due to continue action buttons).\\ A connection is made to the server at first request. It is kept alive for the entire session, i.e. during commit and possible following requests (due to continue action buttons).\\
 The connection may be terminated at any key point (after a request or a commit), since the server is stateless, but it may be saving resources to keep the connection alive, thus only creating one connection per session. The connection may be terminated at any key point (after a request or a commit), since the server is stateless, but it may be saving resources to keep the connection alive, thus only creating one connection per session.
  
-====TODOs====+=====TODOs=====
  
-===Server===+====Server====
   * {{:check.png}} Make configure flag to remove pentominos support.   * {{:check.png}} Make configure flag to remove pentominos support.
   * {{:check.png}} Rename luaprograms/luaprogram tags to scripts/script with a language attribute.   * {{:check.png}} Rename luaprograms/luaprogram tags to scripts/script with a language attribute.
Line 192: Line 166:
   * {{:uncheck.png}} Make header tags in course.   * {{:uncheck.png}} Make header tags in course.
  
-===Client===+====Client====
   * {{:check.png}} Rename luaprograms/luaprogram tags to scripts/script with a language attribute.   * {{:check.png}} Rename luaprograms/luaprogram tags to scripts/script with a language attribute.
   * {{:check.png}} Rewrite client network code.   * {{:check.png}} Rewrite client network code.
Line 213: Line 187:
   * <del>{{:uncheck.png}} Automatic generation of continue button based on 'completed' and deps.</del>   * <del>{{:uncheck.png}} Automatic generation of continue button based on 'completed' and deps.</del>
  
-===Documentation===+ 
 + 
 +====Documentation====
   * {{:uncheck.png}} Document checkbox truevalue/falsevalue attributes.   * {{:uncheck.png}} Document checkbox truevalue/falsevalue attributes.
   * {{:uncheck.png}} Document dbwidget.   * {{:uncheck.png}} Document dbwidget.
   * {{:uncheck.png}} Button continue_nocommit action.   * {{:uncheck.png}} Button continue_nocommit action.
-  * {{:uncheck.png}} New resume tag, with ''store_in_journal'' attribute.+  * {{:uncheck.png}} ''storechildren'' in metawidget
   * {{:uncheck.png}} Header tags in course.   * {{:uncheck.png}} Header tags in course.
 +  * {{:uncheck.png}} ''service'' attribute on query tags.
 +  * {{:uncheck.png}} DateTime widget
 +
  
-===Macros (local)===+====Macros (local)====
   * {{:uncheck.png}} B.2.2 nethinde tykkelse skal have et 'andet' felt.   * {{:uncheck.png}} B.2.2 nethinde tykkelse skal have et 'andet' felt.
   * {{:uncheck.png}} B.1 Præparat skal laves om til noget andet.   * {{:uncheck.png}} B.1 Præparat skal laves om til noget andet.
pracro/pracro.txt · Last modified: 2012/11/08 10:36 by deva