Performs the Security and Export Change.<p>

@throws JspException if including a JSP sub element is not successful
1154
public void actionChangeSecureExport() throws JspException {

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

        String filename = getParamResource();

        try {
            // lock resource if auto lock is enabled
            checkLock(getParamResource());

            // write the properties
            writeProperty(CmsPropertyDefinition.PROPERTY_EXPORT, getParamExport());
            writeProperty(CmsPropertyDefinition.PROPERTY_EXPORTNAME, getParamExportname());
            writeProperty(CmsPropertyDefinition.PROPERTY_SECURE, getParamSecure());

            // change the flag of the resource so that it is internal
            CmsResource resource = getCms().readResource(filename, CmsResourceFilter.IGNORE_EXPIRATION);
            if (resource.isInternal() && !Boolean.valueOf(getParamIntern()).booleanValue()) {
                getCms().chflags(filename, resource.getFlags() & (~CmsResource.FLAG_INTERNAL));
            } else if (!resource.isInternal() && Boolean.valueOf(getParamIntern()).booleanValue()) {
                getCms().chflags(filename, resource.getFlags() | CmsResource.FLAG_INTERNAL);
            }

            actionCloseDialog();
        } catch (Throwable e) {
            // error during change of secure settings, show error dialog
            includeErrorpage(this, e);
        }

    }
1272786
@Override
    public int doStartTag() throws JspException {

        if ((rawDataSource == null) && dataSourceSpecified) {
            throw new JspException(
                    Resources.getMessage("SQL_DATASOURCE_NULL"));
        }

        DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource,
                pageContext);

        try {
            conn = dataSource.getConnection();
            origIsolation = conn.getTransactionIsolation();
            if (origIsolation == Connection.TRANSACTION_NONE) {
                throw new JspTagException(
                        Resources.getMessage("TRANSACTION_NO_SUPPORT"));
            }
            if ((isolation != Connection.TRANSACTION_NONE)
                    && (isolation != origIsolation)) {
                conn.setTransactionIsolation(isolation);
            }
            conn.setAutoCommit(false);
        } catch (SQLException e) {
            throw new JspTagException(
                    Resources.getMessage("ERROR_GET_CONNECTION",
                            e.toString()), e);
        }

        return EVAL_BODY_INCLUDE;
    }
297718
public int doEndTag() throws JspException
    {
        ServletRequest req = pageContext.getRequest();

        // Create an appropriate "input" element based on our parameters
        if (_password) {
            _state.type = INPUT_PASSWORD;
        }
        else {
            _state.type = INPUT_TEXT;
        }


        // Create the state for the input tag
        ByRef ref = new ByRef();
        nameHtmlControl(_state, ref);

        _state.disabled = isDisabled();

        // Create the text value of the TextBox
        Object textObject = evaluateDataSource();
        if ((textObject == null) || (textObject.toString().length() == 0)) {
            textObject = _defaultValue;
        }

        // Get the text value for the textbox, the result
        String text = null;
        if (textObject != null) {
            text = formatText(textObject);
            InternalStringBuilder sb = new InternalStringBuilder(text.length() + 16);
            StringBuilderRenderAppender sbAppend = new StringBuilderRenderAppender(sb);
            HtmlUtils.filter(text, sbAppend);
            text = sb.toString();
        }
        _state.value = text;

        // if there were format errors then report them
        if (_formatErrors) {
            if (bodyContent != null) {
                String value = bodyContent.getString().trim();
                bodyContent.clearBody();
                write(value);
            }
        }

        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        // create the input tag.
        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_TEXT_TAG, req);
        assert(br != null);

        br.doStartTag(writer, _state);
        br.doEndTag(writer);

        // write any script that needs to be written
        if (!ref.isNull())
            write((String) ref.getRef());

        localRelease();
        return EVAL_PAGE;
    }
