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


Java PropositionParameterBo类代码示例

本文整理汇总了Java中org.kuali.rice.krms.impl.repository.PropositionParameterBo的典型用法代码示例。如果您正苦于以下问题:Java PropositionParameterBo类的具体用法?Java PropositionParameterBo怎么用?Java PropositionParameterBo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropositionParameterBo类属于org.kuali.rice.krms.impl.repository包,在下文中一共展示了PropositionParameterBo类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getParamValue

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
private String getParamValue(PropositionParameterBo prop){
    if (PropositionParameterType.TERM.getCode().equalsIgnoreCase(prop.getParameterType())){
        //TODO: use termBoService
        String termName = "";
        String termId = prop.getValue();
        if (termId != null && termId.length() > 0){
            TermBo term = getDataObjectService().find(TermBo.class, termId);

            if (term != null){
                termName = term.getSpecification().getName();
            }
        }
        return termName;
    } else {
        return prop.getValue();
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:SimplePropositionEditNode.java

示例2: processCustomOperators

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
/**
 * walk the proposition tree and process any custom operators found, converting them to custom function invocations.
 *
 * @param propositionBo the root proposition from which to search and convert
 */
private void processCustomOperators(PropositionBo propositionBo) {
    if (StringUtils.isBlank(propositionBo.getCompoundOpCode())) {
        // if it is a simple proposition with a custom operator
        if (!propositionBo.getParameters().isEmpty() && propositionBo.getParameters().get(2).getValue().startsWith(
                KrmsImplConstants.CUSTOM_OPERATOR_PREFIX)) {
            PropositionParameterBo operatorParam = propositionBo.getParameters().get(2);

            CustomOperator customOperator =
                    KrmsServiceLocatorInternal.getCustomOperatorUiTranslator().getCustomOperator(operatorParam.getValue());

            FunctionDefinition operatorFunctionDefinition = customOperator.getOperatorFunctionDefinition();

            operatorParam.setParameterType(PropositionParameterType.FUNCTION.getCode());
            operatorParam.setValue(operatorFunctionDefinition.getId());
        }
    } else {
        // recurse
        for (PropositionBo childProp : propositionBo.getCompoundComponents()) {
            processCustomOperators(childProp);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:AgendaEditorMaintainable.java

示例3: preprocessCustomOperators

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
/**
 * Looks for any custom function calls within simple propositions and attempts to convert them to custom
 * operator keys.
 *
 * @param proposition the proposition to search within and convert
 * @param customOperatorValuesMap a map from function ID to custom operator key, used for the conversion
 */
protected void preprocessCustomOperators(PropositionBo proposition, Map<String, String> customOperatorValuesMap) {
    if (proposition == null) { return; }

    if (proposition.getParameters() != null && proposition.getParameters().size() > 0) {
        for (PropositionParameterBo param : proposition.getParameters()) {
            if (PropositionParameterType.FUNCTION.getCode().equals(param.getParameterType())) {
                // convert to our convention of customOperator:<functionNamespace>:<functionName>
                String convertedValue = customOperatorValuesMap.get(param.getValue());
                if (!StringUtils.isEmpty(convertedValue)) {
                    param.setValue(convertedValue);
                }
            }
        }
    } else if (proposition.getCompoundComponents() != null && proposition.getCompoundComponents().size() > 0) {
        for (PropositionBo childProposition : proposition.getCompoundComponents()) {
            // recurse
            preprocessCustomOperators(childProposition, customOperatorValuesMap);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:AgendaEditorController.java

示例4: getParamValue

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
private String getParamValue(PropositionParameterBo prop){
    if (PropositionParameterType.TERM.getCode().equalsIgnoreCase(prop.getParameterType())){
        //TODO: use termBoService
        String termId = prop.getValue();
        TermBo term = null;
        if (termId!=null) {
            term = getDataObjectService().find(TermBo.class,termId);
        }
        if (term!=null){
            return term.getSpecification().getName();
        }
        return "";
    } else {
        return prop.getValue();
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:SimplePropositionNode.java

示例5: getParamValue

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
private String getParamValue(PropositionParameterBo prop){
    if (PropositionParameterType.TERM.getCode().equalsIgnoreCase(prop.getParameterType())){
        //TODO: use termBoService
        String termName = "";
        String termId = prop.getValue();
        if (termId != null && termId.length() > 0){
            TermBo term = getBoService().findBySinglePrimaryKey(TermBo.class,termId);
            if (term != null){
                termName = term.getSpecification().getName();
            }
        }
        return termName;
    } else {
        return prop.getValue();
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:17,代码来源:SimplePropositionEditNode.java

示例6: setupParameterDisplayString

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
private void setupParameterDisplayString(){
    if (proposition != null && proposition.getPropositionTypeCode().equalsIgnoreCase(PropositionType.SIMPLE.getCode())){
        // Simple Propositions should have 3 parameters ordered in reverse polish notation.
        // TODO: enhance to get term names for term type parameters.
        List<PropositionParameterBo> parameters = proposition.getParameters();
        if (parameters != null && parameters.size() == 3){
            setParameterDisplayString(getParamValue(parameters.get(0)) 
                    + " " + getParamValue(parameters.get(2))
                    + " " + getParamValue(parameters.get(1)));
        } else {
            // should not happen
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:SimplePropositionEditNode.java

示例7: walkPropositionTree

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
private void walkPropositionTree(PropositionBo prop) {
    if (prop == null) { return; }

    if (prop.getParameters() != null) for (PropositionParameterBo param : prop.getParameters()) {
        param.getPropId();
    }

    if (prop.getCompoundComponents() != null) for (PropositionBo childProp : prop.getCompoundComponents()) {
        walkPropositionTree(childProp);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:AgendaEditorMaintainable.java

示例8: getParamValue

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
private String getParamValue(PropositionParameterBo prop){
    if (PropositionParameterType.TERM.getCode().equalsIgnoreCase(prop.getParameterType())){
        //TODO: use termBoService
        String termId = prop.getValue();
        TermBo term = getBoService().findBySinglePrimaryKey(TermBo.class,termId);
        if (term!=null){
            return term.getSpecification().getName();
        }
        return "";
    } else {
        return prop.getValue();
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:14,代码来源:SimplePropositionNode.java

示例9: retrieveTermParameters

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
/**
 * Retrieve a list of {@link RemotableAttributeField}s for the parameters (if any) required by the resolver for
 * the selected term in the proposition that is under edit.
 */
public List<RemotableAttributeField> retrieveTermParameters(View view, Object model, Container container) {

    List<RemotableAttributeField> results = new ArrayList<RemotableAttributeField>();

    AgendaEditor agendaEditor = getAgendaEditor(model);

    // Figure out which rule is being edited
    RuleBo rule = agendaEditor.getAgendaItemLine().getRule();
    if (null != rule) {

        // Figure out which proposition is being edited
        Tree<RuleTreeNode, String> propositionTree = rule.getPropositionTree();
        Node<RuleTreeNode, String> editedPropositionNode = findEditedProposition(propositionTree.getRootElement());

        if (editedPropositionNode != null) {
            PropositionBo propositionBo = editedPropositionNode.getData().getProposition();
            if (StringUtils.isEmpty(propositionBo.getCompoundOpCode()) && CollectionUtils.size(
                    propositionBo.getParameters()) > 0) {
                // Get the term ID; if it is a new parameterized term, it will have a special prefix
                PropositionParameterBo param = propositionBo.getParameters().get(0);
                if (StringUtils.isNotBlank(param.getValue()) &&
                        param.getValue().startsWith(KrmsImplConstants.PARAMETERIZED_TERM_PREFIX)) {
                    String termSpecId = param.getValue().substring(
                            KrmsImplConstants.PARAMETERIZED_TERM_PREFIX.length());
                    TermResolverDefinition simplestResolver = getSimplestTermResolver(termSpecId,
                            rule.getNamespace());

                    // Get the parameters and build RemotableAttributeFields
                    if (simplestResolver != null) {
                        List<String> parameterNames = new ArrayList<String>(simplestResolver.getParameterNames());
                        Collections.sort(parameterNames); // make param order deterministic

                        for (String parameterName : parameterNames) {
                            // TODO: also allow for DD parameters if there are matching type attributes
                            RemotableTextInput.Builder controlBuilder = RemotableTextInput.Builder.create();
                            controlBuilder.setSize(64);

                            RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create(
                                    parameterName);

                            builder.setRequired(true);
                            builder.setDataType(DataType.STRING);
                            builder.setControl(controlBuilder);
                            builder.setLongLabel(parameterName);
                            builder.setShortLabel(parameterName);
                            builder.setMinLength(Integer.valueOf(1));
                            builder.setMaxLength(Integer.valueOf(64));

                            results.add(builder.build());
                        }
                    }
                }
            }
        }
    }
    return results;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:62,代码来源:AgendaEditorMaintainable.java

示例10: retrieveTermParameters

import org.kuali.rice.krms.impl.repository.PropositionParameterBo; //导入依赖的package包/类
/**
 * Retrieve a list of {@link RemotableAttributeField}s for the parameters (if any) required by the resolver for
 * the selected term in the proposition that is under edit.
 */
public List<RemotableAttributeField> retrieveTermParameters(View view, Object model, Container container) {

    List<RemotableAttributeField> results = new ArrayList<RemotableAttributeField>();

    AgendaEditor agendaEditor = getAgendaEditor(model);

    // Figure out which rule is being edited
    RuleBo rule = agendaEditor.getAgendaItemLine().getRule();
    if (null != rule) {

        // Figure out which proposition is being edited
        Tree<RuleTreeNode, String> propositionTree = rule.getPropositionTree();
        Node<RuleTreeNode, String> editedPropositionNode = findEditedProposition(propositionTree.getRootElement());

        if (editedPropositionNode != null) {
            PropositionBo propositionBo = editedPropositionNode.getData().getProposition();
            if (StringUtils.isEmpty(propositionBo.getCompoundOpCode()) && CollectionUtils.size(
                    propositionBo.getParameters()) > 0) {
                // Get the term ID; if it is a new parameterized term, it will have a special prefix
                PropositionParameterBo param = propositionBo.getParameters().get(0);
                if (param.getValue().startsWith(KrmsImplConstants.PARAMETERIZED_TERM_PREFIX)) {
                    String termSpecId = param.getValue().substring(
                            KrmsImplConstants.PARAMETERIZED_TERM_PREFIX.length());
                    TermResolverDefinition simplestResolver = getSimplestTermResolver(termSpecId,
                            rule.getNamespace());

                    // Get the parameters and build RemotableAttributeFields
                    if (simplestResolver != null) {
                        List<String> parameterNames = new ArrayList<String>(simplestResolver.getParameterNames());
                        Collections.sort(parameterNames); // make param order deterministic

                        for (String parameterName : parameterNames) {
                            // TODO: also allow for DD parameters if there are matching type attributes
                            RemotableTextInput.Builder controlBuilder = RemotableTextInput.Builder.create();
                            controlBuilder.setSize(64);

                            RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create(
                                    parameterName);

                            builder.setRequired(true);
                            builder.setDataType(DataType.STRING);
                            builder.setControl(controlBuilder);
                            builder.setLongLabel(parameterName);
                            builder.setShortLabel(parameterName);
                            builder.setMinLength(Integer.valueOf(1));
                            builder.setMaxLength(Integer.valueOf(64));

                            results.add(builder.build());
                        }
                    }
                }
            }
        }
    }
    return results;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:61,代码来源:AgendaEditorMaintainable.java


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