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

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

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

Version.getPath介绍

暂无

代码示例

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

public String getPath()
{
  try
  {
    return version.getPath();
  }
  catch (RepositoryException e)
  {
    throw new VersionException("Error while retrieving the version path", e);
  }
}

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

public String getPath()
{
  try
  {
    return version.getPath();
  }
  catch (RepositoryException e)
  {
    throw new VersionException("Error while retrieving the version path", e);
  }
}

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

/**
 * Tests if <code>Version.checkin()</code> throws an {@link
 * javax.jcr.UnsupportedRepositoryOperationException}
 */
public void testCheckinJcr2() throws Exception {
  try {
    versionManager.checkin(version.getPath());
    fail("Version.checkin() did not throw an UnsupportedRepositoryOperationException");
  } catch (UnsupportedRepositoryOperationException success) {
  }
}

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

/**
 * Tests if <code>Version.getVersionHistory()</code> throws an {@link
 * javax.jcr.UnsupportedRepositoryOperationException}
 */
public void testGetVersionHistoryJcr2() throws Exception {
  try {
    versionManager.getVersionHistory(version.getPath());
    fail("Version.getVersionHistory() did not throw an UnsupportedRepositoryOperationException");
  } catch (UnsupportedRepositoryOperationException success) {
  }
}

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

/**
 * Tests if <code>Version.getCorrespondingNodePath(String)</code> returns
 * the right path
 */
public void testGetCorrespondingNodePath() throws Exception {
  assertEquals("Version.getCorrespondingNodePath(String) did not return the right path", version.getPath(), version.getCorrespondingNodePath(workspaceName));
}

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

/**
 * Tests if <code>Version.checkout()</code> throws an {@link
 * javax.jcr.UnsupportedRepositoryOperationException}
 */
public void testCheckoutJcr2() throws Exception {
  try {
    versionManager.checkout(version.getPath());
    fail("Version.checkout() did not throw an UnsupportedRepositoryOperationException");
  } catch (UnsupportedRepositoryOperationException success) {
  }
}

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

/**
 * Tests if <code>Version.getBaseVersion()</code> throws an {@link
 * javax.jcr.UnsupportedRepositoryOperationException}
 */
public void testGetBaseVersionJcr2() throws Exception {
  try {
    versionManager.getBaseVersion(version.getPath());
    fail("Version.getBaseVersion() did not throw an UnsupportedRepositoryOperationException");
  } catch (UnsupportedRepositoryOperationException success) {
  }
}

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

/**
 * Tests if <code>Version.isCheckedOut()</code> returns <code>true</code>
 */
public void testIsCheckedOutJcr2() throws Exception {
  assertTrue("Version.isCheckedOut() did not return true", versionManager.isCheckedOut(version.getPath()));
}

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

/**
 * Tests if <code>Version.cancelMerge(Version)</code> throws an {@link
 * javax.jcr.UnsupportedRepositoryOperationException}
 */
public void testCancelMergeJcr2() throws Exception {
  try {
    versionManager.cancelMerge(version.getPath(), version2);
    fail("Version.cancelMerge(Version) did not throw an UnsupportedRepositoryOperationException");
  } catch (UnsupportedRepositoryOperationException success) {
  }
}

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

/**
 * Tests if <code>Version.doneMerge(Version)</code> throws an {@link
 * javax.jcr.UnsupportedRepositoryOperationException}
 */
public void testDoneMergeJcr2() throws Exception {
  try {
    versionManager.doneMerge(version.getPath(), version2);
    fail("Version should not be versionable: Version.doneMerge(Version) did not throw an UnsupportedRepositoryOperationException");
  } catch (UnsupportedRepositoryOperationException success) {
  }
}

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

/**
 * Tests if <code>Version.restoreByLabel(String, boolean)</code> throws an
 * {@link javax.jcr.UnsupportedRepositoryOperationException}
 */
public void testRestoreByLabelJcr2() throws Exception {
  try {
    versionManager.restoreByLabel(version.getPath(), "abc", true);
    fail("Version.restoreByLabel(String,boolean) did not throw an UnsupportedRepositoryOperationException");
  } catch (UnsupportedRepositoryOperationException success) {
  }
}

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

