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

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

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

origin: org.opencms/opencms-core

/**
 * Removes all values of the given path in the other locales.<p>
 *
 * @param elementPath the element path
 * @param sourceLocale the source locale
 */
private void removeValuesInOtherLocales(String elementPath, Locale sourceLocale) {
  for (Locale locale : getLocales()) {
    if (locale.equals(sourceLocale)) {
      continue;
    }
    while (hasValue(elementPath, locale)) {
      removeValue(elementPath, locale, 0);
    }
  }
}
origin: org.opencms/opencms-core

/**
 * Removes all surplus values of locale independent fields in the other locales.<p>
 *
 * @param elementPath the element path
 * @param valueCount the value count
 * @param sourceLocale the source locale
 */
private void removeSurplusValuesInOtherLocales(String elementPath, int valueCount, Locale sourceLocale) {
  for (Locale locale : getLocales()) {
    if (locale.equals(sourceLocale)) {
      continue;
    }
    List<I_CmsXmlContentValue> localeValues = getValues(elementPath, locale);
    for (int i = valueCount; i < localeValues.size(); i++) {
      removeValue(elementPath, locale, 0);
    }
  }
}
origin: org.opencms/opencms-core

boolean removeAll = Boolean.valueOf(removeAllStringValue).booleanValue();
if (removeAll && content.hasValue(REMOVE_PATH, locale)) {
  content.removeValue(REMOVE_PATH, locale, 0);
} else if (content.hasValue(ADD_PATH, locale)) {
  String rootPath = content.getFile().getRootPath();
      removeMainAddNode = false;
    } else {
      content.removeValue(ADD_PATH_SINGLE_NODE, locale, i);
    content.removeValue(ADD_PATH, locale, 0);
origin: org.opencms/opencms-core

/**
 * Removes the old detail page information from the XML content.<p>
 *
 * @throws CmsException if something goes wrong
 */
private void removeOldValues() throws CmsException {
  Locale locale = getLocale();
  I_CmsXmlContentValue value = m_document.getValue(N_DETAIL_PAGE, locale);
  do {
    value = m_document.getValue(N_DETAIL_PAGE, locale);
    if (value != null) {
      m_document.removeValue(value.getPath(), locale, 0);
    }
  } while (value != null);
}
origin: org.opencms/opencms-core

  /**
   * Removes the value element of the sequence type at the selected index from XML content document.<p>
   *
   * @param index the index where to remove the value element
   *
   * @see CmsXmlContent#removeValue(String, Locale, int)
   */
  public void removeValue(int index) {

    m_content.removeValue(getPath(), getLocale(), index);

    // re-initialize the value list
    m_values = m_content.getValues(getPath(), getLocale());
  }
}
origin: org.opencms/opencms-solr

  /**
   * Removes the value element of the sequence type at the selected index from XML content document.<p> 
   * 
   * @param index the index where to remove the value element
   * 
   * @see CmsXmlContent#removeValue(String, Locale, int)
   */
  public void removeValue(int index) {

    m_content.removeValue(getPath(), getLocale(), index);

    // re-initialize the value list
    m_values = m_content.getValues(getPath(), getLocale());
  }
}
origin: org.opencms/opencms-core

/**
 * Deletes the given value path from the content document.<p>
 *
 * @param content the content document
 * @param locale the content locale
 * @param path the value XPath
 */
protected void deleteContentValue(CmsXmlContent content, Locale locale, String path) {
  boolean hasValue = content.hasValue(path, locale);
  if (hasValue) {
    int index = CmsXmlUtils.getXpathIndexInt(path) - 1;
    I_CmsXmlContentValue val = content.getValue(path, locale);
    if (index >= val.getMinOccurs()) {
      content.removeValue(path, locale, index);
    } else {
      val.setStringValue(m_cms, "");
    }
  }
}
origin: org.opencms/opencms-core

/**
 * Removes an existing inheritance container entry with a given name from the configuration file.<p>
 *
 * This does nothing if no such entry actually exists.<p>
 *
 * @param cms the current CMS context
 * @param content the XML content
 * @param locale the locale from which to remove the entry
 * @param name the name of the entry
 *
 */
protected void removeExistingEntry(CmsObject cms, CmsXmlContent content, Locale locale, String name) {
  if (!content.hasLocale(locale)) {
    return;
  }
  String entriesXpath = N_CONFIGURATION;
  List<I_CmsXmlContentValue> values = content.getValues(entriesXpath, locale);
  int valueIndex = 0;
  for (I_CmsXmlContentValue value : values) {
    String valueXpath = value.getPath();
    I_CmsXmlContentValue nameValue = content.getValue(CmsXmlUtils.concatXpath(valueXpath, N_NAME), locale);
    String currentName = nameValue.getStringValue(cms);
    if (currentName.equals(name)) {
      content.removeValue(valueXpath, locale, valueIndex);
      break;
    }
    valueIndex += 1;
  }
}
origin: org.opencms/opencms-solr

  content.removeValue(value.getName(), value.getLocale(), value.getIndex());
  modified = true;
} catch (CmsRuntimeException ex) {
origin: org.opencms/opencms-core

/**
 * Removes a model page from the sitemap configuration.<p>
 *
 * @param sitemapConfig the sitemap configuration resource
 * @param structureId the structure id of the model page to remove
 *
 * @throws CmsException if something goes wrong
 */
public void removeModelPage(CmsResource sitemapConfig, CmsUUID structureId) throws CmsException {
  CmsFile sitemapConfigFile = m_cms.readFile(sitemapConfig);
  CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, sitemapConfigFile);
  CmsConfigurationReader reader = new CmsConfigurationReader(m_cms);
  reader.parseConfiguration(m_adeConfig.getBasePath(), content);
  List<CmsModelPageConfig> modelPageConfigs = reader.getModelPageConfigs();
  int i = 0;
  for (CmsModelPageConfig config : modelPageConfigs) {
    if (config.getResource().getStructureId().equals(structureId)) {
      break;
    }
    i += 1;
  }
  if (i < modelPageConfigs.size()) {
    content.removeValue(CmsConfigurationReader.N_MODEL_PAGE, Locale.ENGLISH, i);
  }
  writeSitemapConfig(content, sitemapConfigFile);
}
origin: org.opencms/opencms-core

  content.removeValue(value.getName(), value.getLocale(), value.getIndex());
  modified = true;
} catch (CmsRuntimeException ex) {
origin: org.opencms/opencms-solr

  m_content.removeValue(getParamElementName(), getElementLocale(), index);
} else {
origin: org.opencms/opencms-core

content.removeValue(CmsConfigurationReader.N_MODEL_PAGE, locale, defaultValueIndex);
content.addValue(m_cms, CmsConfigurationReader.N_MODEL_PAGE, locale, 0);
content.getValue(
origin: org.opencms/opencms-core

m_content.removeValue(getParamElementName(), getElementLocale(), index);
  m_content.removeValue(xpath, getElementLocale(), CmsXmlUtils.getXpathIndexInt(xpath) - 1);
org.opencms.xml.contentCmsXmlContentremoveValue

Javadoc

Removes an existing XML content value of the given element name and locale at the given index position from this XML content document.

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
  • addLocale
  • copyLocale
    Copies the content of the given source locale to the given destination locale in this XML document.
  • addLocale,
  • copyLocale,
  • correctXmlStructure,
  • getEncoding,
  • getLocaleNode,
  • initDocument,
  • removeLocale,
  • setAutoCorrectionEnabled,
  • toString,
  • visitAllValuesWith

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setRequestProperty (URLConnection)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • CodeWhisperer alternatives
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