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


Java TermResolverBo类代码示例

本文整理汇总了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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:42,代码来源:TermMaintainable.java

示例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;
    }
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:42,代码来源:TermMaintainable.java


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