Initializes the forbidden template contexts.<p>

@param root the root XML element
@param contentDefinition the content definition
542130
protected void initTemplates(Element root, CmsXmlContentDefinition contentDefinition) {

        String strEnabledByDefault = root.attributeValue(ATTR_ENABLED_BY_DEFAULT);
        m_allowedTemplates.setDefaultMembership(safeParseBoolean(strEnabledByDefault, true));
        List<Node> elements = root.selectNodes(APPINFO_TEMPLATE);
        for (Node elem : elements) {
            boolean enabled = safeParseBoolean(((Element)elem).attributeValue(ATTR_ENABLED), true);
            String templateName = elem.getText().trim();
            m_allowedTemplates.setContains(templateName, enabled);
        }
        m_allowedTemplates.freeze();
    }
1076321
public void registerContentDefinition(CmsContentDefinition definition) {

        getWidgetService().addConfigurations(definition.getConfigurations());
        CmsType baseType = definition.getTypes().get(definition.getEntityTypeName());
        m_entityBackend.registerTypes(baseType, definition.getTypes());
        for (CmsEntity entity : definition.getEntities().values()) {
            CmsEntity previousValue = m_entityBackend.getEntity(entity.getId());
            if (previousValue != null) {
                m_entityBackend.changeEntityContentValues(previousValue, entity);
            } else {
                m_entityBackend.registerEntity(entity);
                m_registeredEntities.add(entity.getId());
            }
        }
        for (Map.Entry<String, CmsComplexWidgetData> entry : definition.getComplexWidgetData().entrySet()) {
            String attrName = entry.getKey();
            CmsComplexWidgetData widgetData = entry.getValue();
            getWidgetService().registerComplexWidgetAttribute(
                attrName,
                widgetData.getRendererName(),
                widgetData.getConfiguration());
        }
    }
1308159
private void initContentView(LayoutInflater inflater, View header, boolean fixedHeader, View footer,
                               boolean fixedFooter, BaseAdapter adapter, int[] padding, int[] margin) {
    View contentView = createView(inflater, header, fixedHeader, footer, fixedFooter, adapter);
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
        ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT
    );
    params.setMargins(margin[0], margin[1], margin[2], margin[3]);
    contentView.setLayoutParams(params);
    getHolderView().setPadding(padding[0], padding[1], padding[2], padding[3]);
    contentContainer.addView(contentView);
  }
1326653
private void initBaseTemplatePath(ServletContext servletContext) {
		if (engine.getSourceFactory() instanceof ClassPathSourceFactory) {
			// do nothing
		} else {
			if (StrKit.isBlank(engine.getBaseTemplatePath())) {
				String path = servletContext.getRealPath("/");
				engine.setBaseTemplatePath(path);
			}
		}
	}
178535
@Override
    public void initialize(ExtensionContext context) {
        // IMPORTANT: Management API version != xsd version! Not all Management API changes result in XSD changes
        SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, InfinispanSchema.CURRENT.getVersion());
        // Create the path resolver handler
        final ResolvePathHandler resolvePathHandler;
        final PathManager pathManager;
        if (context.getProcessType().isServer()) {
            resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager())
                    .setPathAttribute(FileStoreResource.PATH)
                    .setRelativeToAttribute(FileStoreResource.RELATIVE_TO)
                    .build();
            pathManager = context.getPathManager();
        } else {
            resolvePathHandler = null;
            pathManager = null;
        }

        subsystem.registerSubsystemModel(InfinispanSubsystemRootResource.create(resolvePathHandler, pathManager, context.isRuntimeOnlyRegistrationValid()));
        subsystem.registerXMLElementWriter(InfinispanSubsystemXMLWriter::new);
    }
