Skip to content

Commit

Permalink
Merge 50585be into 77b9265
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlittman committed Dec 18, 2019
2 parents 77b9265 + 50585be commit fca3c2d
Show file tree
Hide file tree
Showing 156 changed files with 2,937 additions and 14 deletions.
40 changes: 36 additions & 4 deletions lib/moab/storage_repository.rb
Expand Up @@ -93,10 +93,33 @@ def find_storage_root(object_id, include_deposit = false)
# @return [StorageObject] The representation of a digitial object's storage directory, which might not exist yet.
def find_storage_object(object_id, include_deposit = false)
root = find_storage_root(object_id, include_deposit)
storage_pathname = root.join(storage_trunk, storage_branch(object_id))
storage_object = StorageObject.new(object_id, storage_pathname)
storage_object.storage_root = root
storage_object
create_storage_object(object_id, root)
end

# @param object_id [String] The identifier of the digital object
# @param include_deposit [Boolean] specifies whether to look in deposit areas for objects in process of initial ingest
# @return [Array<StorageObject>] Representations of a digitial object's storage directories, or an empty array if none found.
def search_storage_objects(object_id, include_deposit = false)
storage_objects = []
# Search for the object's home directory in the storage areas
branch = storage_branch(object_id)
storage_roots.each do |root|
root_trunk = root.join(storage_trunk)
raise(MoabRuntimeError, "Storage area not found at #{root_trunk}") unless root_trunk.exist?
root_trunk_branch = root_trunk.join(branch)
storage_objects << create_storage_object(object_id, root) if root_trunk_branch.exist?
end
# Search for the object's directory in the deposit areas
if include_deposit && deposit_trunk
branch = deposit_branch(object_id)
storage_roots.each do |root|
root_trunk = root.join(deposit_trunk)
raise(MoabRuntimeError, "Deposit area not found at #{root_trunk}") unless root_trunk.exist?
root_trunk_branch = root_trunk.join(branch)
storage_objects << create_storage_object(object_id, root) if root_trunk_branch.exist?
end
end
storage_objects
end

# @param object_id [String] The identifier of the digital object whose size is desired
Expand Down Expand Up @@ -129,5 +152,14 @@ def storage_object(object_id, create = false)
def store_new_object_version(druid, bag_pathname)
storage_object(druid, create = true).ingest_bag(bag_pathname)
end

private

def create_storage_object(object_id, root)
storage_pathname = root.join(storage_trunk, storage_branch(object_id))
storage_object = StorageObject.new(object_id, storage_pathname)
storage_object.storage_root = root
storage_object
end
end
end
7 changes: 7 additions & 0 deletions lib/moab/storage_services.rb
Expand Up @@ -41,6 +41,13 @@ def self.find_storage_object(object_id, include_deposit = false)
@@repository.find_storage_object(object_id, include_deposit)
end

# @param object_id [String] The identifier of the digital object
# @param [Object] include_deposit
# @return [Array<StorageObject>] Representations of a digitial object's storage directories, or an empty array if none found.
def self.search_storage_objects(object_id, include_deposit = false)
@@repository.search_storage_objects(object_id, include_deposit)
end