1112527
public int doEndTag() throws JspException
    {
        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        // we verified that the parent was a CheckboxGroup in the doBeginTag()
        ServletRequest req = pageContext.getRequest();
        CheckBoxGroup parent = (CheckBoxGroup) findAncestorWithClass(this, CheckBoxGroup.class);
        ConstantRendering cr = TagRenderingBase.Factory.getConstantRendering(req);
        boolean repeat = parent.isRepeater();

        // create the writer
        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        if (!repeat && parent.isVertical()) {
            cr.TR_TD(writer);
        }


        _state.type = INPUT_CHECKBOX;
        _state.name = parent.getQualifiedDataSourceName();
        if (_state.id != null) {
            String tagId = _state.id;
            _state.id = getIdForTagId(_state.id);
            /* This has been commented out because we can't set focus on checkbox options
               because they don't have a unique name.
            Form parentForm = getNearestForm();
            if (parentForm != null)
                parentForm.addTagID(tagId, _state.name);
                */
            String script = renderDefaultNameAndId((HttpServletRequest) req, _state, tagId, _state.name);
            if (script != null) {
                write(script);
            }
        }

        // Disabled on the option itself will override the parent setting this.
        // We check to see if the option actuall had disabled set on it, if not then look
        // at the parent.
        if (parent.isMatched(_state.value, _defaultValue))
            _state.checked = true;
        _state.disabled = isDisabled();
        if (!_state.disabled)
            _state.disabled = parent.isDisabled();

        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req);
        br.doStartTag(writer, _state);
        br.doEndTag(writer);

        if (repeat && !parent.isDisabled()) {
            parent.createHiddenField(writer);
        }

        // if this is in a repeater, then we only output the <input tag>
        if (repeat) {
            //write(results.toString());
            localRelease();
            return EVAL_PAGE;
        }

        if (_spanState.style == null) {
            _spanState.style = parent.getLabelStyle();
        }
        if (_spanState.styleClass == null) {
            _spanState.styleClass = parent.getLabelStyleClass();
        }

        TagRenderingBase spanTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req);
        spanTag.doStartTag(writer, _spanState);
        if (_text == null)
            write(_state.value);
        else
            write(_text);
        spanTag.doEndTag(writer);

        if (parent.isVertical()) {
            cr.end_TD_TR(writer);
        }

        // Continue evaluating this page
        localRelease();
        return EVAL_PAGE;

    }
1320388
@Override
    public int doStartTag() throws JspException {
        // Sanity check
        if (context != null
                && (!context.startsWith("/") || !url.startsWith("/"))) {
            throw new JspTagException(
                    Resources.getMessage("IMPORT_BAD_RELATIVE"));
        }

        // reset parameter-related state
        urlWithParams = null;
        params = new ParamSupport.ParamManager();

        // check the URL
        if (url == null || url.equals("")) {
            throw new NullAttributeException("import", "url");
        }

        // Record whether our URL is absolute or relative
        isAbsoluteUrl = UrlUtil.isAbsoluteUrl(url);

        try {
            // If we need to expose a Reader, we've got to do it right away
            if (varReader != null) {
                r = acquireReader();
                pageContext.setAttribute(varReader, r);
            }
        } catch (IOException ex) {
            throw new JspTagException(ex.toString(), ex);
        }

        return EVAL_BODY_INCLUDE;
    }
