Package ugh.dl

Examples of ugh.dl.DocStructType


        /*
         * -------------------------------- Imagepfad hinzufügen (evtl. vorhandene zunächst löschen) --------------------------------
         */
        try {
          DigitalDocument dd = this.myRdf.getDigitalDocument();
          DocStructType dst = this.prozessVorlage.getRegelsatz().getPreferences().getDocStrctTypeByName("BoundBook");
          DocStruct dsBoundBook = dd.createDocStruct(dst);
          dd.setPhysicalDocStruct(dsBoundBook);

          UghHelper ughhelp = new UghHelper();
          MetadataType mdt = ughhelp.getMetadataType(this.prozessKopie, "pathimagefiles");
View Full Code Here


    /*
     * -------------------------------- generell ausführen
     * --------------------------------
     */
    if (inStruct.getType().getName().equals("Illustration")) {
      DocStructType dst = myPrefs.getDocStrctTypeByName("Figure");
      inStruct.setType(dst);
    }
  }
View Full Code Here

    /*
     * -------------------------------- Vorbereitung der Dokumentenstruktur --------------------------------
     */
    DigitalDocument dd = new DigitalDocument();
    DocStructType dst = this.myPrefs.getDocStrctTypeByName("Periodical");
    DocStruct dsPeriodical = dd.createDocStruct(dst);
    dst = this.myPrefs.getDocStrctTypeByName("PeriodicalVolume");
    DocStruct dsPeriodicalVolume = dd.createDocStruct(dst);
    dsPeriodical.addChild(dsPeriodicalVolume);

    /*
     * -------------------------------- alle Zeilen durchlaufen --------------------------------
     */
    while ((line = reader.readLine()) != null) {
      // myLogger.debug(line);

      /*
       * -------------------------------- wenn die Zeile leer ist, ist es das Ende eines Absatzes --------------------------------
       */
      if (line.length() == 0) {
        istAbsatz = false;
        /* wenn die Zeile nicht leer ist, den Inhalt prüfen */
      } else {

        /* prüfen ob der String korrekte xml-Zeichen enth�lt */
        String xmlTauglich = xmlTauglichkeitPruefen(line);
        if (xmlTauglich.length() > 0) {
          throw new WrongImportFileException("Parsingfehler (nicht druckbares Zeichen) der Importdatei in der Zeile <br/>" + xmlTauglich);
        }

        /* wenn es gerade ein neuer Absatz ist, diesen als neuen Artikel in die Liste übernehmen */
        if (!istAbsatz) {
          DocStructType dstLocal = this.myPrefs.getDocStrctTypeByName("Article");
          DocStruct ds = dd.createDocStruct(dstLocal);
          listArtikel.add(ds);
          // myLogger.debug("---------------          neuer Artikel          ----------------");
          istAbsatz = true;
          istErsterTitel = true;
View Full Code Here

   * @throws MetadataTypeNotAllowedException
   * @throws TypeNotAllowedAsChildException
   */
  private DocStruct ParsenHeftzuordnung(DocStruct dsPeriodicalVolume, String myRight, DigitalDocument inDigitalDocument)
      throws TypeNotAllowedForParentException, MetadataTypeNotAllowedException, TypeNotAllowedAsChildException {
    DocStructType dst;
    MetadataType mdt = this.myPrefs.getMetadataTypeByName("CurrentNo");
    DocStruct dsPeriodicalIssue = null;
    /* erstmal prüfen, ob das Heft schon existiert */
    List<DocStruct> myList = dsPeriodicalVolume.getAllChildrenByTypeAndMetadataType("PeriodicalIssue", "CurrentNo");
    if (myList != null && myList.size() != 0) {
View Full Code Here

            DocStruct physical = doc.getPhysicalDocStruct();

            List<DocStruct> pageList = physical.getAllChildren();

            int indexToImport = Integer.parseInt(insertPage);
            DocStructType newPageType = prefs.getDocStrctTypeByName("page");
            DocStruct newPage = doc.createDocStruct(newPageType);
            MetadataType physicalPageNoType = prefs.getMetadataTypeByName("physPageNumber");
            MetadataType logicalPageNoType = prefs.getMetadataTypeByName("logicalPageNumber");
            for (int index = 0; index < pageList.size(); index++) {
View Full Code Here

    if (subnode == null) {
      try {
        // TODO: after merge of newspaper module the following three
        //       lines can be subsumed as:
        // subnode = logicalNode.createChild(docStructType, data.getDigitalDocument(), data.getPreferences());
        DocStructType dsType = data.getPreferences().getDocStrctTypeByName(docStructType);
        subnode = data.getDigitalDocument().createDocStruct(dsType);
        logicalNode.addChild(subnode);
      } catch (TypeNotAllowedAsChildException e) {
        // copy rules aren’t related to the rule set but depend on it,
        // so copy rules that don’t work with the current rule set are
View Full Code Here

        /*--------------------------------
         * der physische Baum wird nur
         * angelegt, wenn er noch nicht existierte
         * --------------------------------*/
        if (physicaldocstruct == null) {
            DocStructType dst = this.myPrefs.getDocStrctTypeByName("BoundBook");
            physicaldocstruct = this.mydocument.createDocStruct(dst);

            /*--------------------------------
             * Probleme mit dem FilePath
             * -------------------------------- */
            MetadataType MDTypeForPath = this.myPrefs.getMetadataTypeByName("pathimagefiles");
            try {
                Metadata mdForPath = new Metadata(MDTypeForPath);
                if (SystemUtils.IS_OS_WINDOWS) {
                    mdForPath.setValue("file:/" + inProzess.getImagesTifDirectory(false));
                } else {
                    mdForPath.setValue("file://" + inProzess.getImagesTifDirectory(false));
                }
                physicaldocstruct.addMetadata(mdForPath);
            } catch (MetadataTypeNotAllowedException e1) {
            } catch (DocStructHasNoTypeException e1) {
            }
            this.mydocument.setPhysicalDocStruct(physicaldocstruct);
        }

        if (directory == null) {
            checkIfImagesValid(inProzess.getTitel(), inProzess.getImagesTifDirectory(true));
        } else {
            checkIfImagesValid(inProzess.getTitel(), inProzess.getImagesDirectory() + directory);
        }

        /*-------------------------------
         * retrieve existing pages/images
         * -------------------------------*/
        DocStructType newPage = this.myPrefs.getDocStrctTypeByName("page");
        List<DocStruct> oldPages = physicaldocstruct.getAllChildrenByTypeAndMetadataType("page", "*");
        if (oldPages == null) {
            oldPages = new ArrayList<DocStruct>();
        }

View Full Code Here

    }
    return rueckgabe;
  }

  private List<String> checkMandatoryValues(DocStruct inStruct, ArrayList<String> inList, String language) {
    DocStructType dst = inStruct.getType();
    List<MetadataType> allMDTypes = dst.getAllMetadataTypes();
    for (MetadataType mdt : allMDTypes) {
      String number = dst.getNumberOfMetadataType(mdt);
      List<? extends Metadata> ll = inStruct.getAllMetadataByType(mdt);
      int real = 0;
      // if (ll.size() > 0) {
      real = ll.size();

      if ((number.equals("1m") || number.equals("+")) && real == 1 && (ll.get(0).getValue() == null || ll.get(0).getValue().equals(""))) {

        inList.add(mdt.getNameByLanguage(language) + " in " + dst.getNameByLanguage(language) + " "
            + Helper.getTranslation("MetadataIsEmpty"));
      }
      /* jetzt die Typen prüfen */
      if (number.equals("1m") && real != 1) {
        inList.add(mdt.getNameByLanguage(language) + " in " + dst.getNameByLanguage(language) + " "
            + Helper.getTranslation("MetadataNotOneElement") + " " + real + Helper.getTranslation("MetadataTimes"));
      }
      if (number.equals("1o") && real > 1) {
        inList.add(mdt.getNameByLanguage(language) + " in " + dst.getNameByLanguage(language) + " "
            + Helper.getTranslation("MetadataToManyElements") + " " + real + " " + Helper.getTranslation("MetadataTimes"));
      }
      if (number.equals("+") && real == 0) {
        inList.add(mdt.getNameByLanguage(language) + " in " + dst.getNameByLanguage(language) + " "
            + Helper.getTranslation("MetadataNotEnoughElements"));
      }
    }
    // }
    /* alle Kinder des aktuellen DocStructs durchlaufen */
 
View Full Code Here

  /* =============================================================== */
  public DocStruct ChangeCurrentDocstructType(DocStruct inOldDocstruct, String inNewType) throws DocStructHasNoTypeException,
      MetadataTypeNotAllowedException, TypeNotAllowedAsChildException, TypeNotAllowedForParentException {
    // inOldDocstruct.getType().getName()
    // + " soll werden zu " + inNewType);
    DocStructType dst = this.myPrefs.getDocStrctTypeByName(inNewType);
    DocStruct newDocstruct = this.mydocument.createDocStruct(dst);
    /*
     * -------------------------------- alle Metadaten hinzufügen --------------------------------
     */
    if (inOldDocstruct.getAllMetadata() != null && inOldDocstruct.getAllMetadata().size() > 0) {
View Full Code Here

      return myTypes;
    }

    List<DocStructType> newTypes = new ArrayList<DocStructType>();
    for (String tempTitel : types) {
      DocStructType dst = this.myPrefs.getDocStrctTypeByName(tempTitel);
      if (dst != null) {
        newTypes.add(dst);
      } else {
        Helper.setMeldung(null, "Regelsatz-Fehler: ", " DocstructType " + tempTitel + " nicht definiert");
        myLogger.error("getAddableDocStructTypen() - Regelsatz-Fehler: DocstructType " + tempTitel + " nicht definiert");
      }
    }

    /*
     * -------------------------------- die Metadatentypen sortieren --------------------------------
     */
    HelperComparator c = new HelperComparator();
    c.setSortierart("DocStructTypen");
    // TODO: Uses generics, if possible
    Collections.sort(newTypes, c);

    /*
     * -------------------------------- nun ein Array mit der richtigen Größe anlegen --------------------------------
     */
    int zaehler = newTypes.size();
    myTypes = new SelectItem[zaehler];

    /*
     * -------------------------------- und anschliessend alle Elemente in das Array packen --------------------------------
     */
    zaehler = 0;
    Iterator<DocStructType> it = newTypes.iterator();
    while (it.hasNext()) {
      DocStructType dst = it.next();
      String label = dst.getNameByLanguage((String) Helper.getManagedBeanValue("#{LoginForm.myBenutzer.metadatenSprache}"));
      if (label == null) {
        label = dst.getName();
      }
      myTypes[zaehler] = new SelectItem(dst.getName(), label);
      zaehler++;
    }
    return myTypes;
  }
View Full Code Here

TOP

Related Classes of ugh.dl.DocStructType

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.