Package de.sub.goobi.config

Examples of de.sub.goobi.config.ConfigProjects


  }

  public static List<Field> getFieldConfigForProject(Projekt project) throws IOException {
    List<Field> fields = new ArrayList<Field>();

    ConfigProjects projectConfig = new ConfigProjects(project.getTitel());
    Integer numFields = projectConfig.getParamList("createNewProcess.itemlist.item").size();

    for (Integer field = 0; field < numFields; field++) {
      Field fieldConfig = new Field();
      String fieldRef = "createNewProcess.itemlist.item(" + field + ")";
      fieldConfig.key = projectConfig.getParamString(fieldRef);

      fieldConfig.from = projectConfig.getParamString(fieldRef + "[@from]");
      if (projectConfig.getParamBoolean(fieldRef + "[@ughbinding]")) {
        fieldConfig.ughbinding = Boolean.TRUE;
        fieldConfig.docstruct = projectConfig.getParamString(fieldRef + "[@docstruct]");
      } else {
        fieldConfig.ughbinding = Boolean.FALSE;
      }
      Integer selectEntries = projectConfig.getParamList(fieldRef + ".select").size();
      if (selectEntries > 0) {
        Map<String, String> selectConfig = new HashMap<String, String>();
        for (Integer selectEntry = 0; selectEntry < selectEntries; selectEntry++) {
          String key = projectConfig.getParamString(fieldRef + ".select(" + selectEntry + ")");
          String value = projectConfig.getParamString(fieldRef + ".select(" + selectEntry + ")[@label]");
          selectConfig.put(key, value);
        }
        fieldConfig.option = Label.toListOfLabels(selectConfig, KeyAttribute.LABEL);
      }
      fieldConfig.required = projectConfig.getParamBoolean(fieldRef + "[@required]");
      fields.add(fieldConfig);
    }
    return fields;
  }
View Full Code Here


  private void readProjectConfigs() {
    /*--------------------------------
     * projektabhängig die richtigen Felder in der Gui anzeigen
     * --------------------------------*/
    ConfigProjects cp = null;
    try {
      cp = new ConfigProjects(this.prozessVorlage.getProjekt().getTitel());
    } catch (IOException e) {
      Helper.setFehlerMeldung("IOException", e.getMessage());
      return;
    }

    this.docType = cp.getParamString("createNewProcess.defaultdoctype", this.co.getAllDoctypes().get(0).getTitle());
    this.useOpac = cp.getParamBoolean("createNewProcess.opac[@use]");
    this.useTemplates = cp.getParamBoolean("createNewProcess.templates[@use]");
    this.naviFirstPage = "ProzessverwaltungKopie1";
    if (this.opacKatalog.equals("")) {
      this.opacKatalog = cp.getParamString("createNewProcess.opac.catalogue");
    }

    /*
     * -------------------------------- die auszublendenden Standard-Felder ermitteln --------------------------------
     */
    for (String t : cp.getParamList("createNewProcess.itemlist.hide")) {
      this.standardFields.put(t, false);
    }

    /*
     * -------------------------------- die einzublendenen (zusätzlichen) Eigenschaften ermitteln --------------------------------
     */
    int count = cp.getParamList("createNewProcess.itemlist.item").size();
    for (int i = 0; i < count; i++) {
      AdditionalField fa = new AdditionalField(this);
      fa.setFrom(cp.getParamString("createNewProcess.itemlist.item(" + i + ")[@from]"));
      fa.setTitel(cp.getParamString("createNewProcess.itemlist.item(" + i + ")"));
      fa.setRequired(cp.getParamBoolean("createNewProcess.itemlist.item(" + i + ")[@required]"));
      fa.setIsdoctype(cp.getParamString("createNewProcess.itemlist.item(" + i + ")[@isdoctype]"));
      fa.setIsnotdoctype(cp.getParamString("createNewProcess.itemlist.item(" + i + ")[@isnotdoctype]"));

      // attributes added 30.3.09
      String test = (cp.getParamString("createNewProcess.itemlist.item(" + i + ")[@initStart]"));
      fa.setInitStart(test);

      fa.setInitEnd(cp.getParamString("createNewProcess.itemlist.item(" + i + ")[@initEnd]"));

      /*
       * -------------------------------- Bindung an ein Metadatum eines Docstructs --------------------------------
       */
      if (cp.getParamBoolean("createNewProcess.itemlist.item(" + i + ")[@ughbinding]")) {
        fa.setUghbinding(true);
        fa.setDocstruct(cp.getParamString("createNewProcess.itemlist.item(" + i + ")[@docstruct]"));
        fa.setMetadata(cp.getParamString("createNewProcess.itemlist.item(" + i + ")[@metadata]"));
      }

      /*
       * -------------------------------- prüfen, ob das aktuelle Item eine Auswahlliste werden soll --------------------------------
       */
      int selectItemCount = cp.getParamList("createNewProcess.itemlist.item(" + i + ").select").size();
      /* Children durchlaufen und SelectItems erzeugen */
      if (selectItemCount > 0) {
        fa.setSelectList(new ArrayList<SelectItem>());
      }
      for (int j = 0; j < selectItemCount; j++) {
        String svalue = cp.getParamString("createNewProcess.itemlist.item(" + i + ").select(" + j + ")[@label]");
        String sid = cp.getParamString("createNewProcess.itemlist.item(" + i + ").select(" + j + ")");
        fa.getSelectList().add(new SelectItem(sid, svalue, null));
      }
      this.additionalFields.add(fa);
    }
  }
