congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CmsFile.getTypeId
Code IndexAdd Tabnine to your IDE (free)

How to use
getTypeId
method
in
org.opencms.file.CmsFile

Best Java code snippets using org.opencms.file.CmsFile.getTypeId (Showing top 13 results out of 315)

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

/**
 * Returns an instance of ExtendedProperties with key-values pairs which can be used to build e.g. the headline.<p>
 * 
 * @param linkToFile xml content file which is integrated inside the layout page
 * @return an instance of ExtendedProperties with key-value pairs which define the elements to use inside
 *         an integrated xml content, e.g. to build the headline
 */
protected ExtendedProperties getXmlElementsProperties(CmsFile linkToFile) {
  ExtendedProperties properties = new ExtendedProperties();
  try {
    // get the type name for the integrated file
    // type name is used as key for m_typeMappings
    String typeName = OpenCms.getResourceManager().getResourceType(linkToFile.getTypeId()).getTypeName();
    if (m_typeMappings.get(typeName) == null) {
      // get key/value from the .properties file and store it in properties and m_typeMappings
      properties.load(new ByteArrayInputStream(
        getCmsObject().readFile(
          CmsWorkplace.VFS_PATH_MODULES + MODULE_NAME + "/mappings/" + typeName + ".properties").getContents()));
      m_typeMappings.put(typeName, properties);
    } else {
      // if typeName is already used inside m_typeProperties get properties from this map
      properties = (ExtendedProperties)m_typeMappings.get(typeName);
    }
  } catch (Exception e) {
    // ignore
  }
  return properties;
}
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-solr

/**
 * @see org.opencms.file.wrapper.A_CmsResourceWrapper#writeFile(org.opencms.file.CmsObject, org.opencms.file.CmsFile)
 */
@Override
public CmsFile writeFile(CmsObject cms, CmsFile resource) throws CmsException {
  if (checkTypeId(resource.getTypeId())) {
    CmsWrappedResource wrap = new CmsWrappedResource(resource);
    wrap.setRootPath(CmsResourceWrapperUtils.removeFileExtension(cms, resource.getRootPath(), getExtension()));
    return cms.writeFile(wrap.getFile());
  }
  return null;
}
origin: org.opencms/opencms-core

/**
 * @see org.opencms.file.wrapper.A_CmsResourceWrapper#writeFile(org.opencms.file.CmsObject, org.opencms.file.CmsFile)
 */
@Override
public CmsFile writeFile(CmsObject cms, CmsFile resource) throws CmsException {
  if (checkTypeId(resource.getTypeId())) {
    CmsWrappedResource wrap = new CmsWrappedResource(resource);
    wrap.setRootPath(CmsResourceWrapperUtils.removeFileExtension(cms, resource.getRootPath(), getExtension()));
    return cms.writeFile(wrap.getFile());
  }
  return null;
}
origin: org.opencms/opencms-core

  LOG.warn(e.getLocalizedMessage(), e);
String typeName = OpenCms.getResourceManager().getResourceType(file.getTypeId()).getTypeName();
boolean autoUnlock = OpenCms.getWorkplaceManager().shouldAcaciaUnlock();
Map<String, CmsEntity> entities = new HashMap<String, CmsEntity>();
origin: org.opencms/opencms-core

content.getFile().getTypeId()).getTypeName().equals(CmsADEManager.MODULE_CONFIG_TYPE);
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-solr

getResourceId(),
getRootPath(),
getTypeId(),
getFlags(),
getProjectLastModified(),
origin: org.opencms/opencms-core

/**
 * Decodes a file's contents and return the content string and the encoding to use for writing the file
 * back to the VFS.<p>
 *
 * @param file the file to decode
 * @return a pair (content, encoding)
 * @throws CmsException if something goes wrong
 */
protected CmsPair<String, String> decode(CmsFile file) throws CmsException {
  String content = null;
  String encoding = getConfiguredEncoding(m_cms, file);
  I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(file.getTypeId());
  if (resType instanceof CmsResourceTypeJsp) {
    content = decode(file.getContents(), encoding);
  } else {
    try {
      CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(m_cms);
      // parse the XML and serialize it back to  a string with the configured encoding
      Document doc = CmsXmlUtils.unmarshalHelper(file.getContents(), resolver);
      content = CmsXmlUtils.marshal(doc, encoding);
    } catch (Exception e) {
      // invalid xml structure, just use the configured encoding
      content = decode(file.getContents(), encoding);
    }
  }
  return CmsPair.create(content, encoding);
}
origin: org.opencms/opencms-solr

getCms().createResource(newFileName, templateFile.getTypeId());
origin: org.opencms/opencms-solr

Object[] arguments = new Object[] {vfsName, new Integer(file.getTypeId())};
throw new CmsStaticExportException(Messages.get().container(Messages.ERR_EXPORT_NOT_SUPPORTED_2, arguments));
origin: org.opencms/opencms-core

getResourceId(),
getRootPath(),
getTypeId(),
getFlags(),
getProjectLastModified(),
origin: org.opencms/opencms-core

Object[] arguments = new Object[] {vfsName, new Integer(file.getTypeId())};
throw new CmsStaticExportException(
  Messages.get().container(Messages.ERR_EXPORT_NOT_SUPPORTED_2, arguments));
org.opencms.fileCmsFilegetTypeId

Popular methods of CmsFile

  • getContents
    Returns the content of this file.
  • setContents
    Sets the contents of this file. This will also set the date content, but only if the content is alre
  • getName
  • getRootPath
  • getStructureId
  • setDateLastModified
  • <init>
  • clone
    Returns a clone of this Objects instance.
  • getDateCreated
  • getDateLastModified
  • getFlags
  • getLength
  • getFlags,
  • getLength,
  • getProjectLastModified,
  • getResourceId,
  • getState,
  • isFile,
  • isTouched,
  • setDateExpired,
  • setDateReleased

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • String (java.lang)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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