Index: /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote.pm
===================================================================
--- /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote.pm	(revision 1570)
+++ /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote.pm	(revision 1570)
@@ -0,0 +1,60 @@
+package LATMOS::Accounts::Web::Controller::Remote;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller'; }
+
+=head1 NAME
+
+LATMOS::Accounts::Web::Controller::Remote - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller.
+
+=head1 METHODS
+
+=cut
+
+sub begin {
+    my ( $self, $c ) = @_;
+
+    if ($c->user_exists) {
+        # Set login user:
+        $c->model('Accounts')->db->{_user} =
+        $c->user->{username};
+    }
+}
+
+=head2 index
+
+=cut
+
+sub index :Path :Args(0) {
+    my ( $self, $c ) = @_;
+
+    $c->response->body('Matched LATMOS::Accounts::Web::Controller::Remote in Remote.');
+}
+
+sub end : Private {
+    my ( $self, $c ) = @_;
+    $c->stash->{data} ||= {};
+    $c->forward($c->view('Json'));
+}
+
+=encoding utf8
+
+=head1 AUTHOR
+
+Olivier Thauvin,Guyancourt - B1428,+33 1 80285052,
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Index: /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Listing.pm
===================================================================
--- /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Listing.pm	(revision 1570)
+++ /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Listing.pm	(revision 1570)
@@ -0,0 +1,71 @@
+package LATMOS::Accounts::Web::Controller::Remote::Listing;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller'; }
+
+=head1 NAME
+
+LATMOS::Accounts::Web::Controller::Remote::Listing - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller.
+
+=head1 METHODS
+
+=cut
+
+
+=head2 index
+
+=cut
+
+sub index :Path :Args(0) {
+    my ( $self, $c ) = @_;
+
+    my $base = $c->model('Accounts')->db;
+
+    my $otype = $c->req->param('otype');
+    my @search = $c->req->param('q');
+    my @attrs = $c->req->param('attribute');
+
+    if (!$base->is_supported_object($otype)) {
+        $c->res->status('404');
+        return;
+    }
+
+    my %objects = map { $_ => {} } $c->model('Accounts')->db->search_objects($otype, @search);
+
+    foreach my $attr (@attrs) {
+        foreach (keys %objects) {
+            $objects{$_}{$attr} = [];
+        }
+        my %res = $base->attributes_summary_by_object($otype, $attr);
+        foreach my $obj (keys %res) {
+            exists($objects{$obj}) or next;
+            $objects{$obj}{$attr} = $res{$obj};
+        }
+    }
+
+    $c->stash->{data} = \%objects;
+}
+
+
+
+=encoding utf8
+
+=head1 AUTHOR
+
+Olivier Thauvin,Guyancourt - B1428,+33 1 80285052,
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Index: /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Obj.pm
===================================================================
--- /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Obj.pm	(revision 1570)
+++ /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Obj.pm	(revision 1570)
@@ -0,0 +1,85 @@
+package LATMOS::Accounts::Web::Controller::Remote::Obj;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller'; }
+
+=head1 NAME
+
+LATMOS::Accounts::Web::Controller::Remote::Obj - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller.
+
+=head1 METHODS
+
+=cut
+
+
+=head2 index
+
+=cut
+
+sub index :Path :Args(0) {
+    my ( $self, $c ) = @_;
+
+    $c->stash->{data} = [
+        $c->model('Accounts')->db->list_supported_objects
+    ];
+}
+
+sub List :Path :Args(1) {
+    my ($self, $c, $otype) = @_;
+
+    if (!$c->model('Accounts')->db->is_supported_object($otype)) {
+        $c->res->status('404');
+        return;
+    }
+
+    $c->stash->{data} = [
+        $c->model('Accounts')->db->list_objects($otype)
+    ]
+}
+
+sub Show :Path :Args(2) {
+    my ($self, $c, $otype, $id) = @_;
+
+    my $base = $c->model('Accounts')->db;
+
+    if (!$base->is_supported_object($otype)) {
+        $c->res->status('404');
+        return;
+    }
+
+    my $obj = $base->get_object($otype, $id);
+
+    if (!$obj) {
+        $c->res->status('404');
+        return;
+    } 
+
+    foreach my $attr (sort { $a cmp $b } $base->list_canonical_fields($otype, 'r')) {
+        my $oattr = $obj->attribute($attr) or next;
+        if ($oattr->hidden) { next; }
+        my $val = $obj->get_c_field($attr);
+        $c->stash->{data}{$attr} = $val if ($val);
+    } 
+}
+
+=encoding utf8
+
+=head1 AUTHOR
+
+Olivier Thauvin,Guyancourt - B1428,+33 1 80285052,
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Index: /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Search.pm
===================================================================
--- /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Search.pm	(revision 1570)
+++ /trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Search.pm	(revision 1570)
@@ -0,0 +1,59 @@
+package LATMOS::Accounts::Web::Controller::Remote::Search;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller'; }
+
+=head1 NAME
+
+LATMOS::Accounts::Web::Controller::Remote::Search - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller.
+
+=head1 METHODS
+
+=cut
+
+
+=head2 index
+
+=cut
+
+sub index :Path :Args(0) {
+    my ( $self, $c ) = @_;
+
+    my $otype = $c->req->param('otype');
+    my @search = $c->req->param('q');
+
+    my $base = $c->model('Accounts')->db;
+
+    if (!$base->is_supported_object($otype)) {
+        $c->res->status('404');
+        return;
+    }
+
+    $c->stash->{data} = [
+        $c->model('Accounts')->db->search_objects($otype, @search)
+    ]    
+}
+
+
+
+=encoding utf8
+
+=head1 AUTHOR
+
+Olivier Thauvin,Guyancourt - B1428,+33 1 80285052,
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Index: /trunk/LATMOS-Accounts-Web/t/controller_Remote-Listing.t
===================================================================
--- /trunk/LATMOS-Accounts-Web/t/controller_Remote-Listing.t	(revision 1570)
+++ /trunk/LATMOS-Accounts-Web/t/controller_Remote-Listing.t	(revision 1570)
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+use Test::More;
+
+
+use Catalyst::Test 'LATMOS::Accounts::Web';
+use LATMOS::Accounts::Web::Controller::Remote::Listing;
+
+ok( request('/remote/listing')->is_success, 'Request should succeed' );
+done_testing();
Index: /trunk/LATMOS-Accounts-Web/t/controller_Remote-Obj.t
===================================================================
--- /trunk/LATMOS-Accounts-Web/t/controller_Remote-Obj.t	(revision 1570)
+++ /trunk/LATMOS-Accounts-Web/t/controller_Remote-Obj.t	(revision 1570)
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+use Test::More;
+
+
+use Catalyst::Test 'LATMOS::Accounts::Web';
+use LATMOS::Accounts::Web::Controller::Remote::Obj;
+
+ok( request('/remote/obj')->is_success, 'Request should succeed' );
+done_testing();
Index: /trunk/LATMOS-Accounts-Web/t/controller_Remote-Search.t
===================================================================
--- /trunk/LATMOS-Accounts-Web/t/controller_Remote-Search.t	(revision 1570)
+++ /trunk/LATMOS-Accounts-Web/t/controller_Remote-Search.t	(revision 1570)
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+use Test::More;
+
+
+use Catalyst::Test 'LATMOS::Accounts::Web';
+use LATMOS::Accounts::Web::Controller::Remote::Search;
+
+ok( request('/remote/search')->is_success, 'Request should succeed' );
+done_testing();
Index: /trunk/LATMOS-Accounts-Web/t/controller_Remote.t
===================================================================
--- /trunk/LATMOS-Accounts-Web/t/controller_Remote.t	(revision 1570)
+++ /trunk/LATMOS-Accounts-Web/t/controller_Remote.t	(revision 1570)
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+use Test::More;
+
+
+use Catalyst::Test 'LATMOS::Accounts::Web';
+use LATMOS::Accounts::Web::Controller::Remote;
+
+ok( request('/remote')->is_success, 'Request should succeed' );
+done_testing();
Index: /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
===================================================================
--- /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm	(revision 1569)
+++ /trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm	(revision 1570)
@@ -710,4 +710,5 @@
             cn =>  { iname => 'name', ro => 1 },
             gecos => {
+                managed => 1,
                 ro => 1,
                 get => sub {
