当前位置: 首页>>代码示例>>Java>>正文


Java Group.getId方法代码示例

本文整理汇总了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();
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:17,代码来源:CustomizationHelper.java

示例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());
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:28,代码来源:EditGroupAction.java


注:本文中的nl.strohalm.cyclos.entities.groups.Group.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。