Updates the enabled/diabled status of all elements of the current page.<p>

@throws JspException if there is an error including the error page
421120
public void actionUpdateElements() throws JspException {

        try {
            List<CmsDialogElement> elementList = computeElements();
            CmsFile file = getCms().readFile(getParamTempfile(), CmsResourceFilter.IGNORE_EXPIRATION);
            CmsXmlPage page = CmsXmlPageFactory.unmarshal(getCms(), file);
            boolean foundMandatory = false;
            m_changeElement = "";
            Iterator<CmsDialogElement> i = elementList.iterator();
            while (i.hasNext()) {
                // get the current list element
                CmsDialogElement element = i.next();
                if (element.isMandantory()
                    || element.getName().equals(getParamElementname())
                    || Boolean.valueOf(
                        getJsp().getRequest().getParameter(PREFIX_PARAM_BODY + element.getName())).booleanValue()) {
                    if (!element.isExisting()) {
                        // create element in order to enable it properly
                        page.addValue(element.getName(), getElementLocale());
                    }
                    page.setEnabled(element.getName(), getElementLocale(), true);
                    if (element.isMandantory() && !foundMandatory) {
                        m_changeElement = element.getName();
                        foundMandatory = true;
                    }
                } else {
                    if (element.isExisting()) {
                        // remove element if it is already existing
                        page.removeValue(element.getName(), getElementLocale());
                    }
                }
            }
            // write the temporary file
            file.setContents(page.marshal());
            getCms().writeFile(file);
            // set the javascript functions which should be executed
            if (page.isEnabled(getParamElementname(), getElementLocale())) {
                m_changeElement = getParamElementname();
            } else if (!foundMandatory) {
                if (elementList.size() > 0) {
                    m_changeElement = elementList.get(0).getName();
                }
            }
        } catch (Throwable e) {
            // show error dialog
            setParamMessage(Messages.get().getBundle(getLocale()).key(Messages.ERR_UPDATE_ELEMENTS_0));
            includeErrorpage(this, e);
        }
    }
1002585
private void _updateStatus() {
        boolean doneWithoutErrors = true;
        boolean doneWithErrors = true;
        boolean finishedOne = false;
        if (_status == Status.DONE || _status == Status.ERROR) {
            return;
        }
        for (AsyncBatchedMetricQuery query: _queries) {
            Status status = query.getStatus();
            if (status == Status.PROCESSING) {
                _status = Status.PROCESSING;
                return;
            }
            boolean queryFinished = (status == Status.DONE || status == Status.ERROR);
            if (queryFinished) {
                finishedOne = true;
            }
            doneWithErrors &= queryFinished;
            doneWithoutErrors &= (status == Status.DONE);
        }
        if (!doneWithoutErrors && doneWithErrors) {
            _status = Status.ERROR;
        } else if (doneWithoutErrors) {
            _status = Status.DONE;
        } else if (finishedOne) {
            _status = Status.PROCESSING;
        } else {
            _status = Status.QUEUED;
        }
    }
825103
public void actionUpdateLanguages() throws JspException {

        if ((m_paramSelectedLanguages != null) && !m_paramSelectedLanguages.isEmpty()) {
            try {
                CmsFile file = getCms().readFile(getParamTempfile(), CmsResourceFilter.IGNORE_EXPIRATION);
                CmsXmlContent content = CmsXmlContentFactory.unmarshal(getCms(), file);

                List<Locale> toLocales = new ArrayList<Locale>();
                for (Iterator<String> i = m_paramSelectedLanguages.iterator(); i.hasNext();) {
                    String language = i.next();
                    toLocales.add(CmsLocaleManager.getLocale(language));
                }

                // now transfer the contents
                transferContents(content, getElementLocale(), toLocales);

                // write the temporary file
                String decodedContent = content.toString();
                try {
                    file.setContents(decodedContent.getBytes(content.getEncoding()));
                } catch (UnsupportedEncodingException e) {
                    throw new CmsException(
                        Messages.get().container(Messages.ERR_INVALID_CONTENT_ENC_1, getParamResource()),
                        e);
                }
                // the file content might have been modified during the write operation
                CmsObject cloneCms = OpenCms.initCmsObject(getCms());
                CmsUUID tempProjectId = OpenCms.getWorkplaceManager().getTempFileProjectId();
                cloneCms.getRequestContext().setCurrentProject(getCms().readProject(tempProjectId));
                cloneCms.writeFile(file);

            } catch (Throwable e) {
                // show error dialog
                setParamMessage(Messages.get().getBundle(getLocale()).key(Messages.ERR_UPDATE_LANGUAGES_0));
                includeErrorpage(this, e);
            }
        }
    }
1244432
void setPage(Page page) {
		synchronized(lock) {
			checkNotFrozen();
			if(this.page != null) throw new IllegalStateException("element already has a page: " + this);
			this.page = page;
		}
		assert checkPageAndParentElement();
	}
670018
public void actionToggleElement() throws JspException {

        // set editor values from request
        try {
            setEditorValues(getElementLocale());
        } catch (CmsXmlException e) {
            // an error occurred while trying to set the values, stop action
            showErrorPage(e);
            return;
        }

        // get the necessary parameters to add/remove the element
        int index = 0;
        try {
            index = Integer.parseInt(getParamElementIndex());
        } catch (Exception e) {
            // ignore, should not happen
        }

        if (getAction() == ACTION_ELEMENT_REMOVE) {
            // remove the value , first get the value to remove
            I_CmsXmlContentValue value = m_content.getValue(getParamElementName(), getElementLocale(), index);
            m_content.removeValue(getParamElementName(), getElementLocale(), index);
            // check if the value was a choice option and the last one
            if (value.isChoiceOption()
                && (m_content.getSubValues(
                    CmsXmlUtils.removeLastXpathElement(getParamElementName()),
                    getElementLocale()).size() == 0)) {
                // also remove the parent choice type value
                String xpath = CmsXmlUtils.removeLastXpathElement(getParamElementName());
                m_content.removeValue(xpath, getElementLocale(), CmsXmlUtils.getXpathIndexInt(xpath) - 1);
            }
        } else {
            // add the new value after the clicked element
            if (m_content.hasValue(getParamElementName(), getElementLocale())) {
                // when other values are present, increase index to use right position
                index += 1;
            }
            String elementPath = getParamElementName();
            if (CmsStringUtil.isNotEmpty(getParamChoiceElement())) {
                // we have to add a choice element, first check if the element to add itself is part of a choice or not
                boolean choiceType = Boolean.valueOf(getParamChoiceType()).booleanValue();
                I_CmsXmlSchemaType elemType = m_content.getContentDefinition().getSchemaType(elementPath);
                if (!choiceType || (elemType.isChoiceOption() && elemType.isChoiceType())) {
                    // this is a choice option or a nested choice type to add, remove last element name from xpath
                    elementPath = CmsXmlUtils.removeLastXpathElement(elementPath);
                } else {
                    // this is a choice type to add, first create type element
                    m_content.addValue(getCms(), elementPath, getElementLocale(), index);
                    elementPath = CmsXmlUtils.createXpathElement(elementPath, index + 1);
                    // all eventual following elements to create have to be at first position
                    index = 0;
                }
                // check if there are nested choice elements to add
                if (CmsXmlUtils.isDeepXpath(getParamChoiceElement())) {
                    // create all missing elements except the last one
                    String pathToChoice = CmsXmlUtils.removeLastXpathElement(getParamChoiceElement());
                    String newPath = elementPath;
                    while (CmsStringUtil.isNotEmpty(pathToChoice)) {
                        String createElement = CmsXmlUtils.getFirstXpathElement(pathToChoice);
                        newPath = CmsXmlUtils.concatXpath(newPath, createElement);
                        pathToChoice = CmsXmlUtils.isDeepXpath(pathToChoice)
                        ? CmsXmlUtils.removeFirstXpathElement(pathToChoice)
                        : null;
                        I_CmsXmlContentValue newVal = m_content.addValue(getCms(), newPath, getElementLocale(), index);
                        newPath = newVal.getPath();
                        // all eventual following elements to create have to be at first position
                        index = 0;
                    }
                    // create the path to the last choice element
                    elementPath = CmsXmlUtils.concatXpath(
                        newPath,
                        CmsXmlUtils.getLastXpathElement(getParamChoiceElement()));
                } else {
                    // create the path to the choice element
                    elementPath += "/" + getParamChoiceElement();
                }
            }
            // add the value
            m_content.addValue(getCms(), elementPath, getElementLocale(), index);
        }

        if (getValidationHandler().hasWarnings(getElementLocale())) {
            // there were warnings for the edited content, reset validation handler to avoid display issues
            resetErrorHandler();
        }

        try {
            // write the modified content to the temporary file
            writeContent();
        } catch (CmsException e) {
            // an error occurred while trying to save
            showErrorPage(e);
        }

    }
