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


Java Path.toDisplayPath方法代码示例

本文整理汇总了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);
  	}
  }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:39,代码来源:NodeMonitor.java

示例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));
		}
	}
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:50,代码来源:NodeMonitor.java


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