# @param object_id [String] The identifier of the digital object whose size is desired
# @param include_deposit [Boolean] specifies whether to look in deposit areas for objects in process of initial ingest
# @return [Integer] the size occupied on disk by the storage object, in bytes. this is the entire moab (all versions).
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<contentMetadata type="sample" objectId="druid:jq937jp0017">
<resource type="version" sequence="1" id="version-1">
<file datetime="2012-03-26T08:15:11-06:00" size="40873" id="title.jpg" shelve="yes" publish="yes" preserve="yes">
<checksum type="MD5">1a726cd7963bd6d3ceb10a8c353ec166</checksum>
<checksum type="SHA-1">583220e0572640abcd3ddd97393d224e8053a6ad</checksum>
</file>
<file datetime="2012-03-26T08:20:35-06:00" size="41981" id="intro-1.jpg" shelve="yes" publish="yes" preserve="yes">
<checksum type="MD5">915c0305bf50c55143f1506295dc122c</checksum>
<checksum type="SHA-1">60448956fbe069979fce6a6e55dba4ce1f915178</checksum>
</file>
<file datetime="2012-03-26T08:19:30-06:00" size="39850" id="intro-2.jpg" shelve="yes" publish="yes" preserve="yes">
<checksum type="MD5">77f1a4efdcea6a476505df9b9fba82a7</checksum>
<checksum type="SHA-1">a49ae3f3771d99ceea13ec825c9c2b73fc1a9915</checksum>
</file>
<file datetime="2012-03-26T09:59:14-06:00" size="25153" id="page-1.jpg" shelve="yes" publish="yes" preserve="yes">
<checksum type="MD5">3dee12fb4f1c28351c7482b76ff76ae4</checksum>
<checksum type="SHA-1">906c1314f3ab344563acbbbe2c7930f08429e35b</checksum>
</file>
<file datetime="2012-03-26T09:23:36-06:00" size="39450" id="page-2.jpg" shelve="yes" publish="yes" preserve="yes">
<checksum type="MD5">82fc107c88446a3119a51a8663d1e955</checksum>
<checksum type="SHA-1">d0857baa307a2e9efff42467b5abd4e1cf40fcd5</checksum>
</file>
<file datetime="2012-03-26T09:24:39-06:00" size="19125" id="page-3.jpg" shelve="yes" publish="yes" preserve="yes">
<checksum type="MD5">a5099878de7e2e064432d6df44ca8827</checksum>
<checksum type="SHA-1">c0ccac433cf02a6cee89c14f9ba6072a184447a2</checksum>
</file>
</resource>
</contentMetadata>
@@ -0,0 +1,60 @@
<?xml version="1.0"?>
<mods:mods xmlns:mods="http://www.loc.gov/mods/v0003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.3" xsi:schemaLocation="http://www.loc.gov/mods/v0003 http://cosimo.stanford.edu/standards/mods/v0003/mods-3-3.xsd">
<mods:titleInfo>
<mods:nonSort>The</mods:nonSort>
<mods:title>poems of Robert Burns</mods:title>
<mods:subTitle>A new edition</mods:subTitle>
</mods:titleInfo>
<mods:name type="personal">
<mods:namePart>Burns, Robert</mods:namePart>
<mods:namePart type="date">1759-1796</mods:namePart>
<mods:role>
<mods:roleTerm authority="marcrelator" type="text">creator</mods:roleTerm>
</mods:role>
</mods:name>
<mods:typeOfResource>text</mods:typeOfResource>
<mods:originInfo>
<mods:place>
<mods:placeTerm type="code" authority="marccountry">stk</mods:placeTerm>
</mods:place>
<mods:place>
<mods:placeTerm type="text">Edinburgh</mods:placeTerm>
</mods:place>
<mods:publisher>Printed by Oliver &amp; Co.</mods:publisher>
<mods:dateIssued>1806</mods:dateIssued>
<mods:dateIssued encoding="marc" keyDate="yes">1806</mods:dateIssued>
<mods:issuance>monographic</mods:issuance>
</mods:originInfo>
<mods:language>
<mods:languageTerm authority="iso639-2b" type="code">eng</mods:languageTerm>
</mods:language>
<mods:relatedItem type="original">
<mods:physicalDescription>
<mods:form authority="marcform">print</mods:form>
<mods:extent>1 p. ., [5]-196 p. 12 cm.</mods:extent>
</mods:physicalDescription>
<mods:recordInfo>
<mods:recordContentSource authority="marcorg"/>
<mods:recordCreationDate encoding="marc">910108</mods:recordCreationDate>
<mods:recordChangeDate encoding="iso8601">19910108124826.0</mods:recordChangeDate>
<mods:recordIdentifier source="SUL catalog key">587254</mods:recordIdentifier>
<mods:recordIdentifier source="oclc">22934044</mods:recordIdentifier>
</mods:recordInfo>
</mods:relatedItem>
<mods:physicalDescription>
<mods:form authority="marcform">electronic</mods:form>
<mods:reformattingQuality>preservation</mods:reformattingQuality>
<mods:digitalOrigin>reformatted digital</mods:digitalOrigin>
</mods:physicalDescription>
<mods:note>Title vignette.</mods:note>
<mods:recordInfo>
<mods:recordContentSource>DOR_MARC2MODS3-3.xsl Revision 1.1</mods:recordContentSource>
<mods:recordCreationDate encoding="iso8601">2011-08-25T08:39:54.573-07:00</mods:recordCreationDate>
<mods:recordIdentifier source="Data Provider Digital Object Identifier">36105024276136</mods:recordIdentifier>
</mods:recordInfo>
<mods:identifier type="local" displayLabel="SUL Resource ID">druid:jq937jp0017</mods:identifier>
<mods:location>
<mods:physicalLocation>Stanford University Libraries</mods:physicalLocation>
<mods:url>http://purl.stanford.edu/jq937jp0017</mods:url>
</mods:location>
</mods:mods>
@@ -0,0 +1,20 @@
<identityMetadata>
<objectAdminClass>GoogleBooks</objectAdminClass>
<agreementId>druid:zn292gq7284</agreementId>
<objectType>item</objectType>
<citationTitle>The poems of Robert Burns: A new edition</citationTitle>
<citationCreator>Burns, Robert , 1759-1796</citationCreator>
<otherId name="catkey">587254</otherId>
<otherId name="shelfseq">821.5 .B961O T</otherId>
<otherId name="barcode">36105024276136</otherId>
<otherId name="callseq">1</otherId>
<otherId name="uuid">89abf2c4-c121-41f0-8838-484a661c92d9</otherId>
<objectId>druid:jq937jp0017</objectId>
<objectCreator>DOR</objectCreator>
<sourceId source="google">STANFORD_36105024276136</sourceId>
<objectLabel>Google Scanned Book, barcode 36105024276136</objectLabel>
<tag>Google Book : GBS VIEW_FULL</tag>
<tag>Book : Non-US pre-1891</tag>
<tag>Google Book : Scan source STANFORD</tag>
<tag>Remediated By : 3.6.2</tag>
</identityMetadata>
@@ -0,0 +1,86 @@
<provenanceMetadata xmlns:PREMIS="info:lc/xmlns/premis-v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" objectId="druid:jq937jp0017">
<agent name="Google">
<PREMIS:premis version="2.0">
<PREMIS:object xsi:type="representation">
<PREMIS:objectIdentifier>
<PREMIS:objectIdentifierType>barcode</PREMIS:objectIdentifierType>
<PREMIS:objectIdentifierValue>STANFORD_36105024276136</PREMIS:objectIdentifierValue>
</PREMIS:objectIdentifier>
<PREMIS:significantProperties>
<PREMIS:significantPropertiesType>file count</PREMIS:significantPropertiesType>
<PREMIS:significantPropertiesValue>410</PREMIS:significantPropertiesValue>
</PREMIS:significantProperties>
<PREMIS:significantProperties>
<PREMIS:significantPropertiesType>page count</PREMIS:significantPropertiesType>
<PREMIS:significantPropertiesValue>204</PREMIS:significantPropertiesValue>
</PREMIS:significantProperties>
</PREMIS:object>
<PREMIS:event xmlID="Google_Scan">
<PREMIS:eventIdentifier>
<PREMIS:eventIdentifierType>Google generated</PREMIS:eventIdentifierType>
<PREMIS:eventIdentifierValue>Google_Scan</PREMIS:eventIdentifierValue>
</PREMIS:eventIdentifier>
<PREMIS:eventType>Scan</PREMIS:eventType>
<PREMIS:eventDateTime>2009-03-25T07:04:20</PREMIS:eventDateTime>
<PREMIS:eventDetail>Original image capture</PREMIS:eventDetail>
<PREMIS:linkingAgentIdentifier>
<PREMIS:linkingAgentIdentifierType>AgentID</PREMIS:linkingAgentIdentifierType>
<PREMIS:linkingAgentIdentifierValue>Google (Firm)</PREMIS:linkingAgentIdentifierValue>
</PREMIS:linkingAgentIdentifier>
</PREMIS:event>
<PREMIS:event xmlID="Google_Process">
<PREMIS:eventIdentifier>
<PREMIS:eventIdentifierType>Google generated</PREMIS:eventIdentifierType>
<PREMIS:eventIdentifierValue>Google_Process</PREMIS:eventIdentifierValue>
</PREMIS:eventIdentifier>
<PREMIS:eventType>Process</PREMIS:eventType>
<PREMIS:eventDateTime>2010-04-04T06:24:51</PREMIS:eventDateTime>
<PREMIS:eventDetail>Refinement and cleaning of raw scanned images using image enhancement techniques</PREMIS:eventDetail>
<PREMIS:linkingAgentIdentifier>
<PREMIS:linkingAgentIdentifierType>AgentID</PREMIS:linkingAgentIdentifierType>
<PREMIS:linkingAgentIdentifierValue>Google (Firm)</PREMIS:linkingAgentIdentifierValue>
</PREMIS:linkingAgentIdentifier>
</PREMIS:event>
<PREMIS:event xmlID="Google_Analyze">
<PREMIS:eventIdentifier>
<PREMIS:eventIdentifierType>Google generated</PREMIS:eventIdentifierType>
<PREMIS:eventIdentifierValue>Google_Analyze</PREMIS:eventIdentifierValue>
</PREMIS:eventIdentifier>
<PREMIS:eventType>Analyze</PREMIS:eventType>
<PREMIS:eventDateTime>2011-02-01T13:59:22</PREMIS:eventDateTime>
<PREMIS:eventDetail>Automated quality assessment, extraction of OCR text and metadata, assignment of metadata tags, and page ordering</PREMIS:eventDetail>
<PREMIS:linkingAgentIdentifier>
<PREMIS:linkingAgentIdentifierType>AgentID</PREMIS:linkingAgentIdentifierType>
<PREMIS:linkingAgentIdentifierValue>Google (Firm)</PREMIS:linkingAgentIdentifierValue>
</PREMIS:linkingAgentIdentifier>
</PREMIS:event>
<PREMIS:event xmlID="Google_Convert">
<PREMIS:eventIdentifier>
<PREMIS:eventIdentifierType>Google generated</PREMIS:eventIdentifierType>
<PREMIS:eventIdentifierValue>Google_Convert</PREMIS:eventIdentifierValue>
</PREMIS:eventIdentifier>
<PREMIS:eventType>Convert</PREMIS:eventType>
<PREMIS:eventDateTime>2011-08-25T08:38:33</PREMIS:eventDateTime>
<PREMIS:eventDetail>Creation of partner deliverables</PREMIS:eventDetail>
<PREMIS:linkingAgentIdentifier>
<PREMIS:linkingAgentIdentifierType>AgentID</PREMIS:linkingAgentIdentifierType>
<PREMIS:linkingAgentIdentifierValue>Google (Firm)</PREMIS:linkingAgentIdentifierValue>
</PREMIS:linkingAgentIdentifier>
</PREMIS:event>
<PREMIS:agent>
<PREMIS:agentIdentifier>
<PREMIS:agentIdentifierType>LCNAF</PREMIS:agentIdentifierType>
<PREMIS:agentIdentifierValue>Google (Firm)</PREMIS:agentIdentifierValue>
</PREMIS:agentIdentifier>
<PREMIS:agentType>organization</PREMIS:agentType>
</PREMIS:agent>
</PREMIS:premis>
</agent>
<agent name="DOR">
<what object="druid:jq937jp0017">
<event who="DOR-robot:process-content" when="2011-08-26T01:45:37-07:00">Image files JHOVE 1.4 validated</event>
<event who="DOR-robot:register-object" when="2011-08-25T08:21:22-0700">Google data received</event>
<event who="DOR-robot:google-download" when="2011-08-25T21:24:13-0700">Checksums verified</event>
</what>
</agent>
</provenanceMetadata>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<versionMetadata objectId="druid:jq937jp0017">
<version versionId="1" label="1.0" significance="major">
<description>Initial version</description>
</version>
</versionMetadata>
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileInventoryDifference objectId="druid:jq937jp0017" differenceCount="11" basis="v0" other="v1" reportDatetime="2019-12-17T18:47:20Z">
<fileGroupDifference groupId="content" differenceCount="6" identical="0" copyadded="0" copydeleted="0" renamed="0" modified="0" added="6" deleted="0">
<subset change="added" count="6">
<file change="added" basisPath="" otherPath="intro-1.jpg">
<fileSignature size="41981" md5="915c0305bf50c55143f1506295dc122c" sha1="60448956fbe069979fce6a6e55dba4ce1f915178" sha256="4943c6ffdea7e33b74fd7918de900de60e9073148302b0ad1bf5df0e6cec032a"/>
</file>
<file change="added" basisPath="" otherPath="intro-2.jpg">
<fileSignature size="39850" md5="77f1a4efdcea6a476505df9b9fba82a7" sha1="a49ae3f3771d99ceea13ec825c9c2b73fc1a9915" sha256="3a28718a8867e4329cd0363a84aee1c614d0f11229a82e87c6c5072a6e1b15e7"/>
</file>
<file change="added" basisPath="" otherPath="page-1.jpg">
<fileSignature size="25153" md5="3dee12fb4f1c28351c7482b76ff76ae4" sha1="906c1314f3ab344563acbbbe2c7930f08429e35b" sha256="41aaf8598c9d8e3ee5d55efb9be11c542099d9f994b5935995d0abea231b8bad"/>
</file>
<file change="added" basisPath="" otherPath="page-2.jpg">
<fileSignature size="39450" md5="82fc107c88446a3119a51a8663d1e955" sha1="d0857baa307a2e9efff42467b5abd4e1cf40fcd5" sha256="235de16df4804858aefb7690baf593fb572d64bb6875ec522a4eea1f4189b5f0"/>
</file>
<file change="added" basisPath="" otherPath="page-3.jpg">
<fileSignature size="19125" md5="a5099878de7e2e064432d6df44ca8827" sha1="c0ccac433cf02a6cee89c14f9ba6072a184447a2" sha256="7bd120459eff0ecd21df94271e5c14771bfca5137d1dd74117b6a37123dfe271"/>
</file>
<file change="added" basisPath="" otherPath="title.jpg">
<fileSignature size="40873" md5="1a726cd7963bd6d3ceb10a8c353ec166" sha1="583220e0572640abcd3ddd97393d224e8053a6ad" sha256="8b0cee693a3cf93cf85220dd67c5dc017a7edcdb59cde8fa7b7f697be162b0c5"/>
</file>
</subset>
<subset change="identical" count="0"/>
<subset change="copyadded" count="0"/>
<subset change="copydeleted" count="0"/>
<subset change="renamed" count="0"/>
<subset change="modified" count="0"/>
<subset change="deleted" count="0"/>
</fileGroupDifference>
<fileGroupDifference groupId="metadata" differenceCount="5" identical="0" copyadded="0" copydeleted="0" renamed="0" modified="0" added="5" deleted="0">
<subset change="added" count="5">
<file change="added" basisPath="" otherPath="contentMetadata.xml">
<fileSignature size="1871" md5="8cdee9c3470552d258a4351bf4c117e2" sha1="321737e42cc4a3134164539f768514d4f7f6d184" sha256="af38d344d9aee248b01b0af9c85dffbfbd1aeb0f2c6dadf3620797ca73ab24c3"/>
</file>
<file change="added" basisPath="" otherPath="descMetadata.xml">
<fileSignature size="3055" md5="19c96e98dd25dd68c493faa6a0fde4d0" sha1="541d5845cc866d7676fa43c337b3f7a59f597487" sha256="a575d9058a56d77a4e65e2b1bedb619686a03d5f717374bd0df98d422432e1fe"/>
</file>
<file change="added" basisPath="" otherPath="identityMetadata.xml">
<fileSignature size="932" md5="f0815d7b45530491931d5897ccbe2dd1" sha1="4065ff5523e227c1914098372a3dc587f739030e" sha256="f48727374e73776d00517dcdc8af62ec8b18a24cff46c66a5c5f85515144628e"/>
</file>
<file change="added" basisPath="" otherPath="provenanceMetadata.xml">
<fileSignature size="5306" md5="17193dbf595571d728ba59aa31638db9" sha1="c8b91eacf9ad7532a42dc52b3c9cf03b4ad2c7f6" sha256="d38899a57d4cfca2b1ac73356c8a89cd3c902d35b853ae52f468004887b73dbe"/>
</file>
<file change="added" basisPath="" otherPath="versionMetadata.xml">
<fileSignature size="224" md5="36e3c1dadad827cb49e521f5d6559127" sha1="af96327b72bf37e3e60cf51c6de4dba1f6dea620" sha256="65426a7389e13dfa73d37c0ab1417c3e31de74289bf77cc74b3dcc3ffa6f4c8e"/>
</file>
</subset>
<subset change="identical" count="0"/>
<subset change="copyadded" count="0"/>
<subset change="copydeleted" count="0"/>
<subset change="renamed" count="0"/>
<subset change="modified" count="0"/>
<subset change="deleted" count="0"/>
</fileGroupDifference>
</fileInventoryDifference>

0 comments on commit fca3c2d

Please sign in to comment.