Sets the fields for a given site (m_site).<p>

@param enableAll if true, the site is editable
333734
private void setFieldsForSite(boolean enableAll) {

        try {
            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_site.getSiteRoot())) {
                CmsProperty prop = m_clonedCms.readPropertyObject(
                    m_site.getSiteRoot(),
                    CmsPropertyDefinition.PROPERTY_TEMPLATE,
                    false);
                if (!prop.isNullProperty()) {
                    if (!m_templates.contains(prop.getValue())) {
                        m_simpleFieldTemplate.addItem(prop.getValue());
                    }
                    m_simpleFieldTemplate.select(prop.getValue());
                } else {
                    if (!m_templates.isEmpty()) {
                        m_simpleFieldTemplate.setValue(m_templates.get(0).getRootPath());
                    }
                }
                m_simpleFieldTemplate.setEnabled(enableAll);
            }
        } catch (CmsException e) {
            LOG.error("Unable to read template property.", e);
        }

        m_simpleFieldSiteRoot.setVisible(true);
        m_simpleFieldSiteRoot.setValue(m_site.getSiteRoot());
        m_simpleFieldSiteRoot.setCmsObject(m_clonedCms);
        m_simpleFieldSiteRoot.addValidator(new SiteRootValidator());
        m_simpleFieldSiteRoot.setEnabled(enableAll);
        m_simpleFieldSiteRoot.addValueChangeListener(new ValueChangeListener() {

            /**vaadin serial id. */
            private static final long serialVersionUID = 4680456758446195524L;

            public void valueChange(ValueChangeEvent event) {

                setTemplateField();
                checkOnOfflineSiteRoot();
            }

        });
        m_simpleFieldParentFolderName.setVisible(false);
        m_simpleFieldFolderName.setVisible(false);

        displayResourceInfoDirectly(
            Collections.singletonList(
                new CmsResourceInfo(
                    m_site.getTitle(),
                    m_site.getSiteRoot(),
                    m_manager.getFavIcon(m_site.getSiteRoot()))));

        m_tab.removeTab(m_tab.getTab(4));
        m_simpleFieldTitle.removeTextChangeListener(null);
        m_simpleFieldTitle.setEnabled(enableAll);
        m_simpleFieldParentFolderName.setEnabled(false);
        m_simpleFieldParentFolderName.setValue(
            m_site.getSiteRoot().substring(
                0,
                m_site.getSiteRoot().length()
                    - m_site.getSiteRoot().split("/")[m_site.getSiteRoot().split("/").length - 1].length()));

        m_simpleFieldFolderName.removeAllValidators(); //can not be changed
        m_fieldCreateOU.setVisible(false);

        m_alreadyUsedURL.remove(m_site.getSiteMatcher().forDifferentScheme("https")); //Remove current url to avoid validation problem
        m_alreadyUsedURL.remove(m_site.getSiteMatcher().forDifferentScheme("http"));

        setFieldTitle(m_site.getTitle());
        setFieldFolder(getFolderNameFromSiteRoot(m_site.getSiteRoot()));
        m_simpleFieldFolderName.setEnabled(false);
        m_simpleFieldTitle.setEnabled(enableAll);

        setFieldServer(m_site.getUrl());
        m_simpleFieldServer.setEnabled(enableAll);
        if (m_site.hasSecureServer()) {
            m_fieldSecureServer.setValue(m_site.getSecureUrl());
        }
        if (m_site.getErrorPage() != null) {
            m_fieldErrorPage.setValue(m_site.getErrorPage());
        }
        m_fieldWebServer.setValue(new Boolean(m_site.isWebserver()));
        m_fieldWebServer.setEnabled(enableAll);
        m_fieldExclusiveURL.setValue(new Boolean(m_site.isExclusiveUrl()));
        m_fieldExclusiveURL.setEnabled(enableAll);
        m_fieldExclusiveError.setValue(new Boolean(m_site.isExclusiveError()));
        m_fieldExclusiveError.setEnabled(enableAll);

        Map<String, String> siteParameters = m_site.getParameters();
        for (Entry<String, String> parameter : siteParameters.entrySet()) {
            addParameter(getParameterString(parameter));
        }

        List<CmsSiteMatcher> siteAliases = m_site.getAliases();

        for (CmsSiteMatcher siteMatcher : siteAliases) {
            if (enableAll) {
                m_aliasGroup.addRow(createAliasComponent(siteMatcher.getUrl(), siteMatcher.isRedirect()));
            } else {
                Component c = createAliasComponent(siteMatcher.getUrl(), siteMatcher.isRedirect());
                c.setEnabled(false);
                m_aliases.addComponent(c);
            }
        }

        setTemplateField();

        setUpComboBoxPosition();

        if (!m_fieldSecureServer.isEmpty()) {
            m_fieldExclusiveURL.setEnabled(true && enableAll);
            m_fieldExclusiveError.setEnabled(true && enableAll);
        }
        setFaviconIfExist();
        checkOnOfflineSiteRoot();
        m_fieldUploadFavIcon.setVisible(false);
        m_simpleFieldEncryption.setContainerDataSource(getSSLModeContainer("caption", true, m_site.getSSLMode()));
        m_simpleFieldEncryption.select(m_site.getSSLMode());
        m_simpleFieldEncryption.setEnabled(enableAll);

        m_fieldErrorPage.setEnabled(enableAll);
        m_addParameter.setVisible(enableAll);
        m_fieldPosition.setEnabled(enableAll);
    }