1164310
@Override
    public int doEndTag() throws JspException {

        ServletRequest req = pageContext.getRequest();
        A_CmsConfiguredHtmlParser parser;
        if (m_allowInlineEdit && CmsJspTagEditable.isEditableRequest(req)) {
            // during inline editing the content should not be parsed
            try {
                getBodyContent().writeOut(pageContext.getOut());
                release();
            } catch (Exception ex) {
                release();
                if (LOG.isErrorEnabled()) {
                    LOG.error(Messages.get().getBundle().key(Messages.ERR_PROCESS_TAG_1, TAG_NAME), ex);
                }
                // this is severe
                throw new JspException(ex);
            }
        } else {
            // This will always be true if the page is called through OpenCms
            if (CmsFlexController.isCmsRequest(req)) {
                String content = "";
                try {
                    if (CmsStringUtil.isEmpty(m_configuredParserClassname)) {
                        if (LOG.isErrorEnabled()) {
                            LOG.error(
                                Messages.get().getBundle().key(
                                    Messages.GUI_ERR_TAG_ATTRIBUTE_MISSING_2,
                                    new Object[] {TAG_NAME, ATT_VISITOR_CLASS}));
                        }

                    }
                    // wrong attribute visitorClass -> content will remain empty, but no exception is
                    // thrown
                    try {
                        // load
                        Class<?> cl = Class.forName(m_configuredParserClassname);
                        // Instantiate
                        Object instance = cl.newInstance();
                        // cast
                        parser = (A_CmsConfiguredHtmlParser)instance;
                        parser.setParam(m_param);
                        // cms object:
                        CmsFlexController controller = CmsFlexController.getController(req);
                        CmsObject cms = controller.getCmsObject();
                        parser.setCmsObject(cms);
                        content = parseTagAction(getBodyContent().getString(), pageContext, parser);

                    } catch (Exception e) {
                        if (LOG.isErrorEnabled()) {
                            LOG.error(
                                Messages.get().getBundle().key(
                                    Messages.GUI_ERR_TAG_ATTRIBUTE_INVALID_3,
                                    new Object[] {
                                        TAG_NAME,
                                        ATT_VISITOR_CLASS,
                                        A_CmsConfiguredHtmlParser.class.getName()}),
                                e);
                        }
                        e.printStackTrace(System.err);
                    }

                } finally {
                    try {
                        getBodyContent().clear();
                        getBodyContent().print(content);
                        getBodyContent().writeOut(pageContext.getOut());
                        release();

                    } catch (Exception ex) {
                        release();
                        if (LOG.isErrorEnabled()) {
                            LOG.error(Messages.get().getBundle().key(Messages.ERR_PROCESS_TAG_1, TAG_NAME), ex);
                        }
                        // this is severe
                        throw new JspException(ex);
                    }

                }

            }
        }
        return EVAL_PAGE;
    }
427922
@Override
    public int doStartTag() throws JspException {

        ServletRequest req = pageContext.getRequest();

        // This will always be true if the page is called through OpenCms
        if (!CmsFlexController.isCmsRequest(req)) {
            return SKIP_BODY;
        }
        if (getJs() == null) {
            if (isDynamic()) {
                // in case we want to include the needed js functions
                try {
                    pageContext.getOut().print("<script type='text/javascript' src='"
                        + CmsWorkplace.getSkinUri()
                        + VFS_PATH_LOAD_JS
                        + "' ></script>");
                } catch (Exception ex) {
                    if (LOG.isErrorEnabled()) {
                        LOG.error(Messages.get().getBundle().key(Messages.ERR_PROCESS_TAG_1, "jquery"), ex);
                    }
                    throw new JspException(ex);
                }
            }
            return SKIP_BODY;
        }

        // get the server prefix
        CmsObject cms = CmsFlexController.getCmsObject(req);

        // first handle js file
        String path = VFS_PATH_JQUERY;
        if (cms.getRequestContext().getCurrentProject().isOnlineProject()) {
            // online
            path += VFS_PATH_PACKED;
        } else {
            // offline
            path += VFS_PATH_UNPACKED;
        }
        String file = path + getJs() + EXTENSION_JS;
        try {
            cms.readResource(CmsWorkplace.VFS_PATH_RESOURCES + file);
            if (isDynamic()) {
                pageContext.getOut().print("<script type='text/javascript'>load_script('"
                    + CmsWorkplace.getSkinUri()
                    + file
                    + "', 'js');</script>");
            } else {
                pageContext.getOut().print(
                    "<script type='text/javascript' src='" + CmsWorkplace.getSkinUri() + file + "' ></script>");
            }
        } catch (Exception ex) {
            if (LOG.isErrorEnabled()) {
                LOG.error(Messages.get().getBundle().key(Messages.ERR_PROCESS_TAG_1, "jquery"), ex);
            }
            throw new JspException(ex);
        }
        if (getCss() == null) {
            return SKIP_BODY;
        }

        // now handle css file
        path = VFS_PATH_CSS;
        file = path + getCss() + EXTENSION_CSS;
        try {
            cms.readResource(CmsWorkplace.VFS_PATH_RESOURCES + file);
            pageContext.getOut().println();
            if (isDynamic()) {
                pageContext.getOut().print("<script type='text/javascript'>load_script('"
                    + CmsWorkplace.getSkinUri()
                    + file
                    + "', 'css');</script>");
            } else {
                pageContext.getOut().print(
                    "<link href='" + CmsWorkplace.getSkinUri() + file + "' rel='stylesheet' type='text/css' >");
            }
        } catch (Exception ex) {
            if (LOG.isErrorEnabled()) {
                LOG.error(Messages.get().getBundle().key(Messages.ERR_PROCESS_TAG_1, "jquery"), ex);
            }
            throw new JspException(ex);
        }
        return SKIP_BODY;
    }
