Menu

#5 Read XML configuration for handlers

open
nobody
portal (6)
5
2005-03-23
2005-03-23
No

In module Lemonldap::Handlers::Generic (v0.06), it
seems having a problem on reading XML config for handler.

For example, my configuration is :
<domain
id="d069.cp"
Cookie="linagora"
templates_dir="/var/www/portail/templates"
Portal="http://portail.d069.cp/portail/accueil.pl"
Menu="http://portail.d069.cp/portail/menu.pl"
ldap_server="ldap-lyon-qualif.d069.cp"
ldap_branch_people="ou=dgcp,ou=mefi,o=gouv,c=fr"
Session="memcached"
>
<handler
id="clement"
AttrLdap="ldap_auth"
CodeAppli="LIN"
Basepub="http://hander.d069.cp"
BasePriv="http://www.linagora.com"
IpcNb="0"
EnabledProxy="1"
ProxyExt="http://IP.IP.IP.IP:3132"
>
</handler>

All elements in <domain> are well retrivied, but none
for <handler>. I correct the line 152 :
OLD : my $tmpconf = $GENERAL->{$ID_HANDLER};
NEW : my $tmpconf = $GENERAL->{"handler"}->{$ID_HANDLER};

It works for me...

Discussion

  • Clement OUDOT

    Clement OUDOT - 2005-04-19

    Logged In: YES
    user_id=1141377

    After researches I think I've found the source of the problem :

    when you use IPC cache, you call the _readFile subroutine,
    which parses the XML file like that :
    XMLin( $file, ForceArray => 1) ;

    but when you skip te IPC Cache, in the getAllConfig
    subroutine, you parse the XML file like that :
    XMLin( $file );

    You have to set the option ForecArray here too...

    ---
    Clment OUDOT
    LINAGORA

    http://www.linagora.com
    http://www.linagora.org

     
  • Clement OUDOT

    Clement OUDOT - 2005-04-21

    Logged In: YES
    user_id=1141377

    The ForceArray option doesn't seem to be the final solution...

    When I dump my config, with or without the ForceArray
    option, I have :
    #================================
    'domain' => {
    'd069.cp' => {
    'templates_dir' =>
    '/var/www/portail/templates',
    'ldap_server' => 'XXXX',
    'Portal' =>
    'http://portail.d069.cp/portail/accueil.pl',
    'handler' => {
    'clement2' => {

    'AttrLdap' => 'ldap_auth',

    'BasePriv' => 'http://www.linagora.com',

    'BasePub' => 'http://handler.d069.cp',

    'ProxyExt' => 'http://XXXX:3132',

    'EnabledProxy' => '1',

    'CodeAppli' => 'LIN',

    'IpcNb' => '5'
    },
    'clement' => {

    'AttrLdap' => 'ldap_auth',

    'BasePriv' => 'http://www.linagora.com',

    'BasePub' => 'http://handler.d069.cp',

    'ProxyExt' => 'http://XXX:3132',

    'EnabledProxy' => '1',

    'CodeAppli' => 'LIN',

    'IpcNb' => '5'
    }
    },
    'Session' => 'memcached',
    'ldap_branch_people' =>
    'XXXX',
    'Cookie' => 'maitre',
    'Menu' =>
    'http://portail.d069.cp/portail/menu.pl'
    },
    }
    #================================

    So you see that "handler_id" keys are below "handler" key
    and not at the same level, so the path to access their
    informations is {"handler"}->{"handler_id"} and not just
    {"handler_id"}.

    For infomrmation I use the Debian packages for perl XML...

     

Log in to post a comment.

MongoDB Logo MongoDB