Dateiverwaltung für die WebBox
ulrich
2017-03-29 6e1a290ebaddb441ff2a4fe911f1cdfc62070519
weitere Verschiebungen zwischen wbx-lib und WebKontext, Api, usw.
3 files modified
29 ■■■■ changed files
src/java/de/uhilger/filecms/api/Api.java 25 ●●●● patch | view | raw | blame | history
src/java/de/uhilger/filecms/api/CompileService.java 2 ●●● patch | view | raw | blame | history
src/java/de/uhilger/filecms/api/HtmlExportService.java 2 ●●● patch | view | raw | blame | history
src/java/de/uhilger/filecms/api/Api.java
@@ -20,15 +20,19 @@
package de.uhilger.filecms.api;
import de.uhilger.transit.web.WebKontext;
import de.uhilger.wbx.api.ApiBase;
import de.uhilger.wbx.data.FileRef;
import java.io.File;
import java.util.logging.Logger;
import javax.servlet.ServletContext;
/**
 *
 */
public abstract class Api extends ApiBase {
public abstract class Api extends ApiBase implements WebKontext {
  protected ServletContext ctx;
  
  private static final Logger logger = Logger.getLogger(Api.class.getName());
@@ -71,10 +75,10 @@
      logger.fine("in admin role");
      if(relPath.startsWith(WBX_BASE)) {
        logger.fine("is base");
        targetPath = getCatalinaBase();
        targetPath = getCatalinaBase(ctx);
        targetDir = new File(targetPath, relPath.substring(WBX_BASE.length()));
      } else if(relPath.startsWith(WBX_DATA)) {
        targetPath = getWbxDataDir();
        targetPath = getWbxDataDir(ctx);
        logger.fine("is data, combine " + targetPath + ' ' + relPath.substring(WBX_DATA.length()));
        targetDir = new File(targetPath, relPath.substring(WBX_DATA.length()));
      } else {
@@ -96,12 +100,25 @@
  
  protected FileRef getBase() {
    FileRef base = null;
    Object o = getFileBase();
    Object o = getFileBase(ctx);
    if(o instanceof File) {
      File file = (File) o;
      base = new FileRef(file.getAbsolutePath(), file.isDirectory());
    }
    return base;
  }
  /* ------------- Implementierung WebKontext ------------- */
  @Override
  public ServletContext getServletContext() {
    return ctx;
  }
  @Override
  public void setServletContext(ServletContext servletContext) {
    this.ctx = servletContext;
  }
  
}
src/java/de/uhilger/filecms/api/CompileService.java
@@ -196,7 +196,7 @@
  }
  private final Iterable<String> buildOptions(File targetDir) {
      String cbase = getCatalinaBase();
      String cbase = getCatalinaBase(getServletContext());
      File lib = new File(cbase, "lib");
      String cp = "";
      cp = buildCPFromDir(cp, lib);
src/java/de/uhilger/filecms/api/HtmlExportService.java
@@ -113,7 +113,7 @@
        }
      }
    }
    File catalinaBase = new File(getCatalinaBase());
    File catalinaBase = new File(getCatalinaBase(getServletContext()));
    File bsDir = new File(catalinaBase, "webapps/jslib/bootstrap/css/");
    try {
      FileUtils.copyFile(new File(bsDir, "bootstrap.min.css"), new File(outDir, "bootstrap.min.css"), true);