668379
public DTDElement define(Location loc, StructValidator val,
                             int allowedContent)
    {
        verifyUndefined();
        if (allowedContent == XMLValidator.CONTENT_ALLOW_UNDEFINED) { // sanity check
            ExceptionUtil.throwInternal("trying to use CONTENT_ALLOW_UNDEFINED via define()");
        }

        DTDElement elem = new DTDElement(loc, mName, val, allowedContent,
                                         mNsAware, mXml11);

        // Ok, need to copy state collected so far:
        elem.mAttrMap = mAttrMap;
        elem.mSpecAttrList = mSpecAttrList;
        elem.mAnyFixed = mAnyFixed;
        elem.mValidateAttrs = mValidateAttrs;
        elem.mAnyDefaults = mAnyDefaults;
        elem.mIdAttr = mIdAttr;
        elem.mNotationAttr = mNotationAttr;
        elem.mNsDefaults = mNsDefaults;

        return elem;
    }
680878
private void initRequestFromRpcContext(CmsContainerPageRpcContext context) {

        if (context.getTemplateContext() != null) {
            getRequest().setAttribute(
                CmsTemplateContextManager.ATTR_RPC_CONTEXT_OVERRIDE,
                context.getTemplateContext());
        }
    }
94832
protected void initNestedFormatters(Element element, CmsXmlContentDefinition contentDefinition)
    throws CmsXmlException {

        Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(element, APPINFO_NESTED_FORMATTER);
        while (i.hasNext()) {
            // iterate all "default" elements in the "defaults" node
            Element handlerElement = i.next();
            String formatterElement = handlerElement.attributeValue(APPINFO_ATTR_ELEMENT);
            addNestedFormatter(formatterElement, contentDefinition);
        }
    }
887446
protected void init(I_CmsXmlContentContainer container) {

        m_container = container;

        // append to parent element name (required for nested schemas)
        m_element = CmsXmlUtils.concatXpath(m_container.getXmlDocumentElement(), m_element);

        // get loaded content from parent <contentload> tag
        m_content = m_container.getXmlDocument();
        m_locale = m_container.getXmlDocumentLocale();
        m_index = 0;
        m_currentElement = null;

        // the next loop is the first loop
        m_firstLoop = true;
    }
533648
void setContentDefinition(CmsContentDefinition definition) {

        if (m_availableLocales.isEmpty()) {
            // only set the locales when initially setting the content definition
            m_availableLocales.putAll(definition.getAvailableLocales());
            m_contentLocales.addAll(definition.getContentLocales());
        } else {
            m_contentLocales.add(definition.getLocale());
        }
        m_title = definition.getTitle();
        m_sitePath = definition.getSitePath();
        m_resourceTypeName = definition.getResourceType();
        m_registeredEntities.add(definition.getEntityId());
        String tabs = "";
        for (CmsTabInfo info : definition.getTabInfos()) {
            tabs += info.getTabId() + ":" + info.getStartName() + "   ";
        }
        CmsDebugLog.consoleLog("Tabs: " + tabs);
        m_tabInfos = definition.getTabInfos();
        m_iconClasses = definition.getIconClasses();
        addContentDefinition(definition);
        CmsDefaultWidgetService service = (CmsDefaultWidgetService)getWidgetService();
        service.addConfigurations(definition.getConfigurations());
        service.setSyncValues(definition.getSyncValues());
        service.setSkipPaths(definition.getSkipPaths());
        addEntityChangeHandler(definition.getEntityId(), new ValueChangeHandler<CmsEntity>() {

            public void onValueChange(ValueChangeEvent<CmsEntity> event) {

                setChanged();
            }
        });
    }
987184
public void registerContentDefinition(CmsContentDefinition definition) {

        m_widgetService.addConfigurations(definition.getConfigurations());
        CmsType baseType = definition.getTypes().get(definition.getEntityTypeName());
        m_entityBackend.registerTypes(baseType, definition.getTypes());
        m_entityBackend.registerEntity(definition.getEntity());
    }
736863
public void init(CmsObject cms, Locale locale, List<CmsResource> content) {

        m_cms = cms;
        m_locale = locale;
        m_content = convertResourceList(m_cms, m_locale, content);
    }