1290829
public void doTag()
            throws JspException
    {
        JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, IFormattable.class);

        // if there are errors we need to either add these to the parent AbstractBastTag or report an error.
        if (hasErrors()) {
            if (parentTag instanceof IFormattable) {
                IFormattable parent = (IFormattable) parentTag;
                parent.formatterHasError();
            }
            reportErrors();
            return;
        }

        if (parentTag instanceof IFormattable) {
            StringFormatter formatter = new StringFormatter();
            formatter.setPattern(_pattern);
            formatter.setTruncate(truncate);
            IFormattable parent = (IFormattable) parentTag;
            parent.addFormatter(formatter);
        }
        else {
            String s = Bundle.getString("Tags_FormattableParentRequired");
            registerTagError(s, null);
            reportErrors();
        }
    }
577217
public void actionCopyElementLocale() throws JspException {

        try {
            setEditorValues(getElementLocale());
            if (!hasValidationErrors()) {
                // save content of the editor only to the temporary file
                writeContent();
                CmsObject cloneCms = getCloneCms();
                CmsUUID tempProjectId = OpenCms.getWorkplaceManager().getTempFileProjectId();
                cloneCms.getRequestContext().setCurrentProject(getCms().readProject(tempProjectId));
                // remove eventual release & expiration date from temporary file to make preview work
                cloneCms.setDateReleased(getParamTempfile(), CmsResource.DATE_RELEASED_DEFAULT, false);
                cloneCms.setDateExpired(getParamTempfile(), CmsResource.DATE_EXPIRED_DEFAULT, false);
            }
        } catch (CmsException e) {
            // show error page
            showErrorPage(this, e);
        }
    }
825816
protected void saveData() throws CmsException {

        CmsObject cms = m_context.getCms();
        for (CmsResource resource : m_context.getResources()) {
            CmsLockActionRecord actionRecord = null;
            try {
                actionRecord = CmsLockUtil.ensureLock(m_context.getCms(), resource);

                String secureValue = (String)m_secureField.getValue();
                String exportValue = (String)m_exportField.getValue();
                String exportname = m_exportNameField.getValue();
                CmsProperty secureProp = new CmsProperty(CmsPropertyDefinition.PROPERTY_SECURE, secureValue, null);
                CmsProperty exportProp = new CmsProperty(CmsPropertyDefinition.PROPERTY_EXPORT, exportValue, null);
                CmsProperty exportNameProp = new CmsProperty(
                    CmsPropertyDefinition.PROPERTY_EXPORTNAME,
                    exportname,
                    null);
                boolean internal = m_internalField.getValue().booleanValue();

                cms.writePropertyObjects(resource, Arrays.asList(secureProp, exportProp, exportNameProp));
                resource.setInternal(internal);
                cms.writeResource(resource);
            } finally {
                if ((actionRecord != null) && (actionRecord.getChange() == LockChange.locked)) {
                    try {
                        cms.unlockResource(resource);
                    } catch (CmsLockException e) {
                        LOG.warn(e.getLocalizedMessage(), e);
                    }
                }
            }
        }
    }
