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

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

Best Java code snippets using org.opencms.xml.content.CmsXmlContent.hasValue (Showing top 16 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

/**
 * Ensures the parent values to the given path are created.<p>
 *
 * @param cms the cms context
 * @param valuePath the value path
 * @param locale the content locale
 */
private void ensureParentValues(CmsObject cms, String valuePath, Locale locale) {
  if (valuePath.contains("/")) {
    String parentPath = valuePath.substring(0, valuePath.lastIndexOf("/"));
    if (!hasValue(parentPath, locale)) {
      ensureParentValues(cms, parentPath, locale);
      int index = CmsXmlUtils.getXpathIndexInt(parentPath) - 1;
      addValue(cms, parentPath, locale, index);
    }
  }
}
origin: org.opencms/opencms-core

if (content.hasValue(path, locale)) {
  continue;
} else {
origin: org.opencms/opencms-core

/**
 * Adds the given value to the content document.<p>
 *
 * @param content the content document
 * @param locale the content locale
 * @param path the value XPath
 * @param value the value
 */
protected void addContentValue(CmsXmlContent content, Locale locale, String path, String value) {
  boolean hasValue = content.hasValue(path, locale);
  if (!hasValue) {
    String[] pathElements = path.split("/");
    String currentPath = pathElements[0];
    for (int i = 0; i < pathElements.length; i++) {
      if (i > 0) {
        currentPath = CmsStringUtil.joinPaths(currentPath, pathElements[i]);
      }
      while (!content.hasValue(currentPath, locale)) {
        content.addValue(m_cms, currentPath, locale, CmsXmlUtils.getXpathIndexInt(currentPath) - 1);
      }
    }
  }
  content.getValue(path, locale).setStringValue(m_cms, value);
}
origin: org.opencms/opencms-solr

if (content.hasValue(path, locale)) {
origin: org.opencms/opencms-core

String removeAllStringValue = content.getStringValue(cms, removeAllPath, locale);
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();
  List<String> optionValues = CmsAddFormatterWidget.getSelectOptionValues(cms, rootPath, false);
origin: org.opencms/opencms-core

if (content.hasValue(path, locale)) {
if (content.hasValue(path, locale)) {
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

/**
 * Sets the value in all other locales.<p>
 *
 * @param cms the cms context
 * @param value the value
 * @param requiredParent the path to the required parent value
 */
private void setValueForOtherLocales(CmsObject cms, I_CmsXmlContentValue value, String requiredParent) {
  if (!value.isSimpleType()) {
    throw new IllegalArgumentException();
  }
  for (Locale locale : getLocales()) {
    if (locale.equals(value.getLocale())) {
      continue;
    }
    String valuePath = value.getPath();
    if (CmsStringUtil.isEmptyOrWhitespaceOnly(requiredParent) || hasValue(requiredParent, locale)) {
      ensureParentValues(cms, valuePath, locale);
      if (hasValue(valuePath, locale)) {
        I_CmsXmlContentValue localeValue = getValue(valuePath, locale);
        localeValue.setStringValue(cms, value.getStringValue(cms));
      } else {
        int index = CmsXmlUtils.getXpathIndexInt(valuePath) - 1;
        I_CmsXmlContentValue localeValue = addValue(cms, valuePath, locale, index);
        localeValue.setStringValue(cms, value.getStringValue(cms));
      }
    }
  }
}
origin: org.opencms/opencms-core

    if (hasValue(valuePath, sourceLocale)) {
      List<I_CmsXmlContentValue> subValues = getValues(valuePath, sourceLocale);
      removeSurplusValuesInOtherLocales(elementPath, subValues.size(), sourceLocale);
if (hasValue(elementPath, sourceLocale)) {
  List<I_CmsXmlContentValue> subValues = getValues(elementPath, sourceLocale);
  removeSurplusValuesInOtherLocales(elementPath, subValues.size(), sourceLocale);
origin: org.opencms/opencms-core

  value = content.addValue(m_cms, CmsConfigurationReader.N_MODEL_PAGE, Locale.ENGLISH, i);
  String linkValuePath = value.getPath() + "/" + CmsConfigurationReader.N_MODEL_PAGE;
  I_CmsXmlContentValue linkValue = content.hasValue(linkValuePath, Locale.ENGLISH)
  ? content.getValue(linkValuePath, Locale.ENGLISH)
  : content.addValue(m_cms, linkValuePath, Locale.ENGLISH, 0);
I_CmsXmlContentValue disabledValue = content.hasValue(disabledPath, Locale.ENGLISH)
? content.getValue(disabledPath, Locale.ENGLISH)
: content.addValue(m_cms, disabledPath, Locale.ENGLISH, 0);
origin: org.opencms.modules/org.opencms.frontend.layoutpage

boolean hasFileLink = m_content.hasValue(xPath + NODE_FILELINK, locale);
if (m_content.hasValue(xPath + NODE_HEADLINE, locale)) {
  headline = m_content.getStringValue(getCmsObject(), xPath + NODE_HEADLINE, locale);
boolean imagePresent = false;
if (m_content.hasValue(xPath, locale)) {
    if (m_content.hasValue(xPath + NODE_DESCRIPTION, locale)) {
origin: org.opencms/opencms-core

if (content.hasValue(target, locale)) {
  content.getValue(target, locale).setStringValue(cms, prop.getValue());
} else {
origin: org.opencms/opencms-solr

} else {
  if (m_content.hasValue(getParamElementName(), getElementLocale())) {
origin: org.opencms/opencms-core

if (m_content.hasValue(getParamElementName(), getElementLocale())) {
origin: org.opencms.modules/org.opencms.frontend.templatetwo

if (CmsResourceTypeXmlContent.isXmlContent(resource)) {
  CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(getCmsObject(), resource);
  if (xmlContent.hasValue(NODE_CONFIG, getRequestContext().getLocale())) {
    m_config = xmlContent;
    m_presetPath = getConfigPreset(xmlContent);
org.opencms.xml.contentCmsXmlContenthasValue

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
  • addLocale
  • 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

  • Finding current android device location
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Permission (java.security)
    Legacy security code; do not use.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • BoxLayout (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
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