Unlocks the given resource, synchronously.<p>

@param structureId the resource structure id

@return <code>true</code> if succeeded, if not a a warning is already shown to the user
765811
public boolean unlock(final CmsUUID structureId) {

        // lock the sitemap
        CmsRpcAction<String> unlockAction = new CmsRpcAction<String>() {

            /**
            * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
            */
            @Override
            public void execute() {

                start(200, false);
                getService().unlock(structureId, this);
            }

            /**
            * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
            */
            @Override
            public void onResponse(String result) {

                stop(false);
                if (result == null) {
                    // ok
                    return;
                }
                // unable to lock
                String text = Messages.get().key(Messages.GUI_UNLOCK_NOTIFICATION_2, structureId.toString(), result);
                CmsNotification.get().send(CmsNotification.Type.WARNING, text);
            }
        };
        return unlockAction.executeSync() == null;
    }
598992
protected void ensureChecked(CmsUUID structureId) {

        CmsRadioButton button = (CmsRadioButton)m_listPanel.getItem(
            String.valueOf(structureId)).getDecorationWidgets().get(0);
        if (!button.isChecked()) {
            button.setChecked(true);
        }
    }
1195690
public Structure getStructureForDomain(String scopId) throws IOException, StructureException {
		return getStructureForDomain(scopId, ScopFactory.getSCOP());
	}
567016
public CmsRelationFilter filterStructureId(CmsUUID structureId) {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        filter.m_structureId = structureId;
        return filter;
    }
349582
public static void openWorkplace(final CmsUUID structureId, final boolean classic) {

        CmsRpcAction<String> callback = new CmsRpcAction<String>() {

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
             */
            @Override
            public void execute() {

                start(0, true);
                CmsCoreProvider.getService().getWorkplaceLink(structureId, this);
            }

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
             */
            @Override
            protected void onResponse(String result) {

                stop(false);
                Window.Location.assign(result);
            }
        };
        callback.execute();
    }
123519
private void tryUnlock(CmsResource resource) {

        try {
            m_cms.unlockResource(resource);
        } catch (CmsException e) {
            // usually not a problem
            LOG.debug("failed to unlock " + resource.getRootPath(), e);
        }

    }
1119082
private boolean lockResource(CmsObject cms, CmsResource cmsResource) throws CmsException {

        CmsLock lock = cms.getLock(cms.getSitePath(cmsResource));
        // check the lock
        if ((lock != null)
            && lock.isOwnedBy(cms.getRequestContext().getCurrentUser())
            && lock.isOwnedInProjectBy(
                cms.getRequestContext().getCurrentUser(),
                cms.getRequestContext().getCurrentProject())) {
            // prove is current lock from current user in current project
            return true;
        } else if ((lock != null) && !lock.isUnlocked() && !lock.isOwnedBy(cms.getRequestContext().getCurrentUser())) {
            // the resource is not locked by the current user, so can not lock it
            return false;
        } else if ((lock != null)
            && !lock.isUnlocked()
            && lock.isOwnedBy(cms.getRequestContext().getCurrentUser())
            && !lock.isOwnedInProjectBy(
                cms.getRequestContext().getCurrentUser(),
                cms.getRequestContext().getCurrentProject())) {
            // prove is current lock from current user but not in current project
            // file is locked by current user but not in current project

            cms.changeLock(cms.getSitePath(cmsResource));
        } else if ((lock != null) && lock.isUnlocked()) {
            // lock resource from current user in current project
            cms.lockResource(cms.getSitePath(cmsResource));
        }
        lock = cms.getLock(cms.getSitePath(cmsResource));
        if ((lock != null)
            && lock.isOwnedBy(cms.getRequestContext().getCurrentUser())
            && !lock.isOwnedInProjectBy(
                cms.getRequestContext().getCurrentUser(),
                cms.getRequestContext().getCurrentProject())) {
            // resource could not be locked
            return false;
        }
        // resource is locked successfully
        return true;
    }
1023034
protected boolean canEdit(CmsUUID id) {

        CmsObject cms = A_CmsUI.getCmsObject();
        CmsResource res = null;
        try {
            res = cms.readResource(id, CmsResourceFilter.ALL);
            boolean result = CmsPropertiesDialogAction.VISIBILITY.getVisibility(
                A_CmsUI.getCmsObject(),
                Lists.newArrayList(res)).isActive();
            return result;
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            return false;
        }
    }
375114
public static void tryUnlock(CmsObject cms, CmsResource resource) {

        try {
            cms.unlockResource(resource);
        } catch (CmsException e) {
            LOG.debug("Unable to unlock " + resource.getRootPath(), e);
        }
    }
193007
public synchronized ContainerShutdownDescriptor removeContainer(String containerId) {
        ContainerShutdownDescriptor descriptor = shutdownDescriptorPerContainerMap.remove(containerId);
        if (descriptor != null) {
            removeContainerIdFromLookupMaps(containerId);
            removeDescriptorFromPomLabelMap(descriptor);
        }
        return descriptor;
    }