690891
private void addServer(CmsSiteMatcher matcher, CmsSite site) {

        Map<CmsSiteMatcher, CmsSite> siteMatcherSites = new HashMap<CmsSiteMatcher, CmsSite>(m_siteMatcherSites);
        siteMatcherSites.put(matcher, site);
        setSiteMatcherSites(siteMatcherSites);
    }
1127730
function(site) {
		this._detachListeners();
		this._modelListeners = this._modelListeners || [];

		var editor = this;
		function bindText(widget, modelField) {
			function commitWidgetValue(event) {
				var value = widget.value; //$NON-NLS-0$
				var oldValue = site[modelField];
				site[modelField] = value;
				var isChanged = oldValue !== value;
				editor.setDirty(isChanged || editor.isDirty());
			}
			widget.addEventListener("input", commitWidgetValue); //$NON-NLS-0$
			editor._modelListeners.push({target: widget, type: "input", listener: commitWidgetValue}); //$NON-NLS-0$
		}

		bindText(this.name, messages["Name"]);
		bindText(this.hostHint, messages["HostHint"]);

		var dirtyListener = function(dirtyEvent) {
			editor.setDirty(dirtyEvent.value);
		};
		this.mappings.addEventListener("dirty", dirtyListener); //$NON-NLS-0$
		this._modelListeners.push({target: this.mappings, type: "dirty", listener: dirtyListener}); //$NON-NLS-0$
	}
536069
private void setServerLayout(final List<CmsSite> sites) {

        m_workplaceServerGroup = new CmsEditableGroup(m_serverLayout, new Supplier<Component>() {

            public Component get() {

                CmsWorkplaceServerWidget row = new CmsWorkplaceServerWidget(sites, null);
                return row;
            }
        }, "Add");

        for (String server : OpenCms.getSiteManager().getWorkplaceServers()) {
            CmsWorkplaceServerWidget row = new CmsWorkplaceServerWidget(sites, server);
            m_workplaceServerGroup.addRow(row);
        }
    }
37841
public static function enableAll()
    {
        $app = Application::getFacadeApplication();
        $app->make('cache/request')->enable();
        $app->make('cache/expensive')->enable();
        $app->make('cache')->enable();
    }
619557
public void updateSite(String siteRoot) {

        try {
            CmsObject cloneCms = OpenCms.initCmsObject(m_cms);
            if (siteRoot == null) {
                siteRoot = "/system";
            }
            cloneCms.getRequestContext().setSiteRoot(siteRoot);
            m_cms = cloneCms;
        } catch (CmsException e1) {
            LOG.error(e1.getLocalizedMessage(), e1);
        }
        updateValidation();
    }
716051
public void setEnablecfoutputonly(Object enablecfoutputonly) throws PageException {
	if (enablecfoutputonly instanceof String && Caster.toString(enablecfoutputonly).trim().equalsIgnoreCase("reset")) {
	    pageContext.setCFOutputOnly((short) 0);
	}
	else {
	    pageContext.setCFOutputOnly(Caster.toBooleanValue(enablecfoutputonly));
	}
    }
1306708
@BuilderMethod
    public void setReportField(@NonNull ReportField field, boolean enable) {
        this.reportContentChanges.put(field, enable);
    }
308562
@Override
    public void setEnabled(boolean enabled) {
        context.setEnabled(enabled);
        thisTable.setEnabled(enabled);
        localsTable.setEnabled(enabled);
        evaluator.setEnabled(enabled);
        cmdLine.setEnabled(enabled);
    }
