Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repository seed objects. #236

Merged
merged 2 commits into from Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/tasks/cleaner.rake
Expand Up @@ -17,4 +17,22 @@ task delete_all_objects: :environment do
Dor::CleanupService.nuke!(object.pid)
end
end

# Clear out anything else remaining in solr:
conn = ActiveFedora::SolrService.instance.conn
conn.delete_by_query('*:*')
conn.commit

Rake::Task['seeds'].invoke
end

desc 'Seed the repository with workflows and APOs'
task seed: :environment do
druids = File.readlines(File.join(__dir__, 'seeds', 'druids'))
druids.each do |line|
druid, description = line.split(/\s/, 2)
puts "Loading '#{description.chomp}'"
file = File.join(__dir__, 'seeds', "#{druid}.xml")
ActiveFedora::FixtureLoader.import_to_fedora(file, druid)
end
end
442 changes: 442 additions & 0 deletions lib/tasks/seeds/druid:bb163sd6279.xml

Large diffs are not rendered by default.

2,806 changes: 2,806 additions & 0 deletions lib/tasks/seeds/druid:hv992ry2431.xml

Large diffs are not rendered by default.

147 changes: 147 additions & 0 deletions lib/tasks/seeds/druid:rs056hz6024.xml
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject VERSION="1.1" PID="druid:rs056hz6024"
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="assemblyWF"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="DOR"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2011-07-05T17:12:18.779Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2017-08-04T21:31:11.256Z"/>
</foxml:objectProperties>
<foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2011-07-05T17:12:18.779Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit">
<foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>workflowDefinition</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2012-08-23T17:35:43.534Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
<audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>workflowDefinition</audit:componentID>
<audit:responsibility>argo-test.stanford.edu</audit:responsibility>
<audit:date>2012-11-13T21:50:04.016Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
<audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>workflowDefinition</audit:componentID>
<audit:responsibility>argo-prod-a.stanford.edu</audit:responsibility>
<audit:date>2017-01-19T19:49:14.064Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
<audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>argo-prod-a.stanford.edu</audit:responsibility>
<audit:date>2017-08-04T21:31:11.256Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
</audit:auditTrail>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="DC.1" LABEL="Dublin Core Record for this object" CREATED="2011-08-15T20:47:25.868Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="455">
<foxml:xmlContent>
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>assemblyWF</dc:title>
<dc:identifier>uuid:f4ea0640-0f0f-11e2-892e-0800200c9a66</dc:identifier>
<dc:identifier>druid:rs056hz6024</dc:identifier>
</oai_dc:dc>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="RELS-EXT.0" LABEL="RDF Statements about this object" CREATED="2011-07-05T17:12:18.916Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="463">
<foxml:xmlContent>
<rdf:RDF xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:hydra="http://projecthydra.org/ns/relations#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="info:fedora/fedora-system:def/relations-external#">
<rdf:Description rdf:about="info:fedora/druid:rs056hz6024">
<hydra:isGovernedBy rdf:resource="info:fedora/druid:hv992ry2431"></hydra:isGovernedBy>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion ID="RELS-EXT.1" LABEL="RDF Statements about this object" CREATED="2017-08-04T21:31:11.256Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="575">
<foxml:xmlContent>
<rdf:RDF xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:hydra="http://projecthydra.org/ns/relations#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="info:fedora/fedora-system:def/relations-external#">
<rdf:Description rdf:about="info:fedora/druid:rs056hz6024">
<hydra:isGovernedBy rdf:resource="info:fedora/druid:hv992ry2431"></hydra:isGovernedBy>
<fedora-model:hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/afmodel:Dor_WorkflowObject"></fedora-model:hasModel>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="descMetadata" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="descMetadata.1" LABEL="Descriptive Metadata" CREATED="2011-09-16T19:35:12.064Z" MIMETYPE="text/xml" SIZE="316">
<foxml:xmlContent>
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.3" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd">
<titleInfo>
<title>assemblyWF</title>
</titleInfo>
</mods>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="identityMetadata" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="identityMetadata.1" LABEL="Identity Metadata" CREATED="2011-07-05T17:25:35.008Z" MIMETYPE="text/xml" SIZE="405">
<foxml:xmlContent>
<identityMetadata>
<objectLabel>Assembly Workflow</objectLabel>
<objectType>workflow</objectType>
<otherId name="uuid">f4ea0640-0f0f-11e2-892e-0800200c9a66</otherId>
<objectId>druid:rs056hz6024</objectId>
<objectCreator>DOR</objectCreator>
<agreementId>druid:xf765cv5573</agreementId>
<tag>Project : DOR</tag>
</identityMetadata>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="workflows" STATE="A" CONTROL_GROUP="E" VERSIONABLE="false">
<foxml:datastreamVersion ID="workflows.0" LABEL="Workflow" CREATED="2012-06-05T23:51:36.220Z" MIMETYPE="application/xml">
<foxml:contentLocation TYPE="URL" REF="https://lyberservices-prod.stanford.edu/workflow/dor/objects/druid:rs056hz6024/workflows"/>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="workflowDefinition" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="workflowDefinition.3" LABEL="Workflow Definition" CREATED="2017-01-19T19:49:14.064Z" MIMETYPE="text/xml" SIZE="1124">
<foxml:xmlContent>
<workflow-def id="assemblyWF" repository="dor">
<process name="start-assembly" sequence="1" status="completed">
<label>Initiate assembly of the object</label>
</process>
<process name="content-metadata-create" sequence="2">
<prereq>start-assembly</prereq>
<label>Create content-metadata from stub content metadata if it exists</label>
</process>
<process name="jp2-create" sequence="3">
<prereq>content-metadata-create</prereq>
<label>Create JP2 derivatives for any images in object</label>
</process>
<process name="checksum-compute" sequence="4">
<prereq>jp2-create</prereq>
<label>Compute and compare checksums for any files referenced in contentMetadata</label>
</process>
<process name="exif-collect" sequence="5">
<prereq>checksum-compute</prereq>
<label>Calculate and add exif, mimetype, file size and other attributes to each file node in contentMetadata</label>
</process>
<process name="accessioning-initiate" sequence="6">
<prereq>exif-collect</prereq>
<label>Initiate workspace and start common accessioning</label>
</process>
</workflow-def>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
</foxml:digitalObject>