本文整理汇总了Java中org.alfresco.service.cmr.repository.Path.toDisplayPath方法的典型用法代码示例。如果您正苦于以下问题:Java Path.toDisplayPath方法的具体用法?Java Path.toDisplayPath怎么用?Java Path.toDisplayPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.repository.Path
的用法示例。
在下文中一共展示了Path.toDisplayPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateNode
import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
/**
* Create node event
*
* @param childAssocRef ChildAssociationRef
*/
public void onCreateNode(ChildAssociationRef childAssocRef) {
// Check if the node is a file/folder
NodeRef nodeRef = childAssocRef.getChildRef();
if ( nodeRef.getStoreRef().equals( m_storeRef) == false)
{
// different store so irrelevant
return;
}
QName nodeType = m_nodeService.getType( nodeRef);
FileFolderServiceType fType = m_fileFolderService.getType( nodeType);
if ( fType != FileFolderServiceType.INVALID)
{
// Node is not INVALID - therefore its VALID
Path nodePath = m_nodeService.getPath( nodeRef);
String relPath = nodePath.toDisplayPath(m_nodeService, m_permissionService);
String fName = (String) m_nodeService.getProperty( nodeRef, ContentModel.PROP_NAME);
if ( logger.isDebugEnabled())
{
logger.debug("OnCreateNode: nodeRef=" + nodeRef + ", name=" + fName + ", path=" + relPath);
}
// Create an event to process the node creation
NodeEvent nodeEvent = new CreateNodeEvent( fType, nodeRef, relPath, fName);
// Store the event in the transaction until committed, and register the transaction listener
fireNodeEvent(nodeEvent);
}
}
示例2: onUpdateProperties
import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
/**
* Update properties event
*
* @param nodeRef NodeRef
*/
public void onUpdateProperties( NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) {
// Check that the node is in our store
if ( nodeRef.getStoreRef().equals( m_storeRef) == false)
{
return;
}
// Check if the node is a file/folder
QName nodeType = m_nodeService.getType( nodeRef);
FileFolderServiceType fType = m_fileFolderService.getType( nodeType);
if ( fType != FileFolderServiceType.INVALID)
{
// Check if there has been a lock change
String beforeLock = (String) before.get( ContentModel.PROP_LOCK_TYPE);
String afterLock = (String) after.get( ContentModel.PROP_LOCK_TYPE);
String beforeName = (String) before.get(ContentModel.PROP_NAME);
String afterName = (String) after.get(ContentModel.PROP_NAME);
if (( beforeLock != null && afterLock == null) ||
( beforeLock == null && afterLock != null))
{
Path nodePath = m_nodeService.getPath(nodeRef);
String relPath = nodePath.toDisplayPath(m_nodeService, m_permissionService);
// Process the lock update first
fireNodeEvent(new LockNodeEvent( fType, nodeRef, relPath, beforeName, beforeLock, afterLock));
}
// Check if node has been renamed
if (beforeName != null && !beforeName.equals(afterName))
{
// Yes Node has been renamed in the same folder
ChildAssociationRef childAssocRef = m_nodeService.getPrimaryParent(nodeRef);
String relPath2 = buildRelativePathString(childAssocRef.getParentRef(), beforeName);
String relPath3 = buildRelativePathString(childAssocRef.getParentRef(), afterName);
fireNodeEvent(new MoveNodeEvent( fType, nodeRef, relPath2 , relPath3));
}
}
}