本文整理汇总了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;
}
示例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));
}
示例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();
}
示例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();
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}