Ensure the uniqueness of a given URL-name within the children of the given parent site-map entry.<p>

@param parent the parent entry
@param newName the proposed name
@param callback the callback to execute
498739
public void ensureUniqueName(CmsClientSitemapEntry parent, String newName, I_CmsSimpleCallback<String> callback) {

        ensureUniqueName(parent.getSitePath(), newName, callback);
    }
843563
protected void validateSingle(
        CmsUUID structureId,
        Map<String, String> sitePaths,
        String newSitePath,
        final AsyncCallback<String> errorCallback) {

        Map<String, String> newMap = new HashMap<String, String>(sitePaths);
        newMap.put("NEW", newSitePath); //$NON-NLS-1$
        AsyncCallback<Map<String, String>> callback = new AsyncCallback<Map<String, String>>() {

            public void onFailure(Throwable caught) {

                assert false; // should never happen
            }

            public void onSuccess(Map<String, String> result) {

                String newRes = result.get("NEW"); //$NON-NLS-1$
                errorCallback.onSuccess(newRes);
            }
        };
        validateAliases(structureId, newMap, callback);
    }
1314084
public void createNewGallery(final CmsUUID parentId, final int galleryTypeId, final String title) {

        final String parentFolder = parentId != null
        ? getEntryById(parentId).getSitePath()
        : CmsStringUtil.joinPaths(m_data.getRoot().getSitePath(), m_data.getDefaultGalleryFolder());

        CmsRpcAction<CmsGalleryFolderEntry> action = new CmsRpcAction<CmsGalleryFolderEntry>() {

            @Override
            public void execute() {

                getService().createNewGalleryFolder(parentFolder, title, galleryTypeId, this);
            }

            @Override
            protected void onResponse(CmsGalleryFolderEntry result) {

                CmsSitemapView.getInstance().displayNewGallery(result);

            }
        };
        action.execute();
    }
15152
@Override public void setUniqueID(Integer uniqueID)
   {
      ProjectFile parent = getParentFile();

      if (m_uniqueID != null)
      {
         parent.getCalendars().unmapUniqueID(m_uniqueID);
      }

      parent.getCalendars().mapUniqueID(uniqueID, this);

      m_uniqueID = uniqueID;
   }
61630
def callback_parent(attr, old, new):
    ''''''
    import os

    # Remove accidental white space if copy/pasted
    new = new.strip()
    parent_input.value = new

    # Verify new parent path exists and update `datadirs_select` widget
    if os.path.exists(new):
        # Create sorted list of data directories, ignore files
        joinisdir = lambda parent, d: os.path.isdir(os.path.join(parent, d))
        options = sorted([d for d in os.listdir(new) if joinisdir(new, d)])

        # Update dropdown list of available data directories and select first
        datadirs_select.options = options
        datadirs_select.value = options[0]
        callback_datadirs('value', options[0], options[0])

    else:
        msg = '''
              The parent path `{}` does not exist.

              Check that you have entered the absolute path.
              '''.format(new)
        output_window.text = output_template.format(msg)

    return None
245890
@Override
    public View newView(Context context, Cursor cursor, ViewGroup parent) {
        View v = super.newView(context, cursor, parent);
        v.setTag(new ChildViewCache(v));
        return v;
    }
524911
public void loadPath(
        final String sitePath,
        final boolean continueIfNotLoaded,
        final AsyncCallback<CmsClientSitemapEntry> callback) {

        if (getEntry(sitePath) != null) {
            CmsClientSitemapEntry entry = getEntry(sitePath);
            getChildren(entry.getId(), CmsSitemapTreeItem.getItemById(entry.getId()).isOpen(), callback);
        } else {
            String parentPath = CmsResource.getParentFolder(sitePath);
            CmsUUID idToLoad = null;
            CmsClientSitemapEntry entry = getEntry(parentPath);
            while (entry == null) {
                parentPath = CmsResource.getParentFolder(parentPath);
                if (parentPath == null) {
                    break;
                } else {
                    entry = getEntry(parentPath);
                }
            }
            if (entry != null) {
                idToLoad = entry.getId();
            } else {
                idToLoad = m_data.getSiteRootId();
            }
            CmsSitemapTreeItem treeItem = CmsSitemapTreeItem.getItemById(idToLoad);
            boolean open = true;
            if (treeItem != null) {
                open = treeItem.isOpen();
            }
            getChildren(idToLoad, open, continueIfNotLoaded, new AsyncCallback<CmsClientSitemapEntry>() {

                public void onFailure(Throwable caught) {

                    // nothing to do
                }

                public void onSuccess(CmsClientSitemapEntry result) {

                    // check if target entry is loaded
                    CmsClientSitemapEntry target = getEntry(sitePath);
                    if (target == null) {
                        loadPath(sitePath, continueIfNotLoaded, callback);
                    } else {
                        if (callback != null) {
                            callback.onSuccess(target);
                        }
                    }
                }
            });
        }
    }
