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

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

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

origin: org.opencms.modules/org.opencms.frontend.templatetwo

/**
 * Returns the path to the configuration file for the current uri.<p>
 * 
 * @return the path to the configuration file for the current uri
 */
public String getConfigPath() {
  if (m_config != null) {
    return getCmsObject().getSitePath(m_config.getFile());
  }
  return null;
}
origin: org.opencms/opencms-core

  /**
   * Removes a cached XML content from the cache if it matches a given resource.<p>
   *
   * @param resource the resource for which the cached XML content should be removed
   * @param cache the cache from which to remove the XML content
   */
  private <CONTENT extends CmsXmlContent> void removeCachedContent(CmsResource resource, Map<String, CONTENT> cache) {

    Iterator<Map.Entry<String, CONTENT>> iterator = cache.entrySet().iterator();
    while (iterator.hasNext()) {
      Map.Entry<String, CONTENT> entry = iterator.next();
      CONTENT content = entry.getValue();
      CmsResource contentFile = content.getFile();
      if (contentFile.getStructureId().equals(resource.getStructureId())
        || contentFile.getResourceId().equals(resource.getResourceId())) {
        iterator.remove();
      }
    }

  }
}
origin: org.opencms/opencms-core

/**
 * Returns the required version of the user accepted agreement.<p>
 *
 * @return the required version of the user accepted agreement
 */
public double getRequiredVersion() {
  if (m_requiredVersion == 0) {
    String versionStr = getConfigurationContentStringValue(NODE_VERSION);
    try {
      m_requiredVersion = Double.parseDouble(versionStr);
    } catch (Exception e) {
      // the version number is not in the correct format
      LOG.error(
        Messages.get().getBundle().key(
          Messages.LOG_USERAGREEMENT_WRONG_VERSION_2,
          versionStr,
          getConfigurationContent().getFile().getRootPath()));
    }
  }
  return m_requiredVersion;
}
origin: org.opencms.modules/org.opencms.frontend.templateone.form

xmlcontent.getFile(),
CmsPropertyDefinition.PROPERTY_LOCALE,
true).getValue());
        xpath,
        locale.toString(),
        xmlcontent.getFile().getRootPath(),
        ex.getLocalizedMessage()}));
origin: org.opencms/opencms-solr

siblings = rootCms.readSiblings(content.getFile().getRootPath(), CmsResourceFilter.IGNORE_EXPIRATION);
origin: org.opencms/opencms-core

/**
 * Contains the visibility handler configuration for a content field path.<p>
 */
protected static class VisibilityConfiguration {
  /** The handler instance. */
  private I_CmsXmlContentVisibilityHandler m_handler;
  /** The handler configuration parameters. */
  private String m_params;
  /**
   * Constructor.<p>
   *
   * @param handler the handler instance
   * @param params the handler configuration parameteres
   */
  protected VisibilityConfiguration(I_CmsXmlContentVisibilityHandler handler, String params) {
    m_handler = handler;
    m_params = params;
  }
  /**
   * Returns the visibility handler instance.<p>
   *
   * @return the handler instance
   */
  public I_CmsXmlContentVisibilityHandler getHandler() {
origin: org.opencms/opencms-core

  || isMappingUsingDefault(xpath, TITLE_PROPERTY_SHARED_MAPPING)
  || isMappingUsingDefault(xpath, TITLE_PROPERTY_INDIVIDUAL_MAPPING))) {
result = getDefault(cms, document.getFile(), null, xpath, locale);
origin: org.opencms/opencms-core

  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);
  CmsXmlContentValueSequence addSequence = content.getValueSequence(ADD_PATH_SINGLE_NODE, locale);
origin: org.opencms/opencms-core

siblings = rootCms.readSiblings(content.getFile().getRootPath(), CmsResourceFilter.IGNORE_EXPIRATION);
origin: org.opencms.modules/org.opencms.frontend.templatetwo

/**
 * Returns the preset path set in the given xml content.<p>
 * 
 * @param config the xml content with the config where to get the preset path from
 * 
 * @return the preset path set in the given xml content
 */
private String getConfigPreset(CmsXmlContent config) {
  String result = null;
  if (config != null) {
    Locale locale = OpenCms.getLocaleManager().getDefaultLocale(
      getCmsObject(),
      getCmsObject().getSitePath(m_config.getFile()));
    if (config.getFile().getTypeId() == RESOURCE_TYPE_ID_CONFIG) {
      result = config.getStringValue(getCmsObject(), NODE_PRESET, locale);
    } else {
      result = config.getStringValue(getCmsObject(), NODE_PRESET_NESTED, locale);
    }
  }
  return result;
}
origin: org.opencms/opencms-core

