本文整理汇总了Java中nl.strohalm.cyclos.entities.groups.Group.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Group.getId方法的具体用法?Java Group.getId怎么用?Java Group.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nl.strohalm.cyclos.entities.groups.Group
的用法示例。
在下文中一共展示了Group.getId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pathPart
import nl.strohalm.cyclos.entities.groups.Group; //导入方法依赖的package包/类
/**
* Returns the additional path part for the given customized group
*/
private String pathPart(final Group group, final boolean forceSameGroup) {
if (group == null) {
return null;
}
Long groupId;
if (!forceSameGroup && (group instanceof OperatorGroup)) {
final OperatorGroup og = (OperatorGroup) loadGroup(group.getId(), RelationshipHelper.nested(OperatorGroup.Relationships.MEMBER, Element.Relationships.GROUP));
groupId = og.getMember().getGroup().getId();
} else {
groupId = group.getId();
}
return "group_" + groupId.toString();
}
示例2: handleSubmit
import nl.strohalm.cyclos.entities.groups.Group; //导入方法依赖的package包/类
@Override
protected ActionForward handleSubmit(final ActionContext context) throws Exception {
final EditGroupForm form = context.getForm();
Group group = readGroup(context);
final Group baseGroup = readBaseGroup(context);
final boolean isInsert = group.getId() == null;
// Persist the group
if (isInsert) {
group = groupService.insert(group, baseGroup);
} else {
group = groupService.update(group, form.isForceAccept());
}
// Ensure the customized files collection is reloaded (for example, a group could be copied from other, and we need the collection to be
// up-to-date)
group = groupService.reload(group.getId(), Group.Relationships.CUSTOMIZED_FILES);
// Physically update the files
for (final CustomizedFile file : group.getCustomizedFiles()) {
final File physicalFile = customizationHelper.customizedFileOf(file);
customizationHelper.updateFile(physicalFile, file);
}
context.sendMessage(isInsert ? "group.inserted" : "group.modified");
return ActionHelper.redirectWithParam(context.getRequest(), context.getSuccessForward(), "groupId", group.getId());
}