Aleksander Adamowski > Gtk2-Net-LDAP-Widgets > Gtk2::Net::LDAP::Widgets::LdapTreeSelector

Download:
Gtk2-Net-LDAP-Widgets-2.0.1.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 2.0.1   Source  

NAME ^

Gtk2::Net::LDAP::Widgets::LdapTreeSelector - LDAP entry tree selection window

SYNOPSIS ^

    use Gtk2::Net::LDAP::Widgets;

    my $entryPopup = Gtk2::Net::LDAP::Widgets::LdapTreeSelector->new ($parent_window,
      $ldap_source,
      'o=People,dc=example,dc=com',
      '(|(objectClass=inetorgperson)(objectClass=organization))',
      'interactive_filter_type' => 'none',
      'single_selection' => 1
    );
    # expand entries below top-level tree entry:
    $entryPopup->{ldapTreeView}->expand_row(Gtk2::TreePath->new_from_string('0'), 0);
    $entryPopup->signal_connect (response => sub {
      my ($popup, $response) = @_;
      if($response =~ 'accept') {
        print "Selected entry DN: ".$entryPopup->get_dn;
      }
      $_[0]->destroy;
    });
    $entryPopup->show_all;

ABSTRACT ^

Gtk2::Net::LDAP::Widgets::LdapTreeSelector is a child class to Gtk2::Dialog and is used to create a Gtk2 dialog which lets the user select LDAP entry/entries displayed in a tree-like structure.

The dialog may be equipped with a search/filter box, although there might be problems with displaying search results when an interactive filter is set since there may be problems building the tree if all ancestors for an entry aren't included in the search result.

So it's advised to use this component without displaying a search/filter box ('interactive_filter_type' => 'none').

CONSTRUCTOR ^

new ( parent, ldap_source, base_dn, static_filter, named parameters )

Creates a new Gtk2::Net::LDAP::Widgets::LdapTreeSelector object.

parent the Gtk2::Window which will be parent of this Gtk2::Dialog

ldap_source the Net::LDAP object which is an active connection to an LDAP server

base_dn the base DN of LDAP search operations

static_filter the static filter that will be logically AND-ed with all filters executed by this selector

named parameters

init_interactive_filter => 'some ldap filter'

The string to be initially put in the filter box

single_selection => 0 | 1

Whether to use single selection mode (otherwise multiple selection is posible)

interactive_filter_type => 'ldap' | 'simple' | 'none'

The type of filter box: 'ldap' supports full LDAP filter syntax, 'simple' does a substring search against the "cn" attribute, 'none' disables the search/filter box.

refresh_list

Refresh the entries list - re-execute the search with the filter determined by the search/filter box.

get_dn

Return the list of selected entries' Distinguished Names.

The list has at most one entry if single_selection is set to 1.

SEE ALSO ^

Gtk2::Net::LDAP::Widgets Gtk2 Net::LDAP

AUTHOR ^

Aleksander Adamowski, <cpan@olo.org.pl>

COPYRIGHT AND LICENSE ^

Copyright 2005,2008 by Aleksander Adamowski

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: