Package org.opencms.file

Examples of org.opencms.file.CmsFile


    LOG.debug("getConfiguration() contains: " + getConfiguration());
   
    List<CmsSelectWidgetOption> options = new ArrayList<CmsSelectWidgetOption>();
    try {
      // Load the xmlcontent containing the options
      CmsFile xmlfile = cms.readFile(cms.readResource(getConfiguration()));
      xmlcontent = CmsXmlContentFactory.unmarshal(cms, xmlfile);
     
      // loop through the options
      CmsXmlContentValueSequence seq = xmlcontent.getValueSequence("Option", locale);
      int count = seq.getElementCount();
View Full Code Here


    }
   
    Iterator<String> paths = searchPaths.iterator();
    String path, propertyFile, key;
    Properties props;
    CmsFile file;
    while (paths.hasNext()) {
      path = paths.next();
      propertyFile = cms.getRequestContext().removeSiteRoot(path.concat("/").concat(propertyFileName));
      if (cms.existsResource(propertyFile)) {
        file = cms.readFile(propertyFile);
        props = new Properties();
        props.load(new ByteArrayInputStream(file.getContents()));
       
        Iterator<Object> keys = props.keySet().iterator();
        while (keys.hasNext()) {
          key = (String) keys.next();
          if (!properties.containsKey(key) || allowOverwrite) {
View Full Code Here

  public T map(CmsObject cms, String fileUri) throws MappingException, CmsException {
    Locale locale = OpenCms.getLocaleManager().getDefaultLocale(cms, fileUri);
    return map(cms, locale, fileUri, "");
  }
  public T map(CmsObject cms, Locale locale, String fileUri, String xpathPrefix) throws MappingException, CmsException {
    CmsFile file = cms.readFile(fileUri);
    CmsXmlContent xml = CmsXmlContentFactory.unmarshal(cms, file);
   
    return map(cms, locale, xml, xpathPrefix);
  }
View Full Code Here

   */
  public void saveAndPublish(String projectName) throws Exception {
    CmsProject oldProject = cms.getRequestContext().currentProject();
    cms.getRequestContext().setCurrentProject(cms.readProject(projectName));
   
    CmsFile file = content.getFile();
    file.setContents(content.marshal());
    cms.lockResource(file.getRootPath());
    cms.writeFile(file);
   
    cms.unlockResource(cms.getSitePath(file));
    OpenCms.getPublishManager().publishResource(cms, cms.getSitePath(file), false, new CmsLogReport(locale, getClass()));
    cms.getRequestContext().setCurrentProject(oldProject);
View Full Code Here

      CmsJspActionElement cms = getCmsActionElement();
      CmsFlexController controller = CmsFlexController.getController(cms.getRequest());
      CmsObject cmso = cms.getCmsObject();
     
      uri = CmsLinkManager.getAbsoluteUri(uri, controller.getCurrentRequest().getElementUri());
      CmsFile file = cmso.readFile(uri);
      String contents = new String(file.getContents(), encoding);
      if (var != null) {
        pageContext.setAttribute(var, contents, scope);
      } else {
        pageContext.getOut().write(contents);
      }
View Full Code Here

TOP

Related Classes of org.opencms.file.CmsFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.