Tabnine Logo
CmsXmlContent.addLocale
Code IndexAdd Tabnine to your IDE (free)

How to use
addLocale
method
in
org.opencms.xml.content.CmsXmlContent

Best Java code snippets using org.opencms.xml.content.CmsXmlContent.addLocale (Showing top 20 results out of 315)

origin: org.opencms/opencms-core

content.addLocale(m_cms, locale);
origin: org.opencms/opencms-core

/**
 * @see org.opencms.xml.A_CmsXmlDocument#initDocument(org.dom4j.Document, java.lang.String, org.opencms.xml.CmsXmlContentDefinition)
 */
@Override
protected void initDocument(Document document, String encoding, CmsXmlContentDefinition definition) {
  m_document = document;
  m_contentDefinition = definition;
  m_encoding = CmsEncoder.lookupEncoding(encoding, encoding);
  m_elementLocales = new HashMap<String, Set<Locale>>();
  m_elementNames = new HashMap<Locale, Set<String>>();
  m_locales = new HashSet<Locale>();
  clearBookmarks();
  // initialize the bookmarks
  for (Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(m_document.getRootElement()); i.hasNext();) {
    Element node = i.next();
    try {
      Locale locale = CmsLocaleManager.getLocale(
        node.attribute(CmsXmlContentDefinition.XSD_ATTRIBUTE_VALUE_LANGUAGE).getValue());
      addLocale(locale);
      processSchemaNode(node, null, locale, definition);
    } catch (NullPointerException e) {
      LOG.error(Messages.get().getBundle().key(Messages.LOG_XMLCONTENT_INIT_BOOKMARKS_0), e);
    }
  }
}
origin: org.opencms/opencms-solr

/**
 * @see org.opencms.xml.A_CmsXmlDocument#initDocument(org.dom4j.Document, java.lang.String, org.opencms.xml.CmsXmlContentDefinition)
 */
@Override
protected void initDocument(Document document, String encoding, CmsXmlContentDefinition definition) {
  m_document = document;
  m_contentDefinition = definition;
  m_encoding = CmsEncoder.lookupEncoding(encoding, encoding);
  m_elementLocales = new HashMap<String, Set<Locale>>();
  m_elementNames = new HashMap<Locale, Set<String>>();
  m_locales = new HashSet<Locale>();
  clearBookmarks();
  // initialize the bookmarks
  for (Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(m_document.getRootElement()); i.hasNext();) {
    Element node = i.next();
    try {
      Locale locale = CmsLocaleManager.getLocale(node.attribute(
        CmsXmlContentDefinition.XSD_ATTRIBUTE_VALUE_LANGUAGE).getValue());
      addLocale(locale);
      processSchemaNode(node, null, locale, definition);
    } catch (NullPointerException e) {
      LOG.error(Messages.get().getBundle().key(Messages.LOG_XMLCONTENT_INIT_BOOKMARKS_0), e);
    }
  }
}
origin: org.opencms/opencms-core

  m_xmlBundle.removeLocale(l);
m_xmlBundle.addLocale(m_cms, l);
int i = 0;
List<Object> keys = new ArrayList<Object>(props.keySet());
origin: org.opencms/opencms-core

  m_descContent.removeLocale(Descriptor.LOCALE);
m_descContent.addLocale(m_cms, Descriptor.LOCALE);
origin: org.opencms/opencms-core

  m_content.addLocale(getCms(), locale);
m_content.addLocale(getCms(), locale);
origin: org.opencms/opencms-core

/**
 * Returns the content values.<p>
 *
 * @return the content values
 *
 * @throws CmsException if reading the content fails
 */
public Map<String, String> getValues() throws CmsException {
  CmsFile file = m_cms.readFile(m_editResource);
  CmsXmlContent content = unmarshalXmlContent(file);
  Locale locale = m_cms.getRequestContext().getLocale();
  if (!content.hasLocale(locale)) {
    content.addLocale(m_cms, locale);
  }
  return getContentValues(content, locale);
}
origin: org.opencms/opencms-core

  content.removeLocale(contentLocale);
content.addLocale(cms, contentLocale);
setFieldNames.addAll(addEntityAttributes(cms, content, "", entity, contentLocale));
origin: org.opencms/opencms-core

content.addLocale(cms, locale);
origin: org.opencms/org.opencms.workplace.tools.modules

/**
 * Adds the given messages to the vfs message bundle.<p>
 *
 * @param messages the messages
 * @param vfsBundleFile the bundle file
 *
 * @throws CmsException if something goes wrong writing the file
 */