180381
public int doStartTag()
            throws JspException {

        Tag parent = getParent();
        if (parent != null) {
            String s = Bundle.getString("TempExcp_ContainedTemplate");
            registerTagError(s,null);
            reportErrors();
            _fatalError = true;
            return SKIP_BODY;
        }

        ServletRequest req = pageContext.getRequest();
        _savedContext = (TemplateContext) req.getAttribute(TEMPLATE_SECTIONS);
        TemplateContext ctxt = new TemplateContext();
        req.setAttribute(TEMPLATE_SECTIONS,ctxt);

        return EVAL_BODY_INCLUDE;
    }
627624
void process() {
        fixImports();
        if (insertRegion != null) {
            data.ensureImport(BeanDefinition.class);
            if (properties.size() > 0) {
                data.ensureImport(PropertyDefinition.class);
            }
            removeOld();
            if (data.isRootClass() && data.isExtendsDirectBean()) {
                data.ensureImport(DirectBean.class);
            }
            generateMeta();
            generateSerializationVersionId();
            generatePropertyChangeSupportField();
            generateHashCodeField();
            generateFactory();
            generateImmutableBuilderMethod();
            generateArgBasedConstructor();
            generateBuilderBasedConstructor();
            generateMetaBean();
            generateGettersSetters();
            generateSeparator();
            generateImmutableToBuilder();
            generateClone();
            generateEquals();
            generateHashCode();
            generateToString();
            generateMetaClass();
            generateBuilderClass();
            resolveImports();
            resolveIndents();
        }
    }