1159425
protected void initSynchronizations(Element root, CmsXmlContentDefinition contentDefinition) {

        List<Element> elements = new ArrayList<Element>(CmsXmlGenericWrapper.elements(root, APPINFO_SYNCHRONIZATION));
        for (Element element : elements) {
            String elementName = element.attributeValue(APPINFO_ATTR_ELEMENT);
            m_synchronizations.add(elementName);
        }
    }
193996
public void initialize(CmsUUID id, Locale initialComparisonLocale) throws CmsException {

        removeAllComponents();
        CmsObject cms = A_CmsUI.getCmsObject();
        CmsResource res = cms.readResource(id);
        m_currentRoot = res;
        CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(res.getRootPath());

        Locale rootLocale = OpenCms.getLocaleManager().getDefaultLocale(cms, res);
        m_rootLocale = rootLocale;
        Locale mainLocale = site.getMainTranslationLocale(null);
        List<Locale> secondaryLocales = site.getSecondaryTranslationLocales();

        List<Locale> possibleLocaleSelections = getMainLocaleSelectOptions(cms, res, mainLocale, secondaryLocales);
        m_rootLocaleSelector = new ComboBox();
        m_rootLocaleSelector.addStyleName("o-sitemap-localeselect");
        m_rootLocaleSelector.setNullSelectionAllowed(false);
        for (Locale selectableLocale : possibleLocaleSelections) {
            m_rootLocaleSelector.addItem(selectableLocale);
            m_rootLocaleSelector.setItemIcon(selectableLocale, FontOpenCms.SPACE);
            m_rootLocaleSelector.setItemCaption(
                selectableLocale,
                selectableLocale.getDisplayName(A_CmsUI.get().getLocale()));
        }
        m_rootLocaleSelector.setItemIcon(mainLocale, MAIN_LOCALE_ICON);
        m_rootLocaleSelector.setValue(m_rootLocale);
        m_rootLocaleSelector.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            @SuppressWarnings("synthetic-access")
            public void valueChange(ValueChangeEvent event) {

                if (!m_handlingLocaleChange) {
                    m_handlingLocaleChange = true;
                    try {
                        Locale newLocale = (Locale)(event.getProperty().getValue());
                        switchToLocale(newLocale);
                    } catch (Exception e) {
                        LOG.error(e.getLocalizedMessage(), e);
                        CmsErrorDialog.showErrorDialog(e);
                    } finally {
                        m_handlingLocaleChange = false;
                    }
                }
            }
        });

        m_comparisonLocaleSelector = new ComboBox();
        m_comparisonLocaleSelector.addStyleName("o-sitemap-localeselect");
        m_comparisonLocaleSelector.setNullSelectionAllowed(false);

        List<Locale> comparisonLocales = getComparisonLocales();
        Locale selectedComparisonLocale = null;
        for (Locale comparisonLocale : comparisonLocales) {
            m_comparisonLocaleSelector.addItem(comparisonLocale);
            m_comparisonLocaleSelector.setItemIcon(comparisonLocale, FontOpenCms.SPACE);
            m_comparisonLocaleSelector.setItemCaption(
                comparisonLocale,
                comparisonLocale.getDisplayName(A_CmsUI.get().getLocale()));
            if ((selectedComparisonLocale == null) && !comparisonLocale.equals(m_rootLocale)) {
                selectedComparisonLocale = comparisonLocale;
            }
            if ((initialComparisonLocale != null)
                && comparisonLocale.equals(initialComparisonLocale)
                && !comparisonLocale.equals(m_rootLocale)) {
                // if an initial comparison locale is given, it should have priority over the first comparison locale
                selectedComparisonLocale = comparisonLocale;
            }

        }
        m_comparisonLocale = selectedComparisonLocale;
        m_comparisonLocaleSelector.setValue(selectedComparisonLocale);
        m_comparisonLocaleSelector.setItemIcon(mainLocale, MAIN_LOCALE_ICON);

        m_comparisonLocaleSelector.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            @SuppressWarnings("synthetic-access")
            public void valueChange(ValueChangeEvent event) {

                if (!m_handlingLocaleChange) {
                    m_handlingLocaleChange = true;
                    try {
                        Locale locale = (Locale)(event.getProperty().getValue());
                        if (m_rootLocale.equals(locale)) {
                            Locale oldComparisonLocale = m_comparisonLocale;
                            if (getLocaleGroup().getResourcesByLocale().keySet().contains(oldComparisonLocale)) {
                                m_comparisonLocale = locale;
                                switchToLocale(oldComparisonLocale);
                                updateLocaleWidgets();
                            } else {
                                Notification.show(
                                    CmsVaadinUtils.getMessageText(
                                        Messages.GUI_LOCALECOMPARE_CANNOT_SWITCH_COMPARISON_LOCALE_0));
                                m_comparisonLocaleSelector.setValue(oldComparisonLocale);
                            }
                        } else {
                            m_comparisonLocale = locale;
                            updateLocaleWidgets();
                            initTree(m_currentRoot);
                        }

                    } catch (Exception e) {
                        LOG.error(e.getLocalizedMessage(), e);
                        CmsErrorDialog.showErrorDialog(e);
                    } finally {
                        m_handlingLocaleChange = false;
                    }
                }
            }
        });

        CssLayout localeSelectors = new CssLayout();
        localeSelectors.addStyleName(OpenCmsTheme.SITEMAP_LOCALE_BAR);

        m_rootLocaleSelector.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_LOCALECOMPARE_MAIN_LOCALE_0));
        m_comparisonLocaleSelector.setCaption(
            CmsVaadinUtils.getMessageText(Messages.GUI_LOCALECOMPARE_COMPARISON_LOCALE_0));

        localeSelectors.setWidth("100%");
        localeSelectors.addComponent(m_rootLocaleSelector);
        localeSelectors.addComponent(m_comparisonLocaleSelector);
        // localeSelectors.setComponentAlignment(wrapper2, Alignment.MIDDLE_RIGHT);

        setSpacing(true);
        addComponent(localeSelectors);
        addComponent(m_treeContainer);
        m_treeContainer.setWidth("100%");
        initTree(res);
    }
