Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 4 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 94 additions and 58 deletions.
  1. +94 −58 docs/features.rst
View
152 docs/features.rst
@@ -139,19 +139,19 @@ visible or not.
If you select :guilabel:`Display action in action bar`, the action will be
displayed together with the standard Plomino actions in the action bar.
-New in Plomino 1.5
-------------------
+But (in forms only) you can also choose to insert the action within the
+form layout directly.
-Actions can be inserted directly in the form layout using TinyMCE.
+With Tinymce, actions can be created and inserted directly in the form layout
+from the editor.
Example:
.. image:: images/m2899c882.png
-But (in forms only) you can also choose to insert the action within the
-form layout directly. You must use the :guilabel:`Plomino action` style in
-Kupu, and the action will be rendered according the :guilabel:`Action`
-display parameter (link, submit button, or button).
+With kupu, you must use the :guilabel:`Plomino action` style, and the action
+will be rendered according the :guilabel:`Action` display parameter (link,
+submit button, or button).
Example:
@@ -183,6 +183,10 @@ Computed on creation
the field value is computed only once, the first time the document
is saved.
+Computed on save
+ the field value is computed and stored each time the document is
+ saved.
+
Computed for display
the field value is computed each time the document is opened, but it
is not saved.
@@ -415,43 +419,6 @@ So, for example, if you want to pass a parameter to another form:
Forms
=====
-Layout
-------
-
-Accordions and lazy loading
-```````````````````````````
-
-In Plomino it is possible to *accordion* some parts of the page. This means
-that the content of the accordioned part will not be visible unless you click
-on the headline to open the accordion.
-
-It is also possible to avoid loading the content of the accordion until such
-time as the accordion is opened. This is particularly useful if the content
-it very big, or if there are many accordions on a page and the reader is
-interested in only a few of them.
-
-To turn part of a page into an accordion, use this structure (the header level
-can be from ``h2`` to ``h6``):
-
-.. code-block:: html
-
- <h5 class="plomino-accordion-header"><a href="TARGETURL">Header</a></h5>
- <div>Content</div>
-
-If the class is ``plomino-accordion-header``, the content of the page
-referenced by ``TARGETURL`` will be substituted for the subsequent div.
-
-.. Note:: Plomino does not currently offer UI support for this
- functionality. To use it, you have to generate the desired content via
- Python, or enter it literally into the form layout.
-
-Caching
-```````
-
-Parts of forms can be cached.
-
-.. TODO:: expand on this.
-
Events
------
@@ -523,9 +490,6 @@ hidden. If it returns ``False``, the area is displayed (in our example: if
the book is damaged, it cannot be borrowed, so we hide the action to check
the book availability).
-New in Plomino 1.5
-```````````````````
-
Hide-when formulas can be inserted directly in the form layout using TinyMCE.
Sub-forms
@@ -555,9 +519,6 @@ The form is inserted using the Plomino :guilabel:`Subform` style in Kupu:
database home page, you have to check :guilabel:`Hide in menu` in the
form :guilabel:`Parameters` tab.
-New in Plomino 1.5
-```````````````````
-
Sub-forms can be inserted directly in the form layout using TinyMCE.
Search formula
@@ -648,6 +609,77 @@ Example:
http://localhost:8080/test/testdb/58862f161ea71732944d37e0a0489cfc?openwithform=frmtest
+Accordions and lazy loading
+---------------------------
+
+In Plomino it is possible to *accordion* some parts of the page. This means
+that the content of the accordioned part will not be visible unless you click
+on the headline to open the accordion.
+
+It is also possible to avoid loading the content of the accordion until such
+time as the accordion is opened. This is particularly useful if the content
+it very big, or if there are many accordions on a page and the reader is
+interested in only a few of them.
+
+To turn part of a page into an accordion, use this structure (the header level
+can be from ``h2`` to ``h6``):
+
+.. code-block:: html
+
+ <h5 class="plomino-accordion-header"><a href="TARGETURL">Header</a></h5>
+ <div>Content</div>
+
+If the class is ``plomino-accordion-header``, the content of the page
+referenced by ``TARGETURL`` will be substituted for the subsequent div.
+
+.. Note:: Plomino does not currently offer UI support for this
+ functionality. To use it, you have to generate the desired content via
+ Python, or enter it literally into the form layout.
+
+Caching
+-------
+
+To improve performances, it might be useful to cache some fragments of a form
+so they are not re-computed everytime.
+Cached fragments are set in the layout the same way as hide-when formulas, with
+``start:cache-identifier`` and ``end:cache-identifier`` markers.
+The associated formula is supposed to return a cache key.
+When the form is rendered the first time, the resulting HTML contained into the
+delimited area will be stored in cache and associated with the cache key.
+Everytime the form will be rendered a new time, if the cache key returned by
+the formula matched an existing cache key, the cached HTML is returned.
+
+Consequently, if you use a formula returning always the same value, like::
+
+ "financial-report"
+
+the same cached fragment will be served to all the users in all the cases.
+
+If you use a formula which depends on the current user, like::
+
+ "personal-report-" + context.getCurrentUser().getMemberId()
+
+then there will be a different cached fragment for each user (so if the same
+user displays the form twice, he will received the cached content the second
+time, but other users would not get that cached fragment, they would get their
+own cache).
+
+The formula might depends on the date::
+
+ "today-report-" + DateToString(Now(), "%Y-%m-%d")
+
+or anything (the document id, any specific item value, etc.).
+
+If the cache key is None, cache is not applied, so for instance::
+
+ if context.isEditMode():
+ return None
+ else:
+ return "something-read"
+
+would show the cached content in read mode, but would always regenerate
+the content in edit mode.
+
Views
=====
@@ -863,6 +895,15 @@ and enter an identifier, a title and the code.
This might be useful to run archiving, cleaning, etc. without giving
manager rights to regular users.
+By default, an agent run using the current user access right, but it can also
+run using the designer (the owner) access right. That way, a regular user might
+launch an action that normally requires higher privileges if he was doing it
+manually.
+For instance, if an agent is in charge of archiving documents by moving them
+from the current database to another one, if regular users does not have
+access to the archive db, they would not be able to put some documents in that
+db. If the agent is executed as owner, it will not fail.
+
The agent can be executed (from an action) using the ``runAgent()`` method::
db = plominoDocument.getParentDatabase()
@@ -881,13 +922,8 @@ The agent can also be executed from Python formulas by calling it directly::
.. Note:: this method can take optional positional arguments. It does not
redirect.
-If you install `ZpCron <http://old.zope.org/Members/janik/ZpCron>`_
-on your Zope instance, an agent can also be scheduled. You specify when the
-agent should run using a cron-like format.
-
-With ZpCron_, you can provide the id of a user that will be used to run the
-agent (so the access rights of that user are applied when the agent is
-executed, not those of the current user).
+If you install plone.app.async on your Zope instance, an agent can also be
+executed in asynchronuous mode.
Resources
=========
@@ -898,7 +934,7 @@ contain useful extra assets:
- images or icons you may need to insert in your forms;
- CSS or javascript files;
- ZPT templates (see view template below);
-- Python files, to provide a code library usable from the different
+- Python scripts, to provide a code library usable from the different
formulas (using the `callScriptMethod` method);
- CSV (or other) files containing useful data;
- etc.

No commit comments for this range

Something went wrong with that request. Please try again.