private void addMessagesToVfsBundle(Map<String, String> messages, CmsFile vfsBundleFile) throws CmsException {
  lockTemporary(vfsBundleFile);
  CmsObject cms = getCms();
  CmsXmlContent content = CmsXmlContentFactory.unmarshal(cms, vfsBundleFile);
  Locale locale = CmsLocaleManager.getDefaultLocale();
  if (!content.hasLocale(locale)) {
    content.addLocale(cms, locale);
  }
  Element root = content.getLocaleNode(locale);
  for (Entry<String, String> entry : messages.entrySet()) {
    Element message = root.addElement(CmsVfsBundleLoaderXml.N_MESSAGE);
    Element key = message.addElement(CmsVfsBundleLoaderXml.N_KEY);
    key.setText(entry.getKey());
    Element value = message.addElement(CmsVfsBundleLoaderXml.N_VALUE);
    value.setText(entry.getValue());
  }
  content.initDocument();
  vfsBundleFile.setContents(content.marshal());
  cms.writeFile(vfsBundleFile);
}
origin: org.opencms/opencms-core

  m_content.addLocale(getCms(), newLocale);
} catch (CmsXmlException e) {
  if (LOG.isErrorEnabled()) {
origin: org.opencms/opencms-solr

  m_content.addLocale(getCms(), newLocale);
} catch (CmsXmlException e) {
  if (LOG.isErrorEnabled()) {
origin: org.opencms/opencms-core

  addLocale(cms, locale);
} catch (CmsXmlException e) {
origin: org.opencms/opencms-solr

  addLocale(cms, locale);
} catch (CmsXmlException e) {
origin: org.opencms/opencms-core

/**
 * Saves the inheritance group.<p>
 *
 * @param resource the inheritance group resource
 * @param inheritanceContainer the inherited group container data
 *
 * @throws CmsException if something goes wrong
 */
private void saveInheritanceGroup(CmsResource resource, CmsInheritanceContainer inheritanceContainer)
throws CmsException {
  CmsObject cms = getCmsObject();
  CmsFile file = cms.readFile(resource);
  CmsXmlContent document = CmsXmlContentFactory.unmarshal(cms, file);
  for (Locale docLocale : document.getLocales()) {
    document.removeLocale(docLocale);
  }
  Locale locale = Locale.ENGLISH;
  document.addLocale(cms, locale);
  document.getValue("Title", locale).setStringValue(cms, inheritanceContainer.getTitle());
  document.getValue("Description", locale).setStringValue(cms, inheritanceContainer.getDescription());
  document.getValue("ConfigName", locale).setStringValue(cms, inheritanceContainer.getName());
  byte[] content = document.marshal();
  file.setContents(content);
  cms.writeFile(file);
}
origin: org.opencms/opencms-core

xmlContent.addLocale(newCms, otherLocale);
origin: org.opencms/opencms-core

content.addLocale(cms, contentLocale);
if ((visitor != null) && visitor.hasInvisibleFields()) {
  transferInvisibleValues(originalEntity, entity, visitor);
origin: org.opencms/opencms-core

  content.removeLocale(contentLocale);
content.addLocale(cms, contentLocale);
addEntityAttributes(cms, content, "", entity, contentLocale);
CmsValidationResult validationResult = validateContent(cms, structureId, content);
origin: org.opencms/opencms-core

content.addLocale(cms, saveLocale);
origin: org.opencms/org.opencms.workplace.tools.modules

CmsXmlContent configContent = CmsXmlContentFactory.unmarshal(cms, configFile);
if (!configContent.hasLocale(CmsConfigurationReader.DEFAULT_LOCALE)) {
  configContent.addLocale(cms, CmsConfigurationReader.DEFAULT_LOCALE);
org.opencms.xml.contentCmsXmlContentaddLocale

Popular methods of CmsXmlContent

  • getValue
  • getStringValue
  • getValues
  • hasLocale
  • getFile
  • getLocales
  • marshal
  • addValue
    Adds a new XML schema type with the default value to the given parent node.
  • getIndexCount
  • hasValue
  • copyLocale
    Copies the content of the given source locale to the given destination locale in this XML document.
  • correctXmlStructure
  • copyLocale,
  • correctXmlStructure,
  • getEncoding,
  • getLocaleNode,
  • initDocument,
  • removeLocale,
  • setAutoCorrectionEnabled,
  • toString,
  • visitAllValuesWith

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getContentResolver (Context)
  • compareTo (BigDecimal)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • JLabel (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now