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


Java ContentModel.TYPE_CONTAINER属性代码示例

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


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

示例1: getEditions

/** {@inheritDoc} */
public VersionHistory getEditions(NodeRef mlContainer)
{
    VersionHistory editionHistory = null;

    // Only the mlContainer can have editions
    if (nodeService.getType(mlContainer).equals(
            ContentModel.TYPE_MULTILINGUAL_CONTAINER))
    {
        // get the editions of the mlContainer
        editionHistory = versionService.getVersionHistory(mlContainer);
    }

    else
    {
        throw new IllegalArgumentException("The type of the node must be "
                + ContentModel.TYPE_CONTAINER);
    }

    if (logger.isDebugEnabled())
    {
        logger.debug("Found all editions: \n" + "   Node:     "
                + mlContainer + " (type "
                + ContentModel.TYPE_MULTILINGUAL_CONTAINER + ")\n"
                + "   Editions: " + editionHistory);
    }

    return editionHistory;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:EditionServiceImpl.java

示例2: createUser

public static void createUser(
        String userName, 
        String password, 
        String email,
        NodeRef rootNodeRef,
        NodeService nodeService,
        MutableAuthenticationService authenticationService)
{    
    // ignore if the user's authentication already exists
    if (authenticationService.authenticationExists(userName))
    {
        // ignore
        return;
    }
    QName children = ContentModel.ASSOC_CHILDREN;
    QName system = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "system");
    QName container = ContentModel.TYPE_CONTAINER;
    QName types = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "people");
    
    NodeRef systemNodeRef = nodeService.createNode(rootNodeRef, children, system, container).getChildRef();
    NodeRef typesNodeRef = nodeService.createNode(systemNodeRef, children, types, container).getChildRef();
    
    HashMap<QName, Serializable> properties = new HashMap<QName, Serializable>();
    properties.put(ContentModel.PROP_USERNAME, userName);
    if (email != null && email.length() != 0)
    {
        properties.put(ContentModel.PROP_EMAIL, email);
    }
    nodeService.createNode(typesNodeRef, children, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, userName) , container, properties);
    
    // Create the users
    authenticationService.createAuthentication(userName, password.toCharArray()); 
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:TestWithUserUtils.java

示例3: getRegistryRootNodeRef

private NodeRef getRegistryRootNodeRef()
{
    NodeRef registryRootNodeRef = null;
    // Ensure that the registry root node is present
    NodeRef storeRootNodeRef = nodeService.getRootNode(registryStoreRef);
    List<NodeRef> nodeRefs = searchService.selectNodes(
            storeRootNodeRef,
            registryRootPath,
            new QueryParameterDefinition[] {},
            namespaceService,
            false,
            SearchService.LANGUAGE_XPATH);
    if (nodeRefs.size() == 0)
    {
        throw new AlfrescoRuntimeException(
                "Registry root not present: \n" +
                "   Store: " + registryStoreRef + "\n" +
                "   Path:  " + registryRootPath);
    }
    else if (nodeRefs.size() > 1)
    {
        throw new AlfrescoRuntimeException(
                "Registry root path has multiple targets: \n" +
                "   Store: " + registryStoreRef + "\n" +
                "   Path:  " + registryRootPath);
    }
    else
    {
        registryRootNodeRef = nodeRefs.get(0);
    }
    
    // Check the root
    QName typeQName = nodeService.getType(registryRootNodeRef);
    if (!typeQName.equals(ContentModel.TYPE_CONTAINER))
    {
        throw new AlfrescoRuntimeException(
                "Registry root is not of type " + ContentModel.TYPE_CONTAINER + ": \n" +
                "   Node: " + registryRootNodeRef + "\n" +
                "   Type: " + typeQName);
    }
    // Done
    if (logger.isDebugEnabled())
    {
        logger.debug(
                "Found root for registry: \n" +
                "   Store: " + registryStoreRef + "\n" +
                "   Path : " + registryRootPath + "\n" +
                "   Root:  " + registryRootNodeRef);
    }
    return registryRootNodeRef;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:51,代码来源:RegistryServiceImpl.java

示例4: setUp

public void setUp() throws Exception
{
    if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
    {
        throw new AlfrescoRuntimeException(
                "A previous tests did not clean up transaction: " +
                AlfrescoTransactionSupport.getTransactionId());
    }
    
    aclDaoComponent = (AclDAO) applicationContext.getBean("aclDAO");
    
    nodeService = (NodeService) applicationContext.getBean("nodeService");
    dictionaryService = (DictionaryService) applicationContext.getBean(ServiceRegistry.DICTIONARY_SERVICE
            .getLocalName());
    permissionService = (PermissionServiceSPI) applicationContext.getBean("permissionService");
    namespacePrefixResolver = (NamespacePrefixResolver) applicationContext
            .getBean(ServiceRegistry.NAMESPACE_SERVICE.getLocalName());
    authenticationService = (MutableAuthenticationService) applicationContext.getBean("authenticationService");
    authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
    serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
    permissionModelDAO = (ModelDAO) applicationContext.getBean("permissionsModelDAO");
    personService = (PersonService) applicationContext.getBean("personService");
    authorityService = (AuthorityService) applicationContext.getBean("authorityService");
    
    authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
    authenticationDAO = (MutableAuthenticationDao) applicationContext.getBean("authenticationDao");
    transactionService = (TransactionService) applicationContext.getBean("transactionComponent");
    
    testTX = transactionService.getUserTransaction();
    testTX.begin();
    this.authenticationComponent.setSystemUserAsCurrentUser();
    
    StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.nanoTime());
    rootNodeRef = nodeService.getRootNode(storeRef);

    QName children = ContentModel.ASSOC_CHILDREN;
    QName system = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "system");
    QName container = ContentModel.TYPE_CONTAINER;
    QName types = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "people");

    systemNodeRef = nodeService.createNode(rootNodeRef, children, system, container).getChildRef();
    NodeRef typesNodeRef = nodeService.createNode(systemNodeRef, children, types, container).getChildRef();
    Map<QName, Serializable> props = createPersonProperties("andy");
    nodeService.createNode(typesNodeRef, children, ContentModel.TYPE_PERSON, container, props).getChildRef();
    props = createPersonProperties("lemur");
    nodeService.createNode(typesNodeRef, children, ContentModel.TYPE_PERSON, container, props).getChildRef();

    // create an authentication object e.g. the user
    if(authenticationDAO.userExists("andy"))
    {
        authenticationService.deleteAuthentication("andy");
    }
    authenticationService.createAuthentication("andy", "andy".toCharArray());

    if(authenticationDAO.userExists("lemur"))
    {
        authenticationService.deleteAuthentication("lemur");
    }
    authenticationService.createAuthentication("lemur", "lemur".toCharArray());
    
    if(authenticationDAO.userExists(AuthenticationUtil.getAdminUserName()))
    {
        authenticationService.deleteAuthentication(AuthenticationUtil.getAdminUserName());
    }
    authenticationService.createAuthentication(AuthenticationUtil.getAdminUserName(), "admin".toCharArray());
    
    authenticationComponent.clearCurrentSecurityContext();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:68,代码来源:AclDaoComponentTest.java


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