Returns the selector widget options to build a XML content resource type selector widget.<p>

@return the selector widget options to build a XML content resource type selector widget
771422
private List getXmlContentResourceTypes() {

        // get all available resource types and filter XML content resource types
        List resTypes = OpenCms.getResourceManager().getResourceTypes();
        Iterator i = resTypes.iterator();
        List resTypeNames = new ArrayList(resTypes.size());
        while (i.hasNext()) {
            I_CmsResourceType resType = (I_CmsResourceType)i.next();
            if (!(resType instanceof CmsResourceTypeXmlContent)) {
                // this is not XML content resource type, skip it
                continue;
            }
            if (!resType.getTypeName().equals(TYPE_XMLCONTENT)) {
                resTypeNames.add(resType.getTypeName());
            }
        }

        // create the selector options
        List result = new ArrayList(resTypeNames.size() + 2);
        // add empty "please select" option to selector
        result.add(new CmsSelectWidgetOption("", true, key(Messages.GUI_XMLCONTENTREPAIR_DIALOG_RESTYPE_SELECT_0)));

        // sort the resource type names alphabetically
        Collections.sort(resTypeNames);
        i = resTypeNames.iterator();
        while (i.hasNext()) {
            // add all resource type names to the selector
            String resTypeName = (String)i.next();
            result.add(new CmsSelectWidgetOption(resTypeName));
        }

        // add option for generic XML content without "own" resource types at the end
        result.add(
            new CmsSelectWidgetOption(
                TYPE_XMLCONTENT,
                false,
                key(Messages.GUI_XMLCONTENTREPAIR_DIALOG_RESTYPE_GENERIC_0)));

        return result;
    }
556356
public Map<String, CmsXmlContentProperty> getElementSettings(CmsObject cms, CmsResource resource)
    throws CmsException {

        if (CmsResourceTypeXmlContent.isXmlContent(resource)) {
            Map<String, CmsXmlContentProperty> result = new LinkedHashMap<String, CmsXmlContentProperty>();
            Map<String, CmsXmlContentProperty> settings = CmsXmlContentDefinition.getContentHandlerForResource(
                cms,
                resource).getSettings(cms, resource);
            result.putAll(settings);
            return CmsXmlContentPropertyHelper.copyPropertyConfiguration(result);
        }
        return Collections.<String, CmsXmlContentProperty> emptyMap();
    }
1117104
private List<CmsSelectWidgetOption> getSortNamesIndex() {

        List<CmsSelectWidgetOption> retVal = new ArrayList<CmsSelectWidgetOption>();
        try {
            List<String> names = OpenCms.getSearchManager().getIndexNames();
            for (int i = 0; i < names.size(); i++) {
                String indexName = names.get(i);
                String wpIndexName = getSettings().getUserSettings().getWorkplaceSearchIndexName();
                boolean isDefault = indexName.toLowerCase().equals(wpIndexName.toLowerCase());
                retVal.add(new CmsSelectWidgetOption(names.get(i), isDefault, names.get(i)));
            }
        } catch (Exception e) {
            // noop
        }
        return retVal;
    }
526001
public static SelectOptions getViewSelectOptions(CmsObject cms, String value) {

        Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);

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

        List<I_CmsWorkplaceAppConfiguration> apps = OpenCms.getWorkplaceAppManager().getDefaultQuickLaunchConfigurations();

        for (I_CmsWorkplaceAppConfiguration app : apps) {
            if (OpenCms.getRoleManager().hasRole(
                cms,
                cms.getRequestContext().getCurrentUser().getName(),
                app.getRequiredRole())) {
                values.add(app.getId());
                options.add(app.getName(locale));
            }
        }

        SelectOptions optionBean = new SelectOptions(options, values, selectedIndex);
        return optionBean;
    }
673488
private List<CmsSelectWidgetOption> getFieldList() {

        List<CmsSelectWidgetOption> retVal = new ArrayList<CmsSelectWidgetOption>();
        try {
            Iterator<CmsLuceneField> i = getFields().iterator();
            while (i.hasNext()) {
                CmsLuceneField field = i.next();
                if (isInitialCall()) {
                    // search form is in the initial state
                    retVal.add(
                        new CmsSelectWidgetOption(
                            field.getName(),
                            true,
                            getMacroResolver().resolveMacros(field.getDisplayName())));
                } else {
                    // search form is not in the initial state
                    retVal.add(
                        new CmsSelectWidgetOption(
                            field.getName(),
                            false,
                            getMacroResolver().resolveMacros(field.getDisplayName())));
                }
            }
        } catch (Exception e) {
            // noop
        }
        return retVal;
    }
