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


Java ContentModel.TYPE_CONTENT属性代码示例

本文整理汇总了Java中org.alfresco.model.ContentModel.TYPE_CONTENT属性的典型用法代码示例。如果您正苦于以下问题:Java ContentModel.TYPE_CONTENT属性的具体用法?Java ContentModel.TYPE_CONTENT怎么用?Java ContentModel.TYPE_CONTENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.alfresco.model.ContentModel的用法示例。


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

示例1: childAssoc

private ChildAssociationRef childAssoc(String id)
{
    return new ChildAssociationRef(
        ContentModel.ASSOC_CONTAINS,
        new NodeRef("test://store/parentRef"),
        ContentModel.TYPE_CONTENT,
        new NodeRef("test://store/" + id)
    );
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:9,代码来源:DbOrIndexSwitchingQueryLanguageTest.java

示例2: testCreateRenditionNodeAssoc

@SuppressWarnings({"unchecked" , "rawtypes"})
public void testCreateRenditionNodeAssoc() throws Exception
{
    QName assocType = RenditionModel.ASSOC_RENDITION;
    when(nodeService.exists(source)).thenReturn(true);
    QName nodeType = ContentModel.TYPE_CONTENT;
    ChildAssociationRef renditionAssoc = makeRenditionAssoc();
    RenditionDefinition definition = makeRenditionDefinition(renditionAssoc);

    // Stub the createNode() method to return renditionAssoc.
    when(nodeService.createNode(eq(source), eq(assocType), any(QName.class), any(QName.class), anyMap()))
        .thenReturn(renditionAssoc);
    engine.execute(definition, source);

    // Check the createNode method was called with the correct parameters.
    // Check the nodeType defaults to cm:content.
    ArgumentCaptor<Map> captor = ArgumentCaptor.forClass(Map.class);
    verify(nodeService).createNode(eq(source), eq(assocType), any(QName.class), eq(nodeType), captor.capture());
    Map<String, Serializable> props = captor.getValue();

    // Check the node name is set to match teh rendition name local name.
    assertEquals(renditionAssoc.getQName().getLocalName(), props.get(ContentModel.PROP_NAME));

    // Check content property name defaults to cm:content
    assertEquals(ContentModel.PROP_CONTENT, props.get(ContentModel.PROP_CONTENT_PROPERTY_NAME));

    // Check the returned result is the association created by the call to
    // nodeServcie.createNode().
    Serializable result = definition.getParameterValue(ActionExecuter.PARAM_RESULT);
    assertEquals("The returned rendition association is not the one created by the node service!", renditionAssoc,
                result);

    // Check that setting the default content property and default node type
    // on the rendition engine works.
    nodeType = QName.createQName("url", "someNodeType");
    QName contentPropName = QName.createQName("url", "someContentProp");
    engine.setDefaultRenditionContentProp(contentPropName.toString());
    engine.setDefaultRenditionNodeType(nodeType.toString());
    engine.execute(definition, source);
    verify(nodeService).createNode(eq(source), eq(assocType), any(QName.class), eq(nodeType), captor.capture());
    props = captor.getValue();
    assertEquals(contentPropName, props.get(ContentModel.PROP_CONTENT_PROPERTY_NAME));

    // Check that setting the rendition node type param works.
    nodeType = ContentModel.TYPE_THUMBNAIL;
    contentPropName = ContentModel.PROP_CONTENT;
    definition.setParameterValue(RenditionService.PARAM_RENDITION_NODETYPE, nodeType);
    definition.setParameterValue(AbstractRenderingEngine.PARAM_TARGET_CONTENT_PROPERTY, contentPropName);
    engine.execute(definition, source);
    verify(nodeService).createNode(eq(source), eq(assocType), any(QName.class), eq(nodeType), captor.capture());
    props = captor.getValue();
    assertEquals(contentPropName, props.get(ContentModel.PROP_CONTENT_PROPERTY_NAME));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:53,代码来源:AbstractRenderingEngineTest.java


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