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


Java NamedBean.copy方法代码示例

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


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

示例1: findGroupsByName

import org.ligoj.bootstrap.core.NamedBean; //导入方法依赖的package包/类
/**
 * Search the LDAP Groups matching to the given criteria and for type
 * "Project". Node identifier is ignored for now.
 * 
 * @param criteria
 *            the search criteria.
 * @return LDAP Groups matching the criteria.
 * @see ContainerScope#TYPE_PROJECT
 */
@GET
@Path("group/{node}/{criteria}")
@Consumes(MediaType.APPLICATION_JSON)
public List<INamableBean<String>> findGroupsByName(@PathParam("criteria") final String criteria) {
	final List<INamableBean<String>> result = new ArrayList<>();
	final String criteriaClean = Normalizer.normalize(criteria);
	final Set<GroupOrg> managedGroups = groupLdapResource.getContainers();
	final List<ContainerScope> types = containerScopeResource.findAllDescOrder(ContainerType.GROUP);
	for (final GroupOrg group : managedGroups) {
		final ContainerScope scope = groupLdapResource.toScope(types, group);

		// Check type and criteria
		if (scope != null && ContainerScope.TYPE_PROJECT.equals(scope.getName())
				&& group.getId().contains(criteriaClean)) {
			// Return the nice name
			final INamableBean<String> bean = new NamedBean<>();
			NamedBean.copy(group, bean);
			result.add(bean);
		}
	}

	return result;
}
 
开发者ID:ligoj,项目名称:plugin-id-ldap,代码行数:33,代码来源:LdapPluginResource.java

示例2: newContainerCountVo

import org.ligoj.bootstrap.core.NamedBean; //导入方法依赖的package包/类
/**
 * Build a new secured container managing the effective visibility and rights.
 * 
 * @param rawContainer
 *            the raw container contained sensitive data.
 * @param managedWrite
 *            The containers the current user can write.
 * @param managedAdmin
 *            The containers the current user can administer.
 * @param types
 *            The defined type with locking information.
 * @return A secured container with right and lock information the current user has.
 */
protected ContainerCountVo newContainerCountVo(final ContainerOrg rawContainer, final Set<T> managedWrite, final Set<T> managedAdmin,
		final List<ContainerScope> types) {
	final ContainerCountVo securedUserOrg = new ContainerCountVo();
	NamedBean.copy(rawContainer, securedUserOrg);
	securedUserOrg.setCanWrite(managedWrite.contains(rawContainer));
	securedUserOrg.setCanAdmin(managedAdmin.contains(rawContainer));
	securedUserOrg.setContainerType(type);

	// Find the closest type
	final ContainerScope scope = toScope(types, rawContainer);
	if (scope != null) {
		securedUserOrg.setScope(scope.getName());
		securedUserOrg.setLocked(scope.isLocked());
	}
	securedUserOrg.setLocked(securedUserOrg.isLocked() || rawContainer.isLocked());
	return securedUserOrg;
}
 
开发者ID:ligoj,项目名称:plugin-id,代码行数:31,代码来源:AbstractContainerResource.java

示例3: toVo

import org.ligoj.bootstrap.core.NamedBean; //导入方法依赖的package包/类
/**
 * Simple transformer, securing sensible date. DN is not forwarded.
 */
protected ContainerWithScopeVo toVo(final T rawGroupLdap) {
	// Find the closest type
	final ContainerWithScopeVo securedUserOrg = new ContainerWithScopeVo();
	final List<ContainerScope> scopes = containerScopeResource.findAllDescOrder(type);
	final ContainerScope scope = toScope(scopes, rawGroupLdap);
	NamedBean.copy(rawGroupLdap, securedUserOrg);
	if (scope != null) {
		securedUserOrg.setScope(scope.getName());
	}
	return securedUserOrg;
}
 
开发者ID:ligoj,项目名称:plugin-id,代码行数:15,代码来源:AbstractContainerResource.java


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