source: main/waeup.kofa/trunk/docs/source/userdocs/documents.rst @ 13156

Last change on this file since 13156 was 13156, checked in by Henrik Bettermann, 9 years ago

Include 'end day' when searching for payments in a given period.

File size: 4.9 KB
Line 
1.. _documents:
2
3Public Documents
4****************
5
6The documents section of Kofa is a tiny built-in content management
7system (CMS), which has been developed mainly for publishing
8announcements, adverts, instructions or general information provided
9by the university to inform prospective students about application
10and registration procedures.
11
12Technically speaking, the documents section is a container of type
13`DocumentsContainer` with id ``documents``, which is located in the
14`IUniversity` instance and which contains documents. There are three
15types of public documents::
16
17  Public Documents (DocumentsContainer)
18  |
19  +---> PDFDocument
20  |
21  +---> HTMLDocument
22  |
23  +---> RESTDocument
24
25The first can be used to provide pdf files for download. The second
26and third can be used to create multilingual static html pages on
27the portal. HTML documents expect html coded text as input, REST
28documents expect `reStructuredText <http://docutils.sf.net/rst.html>`_
29which is transformed into html.
30
31Interfaces
32==========
33
34The base for all three document interfaces is `IPublicDocument`
35which inherits from `IDocument`. All attributes are read-only
36properties, i.e. attributes with a getter method only. These
37properties are computed dynamically and can't be set. Only the
38`document_id` and the `title` can be entered on form pages or can be
39imported.
40
41.. literalinclude:: ../../../src/waeup/kofa/documents/interfaces.py
42   :pyobject: IDocument
43
44.. literalinclude:: ../../../src/waeup/kofa/documents/interfaces.py
45   :pyobject: IPublicDocument
46
47A PDF Document further specifies which pdf files are connected to
48the object. Usually, only one filename is in the `filenames` tuple.
49
50.. literalinclude:: ../../../src/waeup/kofa/documents/interfaces.py
51   :pyobject: IPDFDocument
52
53HTML and REST documents have a schema field for multi-lingual
54content in HTML or in REST format respectively, see :ref:`note
55<multilingual>`. The hidden `html_dict` attributes contain the same
56information after saving the form, but the sequence of language
57translations has been split up and copied into a dictionary for
58faster processing.
59
60.. literalinclude:: ../../../src/waeup/kofa/documents/interfaces.py
61   :pyobject: IHTMLDocument
62
63.. literalinclude:: ../../../src/waeup/kofa/documents/interfaces.py
64   :pyobject: IRESTDocument
65
66
67Workflow
68========
69
70Public documents have a publication workflow with two states:
71created and published. Only the content or attached files of
72published documents can be seen by anonymous users::
73
74                 a
75    created ----------- published
76
77    a: publish
78   -a: retract
79
80History & Logging
81=================
82
83All transitions are automatically logged in ``main.log`` and the
84document's history. This is a sample history of public document::
85
86  2015-07-05 07:31:32 UTC - Document created by Admin
87  2015-07-05 07:31:53 UTC - Document published by Admin
88  2015-07-05 07:31:57 UTC - Document retracted by Admin
89
90The corresponding logfile excerpt is as follows::
91
92  2015-07-05 09:31:32,848 - INFO - admin - demodoc - Document created
93  2015-07-05 09:31:32,850 - INFO - admin - documents.browser.DocumentAddFormPage - added: HTML Document demodoc
94  2015-07-05 09:31:39,025 - INFO - admin - documents.browser.HTMLDocumentManageFormPage - demodoc - saved: html_multilingual
95  2015-07-05 09:31:43,279 - INFO - admin - documents.browser.HTMLDocumentManageFormPage - added: benny|waeup.local.DocumentManager
96  2015-07-05 09:31:53,152 - INFO - admin - demodoc - Document published
97  2015-07-05 09:31:57,216 - INFO - admin - demodoc - Document retracted
98  2015-07-05 09:32:46,679 - INFO - admin - documents.browser.DocumentsContainerManageFormPage - removed: demodoc
99
100
101Quick Guide
102===========
103
104How to add and reference an HTML document
105-----------------------------------------
106
1071. Click *Documents > Manage > Add document*.
1082. Select *HTML Document*, fill fields and press *Add document*.
1093. Enter multilingual content in HTML format and press *Save*.
1104. Click *View > Transition*.
1115. Select *Publish document* and press *Save*.
112
113The document is now published and available to anonymous users.
114
1156. Mark and copy the HTML Element provided on the page:
116   ``<a href= ... /a>``.
1177. Open another HTML document or a page with multilingual content
118   and paste the element where needed.
119
120
121How to add and reference a PDF document
122---------------------------------------
123
1241. Click *Documents > Manage > Add document*.
1252. Select *PDF Document*, fill fields and press *Add document*.
1263. Select *Files* and upload a pdf file from your computer.
1274. Click *View > Transition*.
1285. Select *Publish document* and press *Save*.
129
130The document and the connected pdf file are now published and
131available to anonymous users.
132
1336. Open the HTML source with your browser, search for the ``a``
134   element
1357. Mark and copy the HTML element found:
136   ``<a target="image" href= ... /a>``.
1378. Open another HTML document or a page with multilingual content
138   and paste the element where needed.
Note: See TracBrowser for help on using the repository browser.