I_CmsXmlContentValue value = content.getValue(path, locale, counter);
String attributeValue = getDynamicAttributeValue(
  content.getFile(),
  value,
  attributeName,
origin: org.opencms/opencms-solr

CmsFile file = content.getFile();
if (file == null) {
  throw new CmsXmlException(Messages.get().container(Messages.ERR_XMLCONTENT_RESOLVE_FILE_NOT_FOUND_0));
  content.getFile().getRootPath(),
  CmsResourceFilter.IGNORE_EXPIRATION);
origin: org.opencms.modules/com.alkacon.opencms.v8.list

    break;
  case 3: // Date
    date = convertToDate(cms, content.getFile(), xmlContentValue, value);
    if (date != null) {
      result.setDate(date);
String sPath = cms.getSitePath(content.getFile());
origin: org.opencms.modules/org.opencms.frontend.templatetwo

    break;
  case 3: // Date
    date = convertToDate(cms, content.getFile(), xmlContentValue, value);
    if (date != null) {
      result.setDate(date);
link = OpenCms.getLinkManager().getServerLink(cms, cms.getSitePath(content.getFile()));
origin: org.opencms/opencms-core

  content.getFile(),
  CmsPropertyDefinition.PROPERTY_LOGIN_FORM,
  false).getValue()).booleanValue();
getConfigurationContent().getFile().getRootPath()), e);
origin: org.opencms/opencms-core

content.getFile().getTypeId()).getTypeName().equals(CmsADEManager.MODULE_CONFIG_TYPE);
content.getFile(),
isModuleConfig,
basePath,
origin: org.opencms/opencms-core

/**
 * @see org.opencms.xml.content.I_CmsXmlContentHandler#resolveMapping(org.opencms.file.CmsObject, org.opencms.xml.content.CmsXmlContent, org.opencms.xml.types.I_CmsXmlContentValue)
 */
public void resolveMapping(CmsObject cms, CmsXmlContent content, I_CmsXmlContentValue value) throws CmsException {
  if (content.getFile() == null) {
    throw new CmsXmlException(Messages.get().container(Messages.ERR_XMLCONTENT_RESOLVE_FILE_NOT_FOUND_0));
  }
  // get the mappings for the element name
  boolean valueIsSimple = value.isSimpleType();
  String valuePath = value.getPath();
  int valueIndex = value.getIndex();
  Locale valueLocale = value.getLocale();
  CmsObject rootCms1 = createRootCms(cms);
  String originalStringValue = null;
  if (valueIsSimple) {
    originalStringValue = value.getStringValue(rootCms1);
  }
  resolveMapping(cms, content, valuePath, valueIsSimple, valueIndex, valueLocale, originalStringValue);
}
origin: org.opencms/opencms-core

throws CmsException, ParseException {
  I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(content.getFile());
  boolean isMacroFromatter = CmsFormatterConfigurationCache.TYPE_MACRO_FORMATTER.equals(type.getTypeName());
  if (isMacroFromatter) {
    m_formatterResource = content.getFile();
    m_preview = false;
    m_extractContent = true;
      LOG.info("JSP link is null in formatter configuration: " + content.getFile().getRootPath());
      return null;
origin: org.opencms/opencms-core

/**
 * Checks if the content is locale independent.<p>
 *
 * @return true if the content is locale independent
 */
public boolean isLocaleIndependent() {
  CmsFile file = getFile();
  if (CmsResourceTypeXmlContainerPage.isContainerPage(file)
    || OpenCms.getResourceManager().matchResourceType(
      CmsResourceTypeXmlContainerPage.GROUP_CONTAINER_TYPE_NAME,
      file.getTypeId())
    || OpenCms.getResourceManager().matchResourceType(
      CmsResourceTypeXmlContainerPage.INHERIT_CONTAINER_CONFIG_TYPE_NAME,
      file.getTypeId())) {
    return true;
  }
  try {
    I_CmsResourceType resourceType = OpenCms.getResourceManager().getResourceType(file);
    if ((resourceType instanceof CmsResourceTypeLocaleIndependentXmlContent)
      || (resourceType instanceof CmsResourceTypeXmlAdeConfiguration)) {
      return true;
    }
  } catch (Exception e) {
    // ignore
  }
  return false;
}
origin: org.opencms/opencms-core

/**
 * Parses a dynamic function bean from an in-memory XML content object.<p>
 *
 * @param cms the current CMS context
 * @param content the XML content from which to read the dynamic function bean
 *
 * @return the dynamic function bean read from the XML content
 *
 * @throws CmsException if something goes wrong
 */
public CmsDynamicFunctionBean parseFunctionBean(CmsObject cms, CmsXmlContent content) throws CmsException {
  Locale locale = getLocaleToUse(cms, content);
  String oldSiteRoot = cms.getRequestContext().getSiteRoot();
  try {
    cms.getRequestContext().setSiteRoot("");
    CmsResource functionFormatter = getFunctionFormatter(cms);
    CmsXmlContentRootLocation root = new CmsXmlContentRootLocation(content, locale);
    CmsDynamicFunctionBean functionBean = parseFunctionBean(cms, root, content.getFile(), functionFormatter);
    return functionBean;
  } finally {
    cms.getRequestContext().setSiteRoot(oldSiteRoot);
  }
}
org.opencms.xml.contentCmsXmlContentgetFile

Popular methods of CmsXmlContent

  • getValue
  • getStringValue
  • getValues
  • hasLocale
  • 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.
  • correctXmlStructure
  • copyLocale,
  • correctXmlStructure,
  • getEncoding,
  • getLocaleNode,
  • initDocument,
  • removeLocale,
  • setAutoCorrectionEnabled,
  • toString,
  • visitAllValuesWith

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Menu (java.awt)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Top plugins for WebStorm
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