1120641
public boolean add(String parent, String namespaceURI, String localName, String value) {
		NodeList nodes = domDocument.getElementsByTagName(parent);
		if (nodes.getLength() == 0)
			return false;
		Node pNode;
		Node node;
		for (int i = 0; i < nodes.getLength(); i++) {
			pNode = nodes.item(i);
			NamedNodeMap attrs = pNode.getAttributes();
			for (int j = 0; j < attrs.getLength(); j++) {
				node = attrs.item(j);
				if (namespaceURI.equals(node.getNodeValue())) {
					node = domDocument.createElement(localName);
					node.appendChild(domDocument.createTextNode(value));
					pNode.appendChild(node);
					return true;
				}
			}
		}
		return false;
	}
1122836
@Override
    public void setName(final String name) {
        this.name = name;

        if (name == null) {
            return;
        }

        for (final Widget w : getChildren()) {
            if (w instanceof HasName) {
                ((HasName) w).setName(name);
            }
        }
    }
979258
public HsqlName newAutoName(String prefix, HsqlName schema,
                                HsqlName parent, int type) {

        HsqlName name = newAutoName(prefix, (String) null, schema, parent,
                                    type);

        return name;
    }
847082
private void updateParent(ElementBase newParent) {
        ElementBase oldParent = this.parent;
        
        if (oldParent != newParent) {
            beforeParentChanged(newParent);
            this.parent = newParent;
            
            if (oldParent != null) {
                oldParent.updateState();
            }
            
            if (newParent != null) {
                afterParentChanged(oldParent);
                newParent.updateState();
            }
        }
    }
474531
public void createSubEntry(final CmsClientSitemapEntry newEntry, CmsUUID parentId, CmsUUID structureId) {

        if (structureId == null) {
            structureId = m_data.getDefaultNewElementInfo().getCopyResourceId();
        }
        create(newEntry, parentId, m_data.getDefaultNewElementInfo().getId(), structureId, null, false);
    }
88861
private static IIOMetadataNode getOrCreateChildNode(IIOMetadataNode parentNode, String name)
    {
        NodeList nodeList = parentNode.getElementsByTagName(name);
        if (nodeList.getLength() > 0)
        {
            return (IIOMetadataNode) nodeList.item(0);
        }
        IIOMetadataNode childNode = new IIOMetadataNode(name);
        parentNode.appendChild(childNode);
        return childNode;
    }
823993
private void finalizeNameAssignment(Assignment a, String newName) {
    a.setNewName(newName);

    // Keep track of the mapping
    renameMap.put(a.oldName, newName);
  }
513578
public final void addChildBefore(Node newChild, Node node) {
    checkArgument(node.parent == this, "The existing child node of the parent should not be null.");
    checkArgument(newChild.next == null, "The new child node has next siblings.");
    checkArgument(newChild.previous == null, "The new child node has previous siblings.");
    checkArgument(newChild.parent == null, "The new child node already has a parent.");
    if (first == node) {
      Node last = first.previous;
      // NOTE: last.next remains null
      newChild.parent = this;
      newChild.next = first;
      newChild.previous = last;
      first.previous = newChild;
      first = newChild;
    } else {
      addChildAfter(newChild, node.previous);
    }
  }
1028130
public void setName(String name) {
        String oldname = this.name;
        this.name = name;
        //TODO Reset the main map
        save(oldname);
    }
297162
private void updateParentPath(String newParentPath, String oldParentPath) {

        String oldPath = getSitePath();
        String newPath = oldPath.replaceFirst(oldParentPath, newParentPath);
        getListItemWidget().setSubtitleLabel(newPath);
        for (Widget child : getChildren()) {
            ((CmsGalleryTreeItem)child).updateParentPath(newPath, oldPath);
        }
    }