# HG changeset patch # User Damien Correia # Date 1524235969 -7200 # Node ID 6ed4293909350b5e77b11390b9b62f057915e699 # Parent a33f67e15345f0a90af11ce033aec5448030120a merge default diff -r a33f67e15345 -r 6ed429390935 buildout.cfg --- a/buildout.cfg Thu Apr 12 18:01:15 2018 +0200 +++ b/buildout.cfg Fri Apr 20 16:52:49 2018 +0200 @@ -94,7 +94,6 @@ eggs = ${package:eggs} sphinx_rtd_theme - repoze.sphinx.autointerface source = ${buildout:directory}/src/source build = ${buildout:directory}/src/build diff -r a33f67e15345 -r 6ed429390935 requirements.txt --- a/requirements.txt Thu Apr 12 18:01:15 2018 +0200 +++ b/requirements.txt Fri Apr 20 16:52:49 2018 +0200 @@ -41,5 +41,3 @@ websockets==3.4 WebOb==1.7.4 ZODB==5.3.0 -sphinx_rtd_theme==0.2.4 -repoze.sphinx.autointerface==0.8 diff -r a33f67e15345 -r 6ed429390935 setup.py --- a/setup.py Thu Apr 12 18:01:15 2018 +0200 +++ b/setup.py Fri Apr 20 16:52:49 2018 +0200 @@ -62,8 +62,7 @@ extras_require=dict(test=tests_require), install_requires=[ 'setuptools', - 'sphinx_rtd_theme', - 'repoze.sphinx.autointerface', + 'sphinx_rtd_theme' # -*- Extra requirements: -*- ], entry_points={}) diff -r a33f67e15345 -r 6ed429390935 src/source/_static/css/custom.css --- a/src/source/_static/css/custom.css Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/_static/css/custom.css Fri Apr 20 16:52:49 2018 +0200 @@ -1,3 +1,7 @@ .wy-menu .caption-text{ color: #2D87C2; } + +.headerlink::before{ + color: #2D87C2; +} diff -r a33f67e15345 -r 6ed429390935 src/source/appinstall.rst --- a/src/source/appinstall.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/appinstall.rst Fri Apr 20 16:52:49 2018 +0200 @@ -1,5 +1,7 @@ .. _appinstall: +.. _intall: + Installing PyAMS application ============================ @@ -186,12 +188,19 @@ **Then finalize Bootstrap initialization:** - .. code-block:: bash (env) $ python3.5 bootstrap.py (env) $ ./bin/buildout + +.. seealso:: + + `zc.buildout `_ is a powerful + tool for creating repeatable builds of a given software configuration + and environment. + + Environment settings -------------------- @@ -217,8 +226,10 @@ update them carefully before initializing your application database! +.. _zodbinit: + Initializing the ZODB database -========================= +============================== After, you have downloaded and installed all required packages, you have to initialize the database so that all required components are available. @@ -308,96 +319,3 @@ '*/usr/local/lib/nltk_data*'. -Starting the application -======================== - -When database upgrade process has ended, you can start the web application process with the standard Pyramid's -*pserve* command line tool: - -.. code-block:: bash - - (env) $ ./bin/pserve etc/development.ini - -In standard debug mode, all registered components are displayed in the console, until the final line (here using ZEO): - -.. code-block:: bash - - 2018-01-14 11:37:54,339 INFO [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=28695) created RW/normal for storage: 'pyams' - 2018-01-14 11:37:54,340 INFO [ZEO.cache][MainThread] created temporary cache file 3 - 2018-01-14 11:37:54,345 INFO [ZODB.blob][MainThread] (28695) Blob directory `/var/local/env/pyams/var/db/blobs` is used but has no layout marker set. Selected `lawn` layout. - 2018-01-14 11:37:54,345 WARNI [ZODB.blob][MainThread] (28695) The `lawn` blob directory layout is deprecated due to scalability issues on some file systems, please consider migrating to the `bushy` layout. - 2018-01-14 11:37:54,346 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector - 2018-01-14 11:37:54,347 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected None - 2018-01-14 11:37:54,348 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting - 2018-01-14 11:37:54,349 INFO [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False) - 2018-01-14 11:37:54,355 INFO [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100) - 2018-01-14 11:37:54,358 DEBUG [txn.140663320073984][MainThread] new transaction - 2018-01-14 11:37:54,360 DEBUG [txn.140663320073984][MainThread] commit - 2018-01-14 11:37:54,484 DEBUG [config][MainThread] include /home/tflorac/Dropbox/src/PyAMS/pyams_template/src/pyams_template/configure.zcml - 2018-01-14 11:37:54,485 DEBUG [config][MainThread] include /var/local/env/pycharm/lib/python3.5/site-packages/pyramid_zcml/configure.zcml - ... - 2018-01-14 11:37:54,833 DEBUG [PyAMS (utils)][MainThread] Registering utility named 'PyAMS timezone' providing - 2018-01-14 11:37:54,834 DEBUG [PyAMS (utils)][MainThread] Registering class as vocabulary with name "PyAMS timezones" - 2018-01-14 11:37:54,835 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (,) providing - 2018-01-14 11:37:54,839 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (, , ) providing - 2018-01-14 11:37:54,847 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (, ) providing - 2018-01-14 11:37:54,942 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (,) providing - 2018-01-14 11:37:54,943 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for () - 2018-01-14 11:37:54,949 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for () - 2018-01-14 11:37:54,980 DEBUG [PyAMS (utils)][MainThread] Registering class as vocabulary with name "PyAMS ZEO connections" - 2018-01-14 11:37:54,981 DEBUG [PyAMS (utils)][MainThread] Registering class as vocabulary with name "PyAMS ZODB connections" - 2018-01-14 11:37:55,015 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "add-zeo-connection.html" for () - 2018-01-14 11:37:55,016 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (, ) providing - 2018-01-14 11:37:55,017 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for () - ... - 2018-01-14 11:41:13,214 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (, , ) providing - 2018-01-14 11:43:36,665 INFO [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=29335) created RW/normal for storage: 'pyams' - 2018-01-14 11:43:36,665 INFO [ZEO.cache][MainThread] created temporary cache file 9 - 2018-01-14 11:43:36,673 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector - 2018-01-14 11:43:36,674 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 Checking blob cache size. (target: 966367642) - 2018-01-14 11:43:36,674 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected None - 2018-01-14 11:43:36,675 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 blob cache size: 0 - 2018-01-14 11:43:36,675 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting - 2018-01-14 11:43:36,675 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 --> - 2018-01-14 11:43:36,677 INFO [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False) - 2018-01-14 11:43:36,679 INFO [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100) - 2018-01-14 11:43:36,682 DEBUG [txn.140713340237568][MainThread] new transaction - 2018-01-14 11:43:36,683 DEBUG [txn.140713340237568][MainThread] commit - 2018-01-14 11:43:36,690 INFO [PyAMS (scheduler][MainThread] Starting tasks scheduler ... - 2018-01-14 11:43:36,698 INFO [PyAMS (scheduler][MainThread] Started tasks scheduler with PID 29361. - 2018-01-14 11:43:36,701 INFO [apscheduler.scheduler][MainThread] Scheduler started - 2018-01-14 11:43:36,702 DEBUG [apscheduler.scheduler][APScheduler] Looking for jobs to run - 2018-01-14 11:43:36,704 DEBUG [apscheduler.scheduler][APScheduler] No jobs; waiting until a job is added - 2018-01-14 11:43:36,719 INFO [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=29335) created RW/normal for storage: 'pyams' - 2018-01-14 11:43:36,720 INFO [ZEO.cache][MainThread] created temporary cache file 15 - 2018-01-14 11:43:36,724 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector - 2018-01-14 11:43:36,725 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected None - 2018-01-14 11:43:36,726 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting - 2018-01-14 11:43:36,727 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 Checking blob cache size. (target: 966367642) - 2018-01-14 11:43:36,728 INFO [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False) - 2018-01-14 11:43:36,729 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 blob cache size: 0 - 2018-01-14 11:43:36,729 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 --> - 2018-01-14 11:43:36,732 INFO [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100) - 2018-01-14 11:43:36,735 DEBUG [txn.140713340237568][MainThread] new transaction - 2018-01-14 11:43:36,736 DEBUG [txn.140713340237568][MainThread] commit - 2018-01-14 11:43:36,743 INFO [PyAMS (media)][MainThread] Starting medias converter ... - 2018-01-14 11:43:36,751 INFO [PyAMS (media)][MainThread] Started medias converter with PID 29367. - Starting server in PID 29335. - Serving on http://0.0.0.0:6543 - - -Congrats: PyAMS is running ! - -Launch a browser and open URL http://127.0.0.1:6543/admin to get access to PyAMS management interface. - -.. warning:: - - By default: - - - Login: admin - - - Password: admin - - **You must change it as soon as possible!** - (see :ref:`pyams_security`)!!. - diff -r a33f67e15345 -r 6ed429390935 src/source/appmanage.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/source/appmanage.rst Fri Apr 20 16:52:49 2018 +0200 @@ -0,0 +1,51 @@ +.. _appmanage: + +.. _site: + + +PyAMS site management +===================== + +PyAMS site management is based on the ZODB. + + +When the PyAMS is initialized, it create and register several utilities into the *local registry* and saved into ZODB (see +:ref:`zca`). These utilities are created with default values which can be modified through **management interface** when +the application is started. + + +Local registry utilities +'''''''''''''''''''''''' + +Some important utilities include: + +- a **catalog**: the catalog has the responsibility to index every content properties which are required to make quick + and efficient searches. Catalog indexes are automatically created on database upgrade; management interface + allows administrator to get indexes properties, to get the number of indexed objects and values for a given index, and + to delete an index before recreating it by running the database upgrade script another time (see :ref:`scripts`). + +- an **internal IDs** utility: + +- a **language negotiator**: + +- a **portal templates** container: + +- a **security manager**: + +- a **sequential IDs** utility: + +- a **server timezone** utility: + +- a **user profiles** container: + + +Optional utilities can also include: + +- an **Elasticsearch content indexer**: + +- a **maps manager**: + +- a **medias converter**: + +- a **tasks scheduler**: + diff -r a33f67e15345 -r 6ed429390935 src/source/appstart.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/source/appstart.rst Fri Apr 20 16:52:49 2018 +0200 @@ -0,0 +1,95 @@ +.. _appstart: + +Starting the application +======================== + +When database upgrade process has ended ( :ref:`zodbinit` ) , you can start the web application process with the standard Pyramid's +*pserve* command line tool: + +.. code-block:: bash + + (env) $ ./bin/pserve etc/development.ini + +In standard debug mode, all registered components are displayed in the console, until the final line (here using ZEO): + +.. code-block:: bash + + 2018-01-14 11:37:54,339 INFO [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=28695) created RW/normal for storage: 'pyams' + 2018-01-14 11:37:54,340 INFO [ZEO.cache][MainThread] created temporary cache file 3 + 2018-01-14 11:37:54,345 INFO [ZODB.blob][MainThread] (28695) Blob directory `/var/local/env/pyams/var/db/blobs` is used but has no layout marker set. Selected `lawn` layout. + 2018-01-14 11:37:54,345 WARNI [ZODB.blob][MainThread] (28695) The `lawn` blob directory layout is deprecated due to scalability issues on some file systems, please consider migrating to the `bushy` layout. + 2018-01-14 11:37:54,346 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector + 2018-01-14 11:37:54,347 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected None + 2018-01-14 11:37:54,348 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting + 2018-01-14 11:37:54,349 INFO [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False) + 2018-01-14 11:37:54,355 INFO [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100) + 2018-01-14 11:37:54,358 DEBUG [txn.140663320073984][MainThread] new transaction + 2018-01-14 11:37:54,360 DEBUG [txn.140663320073984][MainThread] commit + 2018-01-14 11:37:54,484 DEBUG [config][MainThread] include /home/tflorac/Dropbox/src/PyAMS/pyams_template/src/pyams_template/configure.zcml + 2018-01-14 11:37:54,485 DEBUG [config][MainThread] include /var/local/env/pycharm/lib/python3.5/site-packages/pyramid_zcml/configure.zcml + ... + 2018-01-14 11:37:54,833 DEBUG [PyAMS (utils)][MainThread] Registering utility named 'PyAMS timezone' providing + 2018-01-14 11:37:54,834 DEBUG [PyAMS (utils)][MainThread] Registering class as vocabulary with name "PyAMS timezones" + 2018-01-14 11:37:54,835 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (,) providing + 2018-01-14 11:37:54,839 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (, , ) providing + 2018-01-14 11:37:54,847 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (, ) providing + 2018-01-14 11:37:54,942 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (,) providing + 2018-01-14 11:37:54,943 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for () + 2018-01-14 11:37:54,949 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for () + 2018-01-14 11:37:54,980 DEBUG [PyAMS (utils)][MainThread] Registering class as vocabulary with name "PyAMS ZEO connections" + 2018-01-14 11:37:54,981 DEBUG [PyAMS (utils)][MainThread] Registering class as vocabulary with name "PyAMS ZODB connections" + 2018-01-14 11:37:55,015 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "add-zeo-connection.html" for () + 2018-01-14 11:37:55,016 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (, ) providing + 2018-01-14 11:37:55,017 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for () + ... + 2018-01-14 11:41:13,214 DEBUG [PyAMS (utils)][MainThread] Registering adapter for (, , ) providing + 2018-01-14 11:43:36,665 INFO [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=29335) created RW/normal for storage: 'pyams' + 2018-01-14 11:43:36,665 INFO [ZEO.cache][MainThread] created temporary cache file 9 + 2018-01-14 11:43:36,673 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector + 2018-01-14 11:43:36,674 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 Checking blob cache size. (target: 966367642) + 2018-01-14 11:43:36,674 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected None + 2018-01-14 11:43:36,675 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 blob cache size: 0 + 2018-01-14 11:43:36,675 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting + 2018-01-14 11:43:36,675 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 --> + 2018-01-14 11:43:36,677 INFO [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False) + 2018-01-14 11:43:36,679 INFO [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100) + 2018-01-14 11:43:36,682 DEBUG [txn.140713340237568][MainThread] new transaction + 2018-01-14 11:43:36,683 DEBUG [txn.140713340237568][MainThread] commit + 2018-01-14 11:43:36,690 INFO [PyAMS (scheduler][MainThread] Starting tasks scheduler ... + 2018-01-14 11:43:36,698 INFO [PyAMS (scheduler][MainThread] Started tasks scheduler with PID 29361. + 2018-01-14 11:43:36,701 INFO [apscheduler.scheduler][MainThread] Scheduler started + 2018-01-14 11:43:36,702 DEBUG [apscheduler.scheduler][APScheduler] Looking for jobs to run + 2018-01-14 11:43:36,704 DEBUG [apscheduler.scheduler][APScheduler] No jobs; waiting until a job is added + 2018-01-14 11:43:36,719 INFO [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=29335) created RW/normal for storage: 'pyams' + 2018-01-14 11:43:36,720 INFO [ZEO.cache][MainThread] created temporary cache file 15 + 2018-01-14 11:43:36,724 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector + 2018-01-14 11:43:36,725 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected None + 2018-01-14 11:43:36,726 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting + 2018-01-14 11:43:36,727 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 Checking blob cache size. (target: 966367642) + 2018-01-14 11:43:36,728 INFO [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False) + 2018-01-14 11:43:36,729 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 blob cache size: 0 + 2018-01-14 11:43:36,729 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 --> + 2018-01-14 11:43:36,732 INFO [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100) + 2018-01-14 11:43:36,735 DEBUG [txn.140713340237568][MainThread] new transaction + 2018-01-14 11:43:36,736 DEBUG [txn.140713340237568][MainThread] commit + 2018-01-14 11:43:36,743 INFO [PyAMS (media)][MainThread] Starting medias converter ... + 2018-01-14 11:43:36,751 INFO [PyAMS (media)][MainThread] Started medias converter with PID 29367. + Starting server in PID 29335. + Serving on http://0.0.0.0:6543 + + +Congrats: PyAMS is running ! + +Launch a browser and open URL http://127.0.0.1:6543/admin to get access to PyAMS management interface. + +.. warning:: + + By default: + + - Login: admin + + - Password: admin + + **You must change it as soon as possible!** + (see :ref:`pyams_security`)!!. + diff -r a33f67e15345 -r 6ed429390935 src/source/conf.py --- a/src/source/conf.py Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/conf.py Fri Apr 20 16:52:49 2018 +0200 @@ -69,7 +69,7 @@ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.todo', - 'sphinx.ext.coverage', + #'sphinx.ext.coverage', 'sphinx.ext.viewcode', 'repoze.sphinx.autointerface', ] @@ -242,3 +242,4 @@ def setup(app): app.add_stylesheet('css/custom.css') + diff -r a33f67e15345 -r 6ed429390935 src/source/config.rst --- a/src/source/config.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/config.rst Fri Apr 20 16:52:49 2018 +0200 @@ -3,76 +3,73 @@ PyAMS configuration =================== -PyAMS application configuration is done via several complementary ways: +.. Note:: -- via Pyramid's configuration files located in 'etc/' folder + PyAMS application configuration is done via several complementary ways: -- via settings applied to local utilities defined into ZODB + - via **Pyramid's configuration** files located in 'etc/' folder -- via ZCML files. + - via **ZCML files** . + + - via **Site Management** to setup Local utilities defined into ZODB (see :ref:`appmanage`) Pyramid's configuration files ----------------------------- -PyAMS is using default Pyramid's configuration files to define settings. When using default PyAMS scaffold, these +PyAMS is using default Pyramid's ini_ configuration files to define settings. When using default PyAMS scaffold, these INI files are stored into *etc* folder. Two files are created by scaffold: a development file (*development.ini*) and a production file (*production.ini*) which contain nearly the same directives, except for debug toolbar (activated only in development), Fanstatic configuration and logging. +.. _ini: https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/project.html#development-ini + These files are actually documented, but here are a few important directives: -- **zodbconn.uri**: +- **zodbconn.uri**: (ex: zconfig:/zodb-relstorage.conf) -- **pyams.application_factory**: - -- **pyams.application_name**: +- **pyams.application_name**: Name of your own application +- **pyams.application_factory**: Configuration module path to your custom application. -- **pyams_xxx.tcp_handler** and **pyams_xxx.start_handler**: +- **pyams_xxx.tcp_handler** : Adress of the tcp handler for the service associated to the pyams package +- **pyams_xxx.start_handler**: True / False -- **pyams_content.config.tools_name**: +- **pyams_content.config.xxx_tool_factory** and **pyams_content.config.xxx_tool_name**: You can override default factory by defining these settings or by providing your own adapters. -- **pyams_content.config.xxx_tool_factory** and **pyams_content.config.xxx_tool_name**: -Local registry utilities ------------------------- +Pyramid's configuration files powered by PyAMS_utils +---------------------------------------------------- -When the ZODB is created, PyAMS automatically create and register several utilities into the *local registry* (see -:ref:`zca`). These utilities are created with default values which can be modified through management interface when -the application is started. +On application startup, if PyAMS_utils package is included into Pyramid configuration, several operations take +place: -Some important utilities include: + - a custom **site factory** is defined -- a **catalog**: the catalog has the responsibility to index every content properties which are required to make quick - and efficient searches. Catalog indexes are automatically created on database upgrade; management interface - allows administrator to get indexes properties, to get the number of indexed objects and values for a given index, and - to delete an index before recreating it by running the database upgrade script another time (see :ref:`scripts`). + - custom request methods are defined + + - a custom **traverser** handling **namespaces** is defined -- an **internal IDs** utility: + - a custom subscribers predicate based on interfaces support is defined -- a **language negotiator**: + - several adapters are registered, to handle annotations and key references -- a **portal templates** container: - -- a **security manager**: + - custom TALES extensions are registered. -- a **sequential IDs** utility: +The site factory is an important component in this process. It is this factory which will define the application root +and create a **local site manager**. -- a **server timezone** utility: - -- a **user profiles** container: +Pyramid application is loaded from ZODB's root via a key defined in Pyramid's configuration file; the key is named +*pyams.application_name* and it's default value is *application*. - -Optional utilities can also include: - -- an **Elasticsearch content indexer**: +If the application can't be found, PyAMS is looking for an application class name in Pyramid's configuration file; the +class name configuration key is called *pyams.application_factory* and defined by default as +*pyams_utils.site.BaseSiteRoot*. PyAMS default site factory will then create the application, and add a local site +manager to it (see :ref:`zca`). -- a **maps manager**: +After application creation, a :py:class:`NewLocalSiteCreatedEvent ` is +notified. Custom packages can subscribe to this event to register custom components. -- a **medias converter**: - -- a **tasks scheduler**: ZCML configuration files diff -r a33f67e15345 -r 6ed429390935 src/source/developerguide.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/source/developerguide.rst Fri Apr 20 16:52:49 2018 +0200 @@ -0,0 +1,31 @@ +.. _developerguide: + + +PyAMS Developer's Guide +======================= + +PyAMS package are developed based on ZCA + + + +.. seealso:: + + +Interfaces +---------- + +Interfaces are objects that specify (document) the external behavior +of objects that "provide" them. An interface specifies behavior +through: + +- Informal documentation in a doc string + +- Attribute definitions + +- Invariants, which are conditions that must hold for objects that + provide the interface + +Attribute definitions specify specific attributes. They define the +attribute name and provide documentation and constraints of attribute +values. Attribute definitions can take a number of forms, as we'll + diff -r a33f67e15345 -r 6ed429390935 src/source/index.rst --- a/src/source/index.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/index.rst Fri Apr 20 16:52:49 2018 +0200 @@ -24,7 +24,7 @@ :maxdepth: 2 :caption: Tutorial - User’s Guide + User’s Guide screenshots .. toctree:: @@ -34,31 +34,31 @@ ZODB Server PyAMS Installation PyAMS Configuration - site - scripts + PyAMS Run Server + PyAMS Site management -PyAMS external packages ------------------------ +.. toctree:: + :maxdepth: 2 + :caption: Technical documentation -PyAMS is built on many external packages, and provides a whole set of extensions. Here is a list of them: - + developerguide + packages + extend + tests .. toctree:: :maxdepth: 2 - :caption: API documentation + :caption: Toolkit - extend - packages - + scripts Indices and tables ------------------ * :ref:`genindex` -* :ref:`modules` * :ref:`modindex` * :ref:`search` diff -r a33f67e15345 -r 6ed429390935 src/source/install.rst --- a/src/source/install.rst Thu Apr 12 18:01:15 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -.. _install: - -Installing PyAMS -================ - -.. toctree:: - :maxdepth: 2 - - appinstall - diff -r a33f67e15345 -r 6ed429390935 src/source/manage.rst --- a/src/source/manage.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/manage.rst Fri Apr 20 16:52:49 2018 +0200 @@ -6,5 +6,7 @@ .. toctree:: :maxdepth: 2 + appmanage utilities + diff -r a33f67e15345 -r 6ed429390935 src/source/packages.rst --- a/src/source/packages.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/packages.rst Fri Apr 20 16:52:49 2018 +0200 @@ -3,33 +3,46 @@ PyAMS packages ============== +PyAMS core +---------- + +.. toctree:: + :maxdepth: 1 + + PyAMS ZMI + PyAMS Content + PyAMS Skin + PyAMS Catalog + PyAMS Form + PyAMS Portal + PyAMS Template + PyAMS Pagelet + PyAMS Viewlet + PyAMS Utils + + +PyAMS additional packages +------------------------- + +PyAMS is built on many additional packages, and provides a whole set of extensions. Here is a list of them: + .. toctree:: :maxdepth: 1 PyAMS Alchemy PyAMS Cache - PyAMS Catalog - PyAMS Content PyAMS Content_es PyAMS File - PyAMS Form PyAMS GIS PyAMS I18N PyAMS LDAP PyAMS Mail PyAMS Media PyAMS Notify - PyAMS Pagelet - PyAMS Portal PyAMS Scheduler + PyAMS Thesaurus PyAMS Security PyAMS Sequence - PyAMS Skin - PyAMS Template - PyAMS Thesaurus - PyAMS Utils - PyAMS Viewlet PyAMS Workflow - PyAMS ZMI PyAMS ZMQ PyAMS ZODBbrowser diff -r a33f67e15345 -r 6ed429390935 src/source/pyams_skin/pyams_skin.rst --- a/src/source/pyams_skin/pyams_skin.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/pyams_skin/pyams_skin.rst Fri Apr 20 16:52:49 2018 +0200 @@ -27,6 +27,14 @@ :undoc-members: :show-inheritance: +pyams\_skin\.event module +------------------------- + +.. automodule:: pyams_skin.event + :members: + :undoc-members: + :show-inheritance: + pyams\_skin\.extension module ----------------------------- diff -r a33f67e15345 -r 6ed429390935 src/source/pyams_utils/pyams_utils.rst --- a/src/source/pyams_utils/pyams_utils.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/pyams_utils/pyams_utils.rst Fri Apr 20 16:52:49 2018 +0200 @@ -27,6 +27,14 @@ :undoc-members: :show-inheritance: +pyams\_utils\.cache module +-------------------------- + +.. automodule:: pyams_utils.cache + :members: + :undoc-members: + :show-inheritance: + pyams\_utils\.container module ------------------------------ diff -r a33f67e15345 -r 6ed429390935 src/source/pyams_zmi/pyams_zmi.zmi.rst --- a/src/source/pyams_zmi/pyams_zmi.zmi.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/pyams_zmi/pyams_zmi.zmi.rst Fri Apr 20 16:52:49 2018 +0200 @@ -51,4 +51,12 @@ :undoc-members: :show-inheritance: +pyams\_zmi\.zmi\.table module +----------------------------- +.. automodule:: pyams_zmi.zmi.table + :members: + :undoc-members: + :show-inheritance: + + diff -r a33f67e15345 -r 6ed429390935 src/source/scripts.rst --- a/src/source/scripts.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/scripts.rst Fri Apr 20 16:52:49 2018 +0200 @@ -3,3 +3,42 @@ PyAMS maintenance scripts ========================= + +pyams_upgrade +------------- + + +Pyramid allows to define custom command line scripts for application management. A script called *pyams_upgrade* is +provided by PyAMS_utils package; this script apply the same process as PyAMS site factory, but can also be used to +manage **database generations**. The idea behind this is just to allow custom packages to provide a way to check and +upgrade database configuration away from application startup process: + +.. code-block:: bash + + # ./bin/pyams_upgrade webapp/development.ini + + +A **site generation checker** is just a named utility providing :py:class:`pyams_utils.interfaces.site.ISiteGenerations` +interface. For example, **pyams_security** package provides such utility, to make sure that local site manager +contains a PyAMS security manager and a principal annotation utility: + +.. code-block:: python + + from pyams_utils.site import check_required_utilities + + REQUIRED_UTILITIES = ((ISecurityManager, '', SecurityManager, 'Security manager'), + (IPrincipalAnnotationUtility, '', PrincipalAnnotationUtility, 'User profiles')) + + @utility_config(name='PyAMS security', provides=ISiteGenerations) + class SecurityGenerationsChecker(object): + """I18n generations checker""" + + generation = 1 + + def evolve(self, site, current=None): + """Check for required utilities""" + check_required_utilities(site, REQUIRED_UTILITIES) + +:py:func:`check_required_utilities ` is a PyAMS_utils utility function which +can to used to verify that a set of local utilities are correctly registered with the given names and interfaces. + diff -r a33f67e15345 -r 6ed429390935 src/source/site.rst --- a/src/source/site.rst Thu Apr 12 18:01:15 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -.. _site: - -PyAMS site management -===================== - -PyAMS site management is based on the ZODB. - -On application startup, if PyAMS_utils package is included into Pyramid configuration, several operations take -place: - - - a custom **site factory** is defined - - - custom request methods are defined - - - a custom **traverser** handling **namespaces** is defined - - - a custom subscribers predicate based on interfaces support is defined - - - several adapters are registered, to handle annotations and key references - - - custom TALES extensions are registered. - -The site factory is an important component in this process. It is this factory which will define the application root -and create a **local site manager**. - -Pyramid application is loaded from ZODB's root via a key defined in Pyramid's configuration file; the key is named -*pyams.application_name* and it's default value is *application*. - -If the application can't be found, PyAMS is looking for an application class name in Pyramid's configuration file; the -class name configuration key is called *pyams.application_factory* and defined by default as -*pyams_utils.site.BaseSiteRoot*. PyAMS default site factory will then create the application, and add a local site -manager to it (see :ref:`zca`). - -After application creation, a :py:class:`NewLocalSiteCreatedEvent ` is -notified. Custom packages can subscribe to this event to register custom components. - - -*pyams_upgrade* command line script ------------------------------------ - -Pyramid allows to define custom command line scripts for application management. A script called *pyams_upgrade* is -provided by PyAMS_utils package; this script apply the same process as PyAMS site factory, but can also be used to -manage **database generations**. The idea behind this is just to allow custom packages to provide a way to check and -upgrade database configuration away from application startup process: - -.. code-block:: bash - - # ./bin/pyams_upgrade webapp/development.ini - - -A **site generation checker** is just a named utility providing :py:class:`pyams_utils.interfaces.site.ISiteGenerations` -interface. For example, **pyams_security** package provides such utility, to make sure that local site manager -contains a PyAMS security manager and a principal annotation utility: - -.. code-block:: python - - from pyams_utils.site import check_required_utilities - - REQUIRED_UTILITIES = ((ISecurityManager, '', SecurityManager, 'Security manager'), - (IPrincipalAnnotationUtility, '', PrincipalAnnotationUtility, 'User profiles')) - - @utility_config(name='PyAMS security', provides=ISiteGenerations) - class SecurityGenerationsChecker(object): - """I18n generations checker""" - - generation = 1 - - def evolve(self, site, current=None): - """Check for required utilities""" - check_required_utilities(site, REQUIRED_UTILITIES) - -:py:func:`check_required_utilities ` is a PyAMS_utils utility function which -can to used to verify that a set of local utilities are correctly registered with the given names and interfaces. diff -r a33f67e15345 -r 6ed429390935 src/source/tests.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/source/tests.rst Fri Apr 20 16:52:49 2018 +0200 @@ -0,0 +1,35 @@ +.. _tests: + +PyAMS tests +=========== + +.. toctree:: + :maxdepth: 1 + + PyAMS Alchemy tests + PyAMS Cache tests + PyAMS Catalog tests + PyAMS Content tests + PyAMS Content_es tests + PyAMS File tests + PyAMS Form tests + PyAMS GIS tests + PyAMS I18N tests + PyAMS LDAP tests + PyAMS Mail tests + PyAMS Media tests + PyAMS Notify tests + PyAMS Pagelet tests + PyAMS Portal tests + PyAMS Scheduler tests + PyAMS Security tests + PyAMS Sequence tests + PyAMS Skin tests + PyAMS Template tests + PyAMS Thesaurus tests + PyAMS Utils tests + PyAMS Viewlet tests + PyAMS Workflow tests + PyAMS ZMI tests + PyAMS ZMQ tests + PyAMS ZODBbrowser tests diff -r a33f67e15345 -r 6ed429390935 src/source/userguide.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/source/userguide.rst Fri Apr 20 16:52:49 2018 +0200 @@ -0,0 +1,23 @@ +.. _userguide: + +PyAMS User's Guide +================== + +Creating content +---------------- + +How to create a Site +'''''''''''''''''''' + +How to create a Modele +'''''''''''''''''''''' + +How to create a News +'''''''''''''''''''' + +How to create a Topic +''''''''''''''''''''' + + +Publishing content +------------------ diff -r a33f67e15345 -r 6ed429390935 src/source/zca.rst --- a/src/source/zca.rst Thu Apr 12 18:01:15 2018 +0200 +++ b/src/source/zca.rst Fri Apr 20 16:52:49 2018 +0200 @@ -1,9 +1,9 @@ .. _zca: -Managing ZCA with PyAMS -======================= +Zope Component Architecture with PyAMS +====================================== -The **Zope Component Architecture** (aka ZCA) is used by the Pyramid framework "under the hood" to handle interfaces, +The **Zope Component Architecture** (aka **ZCA**) is used by the Pyramid framework "under the hood" to handle interfaces, adapters and utilities. You don't **have to** use it in your own applications. But you can. The ZCA is mainly adding elements like **interfaces**, **adapters** and **utilities** to the Python language. It @@ -12,6 +12,13 @@ You will find several useful resources about ZCA concepts on the internet. +.. seealso:: + Zope Documentations: + - `Components and Interfaces `_ + - `Zope component `_ + - `Zope interface `_ + + Local utilities ---------------