Updates the given entry.<p>

@param sitePath the entry sitepath
167757
public void updateEntry(String sitePath) {

        CmsClientSitemapEntry entry = getEntry(sitePath);
        if ((entry != null) && (CmsSitemapTreeItem.getItemById(entry.getId()) != null)) {
            getChildren(entry.getId(), CmsSitemapTreeItem.getItemById(entry.getId()).isOpen(), null);
        }
    }
71600
public void updateCmsObject(CmsObject cms) {

        try {
            m_cms = OpenCms.initCmsObject(cms);
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            m_cms = cms;
        }
    }
20596
public void updateFromEntry(UpdateInodeDirectoryEntry entry) {
    if (entry.hasDefaultAcl()) {
      setDefaultACL(
          (DefaultAccessControlList) ProtoUtils.fromProto(entry.getDefaultAcl()));
    }
    if (entry.hasDirectChildrenLoaded()) {
      setDirectChildrenLoaded(entry.getDirectChildrenLoaded());
    }
    if (entry.hasMountPoint()) {
      setMountPoint(entry.getMountPoint());
    }
  }
1256631
private void modifyEntry(CmsSitemapChange change) throws CmsException {

        CmsObject cms = getCmsObject();
        CmsResource entryPage = null;
        CmsResource entryFolder = null;

        CmsResource ownRes = null;
        CmsResource defaultFileRes = null;
        try {
            // lock all resources necessary first to avoid doing changes only half way through

            if (hasOwnChanges(change)) {
                ownRes = cms.readResource(change.getEntryId(), CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
                ensureLock(ownRes);
            }

            if (hasDefaultFileChanges(change)) {
                defaultFileRes = cms.readResource(change.getDefaultFileId(), CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
                ensureLock(defaultFileRes);
            }

            if ((ownRes != null) && ownRes.isFolder()) {
                entryFolder = ownRes;
            }

            if ((ownRes != null) && ownRes.isFile()) {
                entryPage = ownRes;
            }

            if (defaultFileRes != null) {
                entryPage = defaultFileRes;
            }

            if (change.isLeafType()) {
                entryFolder = entryPage;
            }

            updateProperties(cms, ownRes, defaultFileRes, change.getPropertyChanges());
            if (change.hasChangedPosition()) {
                updateNavPos(ownRes, change);
            }

            if (entryFolder != null) {
                if (change.hasNewParent() || change.hasChangedName()) {
                    String destinationPath;
                    if (change.hasNewParent()) {
                        CmsResource futureParent = cms.readResource(
                            change.getParentId(),
                            CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
                        destinationPath = CmsStringUtil.joinPaths(cms.getSitePath(futureParent), change.getName());
                    } else {
                        destinationPath = CmsStringUtil.joinPaths(
                            CmsResource.getParentFolder(cms.getSitePath(entryFolder)),
                            change.getName());
                    }
                    if (change.isLeafType() && destinationPath.endsWith("/")) {
                        destinationPath = destinationPath.substring(0, destinationPath.length() - 1);
                    }
                    // only if the site-path has really changed
                    if (!cms.getSitePath(entryFolder).equals(destinationPath)) {
                        cms.moveResource(cms.getSitePath(entryFolder), destinationPath);
                    }
                    entryFolder = cms.readResource(
                        entryFolder.getStructureId(),
                        CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
                }
            }
        } finally {
            if (entryPage != null) {
                tryUnlock(entryPage);
            }
            if (entryFolder != null) {
                tryUnlock(entryFolder);
            }
        }
    }
1332100
public void addChangeData(CmsSitemapChange data) {

        if (data == null) {
            return;
        }
        if (!m_entryId.equals(data.m_entryId)) {
            throw new UnsupportedOperationException("Can't add data for a different entry id.");
        }
        m_sitePath = data.m_sitePath;
        if (data.hasChangedName()) {
            m_name = data.m_name;
        }
        if (data.hasChangedPosition()) {
            m_position = data.m_position;
        }
        if (data.hasChangedProperties()) {
            m_propertyModifications.addAll(data.m_propertyModifications);
        }
        if (data.hasNewParent()) {
            m_parentId = data.m_parentId;
        }

        if (data.getClipBoardData() != null) {
            m_clipBoardData = data.getClipBoardData();
        }
        if ((data.m_changeType == ChangeType.delete)
            || ((data.m_changeType == ChangeType.remove) && (m_changeType != ChangeType.delete))
            || (m_changeType == ChangeType.clipboardOnly)) {
            m_changeType = data.m_changeType;
        }
    }
1149506
public CmsJspNavElement getNavigationForResource(String sitePath) {

        CmsJspNavElement result = getNavigationForResource(sitePath, CmsResourceFilter.DEFAULT, false);
        if ((result != null) && (result.getNavContext() == null)) {
            result.setNavContext(new NavContext(this, Visibility.navigation, CmsResourceFilter.DEFAULT));
        }
        return result;
    }
1197508
public void setExplorerResource(String value, CmsObject cms) {

        if (value == null) {
            return;
        }
        // get the current explorer mode
        String mode = getExplorerMode();
        if (mode == null) {
            mode = CmsWorkplace.VIEW_EXPLORER;
        }
        if (CmsWorkplace.VIEW_EXPLORER.equals(mode)) {
            // append the current site to the key when in explorer view mode
            mode += "_" + getSite() + "/";
        }

        // set the resource for the given mode
        if (value.startsWith(CmsResource.VFS_FOLDER_SYSTEM + "/")
            && (!value.startsWith(m_currentSite))
            && (!CmsWorkplace.VIEW_GALLERY.equals(getExplorerMode()))) {
            // restrict access to /system/
            m_explorerResource.put(mode, "/");
        } else {
            if (cms != null) {
                // Validation with read resource has 2 advantages:
                // 1: Normalization of the path: a missing trailing slash is not fatal.
                // 2: existence is verified.
                try {
                    CmsResource resource = cms.readResource(value);
                    value = cms.getSitePath(resource);
                } catch (CmsException cme) {
                    // nop
                }
            }
            m_explorerResource.put(mode, value);
        }
    }
1224594
public void changeSite(String siteRoot, String path, boolean force) {

        CmsObject cms = A_CmsUI.getCmsObject();
        String currentSiteRoot = cms.getRequestContext().getSiteRoot();
        if (force || !currentSiteRoot.equals(siteRoot)) {
            CmsAppWorkplaceUi.get().changeSite(siteRoot);
            if (path == null) {
                path = m_locationCache.getFileExplorerLocation(siteRoot);
                if (CmsStringUtil.isEmptyOrWhitespaceOnly(siteRoot)
                    && ((path == null) || !path.startsWith("/system"))) {
                    // switching to the root site and previous root site folder is not below /system
                    // -> stay in the current folder
                    path = m_locationCache.getFileExplorerLocation(currentSiteRoot);
                    if (path != null) {
                        path = CmsStringUtil.joinPaths(currentSiteRoot, path);
                    }
                }
            }
            openPath(path, true);
            Container container = m_siteSelector.getContainerDataSource();
            for (Object id : container.getItemIds()) {
                String key = (String)id;
                if (CmsStringUtil.comparePaths(key, siteRoot)) {
                    siteRoot = key;
                    break;
                }
            }
            m_siteSelector.select(siteRoot);
        }
    }
389686
void submit() {

        String siteRoot = (String)m_siteComboBox.getValue();
        if (!m_context.getCms().getRequestContext().getSiteRoot().equals(siteRoot)) {
            A_CmsUI.get().changeSite(siteRoot);
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(siteRoot) || OpenCms.getSiteManager().isSharedFolder(siteRoot)) {
                // switch to explorer view when selecting shared or root site

                Page.getCurrent().open(CmsCoreService.getFileExplorerLink(A_CmsUI.getCmsObject(), siteRoot), "_top");
                return;
            }
        } else {
            siteRoot = null;
        }
        m_context.finish(null, siteRoot);
    }
1093483
public void setSiteParam(String siteRoot, String key, String value) {

        CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(siteRoot);
        if (site == null) {
            throw new IllegalArgumentException("No site found for path: " + siteRoot);
        } else {
            site.getParameters().put(key, value);
            OpenCms.writeConfiguration(CmsSitesConfiguration.class);
        }
    }
901454
@Override
    public void init(String webAppRfsPath, String servletMapping, String defaultWebApplication) {

        try {
            super.init(webAppRfsPath, servletMapping, defaultWebApplication);
            CmsUpdateInfo.INSTANCE.setAdeModuleVersion(getInstalledModules().get("org.opencms.ade.containerpage"));

            if (m_workplaceUpdateThread != null) {
                if (m_workplaceUpdateThread.isAlive()) {
                    m_workplaceUpdateThread.kill();
                }
                m_workplaceUpdateThread = null;
            }
            if (m_dbUpdateThread != null) {
                if (m_dbUpdateThread.isAlive()) {
                    m_dbUpdateThread.kill();
                }
                m_dbUpdateThread = null;
                m_newLoggingOffset = 0;
                m_oldLoggingOffset = 0;
            }
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }
108612
public void moveTo(String cmsNewPath) throws CmsException {

        ensureLock();
        m_cms.moveResource(m_cms.getSitePath(m_resource), cmsNewPath);
        CmsUUID id = m_resource.getStructureId();
        CmsResource updatedRes = m_cms.readResource(id, CmsJlanDiskInterface.STANDARD_FILTER);
        m_resource = updatedRes;
        updateFromResource();
    }
738764
public void addModified(CmsClientSitemapEntry entry, String previousPath) {

        removeDeleted(entry.getId().toString());
        removeModified(entry.getId().toString());
        getModified().insertItem(createModifiedItem(entry), 0);
        m_clipboardButton.enableClearModified(true);
    }
619557
public void updateSite(String siteRoot) {

        try {
            CmsObject cloneCms = OpenCms.initCmsObject(m_cms);
            if (siteRoot == null) {
                siteRoot = "/system";
            }
            cloneCms.getRequestContext().setSiteRoot(siteRoot);
            m_cms = cloneCms;
        } catch (CmsException e1) {
            LOG.error(e1.getLocalizedMessage(), e1);
        }
        updateValidation();
    }
489862
public void openSiteMap(String sitePath, boolean siteChange) {

        String uri = CmsCoreProvider.get().link(
            CmsCoreProvider.get().getUri()) + "?" + CmsCoreData.PARAM_PATH + "=" + sitePath;
        if (!siteChange) {
            uri += "&" + CmsCoreData.PARAM_RETURNCODE + "=" + getData().getReturnCode();
        }
        Window.Location.replace(uri);
    }
373709
protected void recomputeProperties(CmsClientSitemapEntry entry) {

        for (I_CmsPropertyUpdateHandler handler : m_propertyUpdateHandlers) {
            handler.handlePropertyUpdate(entry);
        }
        for (CmsClientSitemapEntry child : entry.getSubEntries()) {
            recomputeProperties(child);
        }
    }
34949
public void updateEntriesById(Collection<CmsUUID> ids) {

        Map<CmsUUID, CmsClientSitemapEntry> entries = m_controller.getEntriesById(ids);
        for (CmsClientSitemapEntry entry : entries.values()) {
            CmsSitemapTreeItem item = CmsSitemapTreeItem.getItemById(entry.getId());
            item.updateEntry(entry);
        }
    }