762765
private void initFields() {

        CmsObject cms = A_CmsUI.getCmsObject();
        boolean online = cms.getRequestContext().getCurrentProject().isOnlineProject();

        if (m_searchPattern.getValue().isEmpty()) {
            m_searchPattern.setValue(REGEX_ALL);
        }
        m_resourceSearch.setUseRootPaths(true);
        m_replaceResource.setUseRootPaths(true);
        m_resourceSearch.requireFile();
        m_replaceResource.requireFile();
        CmsObject rootCms;
        try {
            rootCms = OpenCms.initCmsObject(cms);

            rootCms.getRequestContext().setSiteRoot("");
            m_resourceSearch.setCmsObject(rootCms);
            m_resourceSearch.setDefaultPath(cms.getRequestContext().getSiteRoot());
            m_replaceResource.setCmsObject(rootCms);
            m_replaceResource.setDefaultPath(cms.getRequestContext().getSiteRoot());

        } catch (CmsException e1) {
            //
        }
        m_siteSelect.setContainerDataSource(
            CmsVaadinUtils.getAvailableSitesContainer(cms, CmsVaadinUtils.PROPERTY_LABEL));
        m_siteSelect.setItemCaptionPropertyId(CmsVaadinUtils.PROPERTY_LABEL);
        m_siteSelect.setTextInputAllowed(true);
        m_siteSelect.setNullSelectionAllowed(false);
        m_siteSelect.setFilteringMode(FilteringMode.CONTAINS);
        m_siteSelect.setValue(cms.getRequestContext().getSiteRoot());
        try {
            for (CmsPropertyDefinition prop : A_CmsUI.getCmsObject().readAllPropertyDefinitions()) {
                m_property.addItem(prop);
                m_property.setItemCaption(prop, prop.getName());
            }
        } catch (CmsException e) {
            //
        }
        m_siteSelect.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = -1079794209679015125L;

            public void valueChange(ValueChangeEvent event) {

                try {
                    updateSearchRoot();
                } catch (CmsException e) {
                    LOG.error("Unable to initialize CmsObject", e);
                }
            }

        });
        m_property.setNullSelectionAllowed(false);
        m_property.select(m_property.getItemIds().iterator().next());
        m_property.setFilteringMode(FilteringMode.CONTAINS);
        m_searchType.setFilteringMode(FilteringMode.OFF);
        m_searchType.setNullSelectionAllowed(false);
        m_searchType.addItem(SearchType.fullText);
        m_searchType.setItemCaption(
            SearchType.fullText,
            CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_SERACH_TYPE_FULLTEXT_0));
        m_searchType.addItem(SearchType.contentValues);
        m_searchType.setItemCaption(
            SearchType.contentValues,
            CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_SERACH_TYPE_XMLCONTENT_0));
        m_searchType.addItem(SearchType.properties);
        m_searchType.setItemCaption(
            SearchType.properties,
            CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_PROPERTY_SEARCH_0));
        m_searchType.addItem(SearchType.resourcetype);
        m_searchType.setItemCaption(
            SearchType.resourcetype,
            CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_RESOURCE_SEARCH_0));
        m_searchType.addItem(SearchType.renameContainer);
        m_searchType.setItemCaption(
            SearchType.renameContainer,
            CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_RENAME_CONTAINER_SEARCH_0));
        if (OpenCms.getSearchManager().getSolrServerConfiguration().isEnabled()) {

            m_searchIndex.setFilteringMode(FilteringMode.OFF);
            m_searchIndex.setNullSelectionAllowed(false);
            String selectIndex = null;
            for (CmsSearchIndex index : OpenCms.getSearchManager().getAllSolrIndexes()) {
                boolean offlineMode = I_CmsSearchIndex.REBUILD_MODE_OFFLINE.equals(index.getRebuildMode());
                // in case the current project is offline, show offline indexes, otherwise show online indexes
                if ((!online && offlineMode) || (online && !offlineMode)) {
                    m_searchIndex.addItem(index.getName());
                    if (selectIndex == null) {
                        selectIndex = index.getName();
                    }
                }
            }
            if (selectIndex != null) {
                m_searchIndex.setValue(selectIndex);

                // only add the solr search types if there is an index available
                m_searchType.addItem(SearchType.solr);
                m_searchType.setItemCaption(
                    SearchType.solr,
                    CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_SERACH_TYPE_SOLR_0));
                m_searchType.addItem(SearchType.solrContentValues);
                m_searchType.setItemCaption(
                    SearchType.solrContentValues,
                    CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_SERACH_TYPE_SOLR_CONTENT_VALUES_0));

            }
        }
        m_searchType.setValue(SearchType.fullText);

        m_searchRoot.setValue("/");
        m_searchRoot.disableSiteSwitch();
        m_searchRoot.setResourceFilter(CmsResourceFilter.DEFAULT_FOLDERS);
        m_searchRoot.requireFolder();
        m_locale.setFilteringMode(FilteringMode.OFF);
        for (Locale locale : OpenCms.getLocaleManager().getAvailableLocales()) {
            m_locale.addItem(locale);
        }

        m_resourceType.setNullSelectionAllowed(true);
        IndexedContainer resTypes = CmsVaadinUtils.getResourceTypesContainer();
        resTypes.addContainerFilter(CmsVaadinUtils.FILTER_NO_FOLDERS);

        m_resourceType.setContainerDataSource(resTypes);
        m_resourceType.setItemCaptionPropertyId(PropertyId.caption);
        m_resourceType.setItemIconPropertyId(PropertyId.icon);
        m_resourceType.setFilteringMode(FilteringMode.CONTAINS);

        m_workProject.setNullSelectionAllowed(false);
        IndexedContainer projects = CmsVaadinUtils.getProjectsContainer(A_CmsUI.getCmsObject(), "caption");
        projects.removeItem(CmsProject.ONLINE_PROJECT_ID);
        m_workProject.setContainerDataSource(projects);
        m_workProject.setItemCaptionPropertyId("caption");

        if (online) {
            m_replace.setEnabled(false);
        } else {
            m_workProject.setValue(cms.getRequestContext().getCurrentProject().getUuid());
        }
    }
