Examples of DocStruct


Examples of ugh.dl.DocStruct

    if (this.myRdf != null) {

      for (AdditionalField field : this.additionalFields) {
        if (field.isUghbinding() && field.getShowDependingOnDoctype()) {
          /* welches Docstruct */
          DocStruct myTempStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct();
          if (field.getDocstruct().equals("firstchild")) {
            try {
              myTempStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct().getAllChildren().get(0);
            } catch (RuntimeException e) {
            }
          }
          if (field.getDocstruct().equals("boundbook")) {
            myTempStruct = this.myRdf.getDigitalDocument().getPhysicalDocStruct();
          }
          /* welches Metadatum */
          try {
            if (field.getMetadata().equals("ListOfCreators")) {
              /* bei Autoren die Namen zusammenstellen */
              String myautoren = "";
              if (myTempStruct.getAllPersons() != null) {
                for (Person p : myTempStruct.getAllPersons()) {
                  myautoren += p.getLastname();
                  if (StringUtils.isNotBlank(p.getFirstname())) {
                    myautoren += ", " + p.getFirstname();
                  }
                  myautoren += "; ";
View Full Code Here

Examples of ugh.dl.DocStruct

      Helper.setFehlerMeldung("Error on reading template-metadata ", e);
    }

    /* falls ein erstes Kind vorhanden ist, sind die Collectionen dafür */
    try {
      DocStruct colStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct();
      removeCollections(colStruct);
      colStruct = colStruct.getAllChildren().get(0);
      removeCollections(colStruct);
    } catch (PreferencesException e) {
      Helper.setFehlerMeldung("Error on creating process", e);
      myLogger.error("Error on creating process", e);
    } catch (RuntimeException e) {
View Full Code Here

Examples of ugh.dl.DocStruct

     * --------------------------------*/
    if (this.myRdf != null) {
      for (AdditionalField field : this.additionalFields) {
        if (field.isUghbinding() && field.getShowDependingOnDoctype()) {
          /* welches Docstruct */
          DocStruct myTempStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct();
          DocStruct myTempChild = null;
          if (field.getDocstruct().equals("firstchild")) {
            try {
              myTempStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct().getAllChildren().get(0);
            } catch (RuntimeException e) {
              /*
               * das Firstchild unterhalb des Topstructs konnte nicht ermittelt werden
               */
            }
          }
          /*
           * falls topstruct und firstchild das Metadatum bekommen sollen
           */
          if (!field.getDocstruct().equals("firstchild") && field.getDocstruct().contains("firstchild")) {
            try {
              myTempChild = this.myRdf.getDigitalDocument().getLogicalDocStruct().getAllChildren().get(0);
            } catch (RuntimeException e) {
            }
          }
          if (field.getDocstruct().equals("boundbook")) {
            myTempStruct = this.myRdf.getDigitalDocument().getPhysicalDocStruct();
          }
          /* welches Metadatum */
          try {
            /*
             * bis auf die Autoren alle additionals in die Metadaten übernehmen
             */
            if (!field.getMetadata().equals("ListOfCreators")) {
              MetadataType mdt = this.ughHelper.getMetadataType(this.prozessKopie.getRegelsatz().getPreferences(), field.getMetadata());
              Metadata md = this.ughHelper.getMetadata(myTempStruct, mdt);
              if (md != null) {
                md.setValue(field.getWert());
              }
              /*
               * wenn dem Topstruct und dem Firstchild der Wert gegeben werden soll
               */
              if (myTempChild != null) {
                md = this.ughHelper.getMetadata(myTempChild, mdt);
                if (md != null) {
                  md.setValue(field.getWert());
                }
              }
            }
          } catch (Exception e) {
            Helper.setFehlerMeldung(e);

          }
        } // end if ughbinding
      }// end for
     
      /*
       * -------------------------------- Collectionen hinzufügen --------------------------------
       */
      DocStruct colStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct();
      try {
        addCollections(colStruct);
        /* falls ein erstes Kind vorhanden ist, sind die Collectionen dafür */
        colStruct = colStruct.getAllChildren().get(0);
        addCollections(colStruct);
      } catch (RuntimeException e) {
        /*
         * das Firstchild unterhalb des Topstructs konnte nicht ermittelt werden
         */
 
View Full Code Here

Examples of ugh.dl.DocStruct

      DigitalDocument dd = new DigitalDocument();
      Fileformat ff = new XStream(myPrefs);
      ff.setDigitalDocument(dd);
      /* BoundBook hinzufügen */
      DocStructType dst = myPrefs.getDocStrctTypeByName("BoundBook");
      DocStruct dsBoundBook = dd.createDocStruct(dst);
      dd.setPhysicalDocStruct(dsBoundBook);

      /* Monographie */
      if (!this.co.getDoctypeByName(this.docType).isPeriodical() && !this.co.getDoctypeByName(this.docType).isMultiVolume()) {
        DocStructType dsty = myPrefs.getDocStrctTypeByName(this.co.getDoctypeByName(this.docType).getRulesetType());
        DocStruct ds = dd.createDocStruct(dsty);
        dd.setLogicalDocStruct(ds);
        this.myRdf = ff;
      }

      /* Zeitschrift */
      else if (this.co.getDoctypeByName(this.docType).isPeriodical()) {
        DocStructType dsty = myPrefs.getDocStrctTypeByName("Periodical");
        DocStruct ds = dd.createDocStruct(dsty);
        dd.setLogicalDocStruct(ds);

        DocStructType dstyvolume = myPrefs.getDocStrctTypeByName("PeriodicalVolume");
        DocStruct dsvolume = dd.createDocStruct(dstyvolume);
        ds.addChild(dsvolume);
        this.myRdf = ff;
      }

      /* MultivolumeBand */
      else if (this.co.getDoctypeByName(this.docType).isMultiVolume()) {
        DocStructType dsty = myPrefs.getDocStrctTypeByName("MultiVolumeWork");
        DocStruct ds = dd.createDocStruct(dsty);
        dd.setLogicalDocStruct(ds);

        DocStructType dstyvolume = myPrefs.getDocStrctTypeByName("Volume");
        DocStruct dsvolume = dd.createDocStruct(dstyvolume);
        ds.addChild(dsvolume);
        this.myRdf = ff;
      }
      if (this.docType.equals("volumerun")) {
        DocStructType dsty = myPrefs.getDocStrctTypeByName("VolumeRun");
        DocStruct ds = dd.createDocStruct(dsty);
        dd.setLogicalDocStruct(ds);

        DocStructType dstyvolume = myPrefs.getDocStrctTypeByName("Record");
        DocStruct dsvolume = dd.createDocStruct(dstyvolume);
        ds.addChild(dsvolume);
        this.myRdf = ff;
      }

    } catch (TypeNotAllowedForParentException e) {
View Full Code Here

Examples of ugh.dl.DocStruct

                createNewFileformat();
                try {
                    if (myRdf.getDigitalDocument().getLogicalDocStruct().equals(tmp.getDigitalDocument().getLogicalDocStruct())) {
                        myRdf = tmp;
                    } else {
                        DocStruct oldLogicalDocstruct = tmp.getDigitalDocument().getLogicalDocStruct();
                        DocStruct newLogicalDocstruct = myRdf.getDigitalDocument().getLogicalDocStruct();
                        // both have no children
                        if (oldLogicalDocstruct.getAllChildren() == null && newLogicalDocstruct.getAllChildren() == null) {
                            copyMetadata(oldLogicalDocstruct, newLogicalDocstruct);
                        }
                        // old has a child, new has no child
                        else if (oldLogicalDocstruct.getAllChildren() != null && newLogicalDocstruct.getAllChildren() == null) {
                            copyMetadata(oldLogicalDocstruct, newLogicalDocstruct);
                            copyMetadata(oldLogicalDocstruct.getAllChildren().get(0), newLogicalDocstruct);
                        }
                        // new has a child, bot old not
                        else if (oldLogicalDocstruct.getAllChildren() == null && newLogicalDocstruct.getAllChildren() != null) {
                            copyMetadata(oldLogicalDocstruct, newLogicalDocstruct);
                            copyMetadata(oldLogicalDocstruct.copy(true, false), newLogicalDocstruct.getAllChildren().get(0));
                        }

                        // both have children
                        else if (oldLogicalDocstruct.getAllChildren() != null && newLogicalDocstruct.getAllChildren() != null) {
                            copyMetadata(oldLogicalDocstruct, newLogicalDocstruct);
                            copyMetadata(oldLogicalDocstruct.getAllChildren().get(0), newLogicalDocstruct.getAllChildren().get(0));
                        }
                    }
                } catch (PreferencesException e) {
                    myLogger.error(e);
                }
View Full Code Here

Examples of ugh.dl.DocStruct

  public String ChangeCurrentDocstructType() {

    if (this.myDocStruct != null && this.tempWert != null) {
      try {
        DocStruct rueckgabe = this.metahelper.ChangeCurrentDocstructType(this.myDocStruct, this.tempWert);
        MetadatenalsBeanSpeichern(rueckgabe);
        MetadatenalsTree3Einlesen1();
      } catch (DocStructHasNoTypeException e) {
        Helper.setFehlerMeldung("Error while changing DocStructTypes (DocStructHasNoTypeException): ", e.getMessage());
        myLogger.error("Error while changing DocStructTypes (DocStructHasNoTypeException): " + e.getMessage());
View Full Code Here

Examples of ugh.dl.DocStruct

   *
   * @throws IOException ============================================================ == ==
   */
  public String KnotenDelete() throws IOException {
    if (this.myDocStruct != null && this.myDocStruct.getParent() != null) {
      DocStruct tempParent = this.myDocStruct.getParent();
      this.myDocStruct.getParent().removeChild(this.myDocStruct);
      this.myDocStruct = tempParent;
    }
    // den Tree neu einlesen
    return MetadatenalsTree3Einlesen1();
View Full Code Here

Examples of ugh.dl.DocStruct

    /*
     * -------------------------------- prüfen, wohin das Strukturelement gepackt werden soll, anschliessend entscheiden, welches Strukturelement
     * gewählt wird und abschliessend richtig einfügen --------------------------------
     */

    DocStruct ds = null;
    /*
     * -------------------------------- vor das aktuelle Element --------------------------------
     */
    if (this.neuesElementWohin.equals("1")) {
      if (this.addDocStructType1 == null || this.addDocStructType1.equals("")) {
        return "Metadaten3links";
      }
      DocStructType dst = this.myPrefs.getDocStrctTypeByName(this.addDocStructType1);
      ds = this.mydocument.createDocStruct(dst);
      if (this.myDocStruct == null) {
        return "Metadaten3links";
      }
      DocStruct parent = this.myDocStruct.getParent();
      if (parent == null) {
        myLogger.debug("das gewählte Element kann den Vater nicht ermitteln");
        return "Metadaten3links";
      }
      List<DocStruct> alleDS = new ArrayList<DocStruct>();

      /* alle Elemente des Parents durchlaufen */
      for (Iterator<DocStruct> iter = parent.getAllChildren().iterator(); iter.hasNext();) {
        DocStruct tempDS = iter.next();

        /* wenn das aktuelle Element das gesuchte ist */
        if (tempDS == this.myDocStruct) {
          alleDS.add(ds);
        }
        alleDS.add(tempDS);
      }

      /* anschliessend alle Childs entfernen */
      for (Iterator<DocStruct> iter = alleDS.iterator(); iter.hasNext();) {
        parent.removeChild(iter.next());
      }

      /* anschliessend die neue Childliste anlegen */
      for (Iterator<DocStruct> iter = alleDS.iterator(); iter.hasNext();) {
        parent.addChild(iter.next());
      }
    }

    /*
     * -------------------------------- hinter das aktuelle Element --------------------------------
     */
    if (this.neuesElementWohin.equals("2")) {
      DocStructType dst = this.myPrefs.getDocStrctTypeByName(this.addDocStructType1);
      ds = this.mydocument.createDocStruct(dst);
      DocStruct parent = this.myDocStruct.getParent();
      if (parent == null) {
        myLogger.debug("das gewählte Element kann den Vater nicht ermitteln");
        return "Metadaten3links";
      }
      List<DocStruct> alleDS = new ArrayList<DocStruct>();

      /* alle Elemente des Parents durchlaufen */
      for (Iterator<DocStruct> iter = parent.getAllChildren().iterator(); iter.hasNext();) {
        DocStruct tempDS = iter.next();
        alleDS.add(tempDS);
        /* wenn das aktuelle Element das gesuchte ist */
        if (tempDS == this.myDocStruct) {
          alleDS.add(ds);
        }
      }

      /* anschliessend alle Childs entfernen */
      for (Iterator<DocStruct> iter = alleDS.iterator(); iter.hasNext();) {
        parent.removeChild(iter.next());
      }

      /* anschliessend die neue Childliste anlegen */
      for (Iterator<DocStruct> iter = alleDS.iterator(); iter.hasNext();) {
        parent.addChild(iter.next());
      }
    }

    /*
     * -------------------------------- als erstes Child --------------------------------
     */
    if (this.neuesElementWohin.equals("3")) {
      DocStructType dst = this.myPrefs.getDocStrctTypeByName(this.addDocStructType2);
      ds = this.mydocument.createDocStruct(dst);
      DocStruct parent = this.myDocStruct;
      if (parent == null) {
        myLogger.debug("das gewählte Element kann den Vater nicht ermitteln");
        return "Metadaten3links";
      }
      List<DocStruct> alleDS = new ArrayList<DocStruct>();
      alleDS.add(ds);

      if (parent.getAllChildren() != null && parent.getAllChildren().size() != 0) {
        alleDS.addAll(parent.getAllChildren());
        parent.getAllChildren().retainAll(new ArrayList<DocStruct>());
      }

      /* anschliessend die neue Childliste anlegen */
      for (Iterator<DocStruct> iter = alleDS.iterator(); iter.hasNext();) {
        parent.addChild(iter.next());
      }
    }

    /*
     * -------------------------------- als letztes Child --------------------------------
     */
    if (this.neuesElementWohin.equals("4")) {
      DocStructType dst = this.myPrefs.getDocStrctTypeByName(this.addDocStructType2);
      ds = this.mydocument.createDocStruct(dst);
      this.myDocStruct.addChild(ds);
    }

    if (!this.pagesStart.equals("") && !this.pagesEnd.equals("")) {
      DocStruct temp = this.myDocStruct;
      this.myDocStruct = ds;
      this.ajaxSeiteStart = this.pagesStart;
      this.ajaxSeiteEnde = this.pagesEnd;
      AjaxSeitenStartUndEndeSetzen();
      this.myDocStruct = temp;
View Full Code Here

Examples of ugh.dl.DocStruct

  public String createPagination() throws TypeNotAllowedForParentException, IOException, InterruptedException, SwapException, DAOException {
    this.imagehelper.createPagination(this.myProzess, this.currentTifFolder);
    retrieveAllImages();

    // added new
    DocStruct log = this.mydocument.getLogicalDocStruct();
    if (log.getType().isAnchor()) {
      if (log.getAllChildren() != null && log.getAllChildren().size() > 0) {
        log = log.getAllChildren().get(0);
      } else {
        return "";
      }
    }

    if (log.getAllChildren() != null) {
      for (Iterator<DocStruct> iter = log.getAllChildren().iterator(); iter.hasNext();) {
        DocStruct child = iter.next();
        List<Reference> childRefs = child.getAllReferences("to");
        for (Reference toAdd : childRefs) {
          boolean match = false;
          for (Reference ref : log.getAllReferences("to")) {
            if (ref.getTarget().equals(toAdd.getTarget())) {
              match = true;
View Full Code Here

Examples of ugh.dl.DocStruct

      this.structSeiten = new SelectItem[listReferenzen.size()];
      this.structSeitenNeu = new MetadatumImpl[listReferenzen.size()];

      /* alle Referenzen durchlaufen und deren Metadaten ermitteln */
      for (Reference ref : listReferenzen) {
        DocStruct target = ref.getTarget();
        StructSeitenErmitteln2(target, zaehler);
        if (imageNr == 0) {
          imageNr = StructSeitenErmitteln3(target);
        }
        zaehler++;
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.