if (rcObjectMetadata.getObjectType() == RcObjectType.MONOGRAPH) { text += rcObjectMetadata.getTitle(); else if (rcObjectMetadata.getObjectType() == RcObjectType.SERIAL_MONOGRAPH) { text += rcObjectMetadata.getTitle(); if (htmlFormatting) { text += "<span style=\"font-size:8px;font-weight:normal;\"><span style=\"color:Gray;\">"; else if (rcObjectMetadata.getObjectType() == RcObjectType.SERIAL) { text += rcObjectMetadata.getTitle(); if (htmlFormatting) { text += "<span style=\"font-size:8px;font-weight:normal;\"><span style=\"color:Gray;\">"; else if (rcObjectMetadata.getObjectType() == RcObjectType.NEWSPAPER) { text += rcObjectMetadata.getTitle(); if (((RcNewspaperMetadata) rcObjectMetadata).getVolume() != null) { if (htmlFormatting) { else if (rcObjectMetadata.getObjectType() == RcObjectType.PHOTO) { text += rcObjectMetadata.getTitle(); text += rcObjectMetadata.getTitle(); text += rcObjectMetadata.getTitle().trim(); if (rcObjectMetadata.getDatePublished() != null) { text += rcObjectMetadata.getDatePublished();
rcFsDsMd = rcObjMd.getParentFileSystemDataSourceMetadata(); rcObjMd.loadStructure(); rcObjMd.clearStructure(); throw new ServletException(exceptionPrefix + "There is no video file metadata associated with " + rcObjMd.getId() + ".");
public static List<RcNameMetadata> getNames(RcObjectMetadata rcObjMd, RcMarcRelator role) { return rcObjMd.getNames(role); }
private String getLabel(RcObjectMetadata rcObjMd) { if ((rcObjMd.getObjectType() == RcObjectType.SERIAL || rcObjMd.getObjectType() == RcObjectType.NEWSPAPER) && rcObjMd.getDatePublished() != null) { return rcObjMd.getTitle() + " " + rcObjMd.getDatePublished(); } else { return rcObjMd.getTitle(); } }
/** * Checks if an object id using the specified institution id, aggregator id, * and root id has already been used in the current data set. * * @param institutionId * The institution is the check for. * @param aggregatorId * The aggregator id to check for. * @param rootId * The root id to check for. * * @return True if an object id using the specified institution id, * aggregator id, and root id has already been used in the current * data set. */ private boolean isObjectIdUsed(String institutionId, String aggregatorId, String rootId) { if (this.targetObjects != null) { for (RcMetadata rcMd : this.targetObjects) { if (rcMd instanceof RcObjectMetadata && ((RcObjectMetadata) rcMd).getInstitutionId().equals(institutionId) && ((RcObjectMetadata) rcMd).getAggregator().equals(aggregatorId) && ((RcObjectMetadata) rcMd).getRootId().equals(rootId)) { return true; } } } return false; }
throw new IOException(curMetsObjectMetadataFile.getPath() + " does not exist."); rcObjMd = RcObjectMetadata.readMets(curMetsObjectMetadataFile); rcObjMd.clearStructure(); this.rcObjectMetadataMap.put(rcObjMd.getId(), rcObjMd); this.setProgress(Math.round((((float) i + 1) / ((float) this.rcObjectDirectoryList.size())) * 100F));
rcObjMd = RcObjectMetadata.readMets(sourceMetsFile); File destObjDir = new File(destinationDirectory.getPath() + File.separator + rcObjMd.getId()); observer.putStatusMessage("WARNING: Skipping pre-existing object " + rcObjMd.getId() + ".\n", showDateTime); observer.putStatusMessage("WARNING: Deleted pre-existing object directory " + rcObjMd.getId() + ".\n", showDateTime); rcObjMd = defaultMetadata.clone(null, false); if (rcObjMd.getObjectType().getDataType() != rcObjDataType) { throw new RcDataConversionException("Unable to apply " + rcObjMd.getObjectType().getDisplayString() + " metadata to " + rcObjDataType + " data."); rcObjMd.setInstitutionId(institutionId); rcObjMd.setAggregator(aggregator); rcObjMd.setRootId(StringUtils.padl(Integer.toString(curRootIdIndex), 8, '0')); File metsSourceFile = new File(metsSourceFileName); try { rcObjMd = RcObjectMetadata.readMets(metsSourceFile); if (rcObjMd.getObjectType() == RcObjectType.PHOTO && sourceFilePageCount > rcImgMdList.size()) { if (rcObjMd.getObjectType() == RcObjectType.PHOTO && sourceFilePageCount > rcImgMdList.size()) { for (RcLanguageMetadata rcLangMd : rcObjMd.getLanguages()) {
String extObjId = rcCollectionMetadata.getTitle() + "/" + rcObjectMetadata.getId(); if (rcObjectMetadata.getObjectType() == RcObjectType.MONOGRAPH) { typeField = new Field("type", RcAr2Indexer.RC_AR2_MONOGRAPH_OBJECT_TYPE, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); else if (rcObjectMetadata.getObjectType() == RcObjectType.SERIAL_MONOGRAPH) { typeField = new Field("type", RcAr2Indexer.RC_AR2_SERIAL_MONOGRAPH_OBJECT_TYPE, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); else if (rcObjectMetadata.getObjectType() == RcObjectType.SERIAL) { typeField = new Field("type", RcAr2Indexer.RC_AR2_SERIAL_OBJECT_TYPE, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); else if (rcObjectMetadata.getObjectType() == RcObjectType.NEWSPAPER) { typeField = new Field("type", RcAr2Indexer.RC_AR2_NEWSPAPER_OBJECT_TYPE, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); else if (rcObjectMetadata.getObjectType() == RcObjectType.PHOTO) { typeField = new Field("type", RcAr2Indexer.RC_AR2_PHOTO_OBJECT_TYPE, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); else if (rcObjectMetadata.getObjectType() == RcObjectType.AUDIO_RECORDING) { typeField = new Field("type", RcAr2Indexer.RC_AR2_AUDIO_RECORDING_OBJECT_TYPE, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); if (rcObjectMetadata.getTitle() != null) { tTitleField = new Field("t_title", rcObjectMetadata.getTitle().trim(), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); iTitleField = new Field("i_title", RcAr2Indexer.stripLeadingAndTrailingPunctuation(rcObjectMetadata.getTitle().trim().toLowerCase(), stripUnderscores), Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); if (rcObjectMetadata.getAbstract() != null) { abstractField = new Field("abstract", RcAr2Indexer.stripLeadingAndTrailingPunctuation(rcObjectMetadata.getAbstract().trim().toLowerCase(), stripUnderscores), Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); if (rcObjectMetadata.getObjectType() == RcObjectType.SERIAL_MONOGRAPH) { volumeField = new Field("volume", ((RcSerialMonographMetadata) rcObjectMetadata).getVolume() != null ? ((RcSerialMonographMetadata) rcObjectMetadata).getVolume() : "", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS);
rcObjMd = RcObjectMetadata.readMets(sourceMetsFile); File destObjDir = new File(destinationDirectory.getPath() + File.separator + rcObjMd.getId()); observer.putStatusMessage("WARNING: Skipping pre-existing object " + rcObjMd.getId() + ".\n", showDateTime); observer.putStatusMessage("WARNING: Deleted pre-existing object directory " + rcObjMd.getId() + ".\n", showDateTime); curSourceRcObjectMetadata = RcObjectMetadata.readMets(curSourceMetadataFile); if (observer != null) observer.putStatusMessage("(Done)\n", false); for (RcLanguageMetadata rcLangMd : curSourceRcObjectMetadata.getLanguages()) { throw new RcDataConversionException("Object id " + curSourceRcObjectMetadata.getId() + " contains an invalid ISO language code."); if (curSourceRcObjectMetadata.getDateCaptured() == null) { curSourceRcObjectMetadata.setDateCaptured(RcDateUtils.getISO8601Date()); if (!curDestinationDirectoryPath.endsWith(File.separator)) curDestinationDirectoryPath += File.separator; curDestinationDirectoryPath += curSourceRcObjectMetadata.getInstitutionId() + File.separator; curDestinationDirectory = new File(curDestinationDirectoryPath); if (!curDestinationDirectory.exists()) curDestinationDirectory.mkdir(); curDestinationDirectoryPath += curSourceRcObjectMetadata.getAggregator() + File.separator; curDestinationDirectory = new File(curDestinationDirectoryPath); if (!curDestinationDirectory.exists()) curDestinationDirectory.mkdir();
if (rcObjMd.getObjectType().getDataType() != RcObjectDataType.IMAGE) { extObjId = rcCollMd.getTitle() + "/" + rcObjMd.getId(); rcObjMd.loadStructure(rcDataVolumeDirectory); observer.outputStatusMessage(" Error indexing page " + rcObjMd.getId() + "/" + rcImgMd.getTechnicalMetadata().getFilename() + " - " + ex.getMessage() + "\n", Color.RED); rcObjMd.clearStructure(); extObjId = rcCollMd.getTitle() + "/" + rcObjMd.getId();
rcObjMd.loadStructure(); rcImgMdList = new ArrayList<RcImageMetadata>(((RcCompoundImageObjectMetadata) rcObjMd).getPhysicalStructure()); rcObjMd.clearStructure(); RcFileSystemDataSourceMetadata rcFsDsMd = rcObjMd.getParentFileSystemDataSourceMetadata(); File rcObjDir = rcFsDsMd.getDirectory(rcObjMd); RcIrPageQuery rcIrPgQuery = new RcIrPageQuery(rcCollMd.getId() + "/" + rcObjMd.getId(), new ArrayList<RcIrQueryClause>()); RcIrPageQueryResults rcIrPgQueryResults = this.rcWebApp.getRcIrSearcher().searchPages(rcIrPgQuery); manifest.put("@type", "sc:Manifest"); manifest.put("label", this.getLabel(rcObjMd)); manifest.put("description", this.getDescriptions(rcObjMd.getAbstracts())); if (rcObjMd.getUseAndReproductionRestrictions() != null && (!rcObjMd.getUseAndReproductionRestrictions().isEmpty())) { manifest.put("attribution", rcObjMd.getUseAndReproductionRestrictions()); canvas.put("@id", baseUrl + IIIF_PRESENTATION_API_PATH + "/" + rcCollMd.getId() + RC_ID_PATH_SEPARATOR + rcObjMd.getId().replace("/", RC_ID_PATH_SEPARATOR) + "/canvas/" + i); canvas.put("@type", "sc:Canvas"); canvas.put("label", new JSONArray().put(rcImgMd.getPageName())); thumbnail.put("@id", baseUrl + THUMBNAIL_SERVICE_PATH + "?obj_id=" + rcObjMd.getId() + "&pg_idx=" + i + "&obj_type=" + rcObjMd.getObjectType()); thumbnail.put("@type", "dctypes:image"); thumbnail.put("format", "image/jpeg"); image.put("@id", baseUrl + IIIF_PRESENTATION_API_PATH + "/" + rcCollMd.getId() + RC_ID_PATH_SEPARATOR + rcObjMd.getId().replace("/", RC_ID_PATH_SEPARATOR) + "/annotation/" + i); image.put("@type", "oa:Annotation"); image.put("motivation", "sc:painting");
if (((RcObjectMetadata) value).getObjectType() == RcObjectType.MONOGRAPH) { text += ((RcObjectMetadata) value).getTitle(); else if (((RcObjectMetadata) value).getObjectType() == RcObjectType.SERIAL_MONOGRAPH) { text += ((RcObjectMetadata) value).getTitle(); text += "<span style=\"font-size:8px;font-weight:normal;\"><span style=\"color:Gray;\"> v</span>" + ((RcSerialMonographMetadata) ((RcObjectMetadata) value)).getVolume() + "</span>"; else if (((RcObjectMetadata) value).getObjectType() == RcObjectType.SERIAL) { text += ((RcObjectMetadata) value).getTitle(); text += "<span style=\"font-size:8px;font-weight:normal;\"><span style=\"color:Gray;\"> v</span>" + ((RcSerialMetadata) ((RcObjectMetadata) value)).getVolume() + "</span>"; for (RcMetadata rcMd : ((RcSerialMetadata) ((RcObjectMetadata) value)).getLogicalStructure()) { else if (((RcObjectMetadata) value).getObjectType() == RcObjectType.NEWSPAPER) { text += ((RcObjectMetadata) value).getTitle(); if (((RcNewspaperMetadata) value).getVolume() != null) { text += "<span style=\"font-size:8px;font-weight:normal;\"><span style=\"color:Gray;\"> v</span>" + ((RcNewspaperMetadata) value).getVolume() + "</span>"; else if (((RcObjectMetadata) value).getObjectType() == RcObjectType.PHOTO) { text += ((RcObjectMetadata) value).getTitle(); text += ((RcObjectMetadata) value).getTitle(); text += ((RcObjectMetadata) value).getId(); text += this.getShortPath(((RcObjectMetadata) value).getParentFileSystemDataSourceMetadata());
try { if (this.rcCollectionMetadata.getObjectMap().containsKey(rcObjectMetadataToAdd[i].getId())) { throw new RcMetadataException("The object " + rcObjectMetadataToAdd[i].getId() + " already exists in " + this.rcCollectionMetadata.getTitle() + "."); if (rcObjectMetadataToAdd[i].getDateCaptured() != null && rcObjectMetadataToAdd[i].getDateCaptured().trim().length() > 0 && (!RcDateUtils.isISO8601(rcObjectMetadataToAdd[i].getDateCaptured()))) throw new RcMetadataException("The date captured for title \"" + rcObjectMetadataToAdd[i].getTitle() + "\" is not ISO8601 compliant."); if (rcObjectMetadataToAdd[i].getDatePublished() != null && rcObjectMetadataToAdd[i].getDatePublished().trim().length() > 0 && (!RcDateUtils.isISO8601(rcObjectMetadataToAdd[i].getDatePublished()))) throw new RcMetadataException("The date published for title \"" + rcObjectMetadataToAdd[i].getTitle() + "\" is not ISO8601 compliant."); curRcObjectMetadataToAdd = rcObjectMetadataToAdd[i].clone(this.rcCollectionMetadata, true); curRcObjectMetadataToAdd.setCollection(this.rcCollectionMetadata); this.rcCollectionMetadata.getObjectMap().put(curRcObjectMetadataToAdd.getId(), curRcObjectMetadataToAdd); collIdSet = this.assignedObjectMap.get(curRcObjectMetadataToAdd.getId()); this.assignedObjectMap.put(curRcObjectMetadataToAdd.getId(), collIdSet);
o.put("coll_id", ((RcCollectionMetadata) rcObjMd.getParentMetadata()).getId()); o.put("index", objStartIndex); o.put("id", rcObjMd.getId()); o.put("type", rcObjMd.getObjectType().toString()); o.put("title", rcObjMd.getTitle());
rcObjMd.loadStructure(); rcImgMdList = new ArrayList<RcImageMetadata>(((RcCompoundImageObjectMetadata) rcObjMd).getPhysicalStructure()); rcWebSessionData.addPhysPgStructCacheEntry(extObjId, rcImgMdList); rcObjMd.clearStructure(); try { rcFsDsMd = rcObjMd.getParentFileSystemDataSourceMetadata(); RcPdfBoxImageToPdf.RcPdfBoxTextBlock metadataFooterTextBlock = new RcPdfBoxImageToPdf.RcPdfBoxTextBlock(rcObjMd.getTitle()); rcPdfMetadata.setTitle(rcObjMd.getTitle() + " - Page " + rcImgMd.getPageName()); for (RcNameMetadata rcNameMd : rcObjMd.getNames()) {
curObjectType = prevObjMd.getObjectType(); ownerNameMd.setType(RcModsName.RcModsTypeAttribute.CORPORATE); ownerNameMd.getRoles().add(RcMarcRelator.OWNER); ownerNameMd.setName(this.config.getInstitutionMetadata().get(newMd.getInstitutionId()).getName()); newMd.getNames().add(ownerNameMd); rcLangMd.setLanguage(this.config.getDefaultLanguageCode()); newMd.getLanguages().add(rcLangMd); newMd.readMods(prevObjMd.getMods());
rcFsDsMd = rcObjMd.getParentFileSystemDataSourceMetadata(); rcObjMd.loadStructure(); rcObjMd.clearStructure();
s1 = rcObjMd1.getCollection().getTitle(); s2 = rcObjMd2.getCollection().getTitle(); s1 = rcObjMd1.getTitle(); s2 = rcObjMd2.getTitle(); if (rcObjMd1.getObjectType() == RcObjectType.SERIAL) { else if (rcObjMd1.getObjectType() == RcObjectType.SERIAL_MONOGRAPH) { else if (rcObjMd1.getObjectType() == RcObjectType.NEWSPAPER) { if (rcObjMd2.getObjectType() == RcObjectType.SERIAL) { else if (rcObjMd2.getObjectType() == RcObjectType.SERIAL_MONOGRAPH) { else if (rcObjMd2.getObjectType() == RcObjectType.NEWSPAPER) { if (rcObjMd1.getObjectType() == RcObjectType.SERIAL) { else if (rcObjMd1.getObjectType() == RcObjectType.NEWSPAPER) { if (rcObjMd2.getObjectType() == RcObjectType.SERIAL) { else if (rcObjMd2.getObjectType() == RcObjectType.NEWSPAPER) { if (rcObjMd1.getDatePublished() != null) { s1 = rcObjMd1.getDatePublished();
rcObjMd.loadStructure(); rcObjMd.clearStructure();