From 606b1d1b5233a2261ea8722edbb54ee81d905b19 Mon Sep 17 00:00:00 2001 From: Badlop Date: Sat, 21 Feb 2009 09:22:51 +0000 Subject: [PATCH] Merge r1858 from trunk: * doc/guide.tex: Provide only an example of language option * doc/guide.html: Likewise SVN Revision: 1899 --- ChangeLog | 3 ++ doc/guide.html | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/guide.tex | 9 +----- 3 files changed, 91 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8526b7705..76f144916 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-02-21 Badlop + * doc/guide.tex: Provide only an example of language option + * doc/guide.html: Likewise + * doc/guide.tex: mod_muc can run in several nodes of cluster * doc/guide.html: Likewise diff --git a/doc/guide.html b/doc/guide.html index e29d8a56a..d0edd2215 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -1119,6 +1119,7 @@ To define a shaper named ‘normal’ with traffic speed limi can be seen by Jabber clients. If a Jabber client do not support xml:lang, the specified language is used. The default value is en. In order to take effect there must be a translation file +<<<<<<< HEAD:doc/guide.html <language>.msg in ejabberd’s msgs directory.

Examples:

3.2  Database and LDAP Configuration

+======= +<language>.msg in ejabberd’s msgs directory.

For example, to set Russian as default language: +

{language, "ru"}.
+

Appendix A provides more details about internationalization and localization.

+

3.1.8  Include Additional Configuration Files

+

The option include_config_file in a configuration file instructs ejabberd to include other configuration files immediately.

The basic usage is: +

{include_config_file, <filename>}.
+

It is also possible to specify suboptions: +

{include_config_file, <filename>, [<suboption>, <suboption>, ...]}.
+

The filename can be indicated either as an absolute path, +or relative to the main ejabberd configuration file. +It isn’t possible to use wildcards. +The file must exist and be readable.

The allowed suboptions are: +

+{disallow, [<option>, <option>, ...]}
Disallows the usage of those options in the included configuration file. +The options that match this criteria are not accepted. +The default value is an empty list: [] +
{allow_only, [<option>, <option>, ...]}
Allows only the usage of those options in the included configuration file. +The options that do not match this criteria are not accepted. +The default value is: all +

This is a basic example: +

{include_config_file, "/etc/ejabberd/additional.cfg"}.
+

In this example, the included file is not allowed to contain a listen option. +If such an option is present, the option will not be accepted. +The file is in a subdirectory from where the main configuration file is. +

{include_config_file, "./example.org/additional_not_listen.cfg", [{disallow, [listen]}]}.
+

In this example, ejabberd.cfg defines some ACL and Access rules, +and later includes another file with additional rules: +

{acl, admin, {user, "admin", "localhost"}}.
+{access, announce, [{allow, admin}]}.
+{include_config_file, "/etc/ejabberd/acl_and_access.cfg", [{allow_only, [acl, access]}]}.
+

and content of the file acl_and_access.cfg can be, for example: +

{acl, admin, {user, "bob", "localhost"}}.
+{acl, admin, {user, "jan", "localhost"}}.
+

+

3.1.9  Option Macros in Configuration File

+

In the ejabberd configuration file, +it is possible to define a macro for a value +and later use this macro when defining an option.

A macro is defined with this syntax: +

{define_macro, '<MACRO>', <value>}.
+

The MACRO must be surrounded by single quotation marks, +and all letters in uppercase; check the examples bellow. +The value can be any valid arbitrary Erlang term.

The first definition of a macro is preserved, +and additional definitions of the same macro are forgotten.

Macros are processed after +additional configuration files have been included, +so it is possible to use macros that +are defined in configuration files included before the usage.

It isn’t possible to use a macro in the definition +of another macro.

There are two ways to use a macro: +

’<MACRO>’
+You can put this instead of a value in an ejabberd option, +and will be replaced with the value previously defined. +If the macro is not defined previously, +the program will crash and report an error.
{use_macro, ’<MACRO>’, <defaultvalue>}
+Use a macro even if it may not be defined. +If the macro is not defined previously, +the provided defaultvalue is used. +This usage behaves as if it were defined and used this way: +
{define_macro, '<MACRO>', <defaultvalue>}.
+'<MACRO>'
+

This example shows the basic usage of a macro: +

{define_macro, 'LOG_LEVEL_NUMBER', 5}.
+{loglevel, 'LOG_LEVEL_NUMBER'}.
+

The resulting option interpreted by ejabberd is: {loglevel, 5}.

This example shows that values can be any arbitrary Erlang term: +

{define_macro, 'USERBOB', {user, "bob", "localhost"}}.
+{acl, admin, 'USERBOB'}.
+

The resulting option interpreted by ejabberd is: {acl, admin, {user, "bob", "localhost"}}.

This complex example: +

{define_macro, 'NUMBER_PORT_C2S', 5222}.
+{define_macro, 'PORT_S2S_IN', {5269, ejabberd_s2s_in, []}}.
+{listen,
+ [
+  {'NUMBER_PORT_C2S', ejabberd_c2s, []},
+  'PORT_S2S_IN',
+  {{use_macro, 'NUMBER_PORT_HTTP', 5280}, ejabberd_http, []}
+ ]
+}.
+

produces this result after being interpreted: +

{listen,
+ [
+  {5222, ejabberd_c2s, []},
+  {5269, ejabberd_s2s_in, []},
+  {5280, ejabberd_http, []}
+ ]
+}.
+

+

3.2  Database and LDAP Configuration

+>>>>>>> d106311... * doc/guide.tex: Provide only an example of language option:doc/guide.html

ejabberd uses its internal Mnesia database by default. However, it is possible to use a relational database or an LDAP server to store persistent, diff --git a/doc/guide.tex b/doc/guide.tex index dacb2b915..a4d0996b5 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -1389,17 +1389,10 @@ can be seen by \Jabber{} clients. If a \Jabber{} client do not support \term{en}. In order to take effect there must be a translation file \term{.msg} in \ejabberd{}'s \term{msgs} directory. -Examples: -\begin{itemize} -\item To set Russian as default language: +For example, to set Russian as default language: \begin{verbatim} {language, "ru"}. \end{verbatim} -\item To set Spanish as default language: -\begin{verbatim} -{language, "es"}. -\end{verbatim} -\end{itemize} \makesection{database}{Database and LDAP Configuration} \ind{database}