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


Java VersionUtil.convertNodeRef方法代码示例

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


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

示例1: isAVersion

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
@Override
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
public boolean isAVersion(NodeRef nodeRef)
{
    if (logger.isDebugEnabled())
    {
        logger.debug("Run as user " + AuthenticationUtil.getRunAsUser());
        logger.debug("Fully authenticated " + AuthenticationUtil.getFullyAuthenticatedUser());
    }
    
    NodeRef realNodeRef = nodeRef;
    if(nodeRef.getStoreRef().getProtocol().equals(VersionBaseModel.STORE_PROTOCOL))
    {
        realNodeRef = VersionUtil.convertNodeRef(nodeRef);            
    }
    return this.dbNodeService.hasAspect(realNodeRef, Version2Model.ASPECT_VERSION);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:Version2ServiceImpl.java

示例2: isVersioned

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
@Override
@Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
public boolean isVersioned(NodeRef nodeRef)
{
    if (logger.isDebugEnabled())
    {
        logger.debug("Run as user " + AuthenticationUtil.getRunAsUser());
        logger.debug("Fully authenticated " + AuthenticationUtil.getFullyAuthenticatedUser());
    }
    
    NodeRef realNodeRef = nodeRef;
    if(nodeRef.getStoreRef().getProtocol().equals(VersionBaseModel.STORE_PROTOCOL))
    {
        realNodeRef = VersionUtil.convertNodeRef(nodeRef);            
    }
    return this.dbNodeService.hasAspect(realNodeRef, ContentModel.ASPECT_VERSIONABLE);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:Version2ServiceImpl.java

示例3: generateVersioningForVersionableNode

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
/**
 * Fixes things up for versionable nodes after importing.
 * Because version information is stored in a different store,
 *  the past versions are not included in the ACP. 
 * However, because the node has the versionable aspect applied to 
 *  it, we still need it to have a single version in the version store.
 * This method arranges for that. 
 */
private void generateVersioningForVersionableNode(final NodeRef nodeRef)
{
    // Is versioning already turned on?
    if(versionService.getVersionHistory(nodeRef) != null)
    {
        // There is already version history, so we don't need to do anything
        return;
    }
    
    // Take a copy of the version label, as it'll be reset when
    //  we request that versioning occurs
    final String label = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_VERSION_LABEL);
    
    // Have versioning enabled
    Version version = versionService.createVersion(nodeRef, null);
    final NodeRef versionNodeRef = VersionUtil.convertNodeRef(version.getFrozenStateNodeRef());
    
    // Put the version label back how it should be on the main node
    dbNodeService.setProperty(nodeRef, ContentModel.PROP_VERSION_LABEL, label);
    
    // Fix up the versioned version node to be what it should be
    // (The previous version label should be off, and the current label is the new one)
    dbNodeService.setProperty(versionNodeRef, ContentModel.PROP_VERSION_LABEL, null);
    dbNodeService.setProperty(versionNodeRef, Version2Model.PROP_QNAME_VERSION_LABEL, label);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:34,代码来源:ImporterComponent.java

示例4: isAVersion

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
@Override
  @Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
  public boolean isAVersion(NodeRef nodeRef)
  {
      if (logger.isDebugEnabled())
      {
      	logger.debug("Run as user " + AuthenticationUtil.getRunAsUser());
      	logger.debug("Fully authenticated " + AuthenticationUtil.getFullyAuthenticatedUser());
      }
   
NodeRef realNodeRef = nodeRef;
      if(nodeRef.getStoreRef().getProtocol().equals(VersionBaseModel.STORE_PROTOCOL))
      {
      	realNodeRef = VersionUtil.convertNodeRef(nodeRef);        	
      }
      return this.dbNodeService.hasAspect(realNodeRef, Version2Model.ASPECT_VERSION);
  }
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:18,代码来源:Version2ServiceImpl.java

示例5: isVersioned

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
@Override
  @Extend(extensionAPI=VersionServiceExtension.class,traitAPI=VersionServiceTrait.class)
  public boolean isVersioned(NodeRef nodeRef)
  {
   if (logger.isDebugEnabled())
      {
      	logger.debug("Run as user " + AuthenticationUtil.getRunAsUser());
      	logger.debug("Fully authenticated " + AuthenticationUtil.getFullyAuthenticatedUser());
      }
   
NodeRef realNodeRef = nodeRef;
      if(nodeRef.getStoreRef().getProtocol().equals(VersionBaseModel.STORE_PROTOCOL))
      {
      	realNodeRef = VersionUtil.convertNodeRef(nodeRef);        	
      }
      return this.dbNodeService.hasAspect(realNodeRef, ContentModel.ASPECT_VERSIONABLE);
  }
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:18,代码来源:Version2ServiceImpl.java

示例6: getProperties

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
/**
 * @see org.alfresco.repo.version.Node2ServiceImpl#getProperties(org.alfresco.service.cmr.repository.NodeRef)
 */
@SuppressWarnings("unchecked")
@Override
public Map<QName, Serializable> getProperties(NodeRef nodeRef) throws InvalidNodeRefException
{
    // TODO only supported for Version2

    NodeRef converted = VersionUtil.convertNodeRef(nodeRef);
    if (dbNodeService.hasAspect(converted, ASPECT_RECORDED_VERSION))
    {
        NodeRef record = (NodeRef)dbNodeService.getProperty(converted, PROP_RECORD_NODE_REF);
        if (record != null && dbNodeService.exists(record))
        {
            Map<QName, Serializable> properties =  dbNodeService.getProperties(record);
            return processProperties(converted, properties);
        }
        else
        {
            return (Map<QName, Serializable>)Collections.EMPTY_MAP;
        }
    }
    else
    {
        return super.getProperties(nodeRef);
    }
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:29,代码来源:RecordableVersionNodeServiceImpl.java

示例7: getAspects

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
/**
 * @see org.alfresco.repo.version.Node2ServiceImpl#getAspects(org.alfresco.service.cmr.repository.NodeRef)
 */
@SuppressWarnings("unchecked")
@Override
public Set<QName> getAspects(NodeRef nodeRef) throws InvalidNodeRefException
{
    // TODO only supported for Version2
    
    NodeRef converted = VersionUtil.convertNodeRef(nodeRef);
    if (dbNodeService.hasAspect(converted, ASPECT_RECORDED_VERSION))
    {
        NodeRef record = (NodeRef)dbNodeService.getProperty(converted, PROP_RECORD_NODE_REF);
        if (record != null && dbNodeService.exists(record))
        {
            Set<QName> aspects =  dbNodeService.getAspects(record);
            return processAspects(aspects);
        }
        else
        {
            return (Set<QName>)Collections.EMPTY_SET;
        }
    }
    else
    {
        return super.getAspects(nodeRef);
    }
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:29,代码来源:RecordableVersionNodeServiceImpl.java

示例8: isNodeAVersion

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
private boolean isNodeAVersion(NodeRef nodeRef)
{
    if(nodeRef.getStoreRef().getProtocol().equals(VersionBaseModel.STORE_PROTOCOL))
    {
        NodeRef realNodeRef = VersionUtil.convertNodeRef(nodeRef);
        return connector.getVersionService().isAVersion(realNodeRef);
    }
    return getNodeAspects().contains(Version2Model.ASPECT_VERSION);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:CMISNodeInfoImpl.java

示例9: isNodeVersioned

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
private boolean isNodeVersioned(NodeRef nodeRef)
{
    if(nodeRef.getStoreRef().getProtocol().equals(VersionBaseModel.STORE_PROTOCOL))
    {
        NodeRef realNodeRef = VersionUtil.convertNodeRef(nodeRef);
        return connector.getVersionService().isVersioned(realNodeRef);
    }
    return getNodeAspects().contains(ContentModel.ASPECT_VERSIONABLE);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:CMISNodeInfoImpl.java

示例10: addVersionHistoryProperty

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
/**
 * Util method to add the version histories of translations as a property of the frozen mlContainer
 */
private void addVersionHistoryProperty(Version edition, List<ChildAssociationRef> childAssocRefs)
{
    List<VersionHistory> translationVersionHistories = new ArrayList<VersionHistory>(childAssocRefs.size());

    for (ChildAssociationRef ref : childAssocRefs)
    {
        NodeRef translation = ref.getChildRef();

        translationVersionHistories.add(versionService.getVersionHistory(translation));
    }

    // properties in which the version histories will be stored
    Map<QName, Serializable> properties = new HashMap<QName, Serializable>();

    // Switch VersionStore depending on configured impl
    if (versionService.getVersionStoreReference().getIdentifier().equals(Version2Model.STORE_ID))
    {
        // V2 version store (eg. workspace://version2Store)

        // add the version history of the translation as property of the Edition
        NodeRef versionNodeRef = VersionUtil.convertNodeRef(edition.getFrozenStateNodeRef());
        this.nodeService.setProperty(versionNodeRef, Version2Model.PROP_QNAME_TRANSLATION_VERSIONS, (Serializable) translationVersionHistories);
    }
    else if (versionService.getVersionStoreReference().getIdentifier().equals(VersionModel.STORE_ID))
    {
        // Deprecated V1 version store (eg. workspace://lightWeightVersionStore)
        
        // add the version history of the translation as property of the Edition
        properties.put(VersionModel.PROP_QNAME_QNAME, VersionModel.PROP_QNAME_TRANSLATION_VERSIONS);
        properties.put(VersionModel.PROP_QNAME_IS_MULTI_VALUE, true);
        properties.put(VersionModel.PROP_QNAME_MULTI_VALUE, (Serializable) translationVersionHistories);

        // create the versioned property node
        this.nodeService.createNode(
                    VersionUtil.convertNodeRef(edition.getFrozenStateNodeRef()),
                    VersionModel.CHILD_QNAME_VERSIONED_ATTRIBUTES,
                    VersionModel.CHILD_QNAME_VERSIONED_ATTRIBUTES,
                    VersionModel.TYPE_QNAME_VERSIONED_PROPERTY,
                    properties);
    }
    else
    {
        throw new AlfrescoRuntimeException("Unexpected versionstore: " + versionService.getVersionStoreReference().getIdentifier());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:49,代码来源:EditionServiceImpl.java

示例11: buildVersionHistory

import org.alfresco.repo.version.common.VersionUtil; //导入方法依赖的package包/类
/**
 * Builds a version history object from the version history reference.
 * <p>
 * The node ref is passed to enable the version history to be scoped to the
 * appropriate branch in the version history.
 *
 * @param versionHistoryRef  the node ref for the version history
 * @param nodeRef            the node reference
 * @return                   a constructed version history object
 */
protected VersionHistory buildVersionHistory(NodeRef versionHistoryRef, NodeRef nodeRef)
{
    VersionHistory versionHistory = null;

    // List of versions with current one last and root one first.
    ArrayList<NodeRef> versionHistoryNodeRefs = new ArrayList<NodeRef>();
    
    NodeRef currentVersion;
    if (this.nodeService.exists(nodeRef))
    {
        currentVersion = getCurrentVersionNodeRef(versionHistoryRef, nodeRef);
    }
    else
    {
        currentVersion = VersionUtil.convertNodeRef(getLatestVersion(nodeRef).getFrozenStateNodeRef());
    }

    while (currentVersion != null)
    {
        AssociationRef preceedingVersion = null;

        versionHistoryNodeRefs.add(0, currentVersion);

        List<AssociationRef> preceedingVersions = this.dbNodeService.getSourceAssocs(
                                                                            currentVersion,
                                                                            VersionModel.ASSOC_SUCCESSOR);
        if (preceedingVersions.size() == 1)
        {
            preceedingVersion = (AssociationRef)preceedingVersions.toArray()[0];
            currentVersion = preceedingVersion.getSourceRef();
        }
        else if (preceedingVersions.size() > 1)
        {
            // Error since we only currently support one preceeding version
            throw new VersionServiceException(MSGID_ERR_ONE_PRECEEDING);
        }
        else
        {
            currentVersion = null;
        }
    }
    
    // Build the version history object
    boolean isRoot = true;
    Version preceeding = null;
    for (NodeRef versionRef : versionHistoryNodeRefs)
    {
        Version version = getVersion(versionRef);

        if (isRoot == true)
        {
            versionHistory = new VersionHistoryImpl(version, versionComparatorDesc);
            isRoot = false;
        }
        else
        {
            ((VersionHistoryImpl)versionHistory).addVersion(version, preceeding);
        }
        preceeding = version;
    }

    return versionHistory;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:74,代码来源:VersionServiceImpl.java


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