From 1f1560bfa8f10079a4c49d4bb113384528e70d79 Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 9 Aug 2017 15:19:59 +0000 Subject: [PATCH] CCM NG/ccm-core: Some files for the Vaadin prototype git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4902 8810af33-2d31-482b-a856-94f89814c4df --- .../admin/ui/AdminViewController.java | 77 +++++++++++++++++++ .../libreccm/admin/ui/GroupsController.java | 43 +++++++++++ .../org/libreccm/admin/ui/RolesManager.java | 43 +++++++++++ .../libreccm/admin/ui/UsersController.java | 62 +++++++++++++++ 4 files changed, 225 insertions(+) create mode 100644 ccm-core/src/main/java/org/libreccm/admin/ui/AdminViewController.java create mode 100644 ccm-core/src/main/java/org/libreccm/admin/ui/GroupsController.java create mode 100644 ccm-core/src/main/java/org/libreccm/admin/ui/RolesManager.java create mode 100644 ccm-core/src/main/java/org/libreccm/admin/ui/UsersController.java diff --git a/ccm-core/src/main/java/org/libreccm/admin/ui/AdminViewController.java b/ccm-core/src/main/java/org/libreccm/admin/ui/AdminViewController.java new file mode 100644 index 000000000..7d9adf408 --- /dev/null +++ b/ccm-core/src/main/java/org/libreccm/admin/ui/AdminViewController.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2017 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.libreccm.admin.ui; + +import com.vaadin.cdi.ViewScoped; +import org.libreccm.l10n.GlobalizationHelper; + +import javax.inject.Inject; + +/** + * Contains injection points for all CDI beans by the AdminView and its + * components. + * + * @author Jens Pelzetter + */ +@ViewScoped +class AdminViewController { + + protected AdminViewController() { + super(); + } + + + @Inject + private GlobalizationHelper globalizationHelper; + + @Inject + private GroupsController groupsController; + + @Inject + private JpqlConsoleController jpqlConsoleController; + + @Inject + private RolesManager rolesManager; + + @Inject + private UsersController usersController; + + protected GlobalizationHelper getGlobalizationHelper() { + return globalizationHelper; + } + + protected GroupsController getGroupsController() { + return groupsController; + } + + protected JpqlConsoleController getJpqlConsoleController() { + return jpqlConsoleController; + } + + protected RolesManager getRolesManager() { + return rolesManager; + } + + protected UsersController getUsersController() { + return usersController; + } + + + +} diff --git a/ccm-core/src/main/java/org/libreccm/admin/ui/GroupsController.java b/ccm-core/src/main/java/org/libreccm/admin/ui/GroupsController.java new file mode 100644 index 000000000..0349af035 --- /dev/null +++ b/ccm-core/src/main/java/org/libreccm/admin/ui/GroupsController.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2017 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.libreccm.admin.ui; + +import com.vaadin.cdi.ViewScoped; +import org.libreccm.security.GroupManager; +import org.libreccm.security.GroupRepository; + +import javax.inject.Inject; + +/** + * + * @author Jens Pelzetter + */ +@ViewScoped +public class GroupsController { + + @Inject + private GroupManager groupManager; + + @Inject + private GroupRepository groupRepository; + + @Inject + private GroupsTableDataProvider groupsTableDataProvider; + +} diff --git a/ccm-core/src/main/java/org/libreccm/admin/ui/RolesManager.java b/ccm-core/src/main/java/org/libreccm/admin/ui/RolesManager.java new file mode 100644 index 000000000..81f3f83c6 --- /dev/null +++ b/ccm-core/src/main/java/org/libreccm/admin/ui/RolesManager.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2017 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.libreccm.admin.ui; + +import com.vaadin.cdi.ViewScoped; +import org.libreccm.security.RoleManager; +import org.libreccm.security.RoleRepository; + +import javax.inject.Inject; + +/** + * + * @author Jens Pelzetter + */ +@ViewScoped +class RolesManager { + + @Inject + private RoleManager roleManager; + + @Inject + private RoleRepository roleRepository; + + @Inject + private RolesTableDataProvider rolesTableDataProvider; + +} diff --git a/ccm-core/src/main/java/org/libreccm/admin/ui/UsersController.java b/ccm-core/src/main/java/org/libreccm/admin/ui/UsersController.java new file mode 100644 index 000000000..36b958ed2 --- /dev/null +++ b/ccm-core/src/main/java/org/libreccm/admin/ui/UsersController.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2017 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.libreccm.admin.ui; + +import com.vaadin.cdi.ViewScoped; +import org.libreccm.security.UserManager; +import org.libreccm.security.UserRepository; + +import javax.inject.Inject; + +/** + * Contains all injection points + * + * @author Jens Pelzetter + */ +@ViewScoped +class UsersController { + + @Inject + private UserManager userManager; + + @Inject + private UserRepository userRepository; + + @Inject + private UsersTableDataProvider usersTableDataProvider; + + protected UsersController() { + super(); + } + + protected UserManager getUserManager() { + return userManager; + } + + protected UserRepository getUserRepository() { + return userRepository; + } + + protected UsersTableDataProvider getUsersTableDataProvider() { + return usersTableDataProvider; + } + + + +}