Examples of CmsFile


Examples of org.opencms.file.CmsFile

  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

Examples of org.opencms.file.CmsFile

   */
  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

Examples of org.opencms.file.CmsFile

      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
Copyright © 2018 www.massapi.com. 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.