![]() |
Configuring WB |
About | Install | Config | Usage | Copyright | F.A.Q. |
---|
To define a new billboard you may point your browser to the billboard management page:
http://url.to.your.cgi/wb.pyto get the following:
Where you can select the "Create new billboard" operation.
Note: System administrator tasks (such as defining a new billboard) require that the user logging in is an "administrative user", i.e.: either admin or administrator, or root, so that the login id field is actually a menu of choices. |
You must then choose a proper name for your billboard.
Note: You can use any name for your billboards, except for names beginning with either '.' or '_', which are reserved for special actions. |
After successful creation, you will find a new subdirectory, named as the billboard name, in the billboard root directory. The created subdirectory will contain an initialization file named wb.ini copied from the default language directory.
Now your billboard is up and running and you might start to use it, but you might want to customize it a little bit to adapt it to your needs.
Most items are self explaining or their purpose may be undestood by reading comments in the file, a few items deserve some more discussion.
index_header, index_item, index_footer, doc_header, doc_footerThese variables may be used to customize the document index and the document display pages generated by WB. Each variable is an array of strings and each element will generate a line of HTML code after being processed as detailed below.
The document index will be generated as an HTML document as follows:
The document display page, instead, is generated as:
- Text generated by index_header.
- for each document, a block generated by index_item
- Text generated by index_footer.
To generate text the definition strings are processed to apply string substitution so that some "variables" are substituted with their values.
- Text generated by doc_header.
- Document body
- List of links to attachments (if any)
- Text generated by doc_footer.
E.g.: the default values of the five items are:
index_header = ['<h3>Index for billboard: <i>%(BBOARD)s</i></h3><blockquote><ul>'] index_item = ['<p><li> %(DATE)s %(EXPIR)s', '<br><a href=%(HREF)s>%(TITLE)s</a>'] index_footer = ['</ul></blockquote>'] doc_header = ['%(DATE)s %(EXPIR)s', '<h3>%(TITLE)s</h3>'] doc_footer = []As you may see the lines resemble HTML code except for the special symbols: %(VAR)s which indicate variable substitution, i.e.: the symbol in parentheses will be substituted with the value of the named variable.
Note: You need to know a little bit of Python syntax to write customization strings. Here's a very short resume: 1) Comment lines begin with "#"; 2) strings are enclosed in either double quote (") or single quote ('). When using double quotes, if you need to put a literal double quote character into the string you must escape it with backslash (E.g.: \"). The same happens when enclosing in single quote. 3) arrays are enclosed in brackets: [ ], elements in arrays are separated by commas; 4) it is safe to start a new line after a comma. |
The following variables are defined and can be used for index generation:
Where it can be used | |||||||
---|---|---|---|---|---|---|---|
Var name | Meaning | index header | index item | index footer | doc header | doc footer | mail body |
AUTHOR | Document author's name | NO | YES | NO | YES | YES | YES |
BBOARD | Current billboard name | YES | YES | YES | YES | YES | YES |
DATE | Document date | NO | YES | NO | YES | YES | YES |
EXPIR | Document expiration date1 | NO | YES | NO | YES | YES | YES |
HREF | URL pointing to document | NO | YES | NO | YES | YES | YES |
IF_AUTHOR* | Document author's string. Format is defined in author_fmt; empty, if no author specified | NO | YES | NO | YES | YES | YES |
N_ITEMS | Number of items in list | YES | YES | YES | NO | NO | NO |
TITLE | Document title | NO | YES | NO | YES | YES | YES |
SEARCH | HTML code to insert a search form. The content of the string is defined by variable search_fmt; It may be empty, if no search form is desired. | YES | NO | YES | NO | NO | NO |
Beware: if a variable is mispelled or not defined an error will result and no index will be displayed.
> python /var/www/http/BillBoards/News/wb.iniNo output should result.
Now you are ready to start putting documents into your billboard, or maybe to define a new billboard.
date expir ascending descendingWords are separated by spaces in the string and may be written in any order. If conflicting words are specified one will prevail at random.
In order to support various languages, language dependent items are contained in "language directories" in the billboard root. Subdirectories are named: _lang_it, _lang_us, end so on, and must contain the following files:
voc.ini | Vocabulary file |
about.html | Brief introduction |
config.html | Configuration manual |
copyright.html | Copyright statement |
help.html | User help |
install.html | Installation notes |
usage.html | Administrator help |
wbfaq.html | F.A.Q |
In order to support a new language you must create a proper directory; e.g.:
> python /var/www/http/BillBoards/_lang_ukand copy into it the set of files from an existing language directory of your choice.
Then you must provide proper translations (please, if you do so consider to send them to me to be added in the next distribution of WB).
The most important file is voc.ini which contains messages displayed to the user.
After providing the transalted version you may select your preferred language as default by editing the file wb.py (different language can be selected for each billboard by editing the specific wb.ini).