javax.jcr.version.Version.getContainingHistory()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中javax.jcr.version.Version.getContainingHistory()方法的一些代码示例,展示了Version.getContainingHistory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getContainingHistory()方法的具体详情如下:
包路径:javax.jcr.version.Version
类名称:Version
方法名:getContainingHistory

Version.getContainingHistory介绍

[英]Returns the VersionHistory that contains this Version.
[中]返回包含此VersionVersionHistory

代码示例

代码示例来源:origin: apache/jackrabbit

/**
 * Return versionhistory that contains this version item
 *
 * @return versionhistory that contains this version item
 * @throws RepositoryException
 * @see javax.jcr.version.Version#getContainingHistory()
 */
private VersionHistory getVersionHistoryItem() throws RepositoryException {
  return ((Version)item).getContainingHistory();
}

代码示例来源:origin: info.magnolia/magnolia-core

/**
 * Get containing version history.
 *
 * @return version history associated to this version
 */
public VersionHistory getContainingHistory() throws RepositoryException {
  return this.state.getContainingHistory();
}

代码示例来源:origin: info.magnolia/magnolia-core

@Override
public VersionHistory getContainingHistory() throws RepositoryException {
  return version.getContainingHistory();
}

代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector

/**
 * @inheritDoc
 */
public VersionHistory getContainingHistory() throws RepositoryException {
  VersionHistory vHistory = version.getContainingHistory();
  return factory.getVersionHistoryDecorator(session, vHistory);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr-commons

/**
 * Returns the version history of this node.
 * <p>
 * The default implementation returns the containing version history of
 * the base version of this node.
 *
 * @return version history
 * @throws RepositoryException if an error occurs
 */
public VersionHistory getVersionHistory() throws RepositoryException {
  return getBaseVersion().getContainingHistory();
}

代码示例来源:origin: apache/jackrabbit

/**
 * Returns the version history of this node.
 * <p>
 * The default implementation returns the containing version history of
 * the base version of this node.
 *
 * @return version history
 * @throws RepositoryException if an error occurs
 */
public VersionHistory getVersionHistory() throws RepositoryException {
  return getBaseVersion().getContainingHistory();
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

/**
 * Returns the version history of this node.
 * <p>
 * The default implementation returns the containing version history of
 * the base version of this node.
 *
 * @return version history
 * @throws RepositoryException if an error occurs
 */
public VersionHistory getVersionHistory() throws RepositoryException {
  return getBaseVersion().getContainingHistory();
}

代码示例来源:origin: org.apache.jackrabbit/com.springsource.org.apache.jackrabbit.commons

/**
 * Returns the version history of this node.
 * <p>
 * The default implementation returns the containing version history of
 * the base version of this node.
 *
 * @return version history
 * @throws RepositoryException if an error occurs
 */
public VersionHistory getVersionHistory() throws RepositoryException {
  return getBaseVersion().getContainingHistory();
}

代码示例来源:origin: info.magnolia/magnolia-core

@Override
public VersionHistory getContainingHistory() throws RepositoryException {
  return getWrappedVersion().getContainingHistory();
}

代码示例来源:origin: apache/jackrabbit

/**
 * Return versionhistory that contains this version item
 *
 * @return versionhistory that contains this version item
 * @throws RepositoryException
 * @see javax.jcr.version.Version#getContainingHistory()
 */
private VersionHistory getVersionHistoryItem() throws RepositoryException {
  return ((Version)getNode()).getContainingHistory();
}

代码示例来源:origin: net.adamcin.oakpal/oakpal-core

@Override
public VersionHistory getContainingHistory() throws RepositoryException {
  VersionHistory internalHistory = delegate.getContainingHistory();
  return new VersionHistoryFacade<>(internalHistory, session);
}

代码示例来源:origin: net.adamcin.commons/net.adamcin.commons.jcr

private int purgeVersions() throws RepositoryException {
  int count = 0;
  Iterator<Version> versions = this.versionsToPurge.iterator();
  while (versions.hasNext()) {
    Version version = versions.next();
    if (!JcrConstants.JCR_ROOTVERSION.equals(version.getName())) {
      version.getContainingHistory().removeVersion(version.getName());
      count++;
    }
    versions.remove();
  }
  return count;
}

代码示例来源:origin: apache/jackrabbit

/** {@inheritDoc} */
public RemoteVersionHistory getContainingHistory() throws RepositoryException, RemoteException {
  try {
    return getFactory().getRemoteVersionHistory(version.getContainingHistory());
  } catch (RepositoryException ex) {
    throw getRepositoryException(ex);
  }
}

代码示例来源:origin: brix-cms/brix-cms

public JcrVersionHistory execute() throws Exception {
    return JcrVersionHistory.Wrapper.wrap(getDelegate().getContainingHistory(),
        getJcrSession());
  }
});

