Index: openacs-4/packages/acs-templating/www/doc/design.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/design.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-templating/www/doc/design.adp 9 Jun 2016 13:03:12 -0000 1.2.2.4 +++ openacs-4/packages/acs-templating/www/doc/design.adp 5 Jul 2016 12:14:22 -0000 1.2.2.5 @@ -15,7 +15,7 @@ procedures show up here. To minimize dependencies across packages, in particular on ad_proc from acs-kernel, this package uses proc.
  • PL/SQL API -- none.
  • Data model -- none. Templating does not depend on a database -system at all. There's the one table +system at all. There's the one table ad_template_sample_users that some of the demonstrations use.
  • Requirements document
  • ER diagram -- none.
  • Transaction flow diagram -- none.
  • @@ -27,50 +27,51 @@ publishing team with a set of tools for simplifying the development and maintenance of the user interface. In particular:

  • What this package is not intended to allow users to accomplish.

  • @@ -83,7 +84,7 @@
  • It supplies a set of custom markup tags.
  • The proc ad_page_contract (from the acs kernel) should be used to specify what makes the dynamic part of the page. -There's also an API for creating forms and for creating and +There's also an API for creating forms and for creating and manipulating multirow data sources.
  • The mechanism for dynamically generating pages combines data and layout. It also allows coposition of modular pages from reusable widges and skins. It is not limited to HTML.
  • The <master> tag specifies a master @@ -94,22 +95,22 @@

    III. Historical Considerations

    Karl Goldstein designed the templating system. First it was -called "Karl's Templates" or "The New Templating System" to -distinguish it from the obsolescent templates or "Styles" by Philip -Greenspun. An extended and improved version was named "Dynamic -Publishing System". It wasn't part of the ACS yet, but client -projects like iluvCAMP used it successfully. Newcomers were -consistently puzzled by the .data files, which -specified the datasources in an apparently unfamiliar XML syntax. -(The .form files specified elements in an HTML form -similarly.) To mitigate this initial shock, Karl redesigned -templates to let the programmer specify datasources and forms in a -.tcl script. The system is present as packages -templates and form-manager in ACS 3.4. -Both these packages are now merged and appear as -acs-templating starting in ACS 4.0. The architecture -of the package was changed several times to meet the emerging -coding/style constraints of ACS 4.0.

    +called "Karl's Templates" or "The New Templating +System" to distinguish it from the obsolescent templates or +"Styles" by Philip Greenspun. An extended and improved +version was named "Dynamic Publishing System". It +wasn't part of the ACS yet, but client projects like iluvCAMP +used it successfully. Newcomers were consistently puzzled by the +.data files, which specified the datasources in an +apparently unfamiliar XML syntax. (The .form files +specified elements in an HTML form similarly.) To mitigate this +initial shock, Karl redesigned templates to let the programmer +specify datasources and forms in a .tcl script. The +system is present as packages templates and +form-manager in ACS 3.4. Both these packages are now +merged and appear as acs-templating starting in ACS +4.0. The architecture of the package was changed several times to +meet the emerging coding/style constraints of ACS 4.0.

    V. Design Tradeoffs

    As indicated above, the primary attribute that the page tries to achieve is the separation of code and layout. The primary sacrifice @@ -152,15 +153,15 @@ tcl extensions.

  • Reliability and robustness (medium): Considering how many parts have to play together, one might not predict a very reliable system. In practice, the package works reliably. It is robust to -user errors in the sense that it won't error out if a file is +user errors in the sense that it won't error out if a file is missing or such; rather it quietly proceeds. Error reporting to the user is not very sophisticated.
  • Usability (high): Emphasis has been put on the easy use of the system. In particular, a graphics designer should only have to learn a small number of special markup tags.
  • Maintainability (medium): The code is well structured in reasonably sized procedures, and well commented.
  • Portability (high): Unlike most other parts of the ACS, the -templating system can work standalone. It doesn't need the database -nor the acs-kernel or any other part of the ACS. All you need is -AOLserver with the fancy ADP parser.
  • Reusability (low): Many parts of the templating system are +templating system can work standalone. It doesn't need the +database nor the acs-kernel or any other part of the ACS. All you +need is AOLserver with the fancy ADP parser.
  • Reusability (low): Many parts of the templating system are actually generally reusable, and probably should be extracted into a common set of utility procs used by this package and the ACS; this would reduce code duplication. The API lets programmers call @@ -188,7 +189,7 @@
    1. The request processor gets a url and maps it to a .adp or .tcl file. As both invoke the -same handler, it doesn't matter that adp take precendence.
    2. If a .tcl file is present, its ad_page_contract +same handler, it doesn't matter that adp take precendence.
    3. If a .tcl file is present, its ad_page_contract in the -properties block indicates a set of data sources that will be made available to the template.
    4. The rest of the tcl script executes, defining these data sources. It may change the name of the page being served by calling @@ -207,7 +208,8 @@

      Tcl Call Stack

      Below is a diagram of the typical call stack when processing a page without dependent pages. To conform to the Tcl notion of -what's up and down (as in upvar), the stack grows down.

      +what's up and down (as in upvar), the stack +grows down.

      @@ -251,29 +253,29 @@ the adp and tcl sources, and re-processes any requested file if the cached version is no longer current. Consequently, this cacheing is transparent in normal use.

      -

      To emphasize that "normal" use essentially always applies, -here's a scenario for abnormal use: Save version n of a -file at 11:36:05.1; request a page that uses it at 11:36:05.3; -modify and save version n+1 of the file at 11:36:05.9. -If you work that fast (!), the new version will have the same -modification time -- kept with 1 second resolution in Unix --, and -will not be refreshed.

      +

      To emphasize that "normal" use essentially always +applies, here's a scenario for abnormal use: Save version +n of a file at 11:36:05.1; request a page that uses it +at 11:36:05.3; modify and save version n+1 of the file +at 11:36:05.9. If you work that fast (!), the new version will have +the same modification time -- kept with 1 second resolution in Unix +--, and will not be refreshed.

      For timing measurements and performance tuning, you can set the parameter RefreshCache in section template to never or always. The former suppresses checking mtime and may improve performance on -a production server, where the content pages don't change. The +a production server, where the content pages don't change. The latter is only inteded for testing.

      VII. Data Model Discussion

      -

      This packages doesn't need a data model.

      +

      This packages doesn't need a data model.

      It comes with its own database interfaces, one for using ns_ora, the Oracle driver from ArsDigita, and one for ns_db, the builtin database interface of the AOL server. If you are programming under the ACS, you should use neither of these, but rather the db_* interface, in particular db_multirow.

      VIII. User Interface

      -

      This packages doesn't have a user interface. It is the +

      This packages doesn't have a user interface. It is the substrate of all user interfaces, be it user or admin pages.

      IX. Configuration/Parameters

      @@ -289,9 +291,10 @@

      X. Future Improvements/Areas of Likely Change

      Passing datasources by reference is new. The acs-templating -syntax &formal="actual" is different from the -independent ATS, which used formal="\@actual.*\@". The -latter is phased out.

      +syntax &formal="actual" is different +from the independent ATS, which used +formal="\@actual.*\@". The latter is phased +out.

      We intend to add a <which>, <switch>, or <case> tag, to complement sequential nested @@ -324,5 +327,5 @@

      Christian Brechbuehler
      -Last modified: $‌Id: design.html,v 1.4 2015/06/16 08:53:38 gustafn -Exp $ +Last modified: $‌Id: design.html,v 1.4.2.1 2016/06/22 07:48:43 +gustafn Exp $
      LevelProcedureArguments