Initializes the formatters for this content handler.<p>

@param root the "formatters" element from the appinfo node of the XML content definition
@param contentDefinition the content definition the formatters belong to
513853
protected void initFormatters(Element root, CmsXmlContentDefinition contentDefinition) {

        // reading the include resources common for all formatters
        Iterator<Element> itFormatter = CmsXmlGenericWrapper.elementIterator(root, APPINFO_FORMATTER);
        while (itFormatter.hasNext()) {
            // iterate all "formatter" elements in the "formatters" node
            Element element = itFormatter.next();
            String type = element.attributeValue(APPINFO_ATTR_TYPE);
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(type)) {
                // if not set use "*" as default for type
                type = CmsFormatterBean.WILDCARD_TYPE;
            }
            String jspRootPath = element.attributeValue(APPINFO_ATTR_URI);
            String minWidthStr = element.attributeValue(APPINFO_ATTR_MINWIDTH);
            String maxWidthStr = element.attributeValue(APPINFO_ATTR_MAXWIDTH);
            String preview = element.attributeValue(APPINFO_ATTR_PREVIEW);
            String searchContent = element.attributeValue(APPINFO_ATTR_SEARCHCONTENT);
            m_formatters.add(
                new CmsFormatterBean(
                    type,
                    jspRootPath,
                    minWidthStr,
                    maxWidthStr,
                    preview,
                    searchContent,
                    contentDefinition.getSchemaLocation()));
        }
    }
947152
public void visitTypes(CmsXmlContentDefinition xmlContentDefinition, Locale messageLocale) {

        m_rootContentDefinition = xmlContentDefinition;
        m_contentHandler = xmlContentDefinition.getContentHandler();
        CmsMessages messages = null;
        m_messages = new CmsMultiMessages(messageLocale);
        m_messages.setFallbackHandler(xmlContentDefinition.getContentHandler().getMessageKeyHandler());

        try {
            messages = OpenCms.getWorkplaceManager().getMessages(messageLocale);
            if (messages != null) {
                m_messages.addMessages(messages);
            }
            messages = m_contentHandler.getMessages(messageLocale);
            if (messages != null) {
                m_messages.addMessages(messages);
            }
        } catch (Exception e) {
            // may happen during start up
            LOG.debug(e.getMessage(), e);
        }
        // generate a new multi messages object and add the messages from the workplace

        m_attributeConfigurations = new HashMap<String, CmsAttributeConfiguration>();
        m_widgetConfigurations = new HashMap<String, CmsExternalWidgetConfiguration>();
        m_registeredTypes = new HashMap<String, CmsType>();
        m_localeSynchronizations = new ArrayList<String>();
        m_dynamicallyLoaded = new ArrayList<String>();
        m_tabInfos = collectTabInfos(xmlContentDefinition);
        readTypes(xmlContentDefinition, "");
    }
367146
public void cacheContentDefinition(String systemId, CmsXmlContentDefinition contentDefinition) {

        String cacheKey = getCacheKeyForCurrentProject(systemId);
        m_cacheContentDefinitions.put(cacheKey, contentDefinition);
        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_ERR_CACHED_SYSTEM_ID_1, cacheKey));
        }
    }
330031
private void buildDefinitionTitle(MarkupDocBuilder markupDocBuilder, String title, String anchor) {
        markupDocBuilder.sectionTitleWithAnchorLevel2(title, anchor);
    }
220051
private void initialize(final Reader xmlFileStream) {

        // Build a DOM model.
        final Document parsedDocument = XsdGeneratorHelper.parseXmlStream(xmlFileStream);

        // Process the DOM model.
        XsdGeneratorHelper.process(parsedDocument.getFirstChild(), true, new NamespaceAttributeNodeProcessor());
    }
332553
private void initDescriptor() throws CmsXmlException, CmsException {

        if (m_bundleType.equals(CmsMessageBundleEditorTypes.BundleType.DESCRIPTOR)) {
            m_desc = m_resource;
        } else {
            //First try to read from same folder like resource, if it fails use CmsMessageBundleEditorTypes.getDescriptor()
            try {
                m_desc = m_cms.readResource(m_sitepath + m_basename + CmsMessageBundleEditorTypes.Descriptor.POSTFIX);
            } catch (CmsVfsResourceNotFoundException e) {
                m_desc = CmsMessageBundleEditorTypes.getDescriptor(m_cms, m_basename);
            }
        }
        unmarshalDescriptor();

    }