/**
 * Tests if <code>Version.restore(String, boolean)</code> and
 * <code>Version.restore(Version, boolean)</code> throw an
 * {@link UnsupportedRepositoryOperationException} and
 * <code>Version.restore(Version, String, boolean)</code> throws a
 * {@link ConstraintViolationException}.
 */
public void testRestoreJcr2() throws Exception {
  try {
    versionManager.restore(version.getPath(), "abc", true);
    fail("Version.restore(String,boolean) did not throw an UnsupportedRepositoryOperationException");
  } catch (UnsupportedRepositoryOperationException success) {
  }
}

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

/**
 * Tests if <code>Version.getPath()</code> returns the right path
 */
public void testGetPath() throws Exception {
  assertTrue("Version.getPath() does not return the right path", version.getPath().startsWith("/" + superuser.getNamespacePrefix(NS_JCR_URI) + ":system/" + superuser.getNamespacePrefix(NS_JCR_URI) + ":versionStorage/"));
}

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

/**
 * Tests if <code>Version.holdsLock()</code> returns <code>false</code>
 */
public void testHoldsLockJcr2() throws Exception {
  ensureLockingSupported();
  assertFalse("Version.holdsLock() did not return false", version.getSession().getWorkspace().getLockManager().holdsLock(version.getPath()));
}

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

/**
 * Tests if <code>Version.isLocked()</code> returns <code>false</code>
 */
public void testIsLockedJcr2() throws Exception {
  ensureLockingSupported();
  assertFalse("Version.isLocked() did not return false", version.getSession().getWorkspace().getLockManager().isLocked(version.getPath()));
}

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

/**
 * Tests if <code>Version.getLock()</code> throws a {@link
 * javax.jcr.lock.LockException}
 */
public void testGetLockJcr2() throws Exception {
  ensureLockingSupported();
  try {
    version.getSession().getWorkspace().getLockManager().getLock(version.getPath());
    fail("Version should not be lockable: Version.getLock() did not throw a LockException");
  } catch (LockException success) {
  }
}

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

/**
 * Tests if <code>Version.unlock()</code> throws a {@link
 * javax.jcr.lock.LockException}
 */
public void testUnlockJcr2() throws Exception {
  ensureLockingSupported();
  try {
    version.getSession().getWorkspace().getLockManager().unlock(version.getPath());
    fail("Version should not be lockable: Version.unlock() did not throw a LockException");
  } catch (LockException success) {
  }
}

代码示例来源:origin: org.exoplatform.jcr/exo.jcr.component.core

protected List<String> getVersionLabelsList(Version version) throws VersionException, RepositoryException
{
 if (!isVersionBelongToThis(version))
 {
   throw new VersionException("There are no version '" + version.getPath() + "' in the version history "
    + getPath());
 }
 List<PropertyData> labelsList = getData().getVersionLabels();
 List<String> vlabels = new ArrayList<String>();
 for (PropertyData prop : labelsList)
 {
   String versionUuid = ValueDataUtil.getString(prop.getValues().get(0));
   if (versionUuid.equals(((VersionImpl)version).getInternalIdentifier()))
   {
    vlabels.add(locationFactory.createJCRName(prop.getQPath().getName()).getAsString());
   }
 }
 return vlabels;
}

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

/**
 * @since oak
 */
@Test
public void testHasVersionContentNodes() throws Exception {
  // version information must still be accessible
  assertTrue(testSession.nodeExists(v.getPath()));
  assertTrue(testSession.nodeExists(v2.getPath()));
  assertTrue(testSession.nodeExists(vh.getPath()));
}

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

@Test
public void hiddenTree() throws Exception {
  Node test = session.getRootNode().addNode("test", "nt:unstructured");
  test.addMixin("mix:versionable");
  session.save();
  NodeBuilder builder = store.getRoot().builder();
  builder.child("test").child(":hidden").setProperty("property", "value");
  store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
  session.refresh(false);
  Version v1 = vMgr.checkpoint("/test");
  Version v2 = vMgr.checkpoint("/test");
  NodeState state = store.getRoot();
  for (String name : PathUtils.elements(v2.getPath())) {
    state = state.getChildNode(name);
  }
  state = state.getChildNode("jcr:frozenNode");
  assertTrue(state.exists());
  assertFalse(state.hasChildNode(":hidden"));
  vMgr.restore(v1, true);
  state = store.getRoot().getChildNode("test");
  assertTrue(state.hasChildNode(":hidden"));
}

相关文章