Builds the html for the workplace start site select box.<p>

@param htmlAttributes optional html attributes for the &lgt;select&gt; tag
@return the html for the workplace start site select box
492860
public String buildSelectUpload(String htmlAttributes) {

        List<String> options = new ArrayList<String>();
        List<String> values = new ArrayList<String>();
        int selectedIndex = 0;
        int pos = 0;

        UploadVariant currentVariant = getParamTabWpUploadVariant();
        for (UploadVariant variant : UploadVariant.values()) {

            values.add(variant.toString());
            options.add(getUploadVariantMessage(variant));

            if (variant.equals(currentVariant)) {
                selectedIndex = pos;
            }
            pos++;
        }
        return buildSelect(htmlAttributes, options, values, selectedIndex);
    }
454553
public String buildSelectFonts(String attributes) {

        List<String> names = new ArrayList<String>();
        for (int i = 0; i < CmsDefaultPageEditor.SELECTBOX_FONTS.length; i++) {
            String value = CmsDefaultPageEditor.SELECTBOX_FONTS[i];
            names.add(value);
        }
        return buildSelect(attributes, names, names, -1, false);
    }
67042
public String buildSelectStartGalleries(String htmlAttributes) {

        StringBuffer result = new StringBuffer(1024);
        HttpServletRequest request = getJsp().getRequest();
        // set the attributes for the select tag
        if (htmlAttributes != null) {
            htmlAttributes += " name=\"" + PARAM_STARTGALLERY_PREFIX;
        }
        Map<String, A_CmsAjaxGallery> galleriesTypes = OpenCms.getWorkplaceManager().getGalleries();
        if (galleriesTypes != null) {

            // sort the galleries by localized name
            Map<String, String> localizedGalleries = new TreeMap<String, String>();
            for (Iterator<String> i = galleriesTypes.keySet().iterator(); i.hasNext();) {
                String currentGalleryType = i.next();
                String localizedName = CmsWorkplaceMessages.getResourceTypeName(this, currentGalleryType);
                localizedGalleries.put(localizedName, currentGalleryType);
            }

            for (Iterator<Map.Entry<String, String>> i = localizedGalleries.entrySet().iterator(); i.hasNext();) {
                Map.Entry<String, String> entry = i.next();
                // first: retrieve the gallery type
                String currentGalleryType = entry.getValue();
                // second: retrieve the gallery type id
                int currentGalleryTypeId = 0;
                try {
                    currentGalleryTypeId = OpenCms.getResourceManager().getResourceType(currentGalleryType).getTypeId();
                } catch (CmsLoaderException e) {
                    // resource type not found, log error
                    if (LOG.isErrorEnabled()) {
                        LOG.error(e.getLocalizedMessage(), e);
                    }
                    continue;
                }
                // third: get the available galleries for this gallery type id
                List<CmsResource> availableGalleries = A_CmsAjaxGallery.getGalleries(currentGalleryTypeId, getCms());

                // forth: fill the select box
                List<String> options = new ArrayList<String>(availableGalleries.size() + 2);
                List<String> values = new ArrayList<String>(availableGalleries.size() + 2);
                options.add(key(Messages.GUI_PREF_STARTGALLERY_PRESELECT_0));
                values.add(INPUT_DEFAULT);
                options.add(key(Messages.GUI_PREF_STARTGALLERY_NONE_0));
                values.add(INPUT_NONE);

                String savedValue = computeStartGalleryPreselection(request, currentGalleryType);
                int counter = 2;
                int selectedIndex = 0;
                Iterator<CmsResource> iGalleries = availableGalleries.iterator();
                while (iGalleries.hasNext()) {
                    CmsResource res = iGalleries.next();
                    String rootPath = res.getRootPath();
                    String sitePath = getCms().getSitePath(res);
                    // select the value
                    if ((savedValue != null) && (savedValue.equals(rootPath))) {
                        selectedIndex = counter;
                    }
                    counter++;
                    // gallery title
                    String title = "";
                    try {
                        // read the gallery title
                        title = getCms().readPropertyObject(
                            sitePath,
                            CmsPropertyDefinition.PROPERTY_TITLE,
                            false).getValue("");
                    } catch (CmsException e) {
                        // error reading title property
                        if (LOG.isErrorEnabled()) {
                            LOG.error(e.getLocalizedMessage(), e);
                        }
                    }
                    options.add(title.concat(" (").concat(sitePath).concat(")"));
                    values.add(rootPath);

                }
                // select the value
                if ((savedValue != null) && savedValue.equals(INPUT_NONE)) {
                    selectedIndex = 1;
                }

                // create the table row for the current resource type
                result.append("<tr>\n\t<td style=\"white-space: nowrap;\">");

                result.append(entry.getKey());
                result.append("</td>\n\t<td>");
                result.append(buildSelect(htmlAttributes + currentGalleryType + "\"", options, values, selectedIndex));
                result.append("</td>\n</tr>\n");

            }

        }
        return result.toString();
    }
