本文整理汇总了Java中org.kuali.rice.kim.api.responsibility.Responsibility.getTemplate方法的典型用法代码示例。如果您正苦于以下问题:Java Responsibility.getTemplate方法的具体用法?Java Responsibility.getTemplate怎么用?Java Responsibility.getTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kim.api.responsibility.Responsibility
的用法示例。
在下文中一共展示了Responsibility.getTemplate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createResponsibility
import org.kuali.rice.kim.api.responsibility.Responsibility; //导入方法依赖的package包/类
@Override
public Responsibility createResponsibility(final Responsibility responsibility)
throws RiceIllegalArgumentException, RiceIllegalStateException {
incomingParamCheck(responsibility, "responsibility");
if (StringUtils.isNotBlank(responsibility.getId()) && getResponsibility(responsibility.getId()) != null) {
throw new RiceIllegalStateException("the responsibility to create already exists: " + responsibility);
}
List<ResponsibilityAttributeBo> attrBos = Collections.emptyList();
if (responsibility.getTemplate() != null) {
attrBos = KimAttributeDataBo.createFrom(ResponsibilityAttributeBo.class, responsibility.getAttributes(), responsibility.getTemplate().getKimTypeId());
}
ResponsibilityBo bo = ResponsibilityBo.from(responsibility);
bo.setAttributeDetails(attrBos);
return ResponsibilityBo.to(getDataObjectService().save(bo));
}
示例2: updateResponsibility
import org.kuali.rice.kim.api.responsibility.Responsibility; //导入方法依赖的package包/类
@Override
public Responsibility updateResponsibility(final Responsibility responsibility)
throws RiceIllegalArgumentException, RiceIllegalStateException {
incomingParamCheck(responsibility, "responsibility");
if (StringUtils.isBlank(responsibility.getId()) || getResponsibility(responsibility.getId()) == null) {
throw new RiceIllegalStateException("the responsibility does not exist: " + responsibility);
}
List<ResponsibilityAttributeBo> attrBos = Collections.emptyList();
if (responsibility.getTemplate() != null) {
attrBos = KimAttributeDataBo.createFrom(ResponsibilityAttributeBo.class, responsibility.getAttributes(), responsibility.getTemplate().getKimTypeId());
}
ResponsibilityBo bo = ResponsibilityBo.from(responsibility);
if (bo.getAttributeDetails() != null) {
bo.getAttributeDetails().clear();
bo.setAttributeDetails(attrBos);
}
return ResponsibilityBo.to(getDataObjectService().save(bo));
}
示例3: getResponsibilityTypeServicesByTemplateId
import org.kuali.rice.kim.api.responsibility.Responsibility; //导入方法依赖的package包/类
private Map<String, ResponsibilityTypeService> getResponsibilityTypeServicesByTemplateId(Collection<Responsibility> responsibilities) {
Map<String, ResponsibilityTypeService> responsibilityTypeServices = new HashMap<String, ResponsibilityTypeService>(responsibilities.size());
for (Responsibility responsibility : responsibilities) {
final Template t = responsibility.getTemplate();
final KimType type = kimTypeInfoService.getKimType(t.getKimTypeId());
final String serviceName = type.getServiceName();
if (serviceName != null) {
ResponsibilityTypeService responsibiltyTypeService = GlobalResourceLoader.getService(QName.valueOf(serviceName));
if (responsibiltyTypeService != null) {
responsibilityTypeServices.put(responsibility.getTemplate().getId(), responsibiltyTypeService);
} else {
responsibilityTypeServices.put(responsibility.getTemplate().getId(), defaultResponsibilityTypeService);
}
}
}
return Collections.unmodifiableMap(responsibilityTypeServices);
}
示例4: from
import org.kuali.rice.kim.api.responsibility.Responsibility; //导入方法依赖的package包/类
/**
* Converts a immutable object to its mutable counterpart
*
* @param im immutable object
* @return the mutable bo
*/
public static ResponsibilityBo from(Responsibility im) {
if (im == null) {
return null;
}
ResponsibilityBo bo = new ResponsibilityBo();
bo.id = im.getId();
bo.namespaceCode = im.getNamespaceCode();
bo.name = im.getName();
bo.description = im.getDescription();
bo.active = im.isActive();
bo.templateId = im.getTemplate() != null ? im.getTemplate().getId() : null;
bo.template = ResponsibilityTemplateBo.from(im.getTemplate());
bo.attributes = im.getAttributes();
bo.setVersionNumber(im.getVersionNumber());
bo.setObjectId(im.getObjectId());
return bo;
}
示例5: createResponsibility
import org.kuali.rice.kim.api.responsibility.Responsibility; //导入方法依赖的package包/类
@Override
public Responsibility createResponsibility(final Responsibility responsibility)
throws RiceIllegalArgumentException, RiceIllegalStateException {
incomingParamCheck(responsibility, "responsibility");
if (StringUtils.isNotBlank(responsibility.getId()) && getResponsibility(responsibility.getId()) != null) {
throw new RiceIllegalStateException("the responsibility to create already exists: " + responsibility);
}
List<ResponsibilityAttributeBo> attrBos = Collections.emptyList();
if (responsibility.getTemplate() != null) {
attrBos = KimAttributeDataBo.createFrom(ResponsibilityAttributeBo.class, responsibility.getAttributes(), responsibility.getTemplate().getKimTypeId());
}
ResponsibilityBo bo = ResponsibilityBo.from(responsibility);
bo.setAttributeDetails(attrBos);
return ResponsibilityBo.to(businessObjectService.save(bo));
}
示例6: updateResponsibility
import org.kuali.rice.kim.api.responsibility.Responsibility; //导入方法依赖的package包/类
@Override
public Responsibility updateResponsibility(final Responsibility responsibility)
throws RiceIllegalArgumentException, RiceIllegalStateException {
incomingParamCheck(responsibility, "responsibility");
if (StringUtils.isBlank(responsibility.getId()) || getResponsibility(responsibility.getId()) == null) {
throw new RiceIllegalStateException("the responsibility does not exist: " + responsibility);
}
List<ResponsibilityAttributeBo> attrBos = Collections.emptyList();
if (responsibility.getTemplate() != null) {
attrBos = KimAttributeDataBo.createFrom(ResponsibilityAttributeBo.class, responsibility.getAttributes(), responsibility.getTemplate().getKimTypeId());
}
ResponsibilityBo bo = ResponsibilityBo.from(responsibility);
if (bo.getAttributeDetails() != null) {
bo.getAttributeDetails().clear();
bo.setAttributeDetails(attrBos);
}
return ResponsibilityBo.to(businessObjectService.save(bo));
}