adp-generator-procs.tcl

  • last updated 1 hour ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
MenuBar reform

- MenuBars are now easier programmatically extensible (easier to maintain)

- refactored code, reduced scatted definitions (all configurations

at the same place)

- unified templating:

use body property @body.folderHTML@ instead of @folderhtml@

From the former API calls only "update_items" has changed,

all existing configurations (i.e. via folders or package parameter)

should continue to work.

== Changes:

One can now extend menubars via menu entry definition

{config -use YOURCONFIG -class YOURCLASS}

in two directions:

a) subclassing

define your own menubar class YOURCLASS, which should

be a subclass of ::xowiki::MenuBar

b) provide your own configuration method to provide

a more tailored configuration. This is performed

by defining a method "config=YOURCONFIG" for ::xowiki::MenuBar

The latter method is used for test-items, which can define a

test item folder by using

-- extra_menu_entries ---

{config -use test-items}

instead of

-- extra_menu_entries ---

{entry -name New.Item.TextInteraction -form en:edit-interaction.wf -query p.item_type=Text}

{entry -name New.Item.ShortTextInteraction -form en:edit-interaction.wf -query p.item_type=ShortText}

{entry -name New.Item.SCInteraction -form en:edit-interaction.wf -query p.item_type=SC}

{entry -name New.Item.MCInteraction -form en:edit-interaction.wf -query p.item_type=MC}

{entry -name New.Item.ReorderInteraction -form en:edit-interaction.wf -query p.item_type=Reorder}

{entry -name New.Item.UploadInteraction -form en:edit-interaction.wf -query p.item_type=Upload}

{entry -name New.App.OnlineExam -form en:online-exam.wf}

{entry -name New.App.InclassQuiz -form en:inclass-quiz.wf}

{entry -name New.App.InclassExam -form en:inclass-exam.wf}

See below for the definition of the "test-items" configuration method,

which is based on the default definitions. In general, the definition

in this method can be performed via menu-entries (same syntax as in

other menu entries) or via the MenuBar API (e.g. calling

":add_menu_item ...").

All configurations follow the following definition order

where later entries can refine earlier entries:

- package level: package parameter ExtraMenuEntries

- configuration method: use standard or tailored confguration methods

- per-folder definition: content of the extra_menu_entries

Note that the menu entry definition language supports as well

adding/clearing menus, etc., so almost everything can be refined.

I've noticed that the tlf* code has several scattered menu

definitions, which are as well done in every case differently.

By these definition one can define e.g. a learning-app folder (where

"New" can be used to define new app folders), and the app folders can

provide their own "New" entries, e.g. for clickers and

others. E.g. For "clickers" there is already on non-oo definition to

achieve similar things (which should be altered to the new method),

but on other places, there are some hard-coded definitions for root

folders, etc. The menubars of the learning-apps should be made this

