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


Java NodeUtil.renameNode方法代码示例

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


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

示例1: setNodeName

import info.magnolia.jcr.util.NodeUtil; //导入方法依赖的package包/类
@Override
  protected void setNodeName(final Node node, final JcrNodeAdapter item) throws RepositoryException {
      try {
	if (item.isNew() || NewsWorkspaceUtil.hasNameChanged(node, getDefinition().getPropertyName())) {
	    final String newNodeName = NewsWorkspaceUtil.generateUniqueNodeName(node, getDefinition().getPropertyName());
	    item.setNodeName(newNodeName);
	    NodeUtil.renameNode(node, newNodeName);
	}
} catch (PathNotFoundException e) {
	LOGGER.error("Trying to fetch value of a non-existant propertyName", e);
}
  }
 
开发者ID:tricode,项目名称:magnolia-news,代码行数:13,代码来源:UniqueNameSaveFormAction.java

示例2: setNodeName

import info.magnolia.jcr.util.NodeUtil; //导入方法依赖的package包/类
@Override
protected void setNodeName(Node node, JcrNodeAdapter item) throws RepositoryException {
    JcrNodeAdapter itemChanged = item;
    // Set the Node Composite Name
    if (itemChanged instanceof JcrNewNodeAdapter || !node.getName().startsWith(defineNodeName(node))) {
        final String newNodeName = generateUniqueNodeNameForTag(node);
        itemChanged.setNodeName(newNodeName);
        NodeUtil.renameNode(node, newNodeName);
    }
}
 
开发者ID:gtenham,项目名称:magnolia-templating,代码行数:11,代码来源:SaveTagFormAction.java

示例3: setNodeName

import info.magnolia.jcr.util.NodeUtil; //导入方法依赖的package包/类
@Override
protected void setNodeName(Node node, JcrNodeAdapter item) throws RepositoryException {
    try {
        if (item.isNew() || BlogWorkspaceUtil.hasNameChanged(node, getDefinition().getPropertyName())) {
            final String newNodeName = BlogWorkspaceUtil.generateUniqueNodeName(node, getDefinition().getPropertyName());
            item.setNodeName(newNodeName);
            NodeUtil.renameNode(node, newNodeName);
        }
    } catch (PathNotFoundException e) {
        LOGGER.error("Trying to fetch value of a non-existent propertyName", e);
    }
}
 
开发者ID:tricode,项目名称:magnolia-blog,代码行数:13,代码来源:UniqueNameSaveFormAction.java

示例4: setNodeName

import info.magnolia.jcr.util.NodeUtil; //导入方法依赖的package包/类
/**
 * Set the node Name. Node name is set to: <br>
 * the value of the property 'name' if it is present.
 */
protected void setNodeName(Node node, JcrNodeAdapter item) throws RepositoryException {
    String propertyName = "name";
    if (node.hasProperty(propertyName) && !node.hasProperty(ModelConstants.JCR_NAME)) {
        Property property = node.getProperty(propertyName);
        String newNodeName = property.getString();
        if (!node.getName().equals(Path.getValidatedLabel(newNodeName))) {
            newNodeName = Path.getUniqueLabel(node.getSession(), node.getParent().getPath(), Path.getValidatedLabel(newNodeName));
            item.setNodeName(newNodeName);
            NodeUtil.renameNode(node, newNodeName);
        }
    }

}
 
开发者ID:rah003,项目名称:neat-tweaks,代码行数:18,代码来源:SaveFieldFormAction.java

示例5: setNodeName

import info.magnolia.jcr.util.NodeUtil; //导入方法依赖的package包/类
protected void setNodeName(Node node, JcrNodeAdapter item) throws RepositoryException {
    if (node.hasProperty(PN_VANITY_URL) && !node.hasProperty("jcrName")) {
        String newNodeName = _nodeNameHelper.getValidatedName(getNormalizedVanityUrl(node));
        if (!node.getName().equals(newNodeName)) {
            newNodeName = _nodeNameHelper.getUniqueName(node.getParent(), newNodeName);
            item.setNodeName(newNodeName);
            NodeUtil.renameNode(node, newNodeName);
        }
    }
}
 
开发者ID:aperto,项目名称:magnolia-vanity-url,代码行数:11,代码来源:VanityUrlSaveFormAction.java


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