Writes the dialog html code, only if the <code>{@link #ACTION_DEFAULT}</code> is set.<p>

@throws JspException if dialog actions fail
@throws IOException if writing to the JSP out fails, or in case of errors forwarding to the required result page
976291
public void writeDialog() throws IOException, JspException {

        if (isForwarded()) {
            return;
        }
        switch (getAction()) {
            case ACTION_CANCEL:
            case ACTION_ERROR:
            case ACTION_SAVE:
                break;

            case ACTION_DEFAULT:
            default:
                // ACTION: show dialog (default)
                setParamAction(DIALOG_SAVE);
                JspWriter out = getJsp().getJspContext().getOut();
                out.print(defaultActionHtml());
        }
    }
1258070
protected String defaultActionHtmlEnd() {

        StringBuffer result = new StringBuffer(2048);
        result.append(dialogEnd());
        result.append(bodyEnd());
        result.append(htmlEnd());
        return result.toString();
    }
869659
protected void writeJavaScript(Header header) throws IOException {
        addTabs(2);
        writeStart(HtmlTags.SCRIPT);
        write(HtmlTags.LANGUAGE, HtmlTags.JAVASCRIPT);
        if (markup.size() > 0) {
          /* JavaScript reference example:
           *
           * <script language="JavaScript" src="/myPath/MyFunctions.js"/>
           */ 
          writeMarkupAttributes(markup);
          os.write(GT);
          writeEnd(HtmlTags.SCRIPT);
        }
        else {
          /* JavaScript coding convention:
           *
           * <script language="JavaScript" type="text/javascript">
           * <!--
           * // ... JavaScript methods ...
           * //-->
           * </script>
           */ 
          write(HtmlTags.TYPE, Markup.HTML_VALUE_JAVASCRIPT);
          os.write(GT);
          addTabs(2);
          write(new String(BEGINCOMMENT) + "\n");
          write(header.getContent());
          addTabs(2);
          write("//" + new String(ENDCOMMENT));
          addTabs(2);
          writeEnd(HtmlTags.SCRIPT);
        }
    }
242462
public int doEndTag() throws JspException
    {
        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        String idScript = null;

        // Create an appropriate "form" element based on our parameters
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        ServletContext servletContext = pageContext.getServletContext();

        // if we have an Id or a tag is forcing the name, then set the state and generate
        // the JavaScript
        if (_state.id != null || _setRealName) {
            String id = _state.id;
            _state.name = _realName;
            _state.id = _realName;
            idScript = renderNameAndId(request, id);
        }

        if (_state.method == null)
            _state.method = FORM_POST;

        // Encode the action
        // If the rewritten form action contains request parameters, turn them into hidden fields --
        // it's not legal to include them in the action URI on a GET.
        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();

        if (_actionUrl != null) {
            _state.action = response.encodeURL(_actionUrl);
        }

        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.FORM_TAG, request);
        br.doStartTag(writer, _state);

        // If the action we're submitting to is checking for double-submits, save a token in the session.
        // This will be written out as a hidden param (below), and will be checked in PageFlowRequestProcessor.
        String token = PageFlowTagUtils.getToken(request, _mapping);

        // Add a transaction token (if present in our session)
        HttpSession session = pageContext.getSession();
        if (session != null) {
            if (token == null) {
                token = (String) session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
            }
            if (token != null) {
                String name = URLRewriterService.getNamePrefix(servletContext, request, Constants.TOKEN_KEY)
                              + Constants.TOKEN_KEY;
                writeHiddenParam(name, token, writer, request, true);
            }
        }

        // add a hidden value for each parameter
        if (_params != null) {
            Iterator paramKeys = _params.keySet().iterator();
            while (paramKeys.hasNext()) {
                Object paramKey = paramKeys.next();
                Object paramValue = _params.get(paramKey);
                if (paramValue instanceof String[]) {
                    String[] paramValArray = (String[]) paramValue;
                    for (int i = 0; i < paramValArray.length; i++) {
                        String name = paramKey.toString();
                        String paramName = URLRewriterService.getNamePrefix(servletContext, request, name) + name;
                        writeHiddenParam(paramName, paramValArray[i], writer, request, true);
                    }
                }
                else {
                    String name = paramKey.toString();
                    String paramName = URLRewriterService.getNamePrefix(servletContext, request, name) + name;
                    writeHiddenParam(paramName, paramValue.toString(), writer, request, true);
                }
            }
        }

        // add the extra hidden parameters
        if (_extraHiddenParams != null && _extraHiddenParams.size() > 0) {
            for (Iterator i = _extraHiddenParams.keySet().iterator(); i.hasNext();) {
                String name = (String) i.next();
                for (Iterator j = ((List)_extraHiddenParams.get(name)).iterator(); j.hasNext();) {
                    String value = (String) j.next();
                    writeHiddenParam(name, value, writer, request, true);
                }
            }
        }

        // add the body content
        if (_text != null)
            write(_text);

        // Remove the page scope attributes we created
        pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE);
        pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE);
        ImplicitObjectUtil.unloadActionForm(pageContext);

        // Render a tag representing the end of our current form
        br.doEndTag(writer);

        // Render JavaScript to set the input focus if required
        if ((_focus != null) && (_focusMap != null)) {
            String focusName = (String) _focusMap.get(_focus);

            if (focusName != null) {
                String formName = _realName;
                ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
                srs.writeFeature(getScriptReporter(), writer, CoreScriptFeature.SET_FOCUS, false, true,
                        new Object[]{formName, focusName});
            }
        }

        if (_formSubmit) {
            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            srs.writeFeature(getScriptReporter(), writer, CoreScriptFeature.ANCHOR_SUBMIT, true, false, null);
        }

        // output any generated javascript
        if (idScript != null)
            write(idScript);

        localRelease();
        return EVAL_PAGE;
    }
