コード例 #1
0
  protected void addRootPlace(Element originInfoEl) {
    ModsTypeClient mods = getFirstMods();
    PlaceTypeClient placeClient = null;
    if (mods != null
        && mods.getOriginInfo() != null
        && mods.getOriginInfo().size() > 0
        && mods.getOriginInfo().get(0).getPlace() != null
        && mods.getOriginInfo().get(0).getPlace().size() > 0)
      placeClient = mods.getOriginInfo().get(0).getPlace().get(0);

    if (placeClient != null
        && placeClient.getPlaceTerm() != null
        && placeClient.getPlaceTerm().size() > 0) {
      String authority = placeClient.getPlaceTerm().get(0).getAuthority().value();
      String type = placeClient.getPlaceTerm().get(0).getType().value();
      String place = placeClient.getPlaceTerm().get(0).getValue();
      if (authority != null && type != null && place != null) {
        Element placeEl = originInfoEl.addElement(new QName("place", Namespaces.mods));
        Element placeTermEl = placeEl.addElement(new QName("placeTerm", Namespaces.mods));
        placeTermEl.addAttribute("type", type);
        placeTermEl.addAttribute("authority", authority);
        placeTermEl.addText(place);
      }
    }
  }
コード例 #2
0
 private TitleInfoTypeClient getFirstTitleInfo() {
   ModsTypeClient mods = getFirstMods();
   if (mods != null
       && mods.getTitleInfo() != null
       && mods.getTitleInfo().size() > 0
       && mods.getTitleInfo().get(0) != null) return mods.getTitleInfo().get(0);
   return null;
 }
コード例 #3
0
  protected String getTypeOfResource() {
    String typeOfResourceValue = null;

    ModsTypeClient mods = getFirstMods();
    if (mods != null
        && mods.getTypeOfResource() != null
        && mods.getTypeOfResource().size() > 0
        && mods.getTypeOfResource().get(0).getValue() != null) {
      typeOfResourceValue = mods.getTypeOfResource().get(0).getValue();
    }

    return typeOfResourceValue;
  }
コード例 #4
0
  protected Element addRootPhysicalDescriptionForm(Element modsRootEl) {
    ModsTypeClient mods = getFirstMods();
    List<StringPlusAuthorityPlusTypeClient> physDescForms = null;
    Element physDescEl = modsRootEl.addElement(new QName("physicalDescription", Namespaces.mods));

    if (mods != null
        && mods.getPhysicalDescription() != null
        && mods.getPhysicalDescription().size() > 0
        && mods.getPhysicalDescription().get(0).getForm() != null
        && mods.getPhysicalDescription().get(0).getForm().size() > 0) {
      physDescForms = mods.getPhysicalDescription().get(0).getForm();

      for (StringPlusAuthorityPlusTypeClient physDescForm : physDescForms) {
        String authority = physDescForm.getAuthority();
        String form = physDescForm.getValue();
        if (authority != null && form != null) {
          Element formEl = physDescEl.addElement(new QName("form", Namespaces.mods));
          formEl.addAttribute("authority", authority);
          formEl.addText(form);
        }
      }
    }
    return physDescEl;
  }
コード例 #5
0
  protected void addRootLanguage(Element modsRootEl) {
    ModsTypeClient mods = getFirstMods();
    if (mods != null
        && mods.getLanguage() != null
        && mods.getLanguage().size() > 0
        && mods.getLanguage().get(0).getLanguageTerm() != null
        && mods.getLanguage().get(0).getLanguageTerm().size() > 0
        && mods.getLanguage().get(0).getLanguageTerm().get(0) != null
        && isNotNullOrEmpty(mods.getLanguage().get(0).getLanguageTerm().get(0).getValue())) {

      Element languageEl = modsRootEl.addElement(new QName("language", Namespaces.mods));
      Element languageTerm = languageEl.addElement(new QName("languageTerm", Namespaces.mods));
      languageTerm.addAttribute("type", "code");
      languageTerm.addAttribute("authority", "iso639-2b");
      languageTerm.addText(mods.getLanguage().get(0).getLanguageTerm().get(0).getValue());
    }
  }