1320293
public String buildSelectPublishSiblings(String htmlAttributes) {

        List<String> options = new ArrayList<String>(2);
        options.add(key(Messages.GUI_PREF_PUBLISH_SIBLINGS_0));
        options.add(key(Messages.GUI_PREF_PUBLISH_ONLY_SELECTED_0));
        List<String> values = new ArrayList<String>(2);
        values.add(CmsStringUtil.TRUE);
        values.add(CmsStringUtil.FALSE);
        int selectedIndex = values.indexOf(getParamTabDiPublishFileMode());
        return buildSelect(htmlAttributes, options, values, selectedIndex);
    }
623569
public Element prepend(String html) {
        Validate.notNull(html);
        List<Node> nodes = NodeUtils.parser(this).parseFragmentInput(html, this, baseUri());
        addChildren(0, nodes.toArray(new Node[0]));
        return this;
    }
1176274
public String buildSelectSite(String htmlAttributes) {

        SelectOptions selectOptions = getSiteSelectOptions();

        return buildSelect(htmlAttributes, selectOptions);
    }
332013
public String htmlSource() {
        try {
            return driver.getPageSource();
        } catch (Exception e) {
            log.warn(e);
            return null;
        }
    }
909323
public static HtmlTree HTML(String lang, Content head, Content body) {
        HtmlTree htmltree = new HtmlTree(HtmlTag.HTML, nullCheck(head), nullCheck(body));
        htmltree.addAttr(HtmlAttr.LANG, nullCheck(lang));
        return htmltree;
    }
1329724
public static String defaultHelpHtml(String helpId, String helpText) {

        StringBuffer html = new StringBuffer(1024);
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(helpText)) {
            html.append("<div class='help' id='help");
            html.append(helpId);
            html.append("' onMouseOut=\"hMH('");
            html.append(helpId);
            html.append("');\">");
            html.append(helpText);
            html.append("</div>\n");
        }
        return html.toString();
    }
79176
public String toHtml() {
        StringBuilder stringBuilder = new StringBuilder();

        stringBuilder
                .append("<p>")
                .append(objectNode.get(TYPE).asText()).append(": ")
                .append(objectNode.get(MESSAGE).asText()).append(" -> ")
                .append(objectNode.get(DETAILS).toString())
                .append("</p>");

        return stringBuilder.toString();
    }