5166
@Override
    public void init(Configuration conf) {
        String rootName = conf.get(ConfigConstants.CONF_DELIMITED_ROOT_NAME, 
                DEFAULT_ROOT_NAME);
        rootStart = '<' + rootName + '>';
        rootEnd = "</" + rootName + '>';
        
    }
116880
public void init(
            Document iddDoc,
            Document extensionDoc,
            final String service,
            String packageName,
            final String basedir,
            final String genSrcDir,
            final Log log,
            final String outputDir,
            boolean client,
            boolean server)
            throws Exception {

        try {
            output = new File(basedir, genSrcDir);
            if (outputDir != null) {
                iDDOutputDir = new File(basedir+"/"+outputDir);
                if (!iDDOutputDir.exists()) {
                    if (!iDDOutputDir.mkdirs()) {
                        throw new IllegalArgumentException("IDD Output Directory "+iDDOutputDir+" could not be created");
                    }
                }
                if (!iDDOutputDir.isDirectory() || (!iDDOutputDir.canWrite())) {
                    throw new IllegalArgumentException("IDD Output Directory "+iDDOutputDir+" is not a directory or cannot be written to.");
                }
            }
            config = new Configuration();
            config.setClassForTemplateLoading(IDLReader.class, "/templates");

            config.setStrictSyntaxMode(true);
            this.log = log;
            this.packageName = packageName;
            this.service = service;
            this.client = client;
            this.server = server || !client; // server must be true if client if false.

            dataModel = NodeModel.wrap(iddDoc.cloneNode(true));

            if (extensionDoc != null) {
                NodeModel extensionModel = NodeModel.wrap(extensionDoc);
                mergeExtensionsIntoDocument(getRootNode(dataModel),
                        getRootNode(extensionModel));
                removeUndefinedOperations(getRootNode(dataModel),
                        getRootNode(extensionModel));
            }
            if(log.isDebugEnabled()) {
                log.debug(serialize());
            }
        } catch (final Exception e) {
            log.error("Failed to initialise FTL", e);
            throw e;
        }
    }
1304641
public void setContentType(String contentType)
  {
    _contentType = contentType;

    if (_contentType.equals("text/xml"))
      _strategy = XML;
    if (_contentType.equals("application/xml"))
      _strategy = XML;
    else if (_contentType.equals("text/xhtml"))
      _strategy = XHTML;
    else if (_contentType.equals("application/xhtml+xml"))
      _strategy = XHTML;
    else if (_contentType.equals("text/html"))
      _strategy = HTML;
    else
      _strategy = XML;
  }
936772
public void init(CmsObject cms, Locale locale, I_CmsXmlDocument content, CmsResource resource) {

        m_cms = cms;
        m_requestedLocale = locale;
        m_content = content;
        m_resource = resource;
    }
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);
  }
1312007
private final void init() {
        InputStream in = null;

        try {
            URL url =
                this.getClass()
                    .getClassLoader()
                    .getResource("padawan.conf.xml");

            if (url != null) {
                URLConnection conn = url.openConnection();
                in = conn.getInputStream();

                long newModified = conn.getLastModified();

                if ((lastModified != newModified) && (newModified != 0)) {
                    lastModified = newModified;
                    Document xmlDoc =
                        CDocumentBuilderFactory.newParser()
                                               .newDocumentBuilder()
                                               .parse(in);
                    parseDocument(xmlDoc);
                }
            }
        } catch (Exception ignore) {
            ignore.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (Exception e) {
            }
        }
    }