394202
protected String defaultActionHtmlStart() {

        StringBuffer result = new StringBuffer(2048);
        result.append(htmlStart(null));
        result.append(getList().listJs());
        result.append(bodyStart("dialog", null));
        result.append(dialogStart());
        result.append(dialogContentStart(getParamTitle()));
        return result.toString();
    }
1332312
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_REPORT_UPDATE:
                setParamAction(REPORT_UPDATE);
                getJsp().include(FILE_REPORT_OUTPUT);
                break;
            case ACTION_REPORT_BEGIN:
            case ACTION_CONFIRMED:
            default:
                CmsStaticExportThread thread = new CmsStaticExportThread(getCms());
                thread.start();
                setParamAction(REPORT_BEGIN);
                setParamThread(thread.getUUID().toString());
                getJsp().include(FILE_REPORT_OUTPUT);
                break;
        }
    }
372326
public void doTag()
            throws JspException, IOException
    {
        PageContext pageContext = getPageContext();
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.BASE_TAG, request);

        // evaluate the body, this is called basically so any attributes my be applied.
        getBufferBody(false);

        InternalStringBuilder buf = new InternalStringBuilder(64);

        // calculate the href
        buf.append(request.getScheme());
        buf.append("://");
        buf.append(request.getServerName());

        String scheme = request.getScheme();
        int port = request.getServerPort();
        if ("http".equals(scheme) && (80 == port)) {
            //Do nothing
        }
        else if ("https".equals(scheme) && (443 == port)) {
            //Do nothing
        }
        else {
            buf.append(":");
            buf.append(request.getServerPort());
        }
        buf.append(request.getRequestURI());
        _state.href = buf.toString();

        // render the tag.
        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        br.doStartTag(writer, _state);
        br.doEndTag(writer);

        // This will produce invalid HTML/XHTML if there are errors
        // because we are going to put markup out into the head.
        if (hasErrors())
            reportErrors();
    }
353714
protected String defaultActionHtml() {

        StringBuffer result = new StringBuffer(32);

        result.append(htmlStart());
        result.append(bodyStart(null));
        result.append(dialogStart());
        result.append(dialogContentStart(""));
        result.append("<form name=\"main\" class=\"nomargin\" action=\"");
        result.append(getJsp().link(getDialogReturnUri()));
        result.append("\" method=\"post\" onsubmit=\"submitAction('");
        result.append(DIALOG_OK);
        result.append("', null, 'main');\" enctype=\"multipart/form-data\">\n");
        result.append(paramsAsHidden());
        if (getParamFramename() == null) {
            result.append("<input type=\"hidden\" name=\"");
            result.append(PARAM_FRAMENAME);
            result.append("\" value=\"\">");
        }
        result.append(createDialogErrorMessage());
        result.append(dialogBlockStart(getStarttext()));
        result.append("<table border=\"0\" width=\"100%\">\n");
        result.append("<tr>\n\t<td style=\"white-space: nowrap;\" unselectable=\"on\">");
        result.append(getImportMessage());
        result.append(":</td>\n");
        result.append("\t<td class=\"maxwidth\">");
        result.append("<input type=\"file\" name=\"");
        result.append(PARAM_IMPORTFILE);
        result.append("\" class=\"maxwidth\" accept=\"application/zip\">");
        result.append("</td>\n</tr>");
        result.append(getAdditionalParameters());
        result.append("</table>\n");
        result.append(dialogBlockEnd());

        result.append(dialogContentEnd());
        result.append(dialogButtonsOkCancel());
        result.append("</form>\n");
        result.append(dialogEnd());
        result.append(bodyEnd());
        result.append(htmlEnd());
        return result.toString();
    }
