Commit graph

2,408 commits

Author SHA1 Message Date
Goffi
4bceddea67 jp: XMLUI implementation first draft:
first implementation of XMLUI for jp. The display is simplistic for now by displaying widgets in the order in which they appear, and doing a simple input when a value is needed.

Not all widgets/dialogs are implemented yet, and most flags/options/styles are not handled.

It is possible to automate command, using "workflow" attribute:
it's a list of command that are executed in order. So far only a const (SUBMIT) and fields values can be set.

If verbosity is set, fields name are displayed, which can be useful to automate commands.
2017-10-31 23:17:37 +01:00
Goffi
7045ad3f1c core (disco): do not cache disco items when node is set 2017-10-31 23:11:58 +01:00
Goffi
a68772cdeb plugin XEP-0050: renamed "requestCommandsList" method to "list" + added a run command + fixes:
- XMLUI cancellation is fixed
- when called from bridge, "list" (adHocList) command doesn't prepend instructions
2017-10-31 23:11:13 +01:00
Goffi
fc08583152 core (xmlui): fixed data_form => XMLUI conversion when filters is None 2017-10-31 23:07:26 +01:00
Goffi
6e8375cda5 plugin tickets: high level tickets handling, first draft:
this plugin use plugin schema to handle tickets, and filter well known fields like created, updated and labels.
2017-10-27 18:24:35 +02:00
Goffi
ecb3ba897e template: improved date formatter:
the date filter is now named "date_fmt" and can be use to specify several useful formats (see docstring), using the current locale.
The "relative" format return the whole human readable relative date.

