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


Java OrganizationalUnit.getName方法代码示例

本文整理汇总了Java中org.guvnor.structure.organizationalunit.OrganizationalUnit.getName方法的典型用法代码示例。如果您正苦于以下问题:Java OrganizationalUnit.getName方法的具体用法?Java OrganizationalUnit.getName怎么用?Java OrganizationalUnit.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.guvnor.structure.organizationalunit.OrganizationalUnit的用法示例。


在下文中一共展示了OrganizationalUnit.getName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: searchByName

import org.guvnor.structure.organizationalunit.OrganizationalUnit; //导入方法依赖的package包/类
@Override
public Collection<OrganizationalUnit> searchByName(String pattern,
                                                   int maxItems,
                                                   boolean caseSensitive) {
    List<OrganizationalUnit> results = new ArrayList<>();
    for (OrganizationalUnit unit : organizationalUnitService.getAllOrganizationalUnits()) {
        String name = unit.getName();
        if (caseSensitive ? name.contains(pattern) : name.toLowerCase().contains(pattern.toLowerCase())) {
            results.add(unit);
            if (maxItems > 0 && results.size() >= maxItems) {
                return results;
            }
        }
    }
    return results;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:OrganizationalUnitSearchServiceImpl.java

示例2: getRepositoryInfo

import org.guvnor.structure.organizationalunit.OrganizationalUnit; //导入方法依赖的package包/类
public RepositoryInfo getRepositoryInfo(final String alias) {
    final Repository repo = getRepository(alias);
    String ouName = null;
    for (final OrganizationalUnit ou : organizationalUnitService.getAllOrganizationalUnits()) {
        for (Repository repository : ou.getRepositories()) {
            if (repository.getAlias().equals(alias)) {
                ouName = ou.getName();
            }
        }
    }

    return new RepositoryInfo(repo.getIdentifier(),
                              alias,
                              ouName,
                              repo.getRoot(),
                              repo.getPublicURIs(),
                              getRepositoryHistory(alias,
                                                   0,
                                                   HISTORY_PAGE_SIZE));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:RepositoryServiceImpl.java

示例3: getOrganizationalUnitDisplayName

import org.guvnor.structure.organizationalunit.OrganizationalUnit; //导入方法依赖的package包/类
private String getOrganizationalUnitDisplayName(final OrganizationalUnit organizationalUnit) {
    final StringBuilder sb = new StringBuilder(organizationalUnit.getName());
    if (!(organizationalUnit.getOwner() == null || organizationalUnit.getOwner().isEmpty())) {
        sb.append(" : ").append(organizationalUnit.getOwner());
    }
    return sb.toString();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:OrganizationalUnitManagerViewImpl.java

示例4: addOrganizationalUnit

import org.guvnor.structure.organizationalunit.OrganizationalUnit; //导入方法依赖的package包/类
@Override
public void addOrganizationalUnit(final OrganizationalUnit ou) {
    final String text = ou.getName();
    final String value = ou.getName();
    final Option option = new Option();
    option.setText(text);
    option.setValue(value);
    organizationalUnitDropdown.add(option);
    organizationalUnitDropdown.refresh();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:11,代码来源:CloneRepositoryViewImpl.java

示例5: addRepository

import org.guvnor.structure.organizationalunit.OrganizationalUnit; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void addRepository(final OrganizationalUnit organizationalUnit,
                          final Repository repository) {
    final ConfigGroup thisGroupConfig = findGroupConfig(organizationalUnit.getName());

    if (thisGroupConfig != null) {
        try {
            configurationService.startBatch();
            ConfigItem<List> repositories = thisGroupConfig.getConfigItem("repositories");
            repositories.getValue().add(repository.getAlias());

            configurationService.updateConfiguration(thisGroupConfig);

            final OrganizationalUnit updatedOrganizationalUnit = organizationalUnitFactory.newOrganizationalUnit(thisGroupConfig);
            registeredOrganizationalUnits.put(updatedOrganizationalUnit.getName(),
                                              updatedOrganizationalUnit);
        } finally {
            configurationService.endBatch();
            repoAddedToOrgUnitEvent.fire(new RepoAddedToOrganizationalUnitEvent(organizationalUnit,
                                                                                repository,
                                                                                getUserInfo(sessionInfo)));
        }
    } else {
        throw new IllegalArgumentException("OrganizationalUnit " + organizationalUnit.getName() + " not found");
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:28,代码来源:OrganizationalUnitServiceImpl.java

示例6: removeRepository

import org.guvnor.structure.organizationalunit.OrganizationalUnit; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void removeRepository(final OrganizationalUnit organizationalUnit,
                             final Repository repository) {
    final ConfigGroup thisGroupConfig = findGroupConfig(organizationalUnit.getName());

    if (thisGroupConfig != null) {
        try {
            configurationService.startBatch();
            final ConfigItem<List> repositories = thisGroupConfig.getConfigItem("repositories");
            repositories.getValue().remove(repository.getAlias());

            configurationService.updateConfiguration(thisGroupConfig);

            final OrganizationalUnit updatedOrganizationalUnit = organizationalUnitFactory.newOrganizationalUnit(thisGroupConfig);
            registeredOrganizationalUnits.put(updatedOrganizationalUnit.getName(),
                                              updatedOrganizationalUnit);
        } finally {
            configurationService.endBatch();
            repoRemovedFromOrgUnitEvent.fire(new RepoRemovedFromOrganizationalUnitEvent(organizationalUnit,
                                                                                        repository,
                                                                                        getUserInfo(sessionInfo)));
        }
    } else {
        throw new IllegalArgumentException("OrganizationalUnit " + organizationalUnit.getName() + " not found");
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:28,代码来源:OrganizationalUnitServiceImpl.java

示例7: addGroup

import org.guvnor.structure.organizationalunit.OrganizationalUnit; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void addGroup(final OrganizationalUnit organizationalUnit,
                     final String group) {
    final ConfigGroup thisGroupConfig = findGroupConfig(organizationalUnit.getName());

    if (thisGroupConfig != null) {
        OrganizationalUnit updatedOrganizationalUnit = null;
        try {
            configurationService.startBatch();
            final ConfigItem<List> groups = backward.compat(thisGroupConfig).getConfigItem("security:groups");
            groups.getValue().add(group);

            configurationService.updateConfiguration(thisGroupConfig);

            updatedOrganizationalUnit = organizationalUnitFactory.newOrganizationalUnit(thisGroupConfig);
            registeredOrganizationalUnits.put(updatedOrganizationalUnit.getName(),
                                              updatedOrganizationalUnit);
        } finally {
            configurationService.endBatch();
            if (updatedOrganizationalUnit != null) {
                updatedOrganizationalUnitEvent.fire(new UpdatedOrganizationalUnitEvent(updatedOrganizationalUnit,
                                                                                       getUserInfo(sessionInfo)));
            }
        }
    } else {
        throw new IllegalArgumentException("OrganizationalUnit " + organizationalUnit.getName() + " not found");
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:30,代码来源:OrganizationalUnitServiceImpl.java

示例8: removeGroup

import org.guvnor.structure.organizationalunit.OrganizationalUnit; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void removeGroup(final OrganizationalUnit organizationalUnit,
                        final String group) {
    final ConfigGroup thisGroupConfig = findGroupConfig(organizationalUnit.getName());

    if (thisGroupConfig != null) {
        OrganizationalUnit updatedOrganizationalUnit = null;
        try {
            configurationService.startBatch();
            final ConfigItem<List> groups = backward.compat(thisGroupConfig).getConfigItem("security:groups");
            groups.getValue().remove(group);

            configurationService.updateConfiguration(thisGroupConfig);

            updatedOrganizationalUnit = organizationalUnitFactory.newOrganizationalUnit(thisGroupConfig);
            registeredOrganizationalUnits.put(updatedOrganizationalUnit.getName(),
                                              updatedOrganizationalUnit);
        } finally {
            configurationService.endBatch();
            if (updatedOrganizationalUnit != null) {
                updatedOrganizationalUnitEvent.fire(new UpdatedOrganizationalUnitEvent(updatedOrganizationalUnit,
                                                                                       getUserInfo(sessionInfo)));
            }
        }
    } else {
        throw new IllegalArgumentException("OrganizationalUnit " + organizationalUnit.getName() + " not found");
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:30,代码来源:OrganizationalUnitServiceImpl.java


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