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


Java DocumentTypeContract类代码示例

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


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

示例1: from

import org.kuali.rice.kew.api.doctype.DocumentTypeContract; //导入依赖的package包/类
public static DocumentType from(org.kuali.rice.kew.api.doctype.DocumentTypeContract dt) {
    if (dt == null) return null;

    // DocumentType BO and DTO are not symmetric
    // set what fields we can
    DocumentType ebo = new DocumentType();
    //ebo.setActionsUrl();
    ebo.setDocumentTypeId(dt.getId());
    ebo.setActive(dt.isActive());
    ebo.setActualApplicationId(dt.getApplicationId());
    //ebo.setActualNotificationFromAddress();
    ebo.setBlanketApproveWorkgroupId(dt.getBlanketApproveGroupId());
    ebo.setCurrentInd(dt.isCurrent());
    ebo.setDescription(dt.getDescription());
    ebo.setVersionNumber(dt.getVersionNumber());
    ebo.setVersion(dt.getDocumentTypeVersion());
    ebo.setUnresolvedDocHandlerUrl(dt.getUnresolvedDocHandlerUrl());
    ebo.setUnresolvedDocSearchHelpUrl(dt.getDocSearchHelpUrl());
    ebo.setUnresolvedHelpDefinitionUrl(dt.getHelpDefinitionUrl());
    ebo.setLabel(dt.getLabel());
    ebo.setName(dt.getName());
    ebo.setDocTypeParentId(dt.getParentId());
    ebo.setPostProcessorName(dt.getPostProcessorName());
    ebo.setSuperUserWorkgroupIdNoInheritence(dt.getSuperUserGroupId());
    List<DocumentTypePolicy> policies = new ArrayList<DocumentTypePolicy>();
    if (dt.getPolicies() != null) {
        for (Map.Entry<org.kuali.rice.kew.api.doctype.DocumentTypePolicy, String> entry: dt.getPolicies().entrySet()) {
            // NOTE: The policy value is actually a boolean field stored to a Decimal(1) column (although the db column is named PLCY_NM)
            // I'm not sure what the string value should be but the BO is simply toString'ing the Boolean value
            // so I am assuming here that "true"/"false" are the acceptable values
            policies.add(new DocumentTypePolicy(dt.getId(), entry.getKey().getCode(), Boolean.TRUE.toString().equals(
                    entry.getValue())));
        }
    }
    if (CollectionUtils.isNotEmpty(dt.getDocumentTypeAttributes())) {
        List<DocumentTypeAttributeBo> attributes = new ArrayList<DocumentTypeAttributeBo>();
        for (DocumentTypeAttributeContract attr : dt.getDocumentTypeAttributes()) {
            attributes.add(DocumentTypeAttributeBo.from(DocumentTypeAttribute.Builder.create(attr).build()));
        }
        
    }
    ebo.setDocumentTypePolicies(policies);
    ebo.setAuthorizer(dt.getAuthorizer());
    return ebo;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:46,代码来源:DocumentType.java

示例2: testEquals

import org.kuali.rice.kew.api.doctype.DocumentTypeContract; //导入依赖的package包/类
@Test
public void testEquals() {
    DocumentTypeContract immutable = create();
    org.kuali.rice.kew.doctype.bo.DocumentType bo = org.kuali.rice.kew.doctype.bo.DocumentType.from(immutable);
    Assert.assertEquals(immutable, org.kuali.rice.kew.doctype.bo.DocumentType.to(bo));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:DocumentTypeBoTest.java

示例3: from

import org.kuali.rice.kew.api.doctype.DocumentTypeContract; //导入依赖的package包/类
public static DocumentType from(org.kuali.rice.kew.api.doctype.DocumentTypeContract dt) {
    if (dt == null) return null;

    // DocumentType BO and DTO are not symmetric
    // set what fields we can
    DocumentType ebo = new DocumentType();
    //ebo.setActionsUrl();
    ebo.setDocumentTypeId(dt.getId());
    ebo.setActive(dt.isActive());
    ebo.setActualApplicationId(dt.getApplicationId());
    //ebo.setActualNotificationFromAddress();
    ebo.setBlanketApproveWorkgroupId(dt.getBlanketApproveGroupId());
    ebo.setCurrentInd(dt.isCurrent());
    ebo.setDescription(dt.getDescription());
    ebo.setVersionNumber(dt.getVersionNumber());
    ebo.setVersion(dt.getDocumentTypeVersion());
    ebo.setUnresolvedDocHandlerUrl(dt.getUnresolvedDocHandlerUrl());
    ebo.setUnresolvedDocSearchHelpUrl(dt.getDocSearchHelpUrl());
    ebo.setUnresolvedHelpDefinitionUrl(dt.getHelpDefinitionUrl());
    ebo.setLabel(dt.getLabel());
    ebo.setName(dt.getName());
    ebo.setDocTypeParentId(dt.getParentId());
    ebo.setPostProcessorName(dt.getPostProcessorName());
    ebo.setSuperUserWorkgroupIdNoInheritence(dt.getSuperUserGroupId());
    List<DocumentTypePolicy> policies = new ArrayList<DocumentTypePolicy>();
    if (dt.getPolicies() != null) {
        for (Map.Entry<org.kuali.rice.kew.api.doctype.DocumentTypePolicy, String> entry: dt.getPolicies().entrySet()) {
            // NOTE: The policy value is actually a boolean field stored to a Decimal(1) column (although the db column is named PLCY_NM)
            // I'm not sure what the string value should be but the BO is simply toString'ing the Boolean value
            // so I am assuming here that "true"/"false" are the acceptable values
            policies.add(new DocumentTypePolicy(entry.getKey().getCode(), Boolean.TRUE.toString().equals(entry.getValue())));
        }
    }
    if (CollectionUtils.isNotEmpty(dt.getDocumentTypeAttributes())) {
        List<DocumentTypeAttributeBo> attributes = new ArrayList<DocumentTypeAttributeBo>();
        for (DocumentTypeAttributeContract attr : dt.getDocumentTypeAttributes()) {
            attributes.add(DocumentTypeAttributeBo.from(DocumentTypeAttribute.Builder.create(attr).build()));
        }
        
    }
    ebo.setDocumentTypePolicies(policies);
    ebo.setAuthorizer(dt.getAuthorizer());
    return ebo;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:45,代码来源:DocumentType.java


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