代码示例来源:origin: brix-cms/brix-cms

public VersionHistory getContainingHistory() throws RepositoryException {
  return VersionHistoryWrapper
      .wrap(getDelegate().getContainingHistory(), getSessionWrapper());
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr2spi

/**
 * Checks if the specified version belongs to this <code>VersionHistory</code>.
 * This method throws <code>VersionException</code> if {@link Version#getContainingHistory()}
 * is not the same item than this <code>VersionHistory</code>.
 *
 * @param version
 * @throws javax.jcr.version.VersionException
 * @throws javax.jcr.RepositoryException
 */
private void checkValidVersion(Version version) throws VersionException, RepositoryException {
  if (!version.getContainingHistory().isSame(this)) {
    throw new VersionException("Specified version '" + version.getName() + "' is not part of this history.");
  }
}

代码示例来源:origin: apache/jackrabbit

/**
 * Checks if the specified version belongs to this <code>VersionHistory</code>.
 * This method throws <code>VersionException</code> if {@link Version#getContainingHistory()}
 * is not the same item than this <code>VersionHistory</code>.
 *
 * @param version
 * @throws javax.jcr.version.VersionException
 * @throws javax.jcr.RepositoryException
 */
private void checkValidVersion(Version version) throws VersionException, RepositoryException {
  if (!version.getContainingHistory().isSame(this)) {
    throw new VersionException("Specified version '" + version.getName() + "' is not part of this history.");
  }
}

代码示例来源:origin: apache/jackrabbit

/**
   * Tests if {@link javax.jcr.version.Version#getContainingHistory()} returns
   * the correct VersionHistory instance.
   */
  public void testGetContainingHistory() throws RepositoryException {
    // create version
    versionableNode.checkout();
    Version version = versionableNode.checkin();

    assertTrue("Method getContainingHistory() must return the same VersionHistory " +
          "as getVersionHistory() of the corresponding Node.",
          versionableNode.getVersionHistory().isSame(version.getContainingHistory()));
  }
}

代码示例来源:origin: apache/jackrabbit

/**
 * Tests if VersionHistory.getVersionableUUID() returns the uuid of the
 * corresponding versionable node.
 */
public void testGetVersionableUUID() throws RepositoryException {
  // create version
  versionableNode.checkout();
  Version version = versionableNode.checkin();
  assertEquals("Method getVersionableUUID() must return the UUID of the corresponding Node.",
      version.getContainingHistory().getVersionableUUID(),
      versionableNode.getUUID());
}

代码示例来源:origin: apache/jackrabbit-oak

/**
 * @since oak
 */
@Test
public void testGetVersion() throws Exception {
  // accessing the version history must be allowed if the versionable node
  // is readable to the editing test session.
  Node testNode = testSession.getNode(versionablePath);
  VersionHistory vh = testNode.getVersionHistory();
  Version version = vh.getVersion(v.getName());
  assertTrue(v.isSame(version));
  assertTrue(vh.isSame(version.getContainingHistory()));
  version = vh.getVersion(v2.getName());
  assertTrue(v2.isSame(version));
  assertTrue(vh.isSame(version.getContainingHistory()));
}

相关文章