++ed by:
GUIMARD

1 PAUSE user

Clément OUDOT
and 1 contributors

NAME

Lemonldap::NG::Manager::Build - Static files generator of Lemonldap::NG Web-SSO system.

SYNOPSIS

  use Lemonldap::NG::Manager::Build;
  
  Lemonldap::NG::Manager::Build->run(
    structFile            => "site/static/struct.json",
    confTreeFile          => "site/static/js/conftree.js",
    managerConstantsFile  => "lib/Lemonldap/NG/Manager/Constants.pm",
    managerAttributesFile => 'lib/Lemonldap/NG/Manager/Attributes.pm',
    defaultValuesFile     => "lib/Lemonldap/NG/Common/Conf/DefaultValues.pm",
    firstLmConfFile       => "_example/conf/lmConf-1.js",
  );

DESCRIPTION

Lemonldap::NG::Manager::Build is used only to build javascript files and Lemonldap::NG constants Perl files. It has to be launched after each change.

DEVELOPER CORNER

To add a new parameter, you have to:

declare it in Manager/Build/Attributes.pm;
declare its position in the tree in Manager/Build/Tree.pm (or Manager/Build/CTrees.pm for complex nodes);
refresh files using this (or launch any build makefile target at the root of the Lemonldap::NG project sources).

See below for details.

Attribute declaration

Set your new attribute as a key of attributes() function that points to a hash ref containing:

type (required):

the type of the content. It must be declared in sub types() in the same file (except if attribute embeds its own tests) and must correspond to a form stored in the static/forms/ directory;

help (optional):

the relative HTML path to the help page (relative to /doc/pages/documentation/<version>/);

default (recommended):

a default value to set if not defined;

select (optional):

required only if type is `select`. In this case, it must contains an array of { k => <keyName>, v => <display name> } hashref

documentation (recommended):

some words for other developpers

test (optional):

if test is not defined for this type or if test must be more restrictive, set her a regular expression or a subroutine. Arguments passed to subroutine are (keyValue, newConf, currentKey), it returns 2 arguments: a boolean result and a message (if non empty will be displayed as warning or error depending of result);

msgFail (optional):

for regexp based tests, message to display in case of error. Words to translate have to be written as so: __toTranslate__;

keyTest (optional):

for keys/values attributes, test to be applied on key;

keyMsgFail (optional):

for regexp based key tests, same as msgFail for keys test;

If you decide to declare a new type, you have to declare the following properties:

test, msgFail, keyTest, keyMsgFail as shown above,
form: the form to use if it doesn't have the same name.

Tree positioning

The tree is now very simple: it contains nodes and leaf. Leaf are designed only by their attribute name. All description must be done in the file described above. Nodes are array member designed as this:

  {
    title => 'titleToTranslate',
    help  => 'helpUrl',
    form  => 'relativeUrl',
    nodes => [
      ... nodes or leaf ...
    ]
  }

Explanations:

title (required):

it must contain an entry of static/languages/lang.json

help (recommended):

as above, the relative HTML path to the help page (relative to /doc/pages/documentation/<version>/);

form (optional):

the name of a static/forms/<name>.html file

nodes:

array of sub nodes and leaf attached to this node

group:

must never be used in conjunction with nodes. Array of leafs only to be displayed in the same form

nodes_cond:

array of sub nodes that will be displayed with a filter. Not yet documented here, see the source code of site/static/js/filterFunctions.js.

nodes_filter:

filter entry in site/static/js/filterFunctions.js for the same feature.

SEE ALSO

Lemonldap::NG::Manager, http://lemonldap-ng.org/

AUTHORS

Clement Oudot, <clem.oudot@gmail.com>
François-Xavier Deltombe, <fxdeltombe@gmail.com.>
Xavier Guimard, <x.guimard@free.fr>
Thomas Chemineau, <thomas.chemineau@gmail.com>

BUG REPORT

Use OW2 system to report bug or ask for features: http://jira.ow2.org

DOWNLOAD

Lemonldap::NG is available at http://forge.objectweb.org/project/showfiles.php?group_id=274

COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.