本文整理汇总了Java中org.kuali.rice.krms.impl.repository.TermResolverBo类的典型用法代码示例。如果您正苦于以下问题:Java TermResolverBo类的具体用法?Java TermResolverBo怎么用?Java TermResolverBo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TermResolverBo类属于org.kuali.rice.krms.impl.repository包,在下文中一共展示了TermResolverBo类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveCustomAttributes
import org.kuali.rice.krms.impl.repository.TermResolverBo; //导入依赖的package包/类
public List<RemotableAttributeField> retrieveCustomAttributes(View view, Object model, Container container) {
List<RemotableAttributeField> results = new ArrayList<RemotableAttributeField>();
String termSpecId =
((TermBo) ((MaintenanceDocumentForm) model).getDocument().getNewMaintainableObject().getDataObject())
.getSpecificationId();
QueryResults<TermResolverBo> termResolvers = getDataObjectService().findMatching(TermResolverBo.class,
QueryByCriteria.Builder.forAttribute("outputId", termSpecId).build());
TermResolverBo termResolver = null;
if (termResolvers.getResults() != null && termResolvers.getResults().size() == 1) {
termResolver = termResolvers.getResults().get(0);
}
if (termResolver != null && !CollectionUtils.isEmpty(termResolver.getParameterSpecifications())) {
List<TermResolverParameterSpecificationBo> params = new ArrayList<TermResolverParameterSpecificationBo>(
termResolver.getParameterSpecifications());
Collections.sort(params, new Comparator<TermResolverParameterSpecificationBo>() {
@Override
public int compare(TermResolverParameterSpecificationBo o1, TermResolverParameterSpecificationBo o2) {
return o1.getName().compareTo(o2.getName());
}
});
for (TermResolverParameterSpecificationBo param : params) {
RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create(param.getName());
RemotableTextInput.Builder inputBuilder = RemotableTextInput.Builder.create();
inputBuilder.setSize(80);
builder.setControl(inputBuilder);
builder.setDataType(DataType.STRING);
builder.setLongLabel(param.getName());
builder.setShortLabel(param.getName());
results.add(builder.build());
}
}
return results;
}
示例2: retrieveCustomAttributes
import org.kuali.rice.krms.impl.repository.TermResolverBo; //导入依赖的package包/类
public List<RemotableAttributeField> retrieveCustomAttributes(View view, Object model, Container container) {
List<RemotableAttributeField> results = new ArrayList<RemotableAttributeField>();
String termSpecId = ((TermBo)((MaintenanceDocumentForm)model).getDocument().getNewMaintainableObject().getDataObject()).getSpecificationId();
Collection<TermResolverBo> termResolvers = getBoService().findMatching(TermResolverBo.class,
Collections.singletonMap("outputId", termSpecId)
);
TermResolverBo termResolver = null;
if (termResolvers != null && termResolvers.size() == 1) {
termResolver = termResolvers.iterator().next();
}
if (termResolver != null && !CollectionUtils.isEmpty(termResolver.getParameterSpecifications())) {
List<TermResolverParameterSpecificationBo> params = new ArrayList<TermResolverParameterSpecificationBo>(termResolver.getParameterSpecifications());
Collections.sort(params, new Comparator<TermResolverParameterSpecificationBo>() {
@Override
public int compare(TermResolverParameterSpecificationBo o1, TermResolverParameterSpecificationBo o2) {
return o1.getName().compareTo(o2.getName());
}
});
for (TermResolverParameterSpecificationBo param : params) {
RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create(param.getName());
RemotableTextInput.Builder inputBuilder = RemotableTextInput.Builder.create();
inputBuilder.setSize(80);
builder.setControl(inputBuilder);
builder.setDataType(DataType.STRING);
builder.setLongLabel(param.getName());
builder.setShortLabel(param.getName());
results.add(builder.build());
}
}
return results;
}