The new in_the_past test allow to check if a date is passed.
2017-10-27 18:20:10 +02:00
Goffi
dde17b2b06 template: new item_value filter
this filter is used with XMLUI to specify filters before using a generate method.
2017-10-27 18:17:35 +02:00
Goffi
26751b4f89 template: improved attribute escaping, and added it to filters under the name "attr_escape" 2017-10-27 18:13:25 +02:00
Goffi
d308bbfd6b template(XMLUI): added items property to ListWidget:
this property get values and labels from items relevant for the current list, according to styles.
2017-10-27 18:11:20 +02:00
Goffi
ada8d4756e plugin tickets import bugzilla: fixed parsing of "created" and "updated" fields 2017-10-27 18:08:53 +02:00
Goffi
0a33ab2d1d core (XMLUI): filters can now be used when converting data form to XMLUI:
they can be used to modify created widgets, this is specially useful to customise well known field.
2017-10-27 18:06:58 +02:00
Goffi
3ccb4c1038 core (XMLUI), template(XMLUI): added flags to ListWidget:
following flags have been added:
- noselect: list selection is not allowed (options are the important data)
- extensible: user can add elements to the list
- reducible: user can remove elements from the list
- inline: presentation hint: the list should be displayed horizontally
2017-10-27 18:03:35 +02:00
Goffi
55a5b603fd plugins tickets import, jp (ticket/import): implemented mapping:
- mapping is an option allowing do map imported field to a specific field in the newly created item
- importers can now use complexe data types in options using JSON
2017-10-27 17:58:05 +02:00
Goffi
baaa4b1419 plugin pubsub schema: allow any data_form schema:
the schema is actually the schema needed for the items, so it should not in pubsub schema namespace.
2017-10-27 17:54:00 +02:00
Goffi
3c4dfb4636 template: added media_path to template data 2017-10-27 08:36:24 +02:00
Goffi
414665c76a plugin tickets import: create comments nodes with open access/publishing 2017-10-27 08:35:22 +02:00
Goffi
bfc27d68dd jp (pubsub/delete): show deleted node + handle URIs 2017-10-27 08:33:48 +02:00
Goffi
8a71ea34b9 template: new "adv_format" filter which use Python's format and return whole value if template is None 2017-10-20 08:49:39 +02:00
Goffi
08a14fa4ac plugins import, tickets import, bugzilla import: comments handling:
- comments are put in "comments" key in import data, it's a list of microblog data
- in resulting item, the comments uri is put in comments_uri field
- (plugin import) root_service and root_node are kept in session
- (plugin ticket) reporter name is now in "reporter" key instead of "reporter_name"
- (plugin bugizlla): if not reporter name is found, first part of email address is used
2017-10-20 08:48:41 +02:00
Goffi
363ee1db88 plugin XEP-0060: added createIfNewNode method which doesn't fail in case of conflict. 2017-10-20 08:44:09 +02:00
Goffi
a8f192a2e4 plugin schema: when publishing a schema, check that values of list are allowed, else use default value 2017-10-20 08:40:54 +02:00
Goffi
3fe93a1b45 frontends (xmlui): added ValueGetter.keys 2017-10-20 08:39:58 +02:00
Goffi
25a66ec8d2 plugin schema, core(xmlui): deep copy base form when reused to avoid accidental modification 2017-10-20 08:39:05 +02:00
Goffi
789a3056d9 template: gidx methods improvment:
gidx methods now use the filtered name to return global indexes.
For instance, if "widget" is filtered name, first index will be "widget", then "widget_1", "widget_2" and so one.
If an other name is used, it restart (e.g. for "label": "label", "label_1", "label_2", etc.).
2017-10-16 07:48:09 +02:00
Goffi
07d5a18b79 template: new "xmlui_class" filter compute class names from name/values of requested fields. 2017-10-16 07:44:08 +02:00
Goffi
c7984f60ec tools (common/data_objects): new OnClick class
OnClick is used to specify what do to when clicking on element.
For now it only handles target URL.
2017-10-16 07:41:36 +02:00
Goffi
158d61b84e plugin import ticket, import ticket bugzilla: some normalization in values:
normalization (i.e. recommandations for importer to have similar values) has been done for some values:
- "status" is now one of "queued", "started", "review", "closed"
- "priority" and "severity" must be stripped and lower case
2017-10-16 07:39:54 +02:00
Goffi
b5daa89208 plugin schema: use new "prepend" argument to put "id" widget first. 2017-10-16 07:36:41 +02:00
Goffi
b8839b97e4 core (xmlui): new "prepend" argument for dataForm2Widgets and dataFormResult2XMLUI:
This argument allow to create widgets which will be put first in LabelContainer of generated XMLUI.
An iterable of *args for XMLUI.addWidget must be used.
2017-10-16 07:36:03 +02:00
Goffi
59c6ab9973 template (xmlui): new properties + inheritance fix:
- "values" property in OptionsWidget return selected values.
- "labels" property in OptionsWidget return list of labels
- "for_name" property in LabelWidget return name of associated widget if set, else None
- fixed inheritance for StringWidget and TextBoxWidget
2017-10-16 07:28:36 +02:00
Goffi
f97b08382f plugin schema: deserialise is now the last kw argument 2017-10-16 07:23:09 +02:00
Goffi
d78aa6f922 frontends (xmlui): new _xmlui_for_name attribute:
_xmlui_for_name is an attribute which can be set to Label widgets to indicate the name of the linked widget.
This attribute is set automatically for LabelContainer.
data argument in _parseChilds is now a dict (or None)
2017-10-16 07:21:44 +02:00
Goffi
5a34d090b3 frontends (xmlui): new widget_value dict to get first value of widget by name 2017-10-16 07:18:07 +02:00
Goffi
d1a44e1501 jp (file): typo 2017-10-16 07:16:11 +02:00
Goffi
151faf6a73 jp (ticket): ticket command first draft:
only has an "import" subcommand for now
2017-10-06 10:55:54 +02:00
Goffi
697bec616c plugin tickets import Bugzilla: Bugzilla tickets importer:
it imports tickets from Bugzilla's XML export format.
2017-10-06 10:55:54 +02:00
Goffi
748eed8ff1 plugin tickets import: specialized importer for tickets, first draft:
import tickets in a node with schema. Comments are not handled yet.
2017-10-06 10:55:54 +02:00
Goffi
9bca9328c3 plugin pubsub schema: values handling:
- "schema" attribute can now be specified directly as a data_form.Form (reparsing it will be avoided in this case)
- new "deserialise" parameter allows deserialisation from unicode strings in sendDataFormItem
- values can now be an iterable or directly the value to use (it will be put in a list automatically in the later case)
- "id" is now put directly in XMLUI's "id" field instea of "_id"
2017-10-06 10:55:51 +02:00
Goffi
1bcdca4a2f plugin import: node can now be specified + added a "session" dict to keep import session data:
import session data are data that can be used by importer to store anything which can be useful to keep between import methods.
2017-10-06 08:52:51 +02:00
Goffi
80eb458024 plugin import: generic data import plugin:
this plugin handle common task for importers. Specialized importers (e.g. blog import) use it as a basic, and specific importers (e.g. Dotclear) register to the specialized one.
Blog importer generic method have been moved to it.
2017-10-01 12:21:23 +02:00
Goffi
3c79544cc4 jp (base): fixed CommandAnswering and progress bar 2017-10-01 12:21:23 +02:00
Goffi
fa1680a119 template (xmlui): added values property to be able to use always values even when there is only one value 2017-10-01 12:21:23 +02:00
Goffi
83aa722103 frontends (xmlui): a dict of named widgets is kept, so they can be easily be retrieved 2017-10-01 12:21:23 +02:00
Goffi
3ec8f283cb core (xmlui): container now keep a list of children 2017-10-01 12:21:23 +02:00
Goffi
df038ad3d4 core (xmlui): added method to convert data form result to XMLUI:
- former method was misnamed as it was used to convert data form element to XMLUI, so it has been renamed to dataFormEltResult2XMLUI
    - dataFormResult2XMLUI is now use to convert wokkel.data_form.Form instances to XMLUI
2017-10-01 12:21:23 +02:00
Goffi
499f2525cc plugin PubSub Schema: schema helper methods:
3 new methods are introduced by this patch:
- psSchemaUIGet to get XMLUI from node schema
- psItemsFormGet to get items as XMLUI when we know they are data forms
- psItemFormSend to set item from values when we know it's a node with schema. For this method, schema can be specified, and if it is not it will be retrieved from node (which imply an additional XMPP request)
2017-10-01 12:21:21 +02:00
Goffi
04d851c5c5 template: template XMLUI first draft:
this module prepares an object which can be easily used in templates to construct interface from XMLUI.
2017-09-24 16:39:36 +02:00
Goffi
506f948214 core, frontends (xmlui): new LabelContainer:
LabelContainer is like a PairContainer where first widget can only be LabelWidget or EmptyWidget. This case is the most common, and allow to generate better code when label can be associated to widget (e.g. in HTML).
2017-09-24 16:36:11 +02:00
Goffi
3f2c1046eb plugin XEP-0060: use client instead of profile_key in getItems 2017-09-24 16:32:22 +02:00
Goffi
c7ccdde0c9 jp (pubsub/node/schema): check that a schema exists before parsing it (fix issue on new schema edition) 2017-09-24 16:29:18 +02:00