1003010
protected void initTabs(Element root, CmsXmlContentDefinition contentDefinition) {

        if (Boolean.valueOf(root.attributeValue(APPINFO_ATTR_USEALL, CmsStringUtil.FALSE)).booleanValue()) {
            // all first level elements should be treated as tabs
            Iterator<I_CmsXmlSchemaType> i = contentDefinition.getTypeSequence().iterator();
            while (i.hasNext()) {
                // get the type
                I_CmsXmlSchemaType type = i.next();
                m_tabs.add(new CmsXmlContentTab(type.getName()));
            }
        } else {
            // manual definition of tabs
            Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_TAB);
            while (i.hasNext()) {
                // iterate all "tab" elements in the "tabs" node
                Element element = i.next();
                // this is a tab node
                String elementName = element.attributeValue(APPINFO_ATTR_ELEMENT);
                String collapseValue = element.attributeValue(APPINFO_ATTR_COLLAPSE, CmsStringUtil.TRUE);
                Node descriptionNode = element.selectSingleNode(APPINFO_ATTR_DESCRIPTION + "/text()");
                String description = null;
                if (descriptionNode != null) {
                    description = descriptionNode.getText();
                } else {
                    description = element.attributeValue(APPINFO_ATTR_DESCRIPTION);
                }

                String tabName = element.attributeValue(APPINFO_ATTR_NAME, elementName);
                if (elementName != null) {
                    // add the element tab
                    m_tabs.add(
                        new CmsXmlContentTab(
                            elementName,
                            Boolean.valueOf(collapseValue).booleanValue(),
                            tabName,
                            description));
                }
            }
            // check if first element has been defined as tab
            I_CmsXmlSchemaType type = contentDefinition.getTypeSequence().get(0);
            CmsXmlContentTab tab = new CmsXmlContentTab(type.getName());
            if (!m_tabs.contains(tab)) {
                m_tabs.add(0, tab);
            }
        }
    }
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());
    }
1094795
private void initDefinition(NodeData parent) throws RepositoryException, ConstraintViolationException
   {
      if (this.isRoot())
      {
         // root - no parent
         this.definition =
            new NodeDefinitionData(null, null, true, true, OnParentVersionAction.ABORT, true,
               new InternalQName[]{Constants.NT_BASE}, null, false);
         return;
      }

      if (parent == null)
      {
         parent = (NodeData)dataManager.getItemData(getParentIdentifier());
      }

      this.definition =
         session.getWorkspace().getNodeTypesHolder().getChildNodeDefinition(getInternalName(),
            nodeData().getPrimaryTypeName(), parent.getPrimaryTypeName(), parent.getMixinTypeNames());

      if (definition == null)
      {
         throw new ConstraintViolationException("Node definition not found for " + getPath());
      }
   }
670623
@SuppressWarnings("unchecked")
  @NonNull public CMARichBlock setContent(@NonNull List<CMARichNode> content) {
    if (content == null) {
      throw new NullPointerException("content is null");
    }

    this.content.clear();
    this.content.addAll(content);

    return this;
  }
304381
public void initInlineEditor(final CmsContainerpageController controller) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_noEditReason)
            && !m_disableNewEditor
            && CmsContentEditor.setEditable(getElement(), CmsContainerpageController.getServerId(m_clientId), true)) {
            if (m_editorClickHandlerRegistration != null) {
                m_editorClickHandlerRegistration.removeHandler();
            }
            m_editorClickHandlerRegistration = Event.addNativePreviewHandler(new NativePreviewHandler() {

                public void onPreviewNativeEvent(NativePreviewEvent event) {

                    if (event.getTypeInt() == Event.ONCLICK) {
                        // if another content is already being edited, don't start another editor
                        if (controller.isContentEditing()) {
                            return;
                        }
                        Element eventTarget = event.getNativeEvent().getEventTarget().cast();
                        // check if the event target is a child
                        if (getElement().isOrHasChild(eventTarget)) {
                            Element target = event.getNativeEvent().getEventTarget().cast();
                            // check if the target closest ancestor drag element is this element
                            Element parentContainerElement = CmsDomUtil.getAncestor(
                                target,
                                I_CmsLayoutBundle.INSTANCE.dragdropCss().dragElement());
                            if (parentContainerElement == getElement()) {
                                while ((target != null)
                                    && !target.getTagName().equalsIgnoreCase("a")
                                    && (target != getElement())) {
                                    if (CmsContentEditor.isEditable(target)) {
                                        CmsEditorBase.markForInlineFocus(target);
                                        controller.getHandler().openEditorForElement(
                                            CmsContainerPageElementPanel.this,
                                            true,
                                            isNew());
                                        removeEditorHandler();
                                        event.cancel();
                                        break;
                                    } else {
                                        target = target.getParentElement();
                                    }
                                }
                            }
                        }
                    }
                }
            });
        }
    }