961492
private List<CmsSelectWidgetOption> getProjectSelections() {

        List<CmsSelectWidgetOption> result = new LinkedList<CmsSelectWidgetOption>();
        List<CmsProject> projects = null;
        try {
            projects = OpenCms.getOrgUnitManager().getAllAccessibleProjects(getCms(), "", true);
        } catch (CmsException e) {
            return result;
        }

        boolean first = true;
        for (CmsProject project : projects) {
            if (!project.getName().equals(CmsProject.ONLINE_PROJECT_NAME)) {
                first = false;
                result.add(new CmsSelectWidgetOption(project.getName(), first, project.getName()));
            }
        }
        return result;
    }
192682
@SuppressWarnings("squid:S1168")
    public String[] selectOptions() {
        if (isNotPresentSelect()) {
            return null;    // returning an empty array could be confused with no options available
        }
        WebElement webElement = element.getWebElement();
        Select dropdown = new Select(webElement);
        List<WebElement> options = dropdown.getOptions();
        String[] stringOptions = new String[options.size()];
        for (int i = 0; i < options.size(); i++) {
            stringOptions[i] = options.get(i).getText();
        }
        return stringOptions;
    }
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();
    }
712089
public Set<String> getTypesWithModifiableFormatters() {

        Set<String> result = new HashSet<String>();
        for (I_CmsResourceType type : OpenCms.getResourceManager().getResourceTypes()) {
            if (type instanceof CmsResourceTypeXmlContent) {
                CmsXmlContentDefinition contentDef = null;
                try {
                    contentDef = CmsXmlContentDefinition.getContentDefinitionForType(getCms(), type.getTypeName());
                    if ((contentDef != null) && contentDef.getContentHandler().hasModifiableFormatters()) {
                        result.add(type.getTypeName());
                    }
                } catch (Exception e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        }
        return result;

    }
163775
@SuppressWarnings("unchecked")
    public CmsList<CmsListItem> getParentList() {

        Widget parent = getParent();
        if (parent == null) {
            return null;
        }
        return (CmsList<CmsListItem>)parent;
    }
972262
private List<CmsSelectWidgetOption> getRoles() {

        List<CmsSelectWidgetOption> roleOptions = new ArrayList<CmsSelectWidgetOption>();
        roleOptions.add(
            new CmsSelectWidgetOption(
                NO_ROLE,
                false,
                Messages.get().getBundle(getLocale()).key(Messages.GUI_USER_EDITOR_NO_ROLE_0)));
        try {
            List<CmsRole> roles = new ArrayList<CmsRole>(
                OpenCms.getRoleManager().getRoles(getCms(), m_paramOufqn, false));
            // ensure the role sorting matches the system roles order
            CmsRole.applySystemRoleOrder(roles);
            for (CmsRole role : roles) {
                roleOptions.add(
                    new CmsSelectWidgetOption(
                        role.getRoleName(),
                        role.getRoleName().equals(CmsRole.ELEMENT_AUTHOR.getRoleName()),
                        role.getDisplayName(getCms(), getLocale())));
            }
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
        return roleOptions;
    }
25223
private static XmlOptions getXmlOptions() {
        if (System.getProperty("runtimeEnv") == null && System.getProperty("mdw.runtime.env") == null)
            return new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(2); // avoid errors when running in Designer

        String[] xmlOptionsProperties = new String[] { PropertyNames.MDW_TRANSLATOR_XMLBEANS_LOAD_OPTIONS,
                PropertyNames.MDW_TRANSLATOR_XMLBEANS_SAVE_OPTIONS };
        /**
         * First set it up with default compatibility options
         */
        xmlOptions = new XmlOptions();

        /**
         * Next get the options that the user needs from the properties file.
         */
        Class<?> xmlOptionsClass = xmlOptions.getClass();

        for (int i = 0; i < xmlOptionsProperties.length; i++) {
            String property = xmlOptionsProperties[i];
            String opt = PropertyManager.getProperty(property);
            /**
             * Only do reflection if we need to
             */
            if (opt != null && !"".equals(opt)) {
                try {
                    String[] propTable = opt.split(",");
                    for (int j = 0; j < propTable.length; j++) {
                        String prop = propTable[j];
                        String[] optTable = prop.split("=");
                        String option = optTable[0];
                        String value = null;

                        Class<?>[] classArray = new Class<?>[] { Object.class };
                        if (optTable.length > 1) {
                            // Check for int
                            value = optTable[1];
                            classArray = new Class<?>[] { Object.class, Object.class };
                            boolean gotInteger = true;
                            try {
                                Integer.parseInt(value);
                            }
                            catch (NumberFormatException e) {
                                // It's not an integer
                                gotInteger = false;
                            }

                            Method method = xmlOptionsClass.getMethod("put", classArray);
                            method.invoke(xmlOptions, new Object[] { option,
                                    gotInteger ? Integer.valueOf(value) : value });

                        }
                        else {

                            Method method = xmlOptionsClass.getMethod("put", classArray);
                            method.invoke(xmlOptions, new Object[] { option });

                        }
                    }
                }
                catch (Exception ex) {
                    // Just log it
                    logger.severeException("Unable to set XMLOption " + opt + " due to " + ex.getMessage(), ex);

                }

            }
        }
        return xmlOptions;

    }
1030605
public List<CmsListItem> getSelectedItems() {

        Iterator<String> it = CmsStringUtil.splitAsList(
            getParamSelItems(),
            CmsHtmlList.ITEM_SEPARATOR,
            true).iterator();
        List<CmsListItem> items = new ArrayList<CmsListItem>();
        while (it.hasNext()) {
            String id = it.next();
            items.add(getList().getItem(id));
        }
        return items;
    }
789178
public List<CmsUUID> getElementIds() {

        if (m_elementIds == null) {
            m_elementIds = new ArrayList<CmsUUID>(m_elements.size());
            for (CmsContainerElementBean element : m_elements) {
                m_elementIds.add(element.getId());
            }
        }
        return m_elementIds;
    }
1329510
private List<I_CmsSearchConfigurationSortOption> getSortOptions() {

        final List<I_CmsSearchConfigurationSortOption> options = new ArrayList<I_CmsSearchConfigurationSortOption>();
        final CmsXmlContentValueSequence sortOptions = m_xml.getValueSequence(XML_ELEMENT_SORTOPTIONS, m_locale);
        if (sortOptions == null) {
            return null;
        } else {
            for (int i = 0; i < sortOptions.getElementCount(); i++) {
                final I_CmsSearchConfigurationSortOption option = parseSortOption(
                    sortOptions.getValue(i).getPath() + "/");
                if (option != null) {
                    options.add(option);
                }
            }
            return options;
        }
    }
757394
public String buildSelectElementName(String attributes) {

        // get the active page elements
        List<CmsDialogElement> elementList = getElementList();

        int counter = 0;
        int currentIndex = -1;
        List<String> options = new ArrayList<String>(elementList.size());
        List<String> values = new ArrayList<String>(elementList.size());
        String elementName = getParamElementname();
        if (CmsStringUtil.isEmpty(elementName)) {
            elementName = getParamOldelementname();
        }
        for (int i = 0; i < elementList.size(); i++) {
            // get the current list element
            CmsDialogElement element = elementList.get(i);

            if (CmsStringUtil.isNotEmpty(elementName) && elementName.equals(element.getName())) {
                // current element is the displayed one, mark it as selected
                currentIndex = counter;
            }
            if ((!m_page.hasValue(element.getName(), getElementLocale()) && element.isMandantory())
                || m_page.isEnabled(element.getName(), getElementLocale())) {
                // add element if it is not available or if it is enabled
                options.add(element.getNiceName());
                values.add(element.getName());
                counter++;
            }
        }
        return buildSelect(attributes, options, values, currentIndex, false);
    }
6785
public CmsXmlContentWidgetVisitor getWidgetCollector() {

        if (m_widgetCollector == null) {
            // create an instance of the widget collector
            m_widgetCollector = new CmsXmlContentWidgetVisitor(getElementLocale());
            m_content.visitAllValuesWith(m_widgetCollector);
        }
        return m_widgetCollector;
    }