439995
protected String defaultActionHtmlStart() throws JspException {

        StringBuffer result = new StringBuffer(2048);
        result.append(htmlStart("administration/index.html"));
        result.append("<script type=\"text/javascript\" src=\"").append(getResourceUri()).append(
            "editors/xmlcontent/edit.js\"></script>\n");
        result.append("<script type=\"text/javascript\" src=\"").append(getResourceUri()).append(
            "editors/xmlcontent/help.js\"></script>\n");
        result.append(getWidgetIncludes());
        result.append("<script type=\"text/javascript\">\n<!--\n");
        result.append("// flag indicating if form initialization is finished\n");
        result.append("var initialized = false;\n");
        result.append("// the OpenCms context path\n");
        result.append("var contextPath = \"").append(OpenCms.getSystemInfo().getOpenCmsContext()).append("\";\n\n");
        result.append("// action parameters of the form\n");
        result.append("var actionAddElement = \"").append(EDITOR_ACTION_ELEMENT_ADD).append("\";\n");
        result.append("var actionRemoveElement = \"").append(EDITOR_ACTION_ELEMENT_REMOVE).append("\";\n");
        result.append("function init() {\n");
        result.append(getWidgetInitCalls());
        result.append("\tsetTimeout(\"scrollForm();\", 200);\n");
        result.append("\tinitialized = true;\n");
        result.append("\twindow.onbeforeunload=exitEditor;\n");
        result.append("}\n\n");
        result.append("window.exitEditorCalled = false;\n");
        result.append("function exitEditor() {\n");
        result.append("\tif (window.exitEditorCalled) return;\n");
        result.append("\twindow.exitEditorCalled = true; \n");
        result.append("\ttry {\n");
        result.append("\t\t// close file selector popup if present\n");
        result.append("\t\tcloseTreeWin();\n");
        result.append("\t} catch (e) {}\n");
        result.append("}\n");
        result.append(getWidgetInitMethods());
        result.append("\n// -->\n</script>\n");
        result.append(bodyStart(null, "onload='init();'  onunload='exitEditor();'"));
        result.append(dialogStart());
        return result.toString();
    }
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;
    }
791754
protected String defaultActionHtmlContent() {

        StringBuffer result = new StringBuffer(2048);
        result.append("<table id='twolists' cellpadding='0' cellspacing='0' align='center' width='100%'>\n");
        result.append("\t<tr>\n");
        result.append("\t\t<td width='50%' valign='top'>\n");
        result.append("\t\t\t").append(m_firstWp.defaultActionHtmlContent()).append("\n");
        result.append("\t\t</td>\n");
        result.append("\t\t<td width='20'>&nbsp;</td>");
        result.append("\t\t<td width='50%' valign='top'>\n");
        result.append("\t\t\t").append(m_secondWp.defaultActionHtmlContent()).append("\n");
        result.append("\t\t</td>\n");
        result.append("\t</tr>\n");
        result.append("</table>\n");
        return result.toString();
    }
452465
protected final void write(String string)
    {
        JspWriter writer = pageContext.getOut();
        try {
            writer.print(string);
        }
        catch (IOException e) {
            logger.error(Bundle.getString("Tags_WriteException"), e);
            org.apache.struts.util.RequestUtils.saveException((PageContext) pageContext, e);
        }
    }
473261
@Override
    public String defaultActionHtmlStart() {

        return new StringBuffer(getList().listJs()).append(dialogContentStart(getParamTitle())).toString();
    }
1032781
public String defaultActionHtml() {

        if ((getList() != null) && getList().getAllContent().isEmpty()) {
            // TODO: check the need for this
            refreshList();
        }
        StringBuffer result = new StringBuffer(2048);
        result.append(defaultActionHtmlStart());
        result.append(customHtmlStart());
        result.append(defaultActionHtmlContent());
        result.append(customHtmlEnd());
        result.append(defaultActionHtmlEnd());
        return result.toString();
    }
308153
protected String defaultActionHtmlContent() {

        StringBuffer result = new StringBuffer(2048);
        result.append("<form name='");
        result.append(getList().getId());
        result.append("-form' action='");
        result.append(getDialogRealUri());
        result.append("' method='post' class='nomargin'");
        if (getList().getMetadata().isSearchable()) {
            result.append(" onsubmit=\"listSearchAction('");
            result.append(getList().getId());
            result.append("', '");
            result.append(getList().getMetadata().getSearchAction().getId());
            result.append("', '");
            result.append(getList().getMetadata().getSearchAction().getConfirmationMessage().key(getLocale()));
            result.append("');\"");
        }
        result.append(">\n");
        result.append(allParamsAsHidden());
        result.append("\n");
        getList().setWp(this);
        result.append(getList().listHtml());
        result.append("\n</form>\n");
        return result.toString();
    }
911491
public void writeHtmlHead(Writer out)
         throws IOException
    {
        if (!writtenHtmlHead)
        {
            writtenHtmlHead=true;
            completeSections();
            out.write("<html><head>");
            String title=(String)properties.get(Title);
            if (title!=null && title.length()>0 && !title.equals(NoTitle))
                out.write("<title>"+title+"</title>");
            head.write(out);
            out.write(base);
            out.write("\n</head>\n");
        }
    }
482497
public void write(Writer out)
         throws IOException
    {
        writeHtmlHead(out);
        
        out.write("<frameset "+border);
        
        if(colSpec!=null)
            out.write(" cols=\""+colSpec+"\"");
        if(rowSpec!=null)
            out.write(" rows=\""+rowSpec+"\"");
        out.write(">");

        for(int r=0;r<rows;r++)
            for(int c=0;c<cols;c++)
                frames[c][r].write(out);

        out.write("<noframes>");
        writeElements(out);
        out.write("</noframes>");

        out.write("</frameset>");
        out.write("</html>");
    }