]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/views/JcrUsersView.java
2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.security
.ui
.admin
.views
;
18 public class JcrUsersView
{
20 /** List all users with filter. Legacy. TODO Remove */
21 // public class JcrUsersView extends ViewPart implements ArgeoNames {
22 // public final static String ID = SecurityAdminPlugin.PLUGIN_ID
25 // /* DEPENDENCY INJECTION */
26 // private Session session;
28 // private UsersTable userTableCmp;
29 // private JcrUserListener userStructureListener;
30 // private JcrUserListener userPropertiesListener;
33 // public void createPartControl(Composite parent) {
34 // parent.setLayout(new FillLayout());
36 // // Create the composite that displays the list and a filter
37 // userTableCmp = new UsersTable(parent, SWT.NO_FOCUS, session);
38 // userTableCmp.populate(true, false);
41 // userTableCmp.getTableViewer().addDoubleClickListener(
42 // new ViewDoubleClickListener());
43 // getViewSite().setSelectionProvider(userTableCmp.getTableViewer());
45 // // Add listener to refresh the list when something changes
46 // userStructureListener = new JcrUserListener(getSite().getShell()
48 // JcrUtils.addListener(session, userStructureListener, Event.NODE_ADDED
49 // | Event.NODE_REMOVED, ArgeoJcrConstants.PEOPLE_BASE_PATH, null);
50 // userPropertiesListener = new JcrUserListener(getSite().getShell()
52 // JcrUtils.addListener(session, userStructureListener,
53 // Event.PROPERTY_CHANGED | Event.PROPERTY_ADDED
54 // | Event.PROPERTY_REMOVED,
55 // ArgeoJcrConstants.PEOPLE_BASE_PATH,
56 // ArgeoTypes.ARGEO_USER_PROFILE);
60 // public void setFocus() {
61 // userTableCmp.setFocus();
65 // public void dispose() {
66 // JcrUtils.removeListenerQuietly(session, userStructureListener);
67 // JcrUtils.removeListenerQuietly(session, userPropertiesListener);
68 // JcrUtils.logoutQuietly(session);
72 // // public void setSession(Session session) {
73 // // this.session = session;
76 // public void refresh() {
77 // this.getSite().getShell().getDisplay().asyncExec(new Runnable() {
79 // public void run() {
80 // userTableCmp.refresh();
85 // private class JcrUserListener implements EventListener {
86 // private final Display display;
88 // public JcrUserListener(Display display) {
90 // this.display = display;
94 // public void onEvent(EventIterator events) {
95 // display.asyncExec(new Runnable() {
97 // public void run() {
98 // userTableCmp.refresh();
104 // class ViewDoubleClickListener implements IDoubleClickListener {
105 // public void doubleClick(DoubleClickEvent evt) {
106 // if (evt.getSelection().isEmpty())
109 // Object obj = ((IStructuredSelection) evt.getSelection())
110 // .getFirstElement();
111 // if (obj instanceof Node) {
113 // String username = ((Node) obj).getProperty(ARGEO_USER_ID)
115 // String commandId = OpenArgeoUserEditor.COMMAND_ID;
116 // String paramName = OpenArgeoUserEditor.PARAM_USERNAME;
117 // CommandUtils.callCommand(commandId, paramName, username);
118 // } catch (RepositoryException e) {
119 // throw new ArgeoException("Cannot open user editor", e);
125 // /* DEPENDENCY INJECTION */
126 // public void setRepository(Repository repository) {
128 // session = repository.login();
129 // } catch (RepositoryException re) {
130 // throw new ArgeoException("Unable to initialise local session", re);