176425
public JobResult buildJobConfiguration(String jobname){
        HttpPost postRequest = new HttpPost(baseUrl + "job/" + jobname);
        StringEntity postEntity = null;
        try {
            postEntity = new StringEntity(BUILD_ACTION);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        postEntity.setContentType("application/x-www-form-urlencoded");
        postRequest.addHeader("Accept", "application/xml");
        postRequest.setEntity(postEntity);
        return jobResult(postRequest);
    }
100673
public String buildSelectPlaces(String htmlAttributes) {

        List<String> options = new ArrayList<String>(4);
        options.add(OPTION_DECIMALPLACES_1);
        options.add(OPTION_DECIMALPLACES_2);
        options.add(OPTION_DECIMALPLACES_3);
        options.add(OPTION_DECIMALPLACES_4);
        List<String> values = new ArrayList<String>(4);
        values.add("1");
        values.add("2");
        values.add("3");
        values.add("4");
        int selectedIndex = 2;
        if (getAction() != ACTION_DEFAULT) {
            selectedIndex = values.indexOf(getParamPlaces());
        }
        return buildSelect(htmlAttributes, options, values, selectedIndex);
    }
361422
public String buildSelectProperty(String attributes) {

        return buildSelectProperty(
            getCms(),
            Messages.get().getBundle(getLocale()).key(Messages.GUI_PLEASE_SELECT_0),
            attributes,
            getParamPropertyName());
    }
1079983
public String buildIncludeJs() {

        StringBuffer html = new StringBuffer(512);

        html.append("<script type='text/javascript' src='");
        html.append(CmsWorkplace.getSkinUri());
        html.append("commons/ajax.js'></script>\n");

        html.append("<script type='text/javascript' src='");
        html.append(CmsWorkplace.getSkinUri());
        html.append("editors/xmlcontent/help.js'></script>\n");

        html.append("<script type='text/javascript' src='");
        html.append(CmsWorkplace.getSkinUri());
        html.append("admin/javascript/general.js'></script>\n");

        html.append("<script type='text/javascript' src='");
        html.append(CmsWorkplace.getSkinUri());
        html.append("admin/javascript/list.js'></script>\n");

        html.append("<script type='text/javascript'><!--\n");

        html.append("\tvar ");
        html.append(CmsHtmlList.NO_SELECTION_HELP_VAR);
        html.append(" = '");
        html.append(
            CmsStringUtil.escapeJavaScript(key(org.opencms.workplace.list.Messages.GUI_LIST_ACTION_NO_SELECTION_0)));
        html.append("';\n");

        html.append("function doReportUpdate(msg, state) {\n");
        html.append("\tvar img = state + '.png';\n");
        html.append("\tvar txt = '';\n");
        html.append("\tvar elem = document.getElementById('ajaxreport');\n");
        html.append("\tif (state != 'ok') {\n");
        html.append("\t\tif (state == 'fatal') {\n");
        html.append("\t\t\timg = 'error.png';\n");
        html.append("\t\t\ttxt = '");
        html.append(key(org.opencms.workplace.Messages.GUI_AJAX_REPORT_GIVEUP_0));
        html.append("';\n");
        html.append("\t\t} else if (state == 'wait') {\n");
        html.append("\t\t\timg = 'wait.gif';\n");
        html.append("\t\t\ttxt = '");
        html.append(key(org.opencms.workplace.Messages.GUI_AJAX_REPORT_WAIT_0));
        html.append("'\n");
        html.append("\t\t} else if (state == 'error') {\n");
        html.append("\t\t\ttxt = '");
        html.append(key(org.opencms.workplace.Messages.GUI_AJAX_REPORT_ERROR_0));
        html.append("' + msg;\n");
        html.append("\t\t}\n");
        html.append("\t} else {");
        html.append("\t\telem.innerHTML = msg;\n");
        html.append("\t}\n");
        html.append("\tif (txt != '') {\n");
        html.append("\t\tvar html = \"<table border='0' style='vertical-align:middle; height: 200px;'>\";");
        html.append("\t\thtml += \"<tr><td width='40' align='center' valign='middle'><img src='");
        html.append(getSkinUri());
        html.append("commons/\";");
        html.append("\t\thtml += img;");
        html.append("\t\thtml += \"' width='32' height='32' alt=''></td>\";");
        html.append("\t\thtml += \"<td valign='middle'><span style='color: #000099; font-weight: bold;'>\";");
        html.append("\t\thtml += txt;");
        html.append("\t\thtml += \"</span><br></td></tr></table>\";");
        html.append("\t\telem.innerHTML = html;");
        html.append("\t}\n");
        html.append("}\n");

        html.append("function reloadReport() {\n");
        html.append("\tvar readtree = document.forms[\"");
        html.append(CmsDeletedResourcesList.LIST_ID);
        html.append("-form\"].");
        html.append(PARAM_READTREE);
        html.append(".checked;\n");
        html.append("\tmakeRequest('");
        html.append(getJsp().link("/system/workplace/commons/report-deleted.jsp"));
        html.append("', '");
        html.append(CmsDialog.PARAM_RESOURCE);
        html.append("=");
        html.append(getParamResource());
        html.append("&");
        html.append(PARAM_READTREE);
        html.append("=");
        html.append("' + readtree");
        html.append(", 'doReportUpdate');\n");
        html.append("}\n");

        html.append("// -->\n");
        html.append("</script>\n");

        return html.toString();
    }
693961
public String getHtmlCode()
	{
		Object[] _params =
		{
			SgmlUtils.generateAttribute(HtmlUtils.AttributeNames.VALUE, getValue())
		};
		MessageFormat _format = (isSelected()) ? FORMAT__SELECTED : FORMAT__NOT_SELECTED;
		return _format.format(_params);
	}
441037
public String create()
   {
      StringBuffer strEditor = new StringBuffer();

      strEditor.append("<div>");
      String encodedValue = HTMLEncode(value);

      if (isCompatible())
      {

         strEditor.append("<input type=\"hidden\" id=\"" + instanceName + "\" name=\"" + instanceName + "\" value=\""
            + encodedValue + "\">");

         strEditor.append(createConfigHTML());
         strEditor.append(createIFrameHTML());

      }
      else
      {
         strEditor.append("<TEXTAREA name=\"" + instanceName + "\" rows=\"4\" cols=\"40\" style=\"WIDTH: " + width
            + "; HEIGHT: " + height + "\" wrap=\"virtual\">" + encodedValue + "</TEXTAREA>");
      }
      strEditor.append("</div>");
      return strEditor.toString();
   }
293825
public String buildOrgUnitSelector() {

        StringBuffer html = new StringBuffer();
        html.append("<select style='width: 100%;' size='1' ");
        appendId(html, PARAM_OUFQN);
        html.append(">\n");
        for (CmsOrganizationalUnit ou : getOus()) {
            String selected = "";
            if (ou.getName().equals(m_oufqn)
                || (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_oufqn) && ou.getName().equals(m_oufqn.substring(1)))) {
                selected = " selected='selected'";
            }
            html.append("<option value='").append(ou.getName()).append("'").append(selected).append(">");
            html.append(ou.getDisplayName(m_locale));
            html.append("</option>\n");
        }
        html.append("</select>\n");
        return html.toString();
    }