Sets the template field depending on current set site root field(s).<p>
356342
protected void setTemplateField() {

        try {
            CmsProperty template = m_clonedCms.readPropertyObject(
                getSiteRoot(),
                CmsPropertyDefinition.PROPERTY_TEMPLATE,
                false);
            if (template.isNullProperty()) {
                m_simpleFieldTemplate.setValue(null);
            } else {
                m_simpleFieldTemplate.setValue(template.getStructureValue());
            }
        } catch (CmsException e) {
            m_simpleFieldTemplate.setValue(null);
        }
    }
746471
public void configure(CmsObject cms) {

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_TOOLMANAGER_CREATED_0));
        }
        if (m_roots.getObject(ROOTKEY_DEFAULT) == null) {
            CmsToolRootHandler defToolRoot = new CmsToolRootHandler();
            defToolRoot.setKey(ROOTKEY_DEFAULT);
            defToolRoot.setUri(CmsWorkplace.PATH_WORKPLACE + "admin/");
            defToolRoot.setName("${key." + Messages.GUI_ADMIN_VIEW_ROOT_NAME_0 + "}");
            defToolRoot.setHelpText("${key." + Messages.GUI_ADMIN_VIEW_ROOT_HELP_0 + "}");
            addToolRoot(defToolRoot);
        }
        m_tools.clear();
        m_urls.clear();
        Iterator<CmsToolRootHandler> it = getToolRoots().iterator();
        while (it.hasNext()) {
            CmsToolRootHandler toolRoot = it.next();
            if (!cms.existsResource(toolRoot.getUri())) {
                if (CmsLog.INIT.isInfoEnabled()) {
                    CmsLog.INIT.info(
                        Messages.get().getBundle().key(
                            Messages.INIT_TOOLMANAGER_ROOT_SKIPPED_2,
                            toolRoot.getKey(),
                            toolRoot.getUri()));
                }
                continue;
            }
            try {
                toolRoot.setup(cms, null, toolRoot.getUri());
                configureToolRoot(cms, toolRoot);
                // log info
                if (CmsLog.INIT.isInfoEnabled()) {
                    CmsLog.INIT.info(
                        Messages.get().getBundle().key(Messages.INIT_TOOLMANAGER_SETUP_1, toolRoot.getKey()));
                }
            } catch (CmsException e) {
                // log failure
                if (CmsLog.INIT.isWarnEnabled()) {
                    CmsLog.INIT.warn(
                        Messages.get().getBundle().key(Messages.INIT_TOOLMANAGER_SETUP_ERROR_1, toolRoot.getKey()),
                        e);
                }
            }
        }
    }
399596
protected void initFields(Element parent, CmsXmlContentDefinition contentDef) throws CmsXmlException {

        for (Element fieldElem : parent.elements(N_SETTING)) {
            initField(fieldElem, contentDef);
        }
    }
1177423
public void setSearchRoots(List<String> searchRoots) {

        if ((searchRoots != null) && !searchRoots.isEmpty()) {
            addFilterQuery(CmsSearchField.FIELD_PARENT_FOLDERS, searchRoots, false, true);
        }
    }
8104
public final void setTemplate() {
        template = new HashMap();
        if (isEventExist()) {
            template.putAll(events.get(next));
        }
        template.put("event", eventType);
    }
512419
private void setFolderTitle(CmsResource res) {

        try {
            CmsProperty titleProperty = m_cms.readPropertyObject(res, CmsPropertyDefinition.PROPERTY_TITLE, false);
            if (!titleProperty.isNullProperty()) {
                titleProperty.setValue(m_site.getTitle(), CmsProperty.TYPE_INDIVIDUAL);
                m_cms.writePropertyObject(res.getRootPath(), titleProperty);
            } else {
                LOG.error("Editing title property of site root resource was not possible");
                getReport().println(
                    Messages.get().container(Messages.RPT_SITE_ERROR_TITLE_0),
                    I_CmsReport.FORMAT_ERROR);
            }
        } catch (CmsException e) {
            LOG.error("Editing title property of site root resource was not possible", e);
            getReport().println(Messages.get().container(Messages.RPT_SITE_ERROR_TITLE_0), I_CmsReport.FORMAT_ERROR);
            getReport().println(e);
        }

    }
