CCM NG/ccm-core: Some things for the Vaadin prototype
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4829 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
c23f1fbcba
commit
da7c2a5190
|
|
@ -219,10 +219,10 @@ public class GroupDetails extends Window {
|
||||||
membersGridHeaderCell
|
membersGridHeaderCell
|
||||||
.setComponent(new HorizontalLayout(addMemberButton));
|
.setComponent(new HorizontalLayout(addMemberButton));
|
||||||
|
|
||||||
final GroupMembersTableDataProvider dataProvider = cdiUtil
|
final GroupMembersTableDataProvider usersDataProvider = cdiUtil
|
||||||
.findBean(GroupMembersTableDataProvider.class);
|
.findBean(GroupMembersTableDataProvider.class);
|
||||||
dataProvider.setGroup(group);
|
usersDataProvider.setGroup(group);
|
||||||
membersGrid.setDataProvider(dataProvider);
|
membersGrid.setDataProvider(usersDataProvider);
|
||||||
|
|
||||||
final GroupRolesController rolesController = cdiUtil
|
final GroupRolesController rolesController = cdiUtil
|
||||||
.findBean(GroupRolesController.class);
|
.findBean(GroupRolesController.class);
|
||||||
|
|
@ -240,24 +240,46 @@ public class GroupDetails extends Window {
|
||||||
rolesGrid.getDataProvider().refreshAll();
|
rolesGrid.getDataProvider().refreshAll();
|
||||||
}))
|
}))
|
||||||
.setId(COL_ROLE_REMOVE);
|
.setId(COL_ROLE_REMOVE);
|
||||||
|
|
||||||
rolesGrid.setWidth("100%");
|
rolesGrid.setWidth("100%");
|
||||||
|
|
||||||
final RoleRepository roleRepository = cdiUtil
|
final RoleRepository roleRepository = cdiUtil
|
||||||
.findBean(RoleRepository.class);
|
.findBean(RoleRepository.class);
|
||||||
|
|
||||||
final HeaderRow rolesGridHeader = rolesGrid.prependHeaderRow();
|
final HeaderRow rolesGridHeader = rolesGrid.prependHeaderRow();
|
||||||
final Button addRoleButton = new Button("Add role");
|
final Button addRoleButton = new Button("Add role");
|
||||||
addRoleButton.setIcon(VaadinIcons.PLUS);
|
addRoleButton.setIcon(VaadinIcons.PLUS);
|
||||||
addRoleButton.setStyleName(ValoTheme.BUTTON_TINY);
|
addRoleButton.setStyleName(ValoTheme.BUTTON_TINY);
|
||||||
addRoleButton.addClickListener(event -> {
|
addRoleButton.addClickListener(event -> {
|
||||||
|
final RoleSelector roleSelector = new RoleSelector(
|
||||||
|
"Select role(s) to add to group",
|
||||||
|
"Add selected role(s) to group",
|
||||||
|
usersGroupsRoles,
|
||||||
|
roleRepository.findByParty(group),
|
||||||
|
(selectedRoles -> {
|
||||||
|
selectedRoles.forEach(role -> {
|
||||||
|
rolesController.assignRoleToGroup(role, group);
|
||||||
|
rolesGrid.getDataProvider().refreshAll();
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
roleSelector.center();
|
||||||
|
roleSelector.setWidth("80%");
|
||||||
|
UI.getCurrent().addWindow(roleSelector);
|
||||||
});
|
});
|
||||||
//ToDo Add roles grid
|
final HeaderCell rolesGridHeaderCell = rolesGridHeader
|
||||||
|
.join(COL_ROLE_NAME,
|
||||||
|
COL_ROLE_REMOVE);
|
||||||
|
rolesGridHeaderCell
|
||||||
|
.setComponent(new HorizontalLayout(addRoleButton));
|
||||||
|
|
||||||
|
final GroupRolesTableDataProvider rolesDataProvider = cdiUtil
|
||||||
|
.findBean(GroupRolesTableDataProvider.class);
|
||||||
|
rolesDataProvider.setGroup(group);
|
||||||
|
rolesGrid.setDataProvider(rolesDataProvider);
|
||||||
|
|
||||||
final TabSheet tabs = new TabSheet();
|
final TabSheet tabs = new TabSheet();
|
||||||
tabs.addTab(membersGrid, "Members");
|
tabs.addTab(membersGrid, "Members");
|
||||||
tabs.addTab(new Label("Roles Placeholder"), "Roles");
|
tabs.addTab(rolesGrid, "Roles");
|
||||||
|
|
||||||
final VerticalLayout windowLayout = new VerticalLayout(propertiesPanel,
|
final VerticalLayout windowLayout = new VerticalLayout(propertiesPanel,
|
||||||
tabs);
|
tabs);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package org.libreccm.admin.ui.usersgroupsroles;
|
||||||
|
|
||||||
import com.arsdigita.ui.admin.AdminUiConstants;
|
import com.arsdigita.ui.admin.AdminUiConstants;
|
||||||
|
|
||||||
import com.vaadin.cdi.CDIUI;
|
|
||||||
import com.vaadin.icons.VaadinIcons;
|
import com.vaadin.icons.VaadinIcons;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Grid;
|
import com.vaadin.ui.Grid;
|
||||||
|
|
@ -42,56 +41,61 @@ import java.util.ResourceBundle;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
public class RoleSelector extends Window {
|
public class RoleSelector extends Window {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1437536052155383270L;
|
private static final long serialVersionUID = -1437536052155383270L;
|
||||||
|
|
||||||
private static final String COL_NAME = "rolename";
|
private static final String COL_NAME = "rolename";
|
||||||
|
private static final String COL_OTHER = "other";
|
||||||
|
|
||||||
private final RoleRepository roleRepo;
|
private final RoleRepository roleRepo;
|
||||||
|
|
||||||
private final RoleSelectionAction roleSelectionAction;
|
private final RoleSelectionAction roleSelectionAction;
|
||||||
|
|
||||||
public RoleSelector(final String caption,
|
public RoleSelector(final String caption,
|
||||||
final String actionLabel,
|
final String actionLabel,
|
||||||
final UsersGroupsRoles usersGroupsRoles,
|
final UsersGroupsRoles usersGroupsRoles,
|
||||||
final List<Role> excludedRoles,
|
final List<Role> excludedRoles,
|
||||||
final RoleSelectionAction action) {
|
final RoleSelectionAction action) {
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
roleRepo = cdiUtil.findBean(RoleRepository.class);
|
roleRepo = cdiUtil.findBean(RoleRepository.class);
|
||||||
this.roleSelectionAction = action;
|
this.roleSelectionAction = action;
|
||||||
|
|
||||||
addWidgets(caption, actionLabel, excludedRoles, action);
|
addWidgets(caption, actionLabel, excludedRoles, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addWidgets(final String caption,
|
private void addWidgets(final String caption,
|
||||||
final String actionLabel,
|
final String actionLabel,
|
||||||
final List<Role> excludedRoles,
|
final List<Role> excludedRoles,
|
||||||
final RoleSelectionAction action) {
|
final RoleSelectionAction action) {
|
||||||
|
|
||||||
setCaption(caption);
|
setCaption(caption);
|
||||||
|
|
||||||
final ResourceBundle bundle = ResourceBundle
|
final ResourceBundle bundle = ResourceBundle
|
||||||
.getBundle(AdminUiConstants.ADMIN_BUNDLE,
|
.getBundle(AdminUiConstants.ADMIN_BUNDLE,
|
||||||
UI.getCurrent().getLocale());
|
UI.getCurrent().getLocale());
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
||||||
final Grid<Role> rolesGrid = new Grid<>();
|
final Grid<Role> rolesGrid = new Grid<>();
|
||||||
rolesGrid
|
rolesGrid
|
||||||
.addColumn(Role::getName)
|
.addColumn(Role::getName)
|
||||||
.setId(COL_NAME)
|
.setId(COL_NAME)
|
||||||
.setCaption("Role");
|
.setCaption("Role");
|
||||||
|
rolesGrid
|
||||||
|
.addColumn(role -> " ")
|
||||||
|
.setId(COL_OTHER)
|
||||||
|
.setCaption(" ");
|
||||||
|
|
||||||
rolesGrid.setSelectionMode(Grid.SelectionMode.MULTI);
|
rolesGrid.setSelectionMode(Grid.SelectionMode.MULTI);
|
||||||
rolesGrid.setWidth("100%");
|
rolesGrid.setWidth("100%");
|
||||||
|
|
||||||
final Button actionButton = new Button(actionLabel);
|
final Button actionButton = new Button(actionLabel);
|
||||||
actionButton.addClickListener(event -> {
|
actionButton.addClickListener(event -> {
|
||||||
action.action(rolesGrid.getSelectedItems());
|
action.action(rolesGrid.getSelectedItems());
|
||||||
close();
|
close();
|
||||||
});
|
});
|
||||||
|
|
||||||
actionButton.setIcon(VaadinIcons.PLUS_CIRCLE_O);
|
actionButton.setIcon(VaadinIcons.PLUS_CIRCLE_O);
|
||||||
actionButton.setStyleName(ValoTheme.BUTTON_TINY);
|
actionButton.setStyleName(ValoTheme.BUTTON_TINY);
|
||||||
|
|
||||||
|
|
@ -101,9 +105,10 @@ public class RoleSelector extends Window {
|
||||||
});
|
});
|
||||||
clearButton.setIcon(VaadinIcons.BACKSPACE);
|
clearButton.setIcon(VaadinIcons.BACKSPACE);
|
||||||
clearButton.setStyleName(ValoTheme.BUTTON_TINY);
|
clearButton.setStyleName(ValoTheme.BUTTON_TINY);
|
||||||
|
|
||||||
final HeaderRow actions = rolesGrid.prependHeaderRow();
|
final HeaderRow actions = rolesGrid.prependHeaderRow();
|
||||||
final HeaderCell actionsCell = actions.join(COL_NAME);
|
final HeaderCell actionsCell = actions.join(COL_NAME,
|
||||||
|
COL_OTHER);
|
||||||
actionsCell.setComponent(new HorizontalLayout(actionButton,
|
actionsCell.setComponent(new HorizontalLayout(actionButton,
|
||||||
clearButton));
|
clearButton));
|
||||||
|
|
||||||
|
|
@ -116,4 +121,5 @@ public class RoleSelector extends Window {
|
||||||
|
|
||||||
setContent(rolesGrid);
|
setContent(rolesGrid);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,66 +70,73 @@ import static org.libreccm.core.CoreConstants.DB_SCHEMA;
|
||||||
@NamedQueries({
|
@NamedQueries({
|
||||||
@NamedQuery(name = "Role.findByName",
|
@NamedQuery(name = "Role.findByName",
|
||||||
query = "SELECT r FROM Role r "
|
query = "SELECT r FROM Role r "
|
||||||
+ "WHERE r.name = :name")
|
+ "WHERE r.name = :name")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.count",
|
name = "Role.count",
|
||||||
query = "SELECT COUNT(r) FROM Role r")
|
query = "SELECT COUNT(r) FROM Role r")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.findAllOrderedByRoleName",
|
name = "Role.findAllOrderedByRoleName",
|
||||||
query = "SELECT r FROM Role r ORDER BY r.name")
|
query = "SELECT r FROM Role r ORDER BY r.name")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.findAllOrderedByRoleNameLimit",
|
name = "Role.findAllOrderedByRoleNameLimit",
|
||||||
query = "SELECT r FROM Role r ORDER BY r.name ")
|
query = "SELECT r FROM Role r ORDER BY r.name ")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.findAllOrderedByRoleNameDesc",
|
name = "Role.findAllOrderedByRoleNameDesc",
|
||||||
query = "SELECT r FROM Role r ORDER BY r.name DESC")
|
query = "SELECT r FROM Role r ORDER BY r.name DESC")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.searchByName",
|
name = "Role.searchByName",
|
||||||
query = "SELECT r FROM Role r "
|
query = "SELECT r FROM Role r "
|
||||||
+ "WHERE LOWER(r.name) LIKE CONCAT(LOWER(:name), '%') "
|
+ "WHERE LOWER(r.name) LIKE CONCAT(LOWER(:name), '%') "
|
||||||
+ "ORDER BY r.name ")
|
+ "ORDER BY r.name ")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.searchByNameCount",
|
name = "Role.searchByNameCount",
|
||||||
query = "SELECT COUNT(r.name) FROM Role r "
|
query = "SELECT COUNT(r.name) FROM Role r "
|
||||||
+ "WHERE LOWER(r.name) LIKE CONCAT(LOWER(:name), '%') "
|
+ "WHERE LOWER(r.name) LIKE CONCAT(LOWER(:name), '%') "
|
||||||
+ "GROUP BY r.name "
|
+ "GROUP BY r.name "
|
||||||
+ "ORDER BY r.name ")
|
+ "ORDER BY r.name ")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.findByPrivilege",
|
name = "Role.findByPrivilege",
|
||||||
query = "SELECT r FROM Role r JOIN r.permissions p "
|
query = "SELECT r FROM Role r JOIN r.permissions p "
|
||||||
+ "WHERE p.grantedPrivilege = :privilege "
|
+ "WHERE p.grantedPrivilege = :privilege "
|
||||||
+ "ORDER BY r.name")
|
+ "ORDER BY r.name")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.findByPrivilegeAndObject",
|
name = "Role.findByPrivilegeAndObject",
|
||||||
query = "SELECT r FROM Role r JOIN r.permissions p "
|
query = "SELECT r FROM Role r JOIN r.permissions p "
|
||||||
+ "WHERE p.grantedPrivilege = :privilege "
|
+ "WHERE p.grantedPrivilege = :privilege "
|
||||||
+ "AND p.object = :object "
|
+ "AND p.object = :object "
|
||||||
+ "ORDER BY r.name")
|
+ "ORDER BY r.name")
|
||||||
,
|
,
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "Role.findRolesOfUser",
|
name = "Role.findRolesOfUser",
|
||||||
query = "SELECT r.role FROM RoleMembership r "
|
query = "SELECT r.role FROM RoleMembership r "
|
||||||
+ "WHERE r.member = :user")
|
+ "WHERE r.member = :user")
|
||||||
|
,
|
||||||
|
@NamedQuery(
|
||||||
|
name = "Role.findByParty",
|
||||||
|
query = "SELECT r FROM Role r "
|
||||||
|
+ "JOIN r.memberships m "
|
||||||
|
+ "WHERE m.member = :member"
|
||||||
|
)
|
||||||
})
|
})
|
||||||
@NamedEntityGraphs({
|
@NamedEntityGraphs({
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
name = Role.ENTITY_GRPAH_WITH_MEMBERS,
|
name = Role.ENTITY_GRPAH_WITH_MEMBERS,
|
||||||
attributeNodes = {
|
attributeNodes = {
|
||||||
@NamedAttributeNode(value = "memberships"),})
|
@NamedAttributeNode(value = "memberships"),})
|
||||||
,
|
,
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
name = Role.ENTITY_GRPAH_WITH_PERMISSIONS,
|
name = Role.ENTITY_GRPAH_WITH_PERMISSIONS,
|
||||||
attributeNodes = {
|
attributeNodes = {
|
||||||
@NamedAttributeNode(value = "permissions")
|
@NamedAttributeNode(value = "permissions")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@XmlRootElement(name = "role", namespace = CORE_XML_NS)
|
@XmlRootElement(name = "role", namespace = CORE_XML_NS)
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
|
@ -142,9 +149,9 @@ public class Role implements Serializable, Portable {
|
||||||
private static final long serialVersionUID = -7121296514181469687L;
|
private static final long serialVersionUID = -7121296514181469687L;
|
||||||
|
|
||||||
public static final String ENTITY_GRPAH_WITH_MEMBERS
|
public static final String ENTITY_GRPAH_WITH_MEMBERS
|
||||||
= "Role.withMembers";
|
= "Role.withMembers";
|
||||||
public static final String ENTITY_GRPAH_WITH_PERMISSIONS
|
public static final String ENTITY_GRPAH_WITH_PERMISSIONS
|
||||||
= "Role.withPermissions";
|
= "Role.withPermissions";
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "ROLE_ID")
|
@Column(name = "ROLE_ID")
|
||||||
|
|
@ -168,12 +175,12 @@ public class Role implements Serializable, Portable {
|
||||||
*/
|
*/
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "ROLE_DESCRIPTIONS",
|
joinTable = @JoinTable(name = "ROLE_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "ROLE_ID")
|
@JoinColumn(name = "ROLE_ID")
|
||||||
}))
|
}))
|
||||||
@XmlElement(name = "description", namespace = CORE_XML_NS)
|
@XmlElement(name = "description", namespace = CORE_XML_NS)
|
||||||
private LocalizedString description = new LocalizedString();
|
private LocalizedString description = new LocalizedString();
|
||||||
|
|
||||||
|
|
@ -334,9 +341,9 @@ public class Role implements Serializable, Portable {
|
||||||
// name,
|
// name,
|
||||||
// Objects.toString(permissions));
|
// Objects.toString(permissions));
|
||||||
return String.format("%s{ "
|
return String.format("%s{ "
|
||||||
+ "roldId = %d, "
|
+ "roldId = %d, "
|
||||||
+ "name = \"%s\", "
|
+ "name = \"%s\", "
|
||||||
+ " }",
|
+ " }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
roleId,
|
roleId,
|
||||||
name);
|
name);
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class RoleRepository extends AbstractEntityRepository<Long, Role> {
|
||||||
|
|
||||||
public long count() {
|
public long count() {
|
||||||
final TypedQuery<Long> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Long> query = getEntityManager().createNamedQuery(
|
||||||
"Role.count", Long.class);
|
"Role.count", Long.class);
|
||||||
return query.getSingleResult();
|
return query.getSingleResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,11 +66,11 @@ public class RoleRepository extends AbstractEntityRepository<Long, Role> {
|
||||||
* @param name The name of the role to retrieve.
|
* @param name The name of the role to retrieve.
|
||||||
*
|
*
|
||||||
* @return The role identified by the provided {@code name} or {@code null}
|
* @return The role identified by the provided {@code name} or {@code null}
|
||||||
* if there is no matching role.
|
* if there is no matching role.
|
||||||
*/
|
*/
|
||||||
public Optional<Role> findByName(final String name) {
|
public Optional<Role> findByName(final String name) {
|
||||||
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
||||||
"Role.findByName", Role.class);
|
"Role.findByName", Role.class);
|
||||||
query.setParameter("name", name);
|
query.setParameter("name", name);
|
||||||
final List<Role> result = query.getResultList();
|
final List<Role> result = query.getResultList();
|
||||||
if (result.isEmpty()) {
|
if (result.isEmpty()) {
|
||||||
|
|
@ -82,42 +82,51 @@ public class RoleRepository extends AbstractEntityRepository<Long, Role> {
|
||||||
|
|
||||||
public List<Role> findAllOrderedByRoleName() {
|
public List<Role> findAllOrderedByRoleName() {
|
||||||
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
||||||
"Role.findAllOrderedByRoleName", Role.class);
|
"Role.findAllOrderedByRoleName", Role.class);
|
||||||
return query.getResultList();
|
return query.getResultList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Role> findAllOrderedByRole(final int maxResults,
|
public List<Role> findAllOrderedByRole(final int maxResults,
|
||||||
final int firstResult) {
|
final int firstResult) {
|
||||||
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
||||||
"Role.findAllOrderedByRoleName", Role.class);
|
"Role.findAllOrderedByRoleName", Role.class);
|
||||||
query.setMaxResults(maxResults);
|
query.setMaxResults(maxResults);
|
||||||
query.setFirstResult(firstResult);
|
query.setFirstResult(firstResult);
|
||||||
return query.getResultList();
|
return query.getResultList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(Transactional.TxType.REQUIRED)
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
public List<Role> findByPrivilege(final String privilege) {
|
public List<Role> findByParty(final Party party) {
|
||||||
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Role> query = getEntityManager()
|
||||||
"Role.findByPrivilege", Role.class);
|
.createNamedQuery("Role.findByParty", Role.class);
|
||||||
query.setParameter("privilege", privilege);
|
query.setParameter("member", party);
|
||||||
|
|
||||||
return query.getResultList();
|
return query.getResultList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public List<Role> findByPrivilege(final String privilege) {
|
||||||
|
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
||||||
|
"Role.findByPrivilege", Role.class);
|
||||||
|
query.setParameter("privilege", privilege);
|
||||||
|
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(Transactional.TxType.REQUIRED)
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
public List<Role> findByPrivilege(final String privilege,
|
public List<Role> findByPrivilege(final String privilege,
|
||||||
final CcmObject object) {
|
final CcmObject object) {
|
||||||
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
||||||
"Role.findByPrivilegeAndObject", Role.class);
|
"Role.findByPrivilegeAndObject", Role.class);
|
||||||
query.setParameter("privilege", privilege);
|
query.setParameter("privilege", privilege);
|
||||||
query.setParameter("object", object);
|
query.setParameter("object", object);
|
||||||
|
|
||||||
return query.getResultList();
|
return query.getResultList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Role> searchByName(final String name) {
|
public List<Role> searchByName(final String name) {
|
||||||
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
||||||
"Role.searchByName", Role.class);
|
"Role.searchByName", Role.class);
|
||||||
query.setParameter("name", name);
|
query.setParameter("name", name);
|
||||||
return query.getResultList();
|
return query.getResultList();
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +135,7 @@ public class RoleRepository extends AbstractEntityRepository<Long, Role> {
|
||||||
final int maxResults,
|
final int maxResults,
|
||||||
final int firstResult) {
|
final int firstResult) {
|
||||||
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Role> query = getEntityManager().createNamedQuery(
|
||||||
"Role.searchByName", Role.class);
|
"Role.searchByName", Role.class);
|
||||||
query.setParameter("name", name);
|
query.setParameter("name", name);
|
||||||
query.setFirstResult(firstResult);
|
query.setFirstResult(firstResult);
|
||||||
query.setMaxResults(maxResults);
|
query.setMaxResults(maxResults);
|
||||||
|
|
@ -135,7 +144,7 @@ public class RoleRepository extends AbstractEntityRepository<Long, Role> {
|
||||||
|
|
||||||
public long searchByNameCount(final String name) {
|
public long searchByNameCount(final String name) {
|
||||||
final TypedQuery<Long> query = getEntityManager().createNamedQuery(
|
final TypedQuery<Long> query = getEntityManager().createNamedQuery(
|
||||||
"Role.searchByNameCount", Long.class);
|
"Role.searchByNameCount", Long.class);
|
||||||
query.setParameter("name", name);
|
query.setParameter("name", name);
|
||||||
try {
|
try {
|
||||||
return query.getSingleResult();
|
return query.getSingleResult();
|
||||||
|
|
|
||||||
|
|
@ -610,3 +610,4 @@ ui.admin.importexport.import.status.import_active=An import process is active.
|
||||||
ui.admin.importexport.import.status.locked=This should not happen.
|
ui.admin.importexport.import.status.locked=This should not happen.
|
||||||
ui.admin.importexport.import.current_status=Import current status
|
ui.admin.importexport.import.current_status=Import current status
|
||||||
ui.admin.importexport.import.report=Report from last import process
|
ui.admin.importexport.import.report=Report from last import process
|
||||||
|
ui.groups.roles.remove=Remove
|
||||||
|
|
|
||||||
|
|
@ -614,3 +614,4 @@ ui.admin.importexport.import.status.import_active=Ein Import-Prozess ist bereits
|
||||||
ui.admin.importexport.import.status.locked=This should not happen.
|
ui.admin.importexport.import.status.locked=This should not happen.
|
||||||
ui.admin.importexport.import.current_status=Aktueller Status des Import-Prozesses
|
ui.admin.importexport.import.current_status=Aktueller Status des Import-Prozesses
|
||||||
ui.admin.importexport.import.report=Bericht des letzten Import-Prozesses
|
ui.admin.importexport.import.report=Bericht des letzten Import-Prozesses
|
||||||
|
ui.groups.roles.remove=Entfernen
|
||||||
|
|
|
||||||
|
|
@ -607,3 +607,4 @@ ui.admin.importexport.import.status.import_active=An import process is active.
|
||||||
ui.admin.importexport.import.status.locked=This should not happen.
|
ui.admin.importexport.import.status.locked=This should not happen.
|
||||||
ui.admin.importexport.import.current_status=Import current status
|
ui.admin.importexport.import.current_status=Import current status
|
||||||
ui.admin.importexport.import.report=Report from last import process
|
ui.admin.importexport.import.report=Report from last import process
|
||||||
|
ui.groups.roles.remove=Remove
|
||||||
|
|
|
||||||
|
|
@ -598,3 +598,4 @@ ui.admin.importexport.import.status.import_active=An import process is active.
|
||||||
ui.admin.importexport.import.status.locked=This should not happen.
|
ui.admin.importexport.import.status.locked=This should not happen.
|
||||||
ui.admin.importexport.import.current_status=Import current status
|
ui.admin.importexport.import.current_status=Import current status
|
||||||
ui.admin.importexport.import.report=Report from last import process
|
ui.admin.importexport.import.report=Report from last import process
|
||||||
|
ui.groups.roles.remove=Remove
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue