[server] Make "sources_by_uri" and "sources_by_eid" properties of repository
I.e. do not populate these dict as repo initialization (bootstrap step) but
always use information from database. This is needed because when multiple
instances of the same application run, if one instance adds a CWSource the
other ones will not see it. In particular, when using a scheduler instance,
new CWSource will be added by the web instance and not seen by the scheduler
which is supposed to update them.
We thus define properties for sources_by_eid and sources_by_uri instead
attributes on repository instance. CWSource entities are thus retrieved from
database every time these properties are accessed. We factor out
initialization of the "source" instance (subclass of
cubicweb.server.source.AbstractSource) in a _sources() method. Note that this
method takes care of calling "init" method on the source as well as
"set_schema" (previously done in repo.set_schema(), which now only touches
system_source). Accordingly the "init_sources_from_database" method is dropped
along with "add_source"/"remove_source" methods.
In syncsources hook, we thus drop:
* SourceAddedOp operation which called repo.add_source() so that the
SourceAddedHook only cares about checking source configuration now;
* SourceRemovedOp and SourceRenamedOp operations for the same reason;
* SourceConfigUpdatedOp as updating the live config of source is
meaningless once we rely on them being retrieved from the database;
* SourceHostConfigUpdatedHook hook which is now useless without call to
SourceConfigUpdatedOp;
In 3.10 migration script, remove usage of sources_by_uri repo attribute which,
unless I'm missing something, appears useless (at least now).
In tests:
* unittest_datafeed: remove test_update_url method since we dropped respective
hook;
* unittest_ldapsource: LDAPFeedUserDeletionTC.test_a_filter_inactivate()
currently fails because it still relies on live config being updated, this
will be fixed in the next changeset once all "live source" logic will be
removed.
.. -*- coding: utf-8 -*-
User interface for web site configuration
=========================================
.. image:: ../../images/lax-book_03-site-config-panel_en.png
This panel allows you to configure the appearance of your instance site.
Six menus are available and we will go through each of them to explain how
to use them.
Navigation
~~~~~~~~~~
This menu provides you a way to adjust some navigation options depending on
your needs, such as the number of entities to display by page of results.
Follows the detailled list of available options :
* navigation.combobox-limit : maximum number of entities to display in related
combo box (sample format: 23)
* navigation.page-size : maximum number of objects displayed by page of results
(sample format: 23)
* navigation.related-limit : maximum number of related entities to display in
the primary view (sample format: 23)
* navigation.short-line-size : maximum number of characters in short description
(sample format: 23)
UI
~~
This menu provides you a way to customize the user interface settings such as
date format or encoding in the produced html.
Follows the detailled list of available options :
* ui.date-format : how to format date in the ui ("man strftime" for format description)
* ui.datetime-format : how to format date and time in the ui ("man strftime" for format
description)
* ui.default-text-format : default text format for rich text fields.
* ui.encoding : user interface encoding
* ui.fckeditor :should html fields being edited using fckeditor (a HTML WYSIWYG editor).
You should also select text/html as default text format to actually get fckeditor.
* ui.float-format : how to format float numbers in the ui
* ui.language : language of the user interface
* ui.main-template : id of main template used to render pages
* ui.site-title : site title, which is displayed right next to the logo in the header
* ui.time-format : how to format time in the ui ("man strftime" for format description)
Actions
~~~~~~~
This menu provides a way to configure the context in which you expect the actions
to be displayed to the user and if you want the action to be visible or not.
You must have notice that when you view a list of entities, an action box is
available on the left column which display some actions as well as a drop-down
menu for more actions.
The context available are :
* mainactions : actions listed in the left box
* moreactions : actions listed in the `more` menu of the left box
* addrelated : add actions listed in the left box
* useractions : actions listed in the first section of drop-down menu
accessible from the right corner user login link
* siteactions : actions listed in the second section of drop-down menu
accessible from the right corner user login link
* hidden : select this to hide the specific action
Boxes
~~~~~
The instance has already a pre-defined set of boxes you can use right away.
This configuration section allows you to place those boxes where you want in the
instance interface to customize it.
The available boxes are :
* actions box : box listing the applicable actions on the displayed data
* boxes_blog_archives_box : box listing the blog archives
* possible views box : box listing the possible views for the displayed data
* rss box : RSS icon to get displayed data as a RSS thread
* search box : search box
* startup views box : box listing the configuration options available for
the instance site, such as `Preferences` and `Site Configuration`
Components
~~~~~~~~~~
[WRITE ME]
Contextual components
~~~~~~~~~~~~~~~~~~~~~
[WRITE ME]