908011
public final void setTemplateMode(final TemplateMode templateMode) {
        Validate.notNull(templateMode, "Cannot set a null template mode value");
        // We re-parse the specified template mode so that we make sure we get rid of deprecated values
        this.templateMode = TemplateMode.parse(templateMode.toString());
    }
836812
public void setFields(String fields) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(fields)) {
            throw new CmsIllegalStateException(Messages.get().container(Messages.ERR_VALIDATE_SEARCH_PARAMS_0));
        }
        m_fields = fields;
    }
1226490
private void setFieldIf(int key, String value, String undef) {
    if (value == null) {
      this.fields[key] = value;
    } else {
      // Special case for language: replace BCP 47 field "root" with undefined value.
      if (key == LANGUAGE && value.equals("root")) {
        this.fields[key] = null;
      } else {
        this.fields[key] = value.equals("") || value.equals(undef) ? null : value;
      }
    }
  }
386654
public void setRoot(int root)
  {
    // %OPT% Get this directly from the lpi.
    XPathContext xctxt = wi().getXPathContext();
    m_dtm = xctxt.getDTM(root);
    m_traverser = m_dtm.getAxisTraverser(m_axis);
    m_isFresh = true;
    m_foundLast = false;
    m_root = root;
    m_currentNode = root;

    if (DTM.NULL == root)
    {
      throw new RuntimeException(
        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL, null)); //"\n !!!! Error! Setting the root of a walker to null!!!");
    }

    resetProximityPositions();
  }
798849
private CmsResource createSiteRootIfNeeded(String siteRoot) throws CmsException {

        CmsResource siteRootResource = null;

        // check if the site root already exists
        try {
            // take the existing site and do not perform any OU related actions
            if (m_cms.existsResource(siteRoot)) {
                siteRootResource = m_cms.readResource(siteRoot);
            } else {
                CmsResource onlineVersion = m_cmsOnline.readResource(siteRoot);
                siteRootResource = m_cms.readResource(onlineVersion.getStructureId());
            }

        } catch (CmsVfsResourceNotFoundException e) {
            // not create a new site folder and the according OU if option is checked checked
            getReport().println(
                Messages.get().container(Messages.RPT_SITE_CREATE_RESOURCES_0),
                I_CmsReport.FORMAT_DEFAULT);
            I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(
                CmsResourceTypeFolderSubSitemap.TYPE_SUBSITEMAP);
            siteRootResource = m_cms.createResource(siteRoot, type);
            CmsProperty folderTitle = new CmsProperty(
                CmsPropertyDefinition.PROPERTY_TITLE,
                m_site.getTitle(),
                m_site.getTitle());
            m_cms.writePropertyObject(siteRoot, folderTitle);

        }
        return siteRootResource;
    }
1363036
private void setUpDefaultUriComboBox(List<CmsSite> allSites) {

        BeanItemContainer<CmsSite> objects = new BeanItemContainer<CmsSite>(CmsSite.class, allSites);
        m_fieldDefaultURI.setContainerDataSource(objects);
        m_fieldDefaultURI.setNullSelectionAllowed(false);
        m_fieldDefaultURI.setTextInputAllowed(false);
        m_fieldDefaultURI.setItemCaptionPropertyId("title");

        //set value
        String siteRoot = OpenCms.getSiteManager().getDefaultUri();
        if (siteRoot.endsWith("/")) {
            siteRoot = siteRoot.substring(0, siteRoot.length() - 1);
        }
        CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot(siteRoot);
        m_fieldDefaultURI.setValue(site);
    }
727447
private void setUpSharedFolderComboBox() {

        m_fieldSharedFolder.setNullSelectionAllowed(false);
        m_fieldSharedFolder.setTextInputAllowed(false);
        try {
            List<CmsResource> folderUnderRoot = m_cms.readResources("/", CmsResourceFilter.DEFAULT_FOLDERS, false);
            for (CmsResource folder : folderUnderRoot) {
                if (!m_forbiddenFolder.contains(folder.getRootPath())) {
                    m_fieldSharedFolder.addItem(folder.getRootPath().replace("/", ""));
                }
            }
        } catch (CmsException e) {
            LOG.error("Error reading resource.", e);
        }
    }
63905
public void setTemplateVars(List<TemplateVar> templateVars) {
		this.templateVars.clear();
		if(templateVars != null && !templateVars.isEmpty()) {
			this.templateVars.addAll(templateVars);
		}
	}