130063
protected I_CmsFormatterBean readFormatter(CmsUUID structureId) {

        I_CmsFormatterBean formatterBean = null;
        CmsResource formatterRes = null;
        try {
            formatterRes = m_cms.readResource(structureId);
            CmsFile formatterFile = m_cms.readFile(formatterRes);
            CmsFormatterBeanParser parser = new CmsFormatterBeanParser(m_cms, m_settingConfigs);
            CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, formatterFile);
            formatterBean = parser.parse(content, formatterRes.getRootPath(), "" + formatterRes.getStructureId());
        } catch (Exception e) {

            if (formatterRes == null) {
                // normal case if resources get deleted, should not be written to the error channel
                LOG.info("Could not read formatter with id " + structureId);
            } else {
                LOG.error(
                    "Error while trying to read formatter configuration "
                        + formatterRes.getRootPath()
                        + ":    "
                        + e.getLocalizedMessage(),
                    e);
            }
        }
        return formatterBean;
    }
669271
protected I_CmsContextMenuEntry transformSingleEntry(CmsContextMenuEntryBean bean, CmsUUID structureId) {

        String name = bean.getName();
        I_CmsContextMenuCommand command = null;
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(name)) {
            command = getContextMenuCommands().get(name);
        }
        if (command instanceof I_CmsValidatingContextMenuCommand) {
            boolean ok = ((I_CmsValidatingContextMenuCommand)command).validate(bean);
            if (!ok) {
                return null;
            }
        }
        CmsContextMenuEntry entry = new CmsContextMenuEntry(this, structureId, command);
        entry.setBean(bean);
        if (bean.hasSubMenu()) {
            entry.setSubMenu(transformEntries(bean.getSubMenu(), structureId));
        }
        return entry;
    }
1159776
protected void unlock() {

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

            @Override
            public void execute() {

                CmsCoreProvider.getVfsService().forceUnlock(getStructureId(), this);
            }

            @Override
            public void onFailure(Throwable t) {

                hide();
                super.onFailure(t);
            }

            @Override
            protected void onResponse(Void result) {

                onUnlock();
            }
        };
        m_closeButton.disable(Messages.get().key(Messages.GUI_LOADING_0));
        m_unlockButton.disable(Messages.get().key(Messages.GUI_LOADING_0));
        action.execute();
    }
587616
private void checkIfUpdateIsNeeded(CmsUUID structureId, String rootPath, int typeId) {

        try {
            I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(typeId);
            if ((resType instanceof CmsResourceTypeXmlContent)
                && !OpenCms.getResourceManager().matchResourceType(
                    CmsResourceTypeXmlContainerPage.RESOURCE_TYPE_NAME,
                    typeId)) {
                markForUpdate(structureId);
            }
        } catch (CmsLoaderException e) {
            // resource type not found, just log an error
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
157457
public void checkNewWidgetsAvailable(final CmsUUID structureId, final AsyncCallback<Boolean> resultCallback) {

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

            @Override
            public void execute() {

                start(200, false);
                getContainerpageService().checkNewWidgetsAvailable(structureId, this);
            }

            @Override
            protected void onResponse(Boolean result) {

                stop(false);
                resultCallback.onSuccess(result);
            }

            // empty
        };
        action.execute();

    }
939202
private boolean containsStructureId(CmsUUID structureId) {

        for (CmsResourceImportData res : m_resources) {
            if (res.getResource().getStructureId().equals(structureId)) {
                return true;
            }
        }
        return false;
    }
135846
public CmsHistoryResourceCollection getResourceHistoryInternal(CmsUUID structureId) throws CmsException {

        CmsHistoryResourceCollection result = new CmsHistoryResourceCollection();
        CmsObject cms = getCmsObject();
        CmsResource resource = cms.readResource(structureId, CmsResourceFilter.ALL);
        List<I_CmsHistoryResource> versions = cms.readAllAvailableVersions(resource);
        if (!resource.getState().isUnchanged()) {
            result.add(createHistoryResourceBean(cms, resource, true, -1));
        }
        int maxVersion = 0;

        if (versions.isEmpty()) {
            try {
                CmsProject online = cms.readProject(CmsProject.ONLINE_PROJECT_ID);
                CmsObject onlineCms = OpenCms.initCmsObject(cms);
                onlineCms.getRequestContext().setCurrentProject(online);
                CmsResource onlineResource = onlineCms.readResource(structureId, CmsResourceFilter.ALL);
                CmsHistoryResourceBean onlineResBean = createHistoryResourceBean(onlineCms, onlineResource, false, 0);
                result.add(onlineResBean);
            } catch (CmsVfsResourceNotFoundException e) {
                LOG.info(e.getLocalizedMessage(), e);
            } catch (Exception e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        } else {
            for (I_CmsHistoryResource historyRes : versions) {
                maxVersion = Math.max(maxVersion, historyRes.getVersion());
            }
            for (I_CmsHistoryResource historyRes : versions) {
                CmsHistoryResourceBean historyBean = createHistoryResourceBean(
                    cms,
                    (CmsResource)historyRes,
                    false,
                    maxVersion);
                result.add(historyBean);
            }
        }
        return result;
    }