1263232
protected void addMemberDesc(Element member, Content contentTree) {
        TypeElement containing = utils.getEnclosingTypeElement(member);
        String classdesc = utils.getTypeElementName(containing, true) + " ";
        if (utils.isField(member)) {
            Content resource = contents.getContent(utils.isStatic(member)
                    ? "doclet.Static_variable_in"
                    : "doclet.Variable_in", classdesc);
            contentTree.addContent(resource);
        } else if (utils.isConstructor(member)) {
            contentTree.addContent(
                    contents.getContent("doclet.Constructor_for", classdesc));
        } else if (utils.isMethod(member)) {
            Content resource = contents.getContent(utils.isStatic(member)
                    ? "doclet.Static_method_in"
                    : "doclet.Method_in", classdesc);
            contentTree.addContent(resource);
        }
        addPreQualifiedClassLink(LinkInfoImpl.Kind.INDEX, containing,
                false, contentTree);
    }
81888
protected void initContextParam(XmlParser.Node node)
    {
        String name=node.getString("param-name",false,true);
        String value=node.getString("param-value",false,true);
        if(log.isDebugEnabled())
            log.debug("ContextParam: "+name+"="+value);
        getWebApplicationContext().setInitParameter(name,value);
    }
455938
public void addPreEditorConditionDefinition(I_CmsPreEditorActionDefinition preEditorCondition) {

        m_preEditorConditionDefinitions.add(preEditorCondition);
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_EDITOR_PRE_ACTION_2,
                    preEditorCondition.getClass().getName(),
                    preEditorCondition.getResourceTypeName()));
        }
    }