1362587
public void displayReport() throws JspException {

        // save initialized instance of this class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
        switch (getAction()) {
            case ACTION_REPORT_END:
                actionCloseDialog();
                break;
            case ACTION_CANCEL:
                actionCloseDialog();
                break;
            case ACTION_REPORT_UPDATE:
                setParamAction(REPORT_UPDATE);
                getJsp().include(FILE_REPORT_OUTPUT);
                break;
            case ACTION_REPORT_BEGIN:
            case ACTION_CONFIRMED:
            case ACTION_DEFAULT:
            default:
                try {
                    if (getCms().readProject(
                        new CmsUUID(getParamProjectid())).getType() == CmsProject.PROJECT_TYPE_TEMPORARY) {
                        // set the flag that this is a temporary project
                        setParamRefreshWorkplace(CmsStringUtil.TRUE);
                    }
                } catch (Exception e) {
                    // ignore
                }

                if (getParamProjectid() == null) {
                    return;
                }

                CmsPublishList list = null;
                try {
                    CmsProject currentProject = getCms().getRequestContext().getCurrentProject();
                    getCms().getRequestContext().setCurrentProject(
                        getCms().readProject(new CmsUUID(getParamProjectid())));
                    list = OpenCms.getPublishManager().getPublishList(getCms());
                    getCms().getRequestContext().setCurrentProject(currentProject);
                } catch (CmsException e) {
                    throw new CmsRuntimeException(e.getMessageContainer(), e);
                }

                // start validation check
                startValidationThread(list);
                getJsp().include(FILE_REPORT_OUTPUT);
        }
    }
592482
public void setEnabled(boolean enabled) {
		super.setEnabled(enabled);
		if (dateEditor != null) {
			dateEditor.setEnabled(enabled);
			calendarButton.setEnabled(enabled);
		}
	}
717159
protected void setActivePage(ApplicationPage page) {
    	getPage().getControl();
    	loadLayoutData(page.getId());
    	((JideApplicationPage)getPage()).updateShowViewCommands();
	}
220893
protected void showErrorPage(Object editor, Exception exception) throws JspException {

        // save initialized instance of the editor class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, editor);

        // reading of file contents failed, show error dialog
        setAction(ACTION_SHOW_ERRORMESSAGE);
        setParamTitle(key(Messages.GUI_TITLE_EDIT_1, new Object[] {CmsResource.getName(getParamResource())}));
        if (exception != null) {
            getJsp().getRequest().setAttribute(ATTRIBUTE_THROWABLE, exception);
            if (CmsLog.getLog(editor).isWarnEnabled()) {
                CmsLog.getLog(editor).warn(exception.getLocalizedMessage(), exception);
            }
        }
        // include the common error dialog
        getJsp().include(FILE_DIALOG_SCREEN_ERRORPAGE);
    }
619409
public void setEnabled(String enabled) {

        if (m_frozen) {
            throw new CmsRuntimeException(Messages.get().container(Messages.ERR_CONFIG_SUBSCRIPTIONMANAGER_FROZEN_0));
        }
        m_enabled = Boolean.valueOf(enabled).booleanValue();
    }
522606
private void updateGhostStyle() {

        if (CmsStringUtil.isEmpty(m_realValue)) {
            if (CmsStringUtil.isEmpty(m_ghostValue)) {
                updateTextArea(m_realValue);
                return;
            }
            if (!m_focus) {
                setGhostStyleEnabled(true);
                updateTextArea(m_ghostValue);
            } else {
                // don't show ghost mode while focused
                setGhostStyleEnabled(false);
            }
        } else {
            setGhostStyleEnabled(false);
            updateTextArea(m_realValue);
        }
    }
242034
public void updateButtons() {
		AbstractButton cancelButton = wizard.getCancelButton();
		if (cancelButton != null) {
			cancelButton.setEnabled(currentPage.isCancelAllowed());
		}
		AbstractButton previousButton = wizard.getPreviousButton();
		if (previousButton != null) {
			previousButton.setEnabled(currentPage.isPreviousAllowed() && !pageHistory.isEmpty());
		}
		AbstractButton nextButton = wizard.getNextButton();
		if (nextButton != null) {
			nextButton.setEnabled(currentPage.isNextAllowed() && (currentPage.getNextPage() != null));
		}
		AbstractButton finishButton = wizard.getFinishButton();
		if (finishButton != null) {
			finishButton.setEnabled(currentPage.isFinishAllowed());
		}
	}