790077
@Override
    public int doStartTag() throws JspException {

        if (isEditableRequest(pageContext.getRequest())) {
            // all this does NOT apply to the "online" project, or for temporary files
            I_CmsDirectEditProvider eb = getDirectEditProvider(pageContext);
            // if no provider is available this is the first "editable" tag on the page
            m_firstOnPage = (eb == null);
            m_manualPlacement = false;
            if ((m_mode == CmsDirectEditMode.MANUAL) || !m_editEmpty) {
                // manual mode requested, we may need to insert HTML
                if (!m_firstOnPage && (eb != null)) {
                    // first tag on a page is only for insertion of header HTML
                    if (eb.isManual(m_mode)) {
                        // the provider supports manual placement of buttons
                        m_manualPlacement = true;
                        editableTagAction(pageContext, m_provider, m_mode, m_file);
                    }
                }
            } else if (!m_firstOnPage && (eb != null) && m_editEmpty) {
                try {
                    insertEditEmpty();
                } catch (CmsException e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        } else {
            // this will ensure the "end" tag is also ignored in the online project
            m_firstOnPage = false;
            m_manualPlacement = false;
        }
        return EVAL_BODY_INCLUDE;
    }
394797
public void actionUpdate() throws JspException {

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

        try {
            // prepare the publish scheduled resource
            performDialogOperation();
            // close the dialog
            actionCloseDialog();
        } catch (Throwable e) {
            // show the error page
            includeErrorpage(this, e);
        }
    }
1299099
public void doTag()
            throws JspException
    {
        // report error if there are any
        if (hasErrors()) {
            reportErrors();
            return;
        }

        PageContext pageContext = getPageContext();
        ServletContainerAdapter sa = AdapterManager.getServletContainerAdapter(pageContext.getServletContext());
        ServletRequest request = pageContext.getRequest();
        assert(sa != null);

        // check to see if we are supposed to report the error
        boolean prodMode = sa.isInProductionMode();
        if (prodMode && !_alwaysReport)
            return;

        LinkedHashMap map = (LinkedHashMap)
                InternalUtils.getBindingUpdateErrors(request);

        if (map == null)
            return;

        if (_expression != null) {
            String expr = "{" + _expression + "}";
            BindingUpdateError err = (BindingUpdateError) map.get(expr);
            if (err != null) {
                Throwable cause = err.getCause();
                String msg = (cause != null) ? cause.getMessage() : err.getMessage();
                String s = Bundle.getString("Tags_BindingUpdateError", new Object[]{_expression, msg});
                registerTagError(s, null);
                reportErrors();
            }
            return;
        }

        Iterator it = map.values().iterator();
        while (it.hasNext()) {
            BindingUpdateError err = (BindingUpdateError) it.next();
            Throwable cause = err.getCause();
            String msg = (cause != null) ? cause.getMessage() : err.getMessage();
            String s = Bundle.getString("Tags_BindingUpdateError", new Object[]{err.getExpression(), msg});
            registerTagError(s, null);
        }
        reportErrors();
    }
927764
protected void init() throws JspException {

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

        try {
            // get the resource name from the selected container
            m_element = OpenCms.getADEManager().getCurrentElement(pageContext.getRequest());
            m_element.initResource(m_cms);
            if (m_cms.getRequestContext().getCurrentProject().isOnlineProject()
                && !m_element.isReleasedAndNotExpired()) {
                throw new CmsException(
                    Messages.get().container(
                        Messages.ERR_RESOURCE_IS_NOT_RELEASE_OR_EXPIRED_1,
                        m_element.getResource().getRootPath()));
            }
            if (m_locale == null) {
                // no locale set, use locale from users request context
                m_locale = m_cms.getRequestContext().getLocale();
            }

            // load content and store it
            CmsJspContentAccessBean bean;
            if ((m_element.isInMemoryOnly() || m_element.isTemporaryContent())
                && (m_element.getResource() instanceof CmsFile)) {
                I_CmsXmlDocument xmlContent = CmsXmlContentFactory.unmarshal(
                    m_cms,
                    m_element.getResource(),
                    pageContext.getRequest());
                bean = new CmsJspContentAccessBean(m_cms, m_locale, xmlContent);
            } else {
                bean = new CmsJspContentAccessBean(m_cms, m_locale, m_element.getResource());
            }
            storeAttribute(getVar(), bean);

            if (m_value != null) {
                // if the optional "val" parameter has been set, store the value map of the content in the page context scope
                storeAttribute(getVal(), bean.getValue());
            }

            if (m_rdfa != null) {
                // if the optional "rdfa" parameter has been set, store the rdfa map of the content in the page context scope
                storeAttribute(getRdfa(), bean.getRdfa());
            }

        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            m_controller.setThrowable(e, m_cms.getRequestContext().getUri());
            throw new JspException(e);
        }
    }
1067933
public void actionReport() 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_CONFIRMED:
            default:
                try {
                    Map params = new HashMap();
                    params.put(PARAM_MODULE, getParamModule());
                    // set style to display report in correct layout
                    params.put(PARAM_STYLE, CmsToolDialog.STYLE_NEW);
                    // set close link to get back to overview after finishing the import
                    params.put(PARAM_CLOSELINK, CmsToolManager.linkForToolPath(getJsp(), "/modules"));
                    // redirect to the report output JSP
                    getToolManager().jspForwardPage(this, DELETE_ACTION_REPORT, params);

                    actionCloseDialog();
                } catch (Throwable e) {
                    // create a new Exception with custom message
                    includeErrorpage(this, e);
                }
                break;
        }
    }