コード例 #1
0
 private boolean isNodeEditable(BrixNode node) {
   if (node.isNodeType("mix:versionable") && !node.isCheckedOut()) {
     return false;
   }
   if (node.isLocked() && node.getLock().getLockToken() == null) {
     return false;
   }
   return true;
 }
コード例 #2
0
  /**
   * Creates a uri path for the specified <code>node</code> By default this method uses {@link
   * BrixConfig#getMapper()} to map node path to a uri path.
   *
   * @param node node to create uri path for
   * @return uri path that represents the node
   */
  public Path getUriPathForNode(final BrixNode node) {
    // allow site plugin to translate jcr path into node path
    final String jcrPath = SitePlugin.get().fromRealWebNodePath(node.getPath());
    final Path nodePath = new Path(jcrPath);

    // use urimapper to create the uri
    return brix.getConfig().getMapper().getUriPathForNode(nodePath, brix);
  }