View Full Code Here

  @Override
  @SuppressWarnings("rawtypes")
  public void CalcProzesstitel() {
    String newTitle = "";
    String titeldefinition = "";
    ConfigProjects cp = null;
    try {
      cp = new ConfigProjects(this.prozessVorlage.getProjekt().getTitel());
    } catch (IOException e) {
      Helper.setFehlerMeldung("IOException", e.getMessage());
      return;
    }

    int count = cp.getParamList("createNewProcess.itemlist.processtitle").size();
    for (int i = 0; i < count; i++) {
      String titel = cp.getParamString("createNewProcess.itemlist.processtitle(" + i + ")");
      String isdoctype = cp.getParamString("createNewProcess.itemlist.processtitle(" + i + ")[@isdoctype]");
      String isnotdoctype = cp.getParamString("createNewProcess.itemlist.processtitle(" + i + ")[@isnotdoctype]");

      if (titel == null) {
        titel = "";
      }
      if (isdoctype == null) {
View Full Code Here

  /* =============================================================== */

  @Override
  public void CalcTiffheader() {
    String tif_definition = "";
    ConfigProjects cp = null;
    try {
      cp = new ConfigProjects(this.prozessVorlage.getProjekt().getTitel());
    } catch (IOException e) {
      Helper.setFehlerMeldung("IOException", e.getMessage());
      return;
    }
   
    tif_definition = cp.getParamString("tifheader." + this.docType.toLowerCase(), "blabla");

    /*
     * -------------------------------- evtuelle Ersetzungen --------------------------------
     */
    tif_definition = tif_definition.replaceAll("\\[\\[", "<");
View Full Code Here

  private List<String> checkConfiguredValidationValues(DocStruct inStruct, ArrayList<String> inFehlerList, Prefs inPrefs, String language,
      ProjectObject project) {
    /*
     * -------------------------------- Konfiguration öffnen und die Validierungsdetails auslesen --------------------------------
     */
    ConfigProjects cp = null;
    try {
      cp = new ConfigProjects(project.getTitel());
    } catch (IOException e) {
      Helper.setFehlerMeldung("[" + this.title + "] " + "IOException", e.getMessage());
      return inFehlerList;
    }
    int count = cp.getParamList("validate.metadata").size();
    for (int i = 0; i < count; i++) {

      /* Attribute auswerten */
      String prop_metadatatype = cp.getParamString("validate.metadata(" + i + ")[@metadata]");
      String prop_doctype = cp.getParamString("validate.metadata(" + i + ")[@docstruct]");
      String prop_startswith = cp.getParamString("validate.metadata(" + i + ")[@startswith]");
      String prop_endswith = cp.getParamString("validate.metadata(" + i + ")[@endswith]");
      String prop_createElementFrom = cp.getParamString("validate.metadata(" + i + ")[@createelementfrom]");
      DocStruct myStruct = inStruct;
      MetadataType mdt = null;
      try {
        mdt = this.ughhelp.getMetadataType(inPrefs, prop_metadatatype);
      } catch (UghHelperException e) {
View Full Code Here

   */
  private List<String> checkConfiguredValidationValues(DocStruct inStruct, ArrayList<String> inFehlerList, Prefs inPrefs, String language) {
    /*
     * -------------------------------- Konfiguration öffnen und die Validierungsdetails auslesen --------------------------------
     */
    ConfigProjects cp = null;
    try {
      cp = new ConfigProjects(this.myProzess.getProjekt().getTitel());
    } catch (IOException e) {
      Helper.setFehlerMeldung("[" + this.myProzess.getTitel() + "] " + "IOException", e.getMessage());
      return inFehlerList;
    }
    int count = cp.getParamList("validate.metadata").size();
    for (int i = 0; i < count; i++) {

      /* Attribute auswerten */
      String prop_metadatatype = cp.getParamString("validate.metadata(" + i + ")[@metadata]");
      String prop_doctype = cp.getParamString("validate.metadata(" + i + ")[@docstruct]");
      String prop_startswith = cp.getParamString("validate.metadata(" + i + ")[@startswith]");
      String prop_endswith = cp.getParamString("validate.metadata(" + i + ")[@endswith]");
      String prop_createElementFrom = cp.getParamString("validate.metadata(" + i + ")[@createelementfrom]");
      DocStruct myStruct = inStruct;
      MetadataType mdt = null;
      try {
        mdt = this.ughhelp.getMetadataType(inPrefs, prop_metadatatype);
      } catch (UghHelperException e) {
View Full Code Here

      MetadataTypeNotAllowedException, ExportFileException,
      UghHelperException, SwapException, DAOException,
      TypeNotAllowedForParentException {
   
    this.myPrefs = myProzess.getRegelsatz().getPreferences();
    this.cp = new ConfigProjects(myProzess.getProjekt().getTitel());
    String atsPpnBand = myProzess.getTitel();

    /*
     * -------------------------------- Dokument einlesen
     * --------------------------------
 
View Full Code Here

    this.myPrefs = ProcessManager.getRuleset(process.getRulesetId()).getPreferences();
 
    this.project =ProjectManager.getProjectById(process.getProjekteID());
   
   
    this.cp = new ConfigProjects(this.project.getTitel());
    String atsPpnBand = process.getTitle();

    /*
     * -------------------------------- Dokument einlesen
     * --------------------------------
 
View Full Code Here

  public boolean startExport(Prozess myProzess) throws IOException, InterruptedException, WriteException, PreferencesException,
      DocStructHasNoTypeException, MetadataTypeNotAllowedException, ExportFileException, UghHelperException, SwapException, DAOException,
      TypeNotAllowedForParentException {
    new ProzessDAO().refresh(myProzess);
    this.myPrefs = myProzess.getRegelsatz().getPreferences();
    this.cp = new ConfigProjects(myProzess.getProjekt().getTitel());
    String atsPpnBand = myProzess.getTitel();

    /*
     * -------------------------------- Dokument einlesen --------------------------------
     */
 
View Full Code Here

        return false;
      }
    }

    /* nur beim Rusdml-Projekt die Metadaten aufbereiten */
    ConfigProjects cp = new ConfigProjects(myProzess.getProjekt().getTitel());
    if (cp.getParamList("dmsImport.check").contains("rusdml")) {
      ExportDms_CorrectRusdml expcorr = new ExportDms_CorrectRusdml(myProzess, this.myPrefs, gdzfile);
      atsPpnBand = expcorr.correctionStart();
    }

    String zielVerzeichnis = prepareUserDirectory(inZielVerzeichnis);
View Full Code Here

TOP

Related Classes of de.sub.goobi.config.ConfigProjects

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.