Package de.sub.goobi.helper

Examples of de.sub.goobi.helper.Helper


public class WebInterfaceConfig {

  public static List<String> getCredencials(String requestIp, String requestPassword) {
    ArrayList<String> allowed = new ArrayList<String>();
    try {
      XMLConfiguration config = new XMLConfiguration(new Helper().getGoobiConfigDirectory() +"goobi_webapi.xml");
      config.setListDelimiter('&');
      config.setReloadingStrategy(new FileChangedReloadingStrategy());

      int count = config.getMaxIndex("credentials");
      for (int i = 0; i <= count; i++) {
View Full Code Here


    logger.trace("config 1");
    List<GoobiHotfolder> answer = new ArrayList<GoobiHotfolder>();
    logger.trace("config 2");

    try {
       XMLConfiguration config = new XMLConfiguration(new Helper().getGoobiConfigDirectory() + "goobi_hotfolder.xml");

      logger.trace("config 3");

      config.setListDelimiter('&');
View Full Code Here

    if (mySchritt.getProzess().isIstTemplate()) {
      return properties;
    }

    String path = new Helper().getGoobiConfigDirectory() + "goobi_processProperties.xml";
    XMLConfiguration config;
    try {
      config = new XMLConfiguration(path);
    } catch (ConfigurationException e) {
      logger.error(e);
View Full Code Here

        pp.setContainer(pe.getContainer());
        properties.add(pp);
      }
      return properties;
    }
    String path = new Helper().getGoobiConfigDirectory() + "goobi_processProperties.xml";
    XMLConfiguration config;
    try {
      config = new XMLConfiguration(path);
    } catch (ConfigurationException e) {
      logger.error(e);
View Full Code Here

 
 
  private void readConfigAsSample() {
    ArrayList<ProcessProperty> properties = new ArrayList<ProcessProperty>();

    String path = new Helper().getGoobiConfigDirectory() + "goobi_processProperties.xml";
    XMLConfiguration config;
    try {
      config = new XMLConfiguration(path);
    } catch (ConfigurationException e) {
      logger.error(e);
View Full Code Here

      xmlpath = "anchor.property";
    }

    HashMap<String, String> fields = new HashMap<String, String>();
    try {
      File file = new File(new Helper().getGoobiConfigDirectory() + "goobi_exportXml.xml");
      if (file.exists() && file.canRead()) {
        XMLConfiguration config = new XMLConfiguration(file);
        config.setListDelimiter('&');
        config.setReloadingStrategy(new FileChangedReloadingStrategy());
View Full Code Here

  }

  private HashMap<String, String> getNamespacesFromConfig() {
    HashMap<String, String> nss = new HashMap<String, String>();
    try {
      File file = new File(new Helper().getGoobiConfigDirectory() + "goobi_exportXml.xml");
      if (file.exists() && file.canRead()) {
        XMLConfiguration config = new XMLConfiguration(file);
        config.setListDelimiter('&');
        config.setReloadingStrategy(new FileChangedReloadingStrategy());
View Full Code Here

  public static XMLConfiguration getPluginConfig(IPlugin inPlugin) {
    String file = "plugin_" + inPlugin.getClass().getSimpleName() + ".xml";
    XMLConfiguration config;
    try {
      config = new XMLConfiguration(new Helper().getGoobiConfigDirectory() + file);
    } catch (ConfigurationException e) {
      logger.error(e);
      config = new XMLConfiguration();
    }
    config.setListDelimiter('&');
View Full Code Here

  XMLConfiguration config;
  private String projektTitel;
  private static final Logger logger = Logger.getLogger(ConfigProjects.class);

  public ConfigProjects(String projectTitle) throws IOException {
    this(projectTitle, new Helper().getGoobiConfigDirectory() + "goobi_projects.xml");
  }
View Full Code Here

    * Aufruf als Thread
    * ================================================================*/
   @Override
public void run() {
      setStatusProgress(5);
      Helper help = new Helper();
      String swapPath = null;
      ProzessDAO dao = new ProzessDAO();
      String processDirectory = "";

      if (ConfigMain.getBooleanParameter("useSwapping")) {
    swapPath = ConfigMain.getParameter("swapPath", "");
  } else {
         setStatusMessage("swapping not activated");
         setStatusProgress(-1);
         return;
      }
      if (swapPath == null || swapPath.length() == 0) {
         setStatusMessage("no swappingPath defined");
         setStatusProgress(-1);
         return;
      }
      File swapFile = new File(swapPath);
      if (!swapFile.exists()) {
         setStatusMessage("Swap folder does not exist or is not mounted");
         setStatusProgress(-1);
         return;
      }
      try {
         processDirectory = getProzess().getProcessDataDirectoryIgnoreSwapping();
         //TODO: Don't catch Exception (the super class)
      } catch (Exception e) {
        logger.warn("Exception:", e);
         setStatusMessage("Error while getting process data folder: " + e.getClass().getName() + " - "
               + e.getMessage());
         setStatusProgress(-1);
         return;
      }

      File fileIn = new File(processDirectory);
      File fileOut = new File(swapPath + getProzess().getId() + File.separator);
      if (fileOut.exists()) {
         setStatusMessage(getProzess().getTitel() + ": swappingOutTarget already exists");
         setStatusProgress(-1);
         return;
      }
      fileOut.mkdir();

      /* ---------------------
       * Xml-Datei vorbereiten
      * -------------------*/
      Document doc = new Document();
      Element root = new Element("goobiArchive");
      doc.setRootElement(root);
      Element source = new Element("source").setText(fileIn.getAbsolutePath());
      Element target = new Element("target").setText(fileOut.getAbsolutePath());
      Element title = new Element("title").setText(getProzess().getTitel());
      Element mydate = new Element("date").setText(new Date().toString());
      root.addContent(source);
      root.addContent(target);
      root.addContent(title);
      root.addContent(mydate);

      /* ---------------------
       * Verzeichnisse und Dateien kopieren und anschliessend den Ordner leeren
      * -------------------*/
      setStatusProgress(50);
      try {
        setStatusMessage("copying process folder");
        Helper.copyDirectoryWithCrc32Check(fileIn, fileOut, help.getGoobiDataDirectory().length(), root);
      } catch (IOException e) {
        logger.warn("IOException:", e);
         setStatusMessage("IOException in copyDirectory: " + e.getMessage());
         setStatusProgress(-1);
         return;
View Full Code Here

TOP

Related Classes of de.sub.goobi.helper.Helper

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.