Examples of GoobiException


Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

   public String getFullTextFile(String sessionId) throws GoobiException {
      super.getFullTextFile(sessionId);
      try {
         return ModuleServerForm.getProcessFromShortSession(sessionId).getFulltextFilePath();
      } catch (IOException e) {
         throw new GoobiException(1300, "******** wrapped IOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (InterruptedException e) {
         throw new GoobiException(1300, "******** wrapped InterruptedException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (SwapException e) {
         throw new GoobiException(1300, "******** wrapped SwapException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (DAOException e) {
         throw new GoobiException(1300, "******** wrapped DAOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      }
   }
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

   public String getImageDir(String sessionId) throws GoobiException {
      super.getImageDir(sessionId);
      try {
         return ModuleServerForm.getProcessFromShortSession(sessionId).getImagesDirectory();
      } catch (IOException e) {
         throw new GoobiException(1300, "******** wrapped IOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (InterruptedException e) {
         throw new GoobiException(1300, "******** wrapped InterruptedException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (SwapException e) {
         throw new GoobiException(1300, "******** wrapped SwapException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (DAOException e) {
         throw new GoobiException(1300, "******** wrapped DAOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      }
   }
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

   public String getMetadataFile(String sessionId) throws GoobiException {
      super.getMetadataFile(sessionId);
      try {
         return ModuleServerForm.getProcessFromShortSession(sessionId).getMetadataFilePath();
      } catch (IOException e) {
         throw new GoobiException(1300, "******** wrapped IOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (InterruptedException e) {
         throw new GoobiException(1300, "******** wrapped InterruptedException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (SwapException e) {
         throw new GoobiException(1300, "******** wrapped SwapException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      } catch (DAOException e) {
         throw new GoobiException(1300, "******** wrapped DAOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      }
   }
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

      Prozess p = ModuleServerForm.getProcessFromShortSession(sessionId);
      myMap.put("ruleset", ConfigMain.getParameter("RegelsaetzeVerzeichnis") + p.getRegelsatz().getDatei());
      try {
    myMap.put("tifdirectory", p.getImagesTifDirectory(false));
    } catch (IOException e) {
          throw new GoobiException(1300, "******** wrapped IOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
    } catch (InterruptedException e) {
          throw new GoobiException(1300, "******** wrapped InterruptedException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
    } catch (SwapException e) {
          throw new GoobiException(1300, "******** wrapped SwapException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
    } catch (DAOException e) {
          throw new GoobiException(1300, "******** wrapped DAOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e))
      }
      return myMap;
   }
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

   public int add(String sessionId, String type, int count, HashMap pp) throws GoobiException {
      super.add(sessionId, type, count, pp);
      Prozess p = ModuleServerForm.getProcessFromShortSession(sessionId);
      GoobiProcessProperty gpp = new GoobiProcessProperty(pp);
      if (gpp.getName().startsWith("#"))
         throw new GoobiException(5, "Parameter not allowed");

      /* --------------------------------
       * Prozesseigenschaft
      * --------------------------------*/
      if (type.equals("") || type.equals(isProcess)) {
         if (p.getEigenschaften() == null)
            p.setEigenschaften(new HashSet<Prozesseigenschaft>());
         Prozesseigenschaft pe = new Prozesseigenschaft();
         pe.setProzess(p);
         pe.setTitel(gpp.getName());
         pe.setWert(gpp.getValue());
         p.getEigenschaften().add(pe);
      }

      /* --------------------------------
       * Werkstückeigenschaft
      * --------------------------------*/
      if (type.equals(isWorkpiece)) {
         /* wenn auf Werkstück zugegriffen werden soll, was nicht existiert, raus */
         if (p.getWerkstueckeSize() - 1 < count)
            throw new GoobiException(1500, "Workpiece does not exist");
         Werkstueck w = p.getWerkstueckeList().get(count);
         if (w.getEigenschaften() == null)
            w.setEigenschaften(new HashSet<Werkstueckeigenschaft>());
         Werkstueckeigenschaft we = new Werkstueckeigenschaft();
         we.setWerkstueck(w);
         we.setTitel(gpp.getName());
         we.setWert(gpp.getValue());
         w.getEigenschaften().add(we);
      }

      /* --------------------------------
       * Scanvorlageneigenschaft
      * --------------------------------*/
      if (type.equals(isTemplate)) {
         /* wenn auf Scanvorlage zugegriffen werden soll, die nicht existiert, raus */
         if (p.getVorlagenSize() - 1 < count)
            throw new GoobiException(1500, "Template does not exist");
         Vorlage v = p.getVorlagenList().get(count);
         if (v.getEigenschaften() == null)
            v.setEigenschaften(new HashSet<Vorlageeigenschaft>());
         Vorlageeigenschaft ve = new Vorlageeigenschaft();
         ve.setVorlage(v);
         ve.setTitel(gpp.getName());
         ve.setWert(gpp.getValue());
         v.getEigenschaften().add(ve);
      }

      try {
         new ProzessDAO().save(p);
      } catch (DAOException e) {
         throw new GoobiException(1400, "******** wrapped DAOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      }
      return 0;
   }
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

       * feste Werkstückeigenschaften
      * --------------------------------*/
      if (type.equals(isWorkpiece)) {
         /* wenn auf Werkstück zugegriffen werden soll, was nicht existiert, raus */
         if (p.getWerkstueckeSize() - 1 < count)
            throw new GoobiException(1500, "Workpiece does not exist");
         Werkstueck w = p.getWerkstueckeList().get(count);
         rueckgabe.put("id", String.valueOf(w.getId().intValue()));
      }

      /* --------------------------------
       * feste Scanvorlageneigenschaften
      * --------------------------------*/
      if (type.equals(isTemplate)) {
         /* wenn auf Scanvorlage zugegriffen werden soll, die nicht existiert, raus */
         if (p.getVorlagenSize() - 1 < count)
            throw new GoobiException(1500, "Template does not exist");
         Vorlage v = p.getVorlagenList().get(count);
         rueckgabe.put("id", String.valueOf(v.getId().intValue()));
         rueckgabe.put("origin", (v.getHerkunft()==null?"":v.getHerkunft()));
      }
      return rueckgabe;
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

       * Werkstückeigenschaften
      * --------------------------------*/
      if (type.equals(isWorkpiece)) {
         /* wenn auf Werkstück zugegriffen werden soll, was nicht existiert, raus */
         if (p.getWerkstueckeSize() - 1 < count)
            throw new GoobiException(1500, "Workpiece does not exist");
         Werkstueck w = p.getWerkstueckeList().get(count);
         //TODO: Use for loops
         for (Iterator<Werkstueckeigenschaft> it = w.getEigenschaftenList().iterator(); it.hasNext();) {
            Werkstueckeigenschaft we = it.next();
            if (!we.getTitel().startsWith("#"))
               gpps.add(new GoobiProcessProperty(we.getTitel(), String.valueOf(we.getId().intValue()), we
                     .getWert()));
         }
      }

      /* --------------------------------
       * Scanvorlageneigenschaften
      * --------------------------------*/
      if (type.equals(isTemplate)) {
         /* wenn auf Scanvorlage zugegriffen werden soll, die nicht existiert, raus */
         if (p.getVorlagenSize() - 1 < count)
            throw new GoobiException(1500, "Template does not exist");
         Vorlage v = p.getVorlagenList().get(count);
         //TODO: Use for loops
         for (Iterator<Vorlageeigenschaft> it = v.getEigenschaftenList().iterator(); it.hasNext();) {
            Vorlageeigenschaft ve = it.next();
            if (!ve.getTitel().startsWith("#"))
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

   public int set(String sessionId, String type, int count, HashMap pp) throws GoobiException {
      super.set(sessionId, type, count, pp);
      Prozess p = ModuleServerForm.getProcessFromShortSession(sessionId);
      GoobiProcessProperty gpp = new GoobiProcessProperty(pp);
      if (gpp.getName().startsWith("#"))
         throw new GoobiException(5, "Parameter not allowed");
      /* --------------------------------
       * Prozesseigenschaft
      * --------------------------------*/
      String myquery = "from Prozesseigenschaft where prozess=" + p.getId().intValue();
      /* --------------------------------
       * Werkstückeigenschaft
      * --------------------------------*/
      if (type.equals(isWorkpiece)) {
         if (p.getWerkstueckeSize() - 1 < count)
            throw new GoobiException(1500, "Workpiece does not exist");
         Werkstueck w = p.getWerkstueckeList().get(count);
         myquery = "from Werkstueckeigenschaft where werkstueck=" + w.getId().intValue();

      }

      /* --------------------------------
       * Scanvorlageneigenschaft
      * --------------------------------*/
      if (type.equals(isTemplate)) {
         if (p.getVorlagenSize() - 1 < count)
            throw new GoobiException(1500, "Template does not exist");
         Vorlage v = p.getVorlagenList().get(count);
         myquery = "from Vorlageeigenschaft where vorlage=" + v.getId().intValue();
      }
      myquery += " and titel='" + gpp.getName() + "' and id=" + gpp.getId();

      try {
       //TODO: Use generics
         List hits = new ProzessDAO().search(myquery);
         if (hits.size() > 0) {
            if (type.equals("") || type.equals(isProcess)) {
               Prozesseigenschaft pe = (Prozesseigenschaft) hits.get(0);
               pe.setWert(gpp.getValue());
            }
            if (type.equals(isWorkpiece)) {
               Werkstueckeigenschaft we = (Werkstueckeigenschaft) hits.get(0);
               we.setWert(gpp.getValue());
            }
            if (type.equals(isTemplate)) {
               Vorlageeigenschaft ve = (Vorlageeigenschaft) hits.get(0);
               ve.setWert(gpp.getValue());
            }
            new ProzessDAO().save(p);
         } else {
            throw new GoobiException(1500, "Property " + gpp.getName() + " with id " + gpp.getId()
                  + " does not exist");
         }
      } catch (DAOException e) {
         throw new GoobiException(1400, "******** wrapped DAOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
      }
      return 0;
   }
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

    /*
     * -------------------------------- Modulserver läuft noch nicht --------------------------------
     */
    if (modulmanager == null)
      throw new GoobiException(0, "Der Modulserver läuft nicht");

    /*
     * -------------------------------- ohne gewähltes Modul gleich wieder raus --------------------------------
     */
    for (ModuleDesc md : modulmanager)
View Full Code Here

Examples of de.unigoettingen.goobi.module.api.exception.GoobiException

        Helper.getHibernateSession().refresh(tempProz);

      return tempProz;
    } catch (NumberFormatException e) {
      new Helper();
      throw new GoobiException(5, "******** wrapped NumberFormatException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
    } catch (DAOException e) {
      new Helper();
      throw new GoobiException(1400, "******** wrapped DAOException ********: " + e.getMessage() + "\n" + Helper.getStacktraceAsString(e));
    }
  }
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.