本文整理汇总了Java中org.alfresco.repo.nodelocator.NodeLocatorService类的典型用法代码示例。如果您正苦于以下问题:Java NodeLocatorService类的具体用法?Java NodeLocatorService怎么用?Java NodeLocatorService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeLocatorService类属于org.alfresco.repo.nodelocator包,在下文中一共展示了NodeLocatorService类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
applicationContext = ApplicationContextHelper.getApplicationContext();
// initialise policy test model
DictionaryBootstrap bootstrap = new DictionaryBootstrap();
List<String> bootstrapModels = new ArrayList<String>();
bootstrapModels.add(TEST_MODEL);
bootstrap.setModels(bootstrapModels);
bootstrap.setDictionaryDAO((DictionaryDAO)applicationContext.getBean("dictionaryDAO"));
bootstrap.setTenantService((TenantService)applicationContext.getBean("tenantService"));
bootstrap.bootstrap();
// retrieve policy component
this.policyComponent = (PolicyComponent)applicationContext.getBean("policyComponent");
this.behaviourFilter = (BehaviourFilter) applicationContext.getBean("policyBehaviourFilter");
this.trxService = (TransactionService) applicationContext.getBean("transactionComponent");
this.nodeService = (NodeService) applicationContext.getBean("nodeService");
this.nodeLocatorService = (NodeLocatorService) applicationContext.getBean("nodeLocatorService");
this.authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent");
this.authenticationComponent.setSystemUserAsCurrentUser();
// Register Policy
if (sideEffectDelegate == null)
{
sideEffectDelegate = policyComponent.registerClassPolicy(SideEffectTestPolicy.class);
// Bind Behaviour to side effect policy
QName policyName = QName.createQName(TEST_NAMESPACE, "sideEffect");
Behaviour baseBehaviour = new JavaBehaviour(this, "sideEffectTest", NotificationFrequency.TRANSACTION_COMMIT);
this.policyComponent.bindClassBehaviour(policyName, BASE_TYPE, baseBehaviour);
}
this.companyHome = nodeLocatorService.getNode(CompanyHomeNodeLocator.NAME, null, null);
createAndEnableBehaviours();
}
示例2: setUp
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
// initialise policy test model
DictionaryBootstrap bootstrap = new DictionaryBootstrap();
List<String> bootstrapModels = new ArrayList<String>();
bootstrapModels.add(TEST_MODEL);
bootstrap.setModels(bootstrapModels);
bootstrap.setDictionaryDAO((DictionaryDAO)applicationContext.getBean("dictionaryDAO"));
bootstrap.setTenantService((TenantService)applicationContext.getBean("tenantService"));
bootstrap.bootstrap();
// retrieve policy component
this.policyComponent = (PolicyComponent)applicationContext.getBean("policyComponent");
this.behaviourFilter = (BehaviourFilter) applicationContext.getBean("policyBehaviourFilter");
this.trxService = (TransactionService) applicationContext.getBean("transactionComponent");
this.nodeService = (NodeService) applicationContext.getBean("nodeService");
this.nodeLocatorService = (NodeLocatorService) applicationContext.getBean("nodeLocatorService");
this.authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent");
this.authenticationComponent.setSystemUserAsCurrentUser();
// Register Policy
if (sideEffectDelegate == null)
{
sideEffectDelegate = policyComponent.registerClassPolicy(SideEffectTestPolicy.class);
// Bind Behaviour to side effect policy
QName policyName = QName.createQName(TEST_NAMESPACE, "sideEffect");
Behaviour baseBehaviour = new JavaBehaviour(this, "sideEffectTest", NotificationFrequency.TRANSACTION_COMMIT);
this.policyComponent.bindClassBehaviour(policyName, BASE_TYPE, baseBehaviour);
}
this.companyHome = nodeLocatorService.getNode(CompanyHomeNodeLocator.NAME, null, null);
createAndEnableBehaviours();
}
示例3: setNodeLocatorService
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
public void setNodeLocatorService(NodeLocatorService nodeLocatorService) {
this.nodeLocatorService = nodeLocatorService;
}
示例4: getNodeLocatorService
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
@Override
public NodeLocatorService getNodeLocatorService()
{
return (NodeLocatorService)getService(NODE_LOCATOR_SERVICE);
}
示例5: resolveNodeReference
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
/**
* Use the Node Locator Service to find the a node reference from a number of possible locator types.
* This method is responsible for determining the locator type and then calling the Service as the
* Service does not know how to guess which locator to use.
* <p>
* This service supports 'virtual' nodes including the following:
* <p>
* alfresco://company/home The Company Home root node<br>
* alfresco://user/home The User Home node under Company Home<br>
* alfresco://company/shared The Shared node under Company Home<br>
* alfresco://sites/home The Sites home node under Company Home<br>
* workspace://.../... Any standard NodeRef<br>
* /app:company_home/cm:... XPath QName style node reference<br>
*
* @param reference The node reference - See above for list of possible node references supported.
*
* @return ScriptNode representing the node or null if not found
*/
public ScriptNode resolveNodeReference(final String reference)
{
if (reference == null)
{
throw new IllegalArgumentException("Node 'reference' argument is mandatory.");
}
final NodeLocatorService locatorService = this.services.getNodeLocatorService();
NodeRef nodeRef = null;
switch (reference)
{
case "alfresco://company/home":
nodeRef = locatorService.getNode(CompanyHomeNodeLocator.NAME, null, null);
break;
case "alfresco://user/home":
nodeRef = locatorService.getNode(UserHomeNodeLocator.NAME, null, null);
break;
case "alfresco://company/shared":
nodeRef = locatorService.getNode(SharedHomeNodeLocator.NAME, null, null);
break;
case "alfresco://sites/home":
nodeRef = locatorService.getNode(SitesHomeNodeLocator.NAME, null, null);
break;
default:
if (reference.indexOf("://") > 0)
{
NodeRef ref = new NodeRef(reference);
if (this.services.getNodeService().exists(ref) &&
this.services.getPermissionService().hasPermission(ref, PermissionService.READ) == AccessStatus.ALLOWED)
{
nodeRef = ref;
}
}
else if (reference.startsWith("/"))
{
final Map<String, Serializable> params = new HashMap<>(1, 1.0f);
params.put(XPathNodeLocator.QUERY_KEY, reference);
nodeRef = locatorService.getNode(XPathNodeLocator.NAME, null, params);
}
break;
}
return nodeRef != null ? (ScriptNode)new ValueConverter().convertValueForScript(this.services, getScope(), null, nodeRef) : null;
}
示例6: getNodeLocatorService
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
@Override
public NodeLocatorService getNodeLocatorService()
{
// A mock response
return null;
}
示例7: setNodeLocatorService
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
/**
* @param locatorService the locatorService to set
*/
public void setNodeLocatorService(NodeLocatorService locatorService)
{
this.locatorService = locatorService;
}
示例8: setNodeLocatorService
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
public void setNodeLocatorService(NodeLocatorService nodeLocatorService)
{
this.nodeLocatorService = nodeLocatorService;
}
示例9: getNodeLocatorService
import org.alfresco.repo.nodelocator.NodeLocatorService; //导入依赖的package包/类
/**
* Get the node locator service (or null if one is not provided)
*/
@NotAuditable
NodeLocatorService getNodeLocatorService();