1143409
@Override
    public void setComponentEnabled(boolean enabled) {
        super.setComponentEnabled(enabled);

        boolean enable = enabled && getModel().getRowCount() > 0;
        enableAllButton.setEnabled(enable);
        disableAllButton.setEnabled(enable);
    }
1153978
private void addAll(final List<Field> l, final Field[] fields) {
        for (final Field field : fields) {
            field.setAccessible(true);
            l.add(field);
        }
    }
476578
public void setEnabled(boolean enabled) {

        if (m_frozen) {
            throw new CmsRuntimeException(Messages.get().container(Messages.ERR_CONFIG_SUBSCRIPTIONMANAGER_FROZEN_0));
        }
        m_enabled = enabled;
    }
804401
private void initSite() {

        Object o = null;
        if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
            // this is the initial dialog call
            if (CmsStringUtil.isNotEmpty(m_paramSites)) {
                // edit an existing site, get it from manager
                o = OpenCms.getSiteManager().getSiteForSiteRoot(m_paramSites);
            }
        } else {
            // this is not the initial call, get site from session
            o = getDialogObject();
        }
        if (o instanceof CmsSite) {
            // reuse site stored in session
            m_site = new CmsSiteBean((CmsSite)o);
        } else if (o instanceof CmsSiteBean) {
            // create a new site
            m_site = (CmsSiteBean)o;
        } else if (DIALOG_NEW.equals(getParamEditaction())) {
            m_site = new CmsSiteBean();
        } else {
            try {
                getToolManager().jspForwardTool(this, "/sites", new HashMap<String, String[]>());
            } catch (Exception e) {
                // noop
            }
        }

        if (!m_site.hasSecureServer()) {
            m_site.setSecureUrl("");
        }
        try {
            CmsObject clone = OpenCms.initCmsObject(getCms());
            clone.getRequestContext().setSiteRoot("");
            String iconPath = m_site.getSiteRoot() + "/" + CmsSiteFaviconDialog.ICON_NAME;
            if (clone.existsResource(iconPath)) {
                m_site.setFavicon(iconPath);
            }
        } catch (Throwable t) {
            // noop
        }

        if (m_site.getSiteRoot() != null) {
            setSitename(CmsResource.getName(m_site.getSiteRoot()));
        }

        CmsModule module = OpenCms.getModuleManager().getModule(MODULE_NAME);
        m_createou = Boolean.valueOf(module.getParameter(PARAM_CREATE_OU, Boolean.FALSE.toString())).booleanValue();
        m_ouDescription = module.getParameter(PARAM_OU_DESCRIPTION, "OU for: %(site)");
        setDialogObject(m_site);
    }
1373878
private void setListEnabled(CmsList<? extends I_CmsListItem> list, boolean enabled, String disabledReason) {

        for (Widget child : list) {
            CmsTreeItem treeItem = (CmsTreeItem)child;
            if (enabled) {
                treeItem.getCheckBox().enable();
            } else {
                treeItem.getCheckBox().disable(disabledReason);
            }
            setListEnabled(treeItem.getChildren(), enabled, disabledReason);
        }
    }
413590
private void initFields() {

        m_latitudeField.setTriggerChangeOnKeyPress(true);
        m_longitudeField.setTriggerChangeOnKeyPress(true);
        m_heightField.setTriggerChangeOnKeyPress(true);
        m_widthField.setTriggerChangeOnKeyPress(true);
    }
306854
public void enable() {

        if (!m_isEnabled) {
            m_isEnabled = true;
            m_disabledReason = null;
            m_scrollList.removeStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().disabled());
            setListEnabled(m_scrollList, true, null);
        }
    }