當前位置: 首頁>>代碼示例>>Java>>正文


Java NodeService類代碼示例

本文整理匯總了Java中org.alfresco.service.cmr.repository.NodeService的典型用法代碼示例。如果您正苦於以下問題:Java NodeService類的具體用法?Java NodeService怎麽用?Java NodeService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NodeService類屬於org.alfresco.service.cmr.repository包,在下文中一共展示了NodeService類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onSetUpInTransaction

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
@SuppressWarnings("deprecation")
@Override
protected void onSetUpInTransaction() throws Exception
{
    super.onSetUpInTransaction();
    this.nodeService = (NodeService) this.applicationContext.getBean("NodeService");
    this.contentService = (ContentService) this.applicationContext.getBean("ContentService");
    this.renditionService = (RenditionService) this.applicationContext.getBean("RenditionService");
    this.repositoryHelper = (Repository) this.applicationContext.getBean("repositoryHelper");
    this.dictionaryService = (DictionaryService) this.applicationContext.getBean("dictionaryService");
    this.companyHome = repositoryHelper.getCompanyHome();
    
    createTargetFolder();
    
    // Setup the basic rendition definition
    QName renditionName = QName.createQName("Test");
    RenditionDefinition rd = renditionService.loadRenditionDefinition(renditionName); 
    if(rd != null)
    {
       RenditionDefinitionPersisterImpl rdp = new RenditionDefinitionPersisterImpl();
       rdp.setNodeService(nodeService);
       rdp.deleteRenditionDefinition(rd);
    }
    def = renditionService.createRenditionDefinition(renditionName, HTMLRenderingEngine.NAME);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:26,代碼來源:HTMLRenderingEngineTest.java

示例2: FileFolderLoader

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
/**
 * @param repoState             keep track of repository readiness
 * @param transactionService    ensure proper rollback, where required
 * @param repositoryHelper      access standard repository paths
 * @param fileFolderService     perform actual file-folder manipulation
 */
public FileFolderLoader(
        RepositoryState repoState,
        TransactionService transactionService,
        Repository repositoryHelper,
        FileFolderService fileFolderService,
        NodeService nodeService,
        ContentService contentService,
        BehaviourFilter policyBehaviourFilter)
{
    this.repoState = repoState;
    this.transactionService = transactionService;
    this.repositoryHelper = repositoryHelper;
    this.fileFolderService = fileFolderService;
    this.nodeService = nodeService;
    this.contentService = contentService;
    this.policyBehaviourFilter = policyBehaviourFilter;
    
    this.normalDistribution = new NormalDistributionHelper();
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:26,代碼來源:FileFolderLoader.java

示例3: CMMDownloadTestUtil

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
public CMMDownloadTestUtil(ApplicationContext ctx)
{
    this.transactionHelper = ctx.getBean("retryingTransactionHelper", RetryingTransactionHelper.class);
    this.contentService = ctx.getBean("contentService", ContentService.class);
    this.searchService = ctx.getBean("searchService", SearchService.class);
    this.nodeService = ctx.getBean("nodeService", NodeService.class);
    this.namespaceService = ctx.getBean("namespaceService", NamespaceService.class);
    this.downloadService = ctx.getBean("downloadService", DownloadService.class);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:10,代碼來源:CMMDownloadTestUtil.java

示例4: onSetUpInTransaction

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
/**
 * Called at the beginning of all tests
 */
@Override
protected void onSetUpInTransaction() throws Exception
{
    this.checkOutCheckInService = (CheckOutCheckInService) this.applicationContext.getBean("checkOutCheckInService");
    this.nodeService = (NodeService)this.applicationContext.getBean("nodeService");
    this.ruleService = (RuleService)this.applicationContext.getBean("ruleService");
    this.actionService = (ActionService)this.applicationContext.getBean("actionService");
    transactionHelper = (RetryingTransactionHelper)applicationContext.getBean("retryingTransactionHelper");
    fileFolderService = applicationContext.getBean("fileFolderService", FileFolderService.class);
    contentService = applicationContext.getBean("contentService", ContentService.class);
    
    AuthenticationComponent authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent");
    authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
    
    // Create the store and get the root node
    this.testStoreRef = this.nodeService.createStore(
            StoreRef.PROTOCOL_WORKSPACE, "Test_"
                    + System.currentTimeMillis());
    this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef);

    // Get the executer instance 
    this.executer = (ExecuteAllRulesActionExecuter)this.applicationContext.getBean(ExecuteAllRulesActionExecuter.NAME);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:27,代碼來源:ExecuteAllRulesActionExecuterTest.java

示例5: initTestsContext

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
@BeforeClass public static void initTestsContext() throws Exception
{
    ApplicationContext testContext = APP_CONTEXT_INIT.getApplicationContext();
    
    PRIVATE_REMOTE_CREDENTIALS_SERVICE = (RemoteCredentialsService)testContext.getBean("remoteCredentialsService");
    REMOTE_CREDENTIALS_SERVICE = (RemoteCredentialsService)testContext.getBean("RemoteCredentialsService");
    
    AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
    BEHAVIOUR_FILTER       = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
    DICTIONARY_SERVICE     = (DictionaryService)testContext.getBean("dictionaryService");
    NAMESPACE_SERVICE      = (NamespaceService)testContext.getBean("namespaceService");
    REPOSITORY_HELPER      = (Repository)testContext.getBean("repositoryHelper");
    NODE_SERVICE           = (NodeService)testContext.getBean("nodeService");
    PUBLIC_NODE_SERVICE    = (NodeService)testContext.getBean("NodeService");
    PERSON_SERVICE         = (PersonService)testContext.getBean("personService");
    TRANSACTION_HELPER     = (RetryingTransactionHelper)testContext.getBean("retryingTransactionHelper");
    TRANSACTION_SERVICE    = (TransactionService)testContext.getBean("TransactionService");
    PERMISSION_SERVICE     = (PermissionService)testContext.getBean("permissionService");

    // Switch to a test shared system container
    RemoteCredentialsServiceImpl.setSharedCredentialsSystemContainerName(SHARED_SYSTEM_CONTAINER_NAME);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:23,代碼來源:RemoteCredentialsServicesTest.java

示例6: onSetUpInTransaction

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
@SuppressWarnings("deprecation")
@Override
protected void onSetUpInTransaction() throws Exception
{
    this.nodeService = (NodeService)applicationContext.getBean("nodeService");
    this.taggingService = (TaggingService)applicationContext.getBean("taggingService");
    
    // Create the store and get the root node
    this.testStoreRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
    this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef); 

    // Create the node used for tests
    this.nodeRef = this.nodeService.createNode(
            this.rootNodeRef,
            ContentModel.ASSOC_CHILDREN,
            QName.createQName("{test}testnode"),
            ContentModel.TYPE_CONTENT).getChildRef();
    
    this.evaluator = (HasTagEvaluator)applicationContext.getBean(HasTagEvaluator.NAME);        
    AuthenticationUtil.setFullyAuthenticatedUser("admin");
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:22,代碼來源:HasTagEvaluatorTest.java

示例7: initTestsContext

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
@BeforeClass public static void initTestsContext() throws Exception
{
    AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
    BEHAVIOUR_FILTER       = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
    LINKS_SERVICE          = (LinksService)testContext.getBean("LinksService");
    NODE_SERVICE           = (NodeService)testContext.getBean("nodeService");
    PUBLIC_NODE_SERVICE    = (NodeService)testContext.getBean("NodeService");
    PERSON_SERVICE         = (PersonService)testContext.getBean("personService");
    TRANSACTION_HELPER     = (RetryingTransactionHelper)testContext.getBean("retryingTransactionHelper");
    PERMISSION_SERVICE     = (PermissionService)testContext.getBean("permissionService");
    SITE_SERVICE           = (SiteService)testContext.getBean("siteService");
    CONTENT_SERVICE        = (ContentService)testContext.getBean("ContentService");

    // Do the setup as admin
    AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER);
    createUser(TEST_USER);
    
    // We need to create the test site as the test user so that they can contribute content to it in tests below.
    AuthenticationUtil.setFullyAuthenticatedUser(TEST_USER);
    createTestSites();
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:22,代碼來源:LinksServiceImplTest.java

示例8: addForumNode

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
/**
     * Adds forum node
     * 
     * @param nodeRef Paren node
     * @return Reference to created node
     */
    private NodeRef addForumNode(NodeRef nodeRef)
    {
        NodeService nodeService = getNodeService();
        
//        //Add discussable aspect to content node
//        if (!nodeService.hasAspect(nodeRef, ForumModel.ASPECT_DISCUSSABLE))
//        {
//            nodeService.addAspect(nodeRef, ForumModel.ASPECT_DISCUSSABLE, null);
//        }

        //Create forum node and associate it with content node
        Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
        properties.put(ContentModel.PROP_NAME, forumNodeName);
        ChildAssociationRef childAssoc = nodeService.createNode(nodeRef, ForumModel.ASSOC_DISCUSSION, ForumModel.ASSOC_DISCUSSION, ForumModel.TYPE_FORUM, properties);
        NodeRef forumNode = childAssoc.getChildRef();        

        //Add necessary aspects to forum node
        properties.clear();
        properties.put(ApplicationModel.PROP_ICON, "forum");
        nodeService.addAspect(forumNode, ApplicationModel.ASPECT_UIFACETS, properties);
        
        return forumNode;
    }
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:30,代碼來源:DocumentEmailMessageHandler.java

示例9: processExcludedSet

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
/**
 * @param thisNode NodeRef
 * @return Set<NodeRef>
 */
private Set<NodeRef> processExcludedSet(NodeRef thisNode)
{
    Set<NodeRef> results = new HashSet<NodeRef>(89);
    NodeService nodeService = serviceRegistry.getNodeService();

    // Find any peer nodes (filtering as necessary)
    List<AssociationRef> targets = nodeService.getTargetAssocs(thisNode, RegexQNamePattern.MATCH_ALL);
    boolean filterPeers = !peerAssociationTypes.isEmpty();
    for (AssociationRef target : targets)
    {
        if (!filterPeers || !peerAssociationTypes.contains(target.getTypeQName()))
        {
            results.add(target.getTargetRef());
        }
    }
    return results;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:22,代碼來源:PeerAssociatedNodeFinder.java

示例10: GetPeopleCannedQuery

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
public GetPeopleCannedQuery(
        NodeDAO nodeDAO,
        QNameDAO qnameDAO,
        CannedQueryDAO cannedQueryDAO,
        TenantService tenantService,
        NodeService nodeService,
        AuthorityService authorityService,
        CannedQueryParameters params)
{
    super(params);
    
    this.nodeDAO = nodeDAO;
    this.qnameDAO = qnameDAO;
    this.cannedQueryDAO = cannedQueryDAO;
    this.tenantService = tenantService;
    this.nodeService = nodeService;
    this.authorityService = authorityService;
    
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:20,代碼來源:GetPeopleCannedQuery.java

示例11: initContextAndCreateUser

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
public  void initContextAndCreateUser()
{
    appContext = ApplicationContextHelper.getApplicationContext();

    authenticationService = (MutableAuthenticationService) appContext.getBean("AuthenticationService");
    contentService = (ContentService) appContext.getBean("ContentService");
    nodeService = (NodeService) appContext.getBean("NodeService");
    permissionService = (PermissionService) appContext.getBean("PermissionService");
    personService = (PersonService) appContext.getBean("PersonService");
    renditionService = (RenditionService) appContext.getBean("RenditionService");
    repositoryHelper = (Repository) appContext.getBean("repositoryHelper");
    transactionService = (TransactionService) appContext.getBean("TransactionService");
    txnHelper = transactionService.getRetryingTransactionHelper();
    ownableService = (OwnableService) appContext.getBean("ownableService");

    ADMIN_USER = AuthenticationUtil.getAdminUserName();
    
    // Create a nonAdminUser
    createUser(NON_ADMIN_USER);

}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:22,代碼來源:MultiUserRenditionTest.java

示例12: getSystemChildContainer

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
/**
 * Returns the NodeRef of a given Child Container within the current Tenant's 
 *  System Container, if found
 */
public static NodeRef getSystemChildContainer(final QName childName, final NodeService nodeService, final Repository repositoryHelper)
{
    NodeRef system = getSystemContainer(nodeService, repositoryHelper);

    // Find the container, under system
    List<ChildAssociationRef> containerRefs = nodeService.getChildAssocs(
            system, ContentModel.ASSOC_CHILDREN, childName);

    NodeRef container = null;
    if (containerRefs.size() > 0)
    {
        container = containerRefs.get(0).getChildRef();
        if (containerRefs.size() > 1)
            logger.warn("Duplicate Shared Credentials Containers found: " + containerRefs);
    }

    return container;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:23,代碼來源:SystemNodeUtils.java

示例13: dumpNode

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
/**
 * Dumps the contents of a node 
 * 
 * @param nodeService NodeService
 * @param nodeRef NodeRef
 * @return String
 */
public static String dumpNode(NodeService nodeService, NodeRef nodeRef)
{
    StringBuilder builder = new StringBuilder();
    
    if (nodeService.exists(nodeRef) == true)
    {
        builder.append(outputNode(0, nodeService, nodeRef));            
    }
    else
    {
        builder.
            append("The node ").
            append(nodeRef.toString()).
            append(" does not exist.");
    }
    
    return builder.toString();
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:26,代碼來源:NodeStoreInspector.java

示例14: onSetUpInTransaction

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
@Override
protected void onSetUpInTransaction() throws Exception
{
    this.nodeService = (NodeService)this.applicationContext.getBean("nodeService");
    
    // Create the store and get the root node
    this.testStoreRef = this.nodeService.createStore(
            StoreRef.PROTOCOL_WORKSPACE, "Test_"
                    + System.currentTimeMillis());
    this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef);

    // Create the node used for tests
    this.nodeRef = this.nodeService.createNode(
            this.rootNodeRef,
            ContentModel.ASSOC_CHILDREN,
            QName.createQName("{test}testnode"),
            ContentModel.TYPE_CONTENT).getChildRef();
    
    this.evaluator = (IsSubTypeEvaluator)this.applicationContext.getBean(IsSubTypeEvaluator.NAME);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:21,代碼來源:IsSubTypeEvaluatorTest.java

示例15: updateAssociations

import org.alfresco.service.cmr.repository.NodeService; //導入依賴的package包/類
@Override
protected void updateAssociations(NodeService nodeService)
{
    List<AssociationRef> existingAssocs = nodeService.getTargetAssocs(sourceNodeRef, assocQName);
    for (AssociationRef assoc : existingAssocs)
    {
        if (assoc.getTargetRef().equals(targetNodeRef))
        {
            if (logger.isWarnEnabled())
            {
                logger.warn("Attempt to add existing association prevented. " + assoc);
            }
            return;
        }
    }
    nodeService.createAssociation(sourceNodeRef, targetNodeRef, assocQName);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:18,代碼來源:ContentModelFormProcessor.java


注:本文中的org.alfresco.service.cmr.repository.NodeService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。