way more consistent with the rest (e.g. using "New", supporting "table

of contents" for clipboard interactions, etc.)

namespace eval ::xowiki {

::xowiki::MenuBar instproc config=test-items {

{-bind_vars {}}

-current_page:required

-package_id:required

-folder_link:required

-return_url

} {

:config=default \

-bind_vars $bind_vars \

-current_page $current_page \

-package_id $package_id \

-folder_link $folder_link \

-return_url $return_url

return {

{clear_menu -menu New}

{entry -name New.Item.TextInteraction -form en:edit-interaction.wf -query p.item_type=Text}

{entry -name New.Item.ShortTextInteraction -form en:edit-interaction.wf -query p.item_type=ShortText}

{entry -name New.Item.SCInteraction -form en:edit-interaction.wf -query p.item_type=SC}

{entry -name New.Item.MCInteraction -form en:edit-interaction.wf -query p.item_type=MC}

{entry -name New.Item.ReorderInteraction -form en:edit-interaction.wf -query p.item_type=Reorder}

{entry -name New.Item.UploadInteraction -form en:edit-interaction.wf -query p.item_type=Upload}

{entry -name New.App.OnlineExam -form en:online-exam.wf}

{entry -name New.App.InclassQuiz -form en:inclass-quiz.wf}

{entry -name New.App.InclassExam -form en:inclass-exam.wf}

}

}

}

  1. … 16 more files in changeset.
introduced "ad_file" as a means to avoid unexpected tilde substitution in file names

  1. … 50 more files in changeset.
remove spurious colons

  1. … 1 more file in changeset.
add a plain template using the master

  1. … 10 more files in changeset.
whitespace and spelling changes

  1. … 9 more files in changeset.
- add URNs for jquery, bootstrap, get-http-object, xowiki.css and yui2

- fix return-string from popular-tags and improve stylability in includelet

- remove obsolete "header_stuff" from templates

- replace global parameters BootstrapCSS and BootstrapJS in favor of URNs

- bump version number to 5.10.0d6

  1. … 24 more files in changeset.
Reduce number of "catch" operations

  1. … 5 more files in changeset.
prefer XOTcl2 idioms

  1. … 3 more files in changeset.
make all files in xowiki usable for ::xo::library require ...

Add feature: overwrite generated ADP files only when necessary

Cases might be:

- ADP file list

- Generator updated

merged changes from the oacs-5-9 branch and resolved conflicts

  1. … 7834 more files in changeset.
- prefer lower case HTML attribute names

Fixed typo

- make contributors link robust against subdirs

  1. … 3 more files in changeset.
- add conditional search field to adp-generator

- fix typo

  1. … 11 more files in changeset.
- don't offer search control in xowiki menu bar, when no search is configured on the system

- prefer usage of add_event_listener over add_body script

  1. … 10 more files in changeset.
- remove remaining onclick handlers in templates

  1. … 11 more files in changeset.
- fix css in generator procs

- prevent jumping in event listeners

- added sample template oacs-view3-bootstrap3.adp as used on openacs.org

- updated sample templates

  1. … 10 more files in changeset.
- use addEventListener instead of onclick markup for wiki-search,

edit-tags and popular-tags

- fix popular tags link

- regenerated template files

- added scp directives for yui

- bump version number to 5.9.1d12

  1. … 12 more files in changeset.
- renamed array variables passed to xowiki-templates from

"property_doc" and "property_body" simply to "doc" and "body":

reasoning: this makes it more uniform to use this variables already

in the xowiki .adp files with the same name as in the master

templates.

- added @body.menubarHTML@ to allow the higher level master templates

to place the menubar. On the longer range, we might even prefer

@body.menubar@ to pass a generic (skin-agnostic) representation.

- replaced the hard wired placement of the menubar by a adp-controlled

layout

- added @body.title@ to provide a title suitable for <h1> in contrast

to @doc.title@ which is for <title>. Prefer usage of @body.title@

over @title@, but the latter variable is still provided.

- added csrf protection for wiki-search

  1. … 9 more files in changeset.
- move adp templates from xowiki/www to xowiki/resources/templates

- improve validity checking on tags (e.g. in path notation) to avoid

potential pg errors on invalid UTF-8

  1. … 24 more files in changeset.
- adjust adp-generator-procs to generate properties as recommended

Merging back to HEAD all changes that happened in branch oacs-5-8 between tags: vg-merge-oacs-5-8-from-20141027 and vg-merge-oacs-5-8-from-20150427

  1. … 520 more files in changeset.
- use "create" method explicitely

  1. … 8 more files in changeset.
Merging back to HEAD branch oacs-5-8 (using tag vg-merge-oacs-5-8-from-20141027).

  1. … 2547 more files in changeset.
- remove dependency on "header_stuff"

  1. … 9 more files in changeset.
- remove xowiki.css from generated templates

- regenerate templates

  1. … 8 more files in changeset.
- provide quoting for page name in generated adp files

  1. … 8 more files in changeset.