760514
private void buildField(
        Map<String, CmsClientProperty> ownProps,
        final String propName,
        CmsClientProperty.Mode mode) {

        String entryId = m_handler.getId().toString();
        CmsXmlContentProperty propDef = m_propertyConfig.get(propName);

        if (propDef == null) {
            String widget = CmsClientProperty.PROPERTY_TEMPLATE.equals(propName) ? "template" : "string";
            propDef = new CmsXmlContentProperty(
                propName,
                "string",
                widget,
                "",
                null,
                null,
                null,
                null,
                null,
                null,
                null);
        }

        if (mode != Mode.effective) {
            propDef = propDef.withNiceName(propName);
        }

        CmsClientProperty ownProp = m_properties.get(propName);
        CmsPathValue pathValue = CmsClientProperty.getPathValue(ownProp, mode).prepend(entryId + "/" + propName + "/");

        //CHECK: should fields other than NavText be really automatically allowed to be empty in navigation mode?
        final String tab = tabs.get(mode);
        final CmsBasicFormField field = CmsBasicFormField.createField(
            propDef,
            pathValue.getPath() + "#" + tab,
            this,
            Collections.<String, String> emptyMap(),
            true);

        CmsPair<String, String> defaultValueAndOrigin = getDefaultValueToDisplay(ownProp, mode);
        String defaultValue = "";
        String origin = "";
        if (defaultValueAndOrigin != null) {
            defaultValue = defaultValueAndOrigin.getFirst();
            origin = defaultValueAndOrigin.getSecond();
        }
        final Widget w = (Widget)field.getWidget();
        I_CmsStringModel model = getStringModel(pathValue);
        field.bind(model);
        boolean ghost = CmsStringUtil.isEmptyOrWhitespaceOnly(pathValue.getValue());
        String initialValue = pathValue.getValue();
        if (w instanceof I_CmsHasGhostValue) {
            ((I_CmsHasGhostValue)w).setGhostValue(defaultValue, ghost);
            if (ghost) {
                initialValue = null;
            }
        }
        if (w instanceof HasFocusHandlers) {
            try {
                ((HasFocusHandlers)w).addFocusHandler(new FocusHandler() {

                    @SuppressWarnings("synthetic-access")
                    public void onFocus(FocusEvent event) {

                        if ((w instanceof CmsTextBox) || (w instanceof CmsTextArea)) {
                            m_activeFieldData = new CmsActiveFieldData(field, tab, propName);
                        } else {
                            // field received focus, but it doesn't make sense to restore it later
                            m_activeFieldData = null;
                        }
                    }
                });
            } catch (Exception e) {
                CmsDebugLog.consoleLog("" + e);
            }

        }

        boolean isShowingGhost = ghost && !CmsStringUtil.isEmpty(defaultValue);

        if (isShowingGhost) {
            field.getLayoutData().put("info", origin);
        }
        if (!ghost || isShowingGhost) {
            field.getLayoutData().put(CmsPropertyPanel.LD_DISPLAY_VALUE, "true");
        }
        field.getLayoutData().put(CmsPropertyPanel.LD_PROPERTY, propName);
        field.getLayoutData().put("tab", tab);
        m_form.addField(tab, field, initialValue);
    }
75326
public void clear(CmsObject cms, String siteRoot) {

        CmsUser originalUser = m_map.getIfPresent(siteRoot);
        if ((originalUser == null) || !originalUser.equals(cms.getRequestContext().getCurrentUser())) {
            return;
        }
        m_map.invalidate(siteRoot);
    }
1205800
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, CONTACT_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PERSON_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, MESSAGE_TRANSPORT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, MESSAGE_PROCESS_INFO_ID, 60, null, null);
        field.setDataClass(Integer.class);
        //field = new FieldInfo(this, DESTINATION_SITE, 127, null, null);
        //field = new FieldInfo(this, DESTINATION_PATH, 127, null, null);
        //field = new FieldInfo(this, RETURN_SITE, 127, null, null);
        //field = new FieldInfo(this, RETURN_PATH, 127, null, null);
        //field = new FieldInfo(this, XSLT_DOCUMENT, 127, null, null);
        //field = new FieldInfo(this, DEFAULT_MESSAGE_VERSION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //field.setDataClass(Integer.class);
        field = new FieldInfo(this, DEFAULT_MESSAGE_TRANSPORT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        //field = new FieldInfo(this, INITIAL_MANUAL_TRANSPORT_STATUS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //field.setDataClass(Integer.class);
    }