本文整理了Java中org.dspace.eperson.Group.setName()
方法的一些代码示例,展示了Group.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group.setName()
方法的具体详情如下:
包路径:org.dspace.eperson.Group
类名称:Group
方法名:setName
[英]Change the name of this Group.
[中]更改此组的名称。
代码示例来源:origin: DSpace/DSpace
@Override
public void setName(Group group, String name) throws SQLException {
if (group.isPermanent()) {
log.error("Attempt to rename permanent Group {} to {}.",
group.getName(), name);
throw new SQLException("Attempt to rename a permanent Group");
} else {
group.setName(name);
}
}
代码示例来源:origin: DSpace/DSpace
@Override
public void initDefaultGroupNames(Context context) throws SQLException, AuthorizeException {
GroupService groupService = EPersonServiceFactory.getInstance().getGroupService();
// Check for Anonymous group. If not found, create it
Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS);
if (anonymousGroup == null) {
anonymousGroup = groupService.create(context);
anonymousGroup.setName(Group.ANONYMOUS);
anonymousGroup.setPermanent(true);
groupService.update(context, anonymousGroup);
}
// Check for Administrator group. If not found, create it
Group adminGroup = groupService.findByName(context, Group.ADMIN);
if (adminGroup == null) {
adminGroup = groupService.create(context);
adminGroup.setName(Group.ADMIN);
adminGroup.setPermanent(true);
groupService.update(context, adminGroup);
}
}
代码示例来源:origin: org.dspace/dspace-xmlui-api
private static Group getXMLWorkflowRole(Context context, int collectionID, String roleName, Collection collection, Group roleGroup) throws IOException, WorkflowConfigurationException, SQLException, AuthorizeException {
Role role = WorkflowUtils.getCollectionRoles(collection).get(roleName);
if(role.getScope() == Role.Scope.COLLECTION){
roleGroup = WorkflowUtils.getRoleGroup(context, collectionID, role);
if(roleGroup == null){
AuthorizeManager.authorizeAction(context, collection, Constants.WRITE);
roleGroup = Group.create(context);
roleGroup.setName("COLLECTION_" + collection.getID() + "_WORKFLOW_ROLE_" + roleName);
roleGroup.update();
AuthorizeManager.addPolicy(context, collection, Constants.ADD, roleGroup);
WorkflowUtils.createCollectionWorkflowRole(context, collectionID, roleName, roleGroup);
}
}
return roleGroup;
}
代码示例来源:origin: org.dspace/dspace-jspui-api
group.setName(newName);
group.update();
group.setName("new group" + group.getID());
group.update();
代码示例来源:origin: org.dspace/dspace-xmlui-api
group.setName(newName);
group.setName(newName);
代码示例来源:origin: org.dspace/dspace-xmlui-api
role.setName("COLLECTION_"+collection.getID() +"_DEFAULT_READ");
代码示例来源:origin: org.dspace/dspace-jspui-api
.setName("COLLECTION_" + collection.getID()
+ "_DEFAULT_ITEM_READ");
内容来源于网络,如有侵权,请联系作者删除!