1131036
protected void updatePageStatus() {
		final boolean ok;
		if (Strings.isEmpty(this.titleField.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_5, IMessageProvider.ERROR);
		} else if (Strings.isEmpty(this.trackerLogin.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_6, IMessageProvider.ERROR);
		} else if (Strings.isEmpty(this.trackerPassword.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_7, IMessageProvider.ERROR);
		} else {
			ok = true;
			if (Strings.isEmpty(this.descriptionField.getText())) {
				setMessage(Messages.IssueInformationPage_8, IMessageProvider.WARNING);
			} else {
				setMessage(null, IMessageProvider.NONE);
			}
		}
		setPageComplete(ok);
	}
524545
private void resetState() {

        // clear all members so the tag object may be reused
        m_type = null;
        m_name = null;
        m_param = null;
        m_maxElements = null;
        m_tag = null;
        m_tagClass = null;
        m_detailView = false;
        m_detailOnly = false;
        m_width = null;
        m_editableBy = null;
        m_bodyContent = null;
        m_hasModelGroupAncestor = false;
        // reset the current element
        CmsJspStandardContextBean cmsContext = CmsJspStandardContextBean.getInstance(pageContext.getRequest());
        cmsContext.setElement(m_parentElement);
        cmsContext.setContainer(m_parentContainer);
        m_parentElement = null;
        m_parentContainer = null;
    }
1302660
public void elementUpdated (ElementUpdatedEvent event)
    {
        dispatchMethod(event.getName() + "Updated",
            new Object[] { event.getIndex(), event.getValue() });
    }
446992
public void setJavaScriptEnabled(boolean javaScriptEnabled)
    {
        this.javaScriptEnabled = javaScriptEnabled;

        // and now also store this information inside a cookie!
        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (facesContext != null)
        {
            Object r = facesContext.getExternalContext().getResponse();
            if (r instanceof HttpServletResponse)
            {
                Cookie cookie = new Cookie(COOKIE_NAME_NOSCRIPT_ENABLED, "" + javaScriptEnabled);
                cookie.setPath("/"); // for all the server
                HttpServletResponse response = (HttpServletResponse) r;
                response.addCookie(cookie);
            }
        }
    }
126422
protected void init() throws JspException {

        // initialize OpenCms access objects
        m_controller = CmsFlexController.getController(pageContext.getRequest());
        m_cms = m_controller.getCmsObject();

        try {
            I_CmsSearchConfiguration config = null;
            if (m_configFile != null) {
                CmsFile configFile = m_cms.readFile(CmsJspElFunctions.convertRawResource(m_cms, m_configFile));
                if (m_fileFormat == FileFormat.JSON) {
                    // read the JSON config file
                    OpenCms.getLocaleManager();
                    String configString = new String(
                        configFile.getContents(),
                        CmsLocaleManager.getResourceEncoding(m_cms, configFile));
                    config = new CmsSearchConfiguration(new CmsJSONSearchConfigurationParser(configString));
                } else { // assume XML
                    CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(m_cms, configFile);
                    config = new CmsSearchConfiguration(
                        new CmsXMLSearchConfigurationParser(xmlContent, m_cms.getRequestContext().getLocale()));
                }
            }
            if (m_configString != null) {
                if (m_configString.trim().startsWith("{")) {
                    config = new CmsSearchConfiguration(new CmsJSONSearchConfigurationParser(m_configString, config));
                } else {
                    config = new CmsSearchConfiguration(
                        new CmsPlainQuerySearchConfigurationParser(m_configString, config));
                }
            }
            m_searchController = new CmsSearchController(config);

            String indexName = m_searchController.getCommon().getConfig().getSolrIndex();
            // try to use configured index
            if ((indexName != null) && !indexName.trim().isEmpty()) {
                m_index = OpenCms.getSearchManager().getIndexSolr(indexName);
            }
            // if not successful, use the following default
            if (m_index == null) {
                m_index = OpenCms.getSearchManager().getIndexSolr(
                    m_cms.getRequestContext().getCurrentProject().isOnlineProject()
                    ? CmsSolrIndex.DEFAULT_INDEX_NAME_ONLINE
                    : CmsSolrIndex.DEFAULT_INDEX_NAME_OFFLINE);
            }

            storeAttribute(getVar(), getSearchResults());

        } catch (Exception e) { // CmsException | UnsupportedEncodingException | JSONException
            LOG.error(e.getLocalizedMessage(), e);
            m_controller.setThrowable(e, m_cms.getRequestContext().getUri());
            throw new JspException(e);
        }
    }