• last updated 7 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
provide additional configuration hooks when creating new pages

- p.source (copy variables from that site-wide page upon creation)

- p.configure (call a method for configuration of the page)

provide mimetype to "text" field (otherwise form is incorrectly displayed in browser)

Port of downstream behavior:

create_link instproc is supposed to return an object. In case of error, just crash and let the anchor insproc handle the exception, instead of trying to use the error message as an object.

relax url detection

add check if item_id exists

fix typo in log statement

Added points in addition to minutes to test items and inclass-exam workflows

  1. … 5 more files in changeset.
return raw value for form-fields of type label, when disableOutputEscaping is set

use localized_text for folders and links

no need to subst

resolve message keys in titles

reduce verbosity

factor out script wrappers

fix typo

undo recent changes on too global localizations

The new form-field class localized_text text solves the goals

of for providing a formfield interface to message keys in a

loca fashion rather than altering the behavior of all form

field and of all property interfaces.

New form-field class: localized_text

This class can be used to provide an interface for specifying

internationalized text strings saved in message keys via input

from a form. When editing the content provided via the input field

is saved together with an item-specific message keys in the

message key tables via lang::util::convert_to_i18n.

This formfield class is especially useful for xowiki items which

have no language-prefix (e.g. folders or links). In other cases it

is probably still a better idea to create same named pages with

different language prefixes.

improve spelling

Disable any conversion on the _name property (:name Page instance variable): this property is special and receives already its necessary conversion at validation time, happening before conversion time and should not be overridden

Implement 'language_specific' formfields and 'localized' FormPage properties:

- properties can be stored and retrieved specifying a -localized flag: this flag will make transparently store and retrieve the property value from a custom message key created in the acs-translations package referencing the FormPage. This localization mechanism is additional to that of language-prefixed pages and can address the need of multi-language content for non-prefixable objects such as folders

- via specifying language_specific in the formfield spec, one can enable this new localization mechanism when interacting with the FormPage via a xowiki::Form

TODO: handle export/import of pages (e.g. serializing available translation and generate the new message keys for the imported page), add some nicer UI to make the user aware of e.g. current translation context

Improve sql portability

  1. … 4 more files in changeset.
prefer SQL max() function over sort and limit 1

  1. … 1 more file in changeset.
Improve doc and minor refactoring to reduce the diff with possible upcoming change

remove unnecessary parameter package_id

fix comment and missing arguemnt

whitespace changes

make "instantiate_forms" a method of packages

this reads better than the previous variant based on the Weblog class.

  1. … 2 more files in changeset.
whitespace changes

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}

}

}

}

    • -3
    • +3
    ./resources/templates/view-default.adp
improve comments

  1. … 3 more files in changeset.
reduce usage of anonymous arrays