cul_hydra 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/app/assets/images/cul_hydra/crystal/binary.png +0 -0
- data/app/assets/images/cul_hydra/crystal/document.png +0 -0
- data/app/assets/images/cul_hydra/crystal/file.png +0 -0
- data/app/assets/images/cul_hydra/crystal/file_broken.png +0 -0
- data/app/assets/images/cul_hydra/crystal/folder_documents.png +0 -0
- data/app/assets/images/cul_hydra/crystal/folder_images.png +0 -0
- data/app/assets/images/cul_hydra/crystal/folder_music.png +0 -0
- data/app/assets/images/cul_hydra/crystal/folder_sound.png +0 -0
- data/app/assets/images/cul_hydra/crystal/folder_video.png +0 -0
- data/app/assets/images/cul_hydra/crystal/kmultiple.png +0 -0
- data/app/assets/images/cul_hydra/crystal/knotify.png +0 -0
- data/app/assets/images/cul_hydra/crystal/mp3.png +0 -0
- data/app/assets/images/cul_hydra/crystal/multimedia2.png +0 -0
- data/app/assets/images/cul_hydra/crystal/video.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/application.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/code.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/css.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/db.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/directory.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/doc.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/file.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/film.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/flash.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/folder_open.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/html.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/java.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/linux.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/music.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/pdf.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/php.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/picture.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/ppt.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/psd.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/ruby.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/script.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/spinner.gif +0 -0
- data/app/assets/images/cul_hydra/filesystem/txt.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/xls.png +0 -0
- data/app/assets/images/cul_hydra/filesystem/zip.png +0 -0
- data/app/controllers/concerns/cul/hydra/application_id_behavior.rb +43 -0
- data/app/controllers/concerns/cul/hydra/controller.rb +22 -0
- data/app/controllers/concerns/cul/hydra/resolver.rb +69 -0
- data/app/controllers/concerns/cul/hydra/thumbnails.rb +62 -0
- data/app/helpers/cul/hydra/ore_proxies_helper_behavior.rb +119 -0
- data/app/helpers/cul/hydra/struct_metadata_helper_behavior.rb +89 -0
- data/app/models/bag_aggregator.rb +7 -0
- data/app/models/concept.rb +23 -0
- data/app/models/concerns/cul/hydra/models.rb +24 -0
- data/app/models/concerns/cul/hydra/models/aggregator.rb +121 -0
- data/app/models/concerns/cul/hydra/models/common.rb +220 -0
- data/app/models/concerns/cul/hydra/models/image_resource.rb +106 -0
- data/app/models/concerns/cul/hydra/models/linkable_resources.rb +108 -0
- data/app/models/concerns/cul/hydra/models/resource.rb +87 -0
- data/app/models/concerns/nfo/common.rb +17 -0
- data/app/models/concerns/nfo/file_data_object.rb +10 -0
- data/app/models/concerns/nfo/folder.rb +10 -0
- data/app/models/concerns/nie/information_element.rb +10 -0
- data/app/models/concerns/ore/proxy.rb +124 -0
- data/app/models/concerns/rdf/cul.rb +77 -0
- data/app/models/concerns/rdf/fcrepo3.rb +360 -0
- data/app/models/concerns/rdf/nfo.rb +807 -0
- data/app/models/concerns/rdf/nie.rb +338 -0
- data/app/models/concerns/rdf/olo.rb +100 -0
- data/app/models/concerns/rdf/ore.rb +101 -0
- data/app/models/concerns/rdf/pimo.rb +605 -0
- data/app/models/concerns/rdf/sc.rb +47 -0
- data/app/models/concerns/sc/canvas.rb +12 -0
- data/app/models/concerns/sc/sequence.rb +21 -0
- data/app/models/content_aggregator.rb +3 -0
- data/app/models/cul/hydra/datastreams/dc_metadata.rb +107 -0
- data/app/models/cul/hydra/datastreams/mods_document.rb +195 -0
- data/app/models/cul/hydra/datastreams/struct_metadata.rb +176 -0
- data/app/models/dc_document.rb +39 -0
- data/app/models/generic_aggregator.rb +68 -0
- data/app/models/generic_object.rb +18 -0
- data/app/models/generic_resource.rb +210 -0
- data/app/models/jp2_image_aggregator.rb +34 -0
- data/app/models/mets_structured_aggregator.rb +18 -0
- data/app/models/resource.rb +78 -0
- data/app/models/resource_aggregator.rb +22 -0
- data/app/models/static_audio_aggregator.rb +12 -0
- data/app/models/static_image_aggregator.rb +32 -0
- data/bin/rails +12 -0
- data/config/fedora.yml +17 -0
- data/config/jetty.yml +6 -0
- data/config/locales/ldpd_hydra.en.yml +125 -0
- data/config/predicate_mappings.yml +79 -0
- data/config/solr.yml +8 -0
- data/config/solr_mappings.yml +26 -0
- data/config/solr_value_maps.yml +41 -0
- data/config/subs.yml +17 -0
- data/fixtures/cmodels/ldpd_ADLMetadata.xml +56 -0
- data/fixtures/cmodels/ldpd_AESMetadata.xml +56 -0
- data/fixtures/cmodels/ldpd_BagAggregator.xml +70 -0
- data/fixtures/cmodels/ldpd_Concept.xml +69 -0
- data/fixtures/cmodels/ldpd_ContentAggregator.xml +70 -0
- data/fixtures/cmodels/ldpd_DynamicAggregator.xml +56 -0
- data/fixtures/cmodels/ldpd_JP2ImageAggregator.xml +60 -0
- data/fixtures/cmodels/ldpd_METSMetadata.xml +56 -0
- data/fixtures/cmodels/ldpd_METSStructuredAggregator.xml +53 -0
- data/fixtures/cmodels/ldpd_MODSMetadata.xml +73 -0
- data/fixtures/cmodels/ldpd_MostRecent.xml +46 -0
- data/fixtures/cmodels/ldpd_PTIFImageAggregator.xml +63 -0
- data/fixtures/cmodels/ldpd_Resource.xml +72 -0
- data/fixtures/cmodels/ldpd_RestrictedResource.xml +54 -0
- data/fixtures/cmodels/ldpd_Since.xml +62 -0
- data/fixtures/cmodels/ldpd_StaticAudioAggregator.xml +54 -0
- data/fixtures/cmodels/ldpd_StaticImageAggregator.xml +71 -0
- data/fixtures/cmodels/ldpd_htest.xml +54 -0
- data/fixtures/cmodels/ldpd_nullbind.xml +63 -0
- data/fixtures/cmodels/ldpd_sdef.Aggregator.xml +71 -0
- data/fixtures/cmodels/ldpd_sdef.Core.xml +48 -0
- data/fixtures/cmodels/ldpd_sdef.Image.xml +47 -0
- data/fixtures/cmodels/ldpd_sdef.Metadata.xml +62 -0
- data/fixtures/cmodels/ldpd_sdef.Resource.xml +76 -0
- data/fixtures/cmodels/ldpd_sdef.ZoomingImage.xml +46 -0
- data/fixtures/cmodels/ldpd_sdep.BagAggregator.xml +160 -0
- data/fixtures/cmodels/ldpd_sdep.BagAggregatorCore.xml +221 -0
- data/fixtures/cmodels/ldpd_sdep.ContentAggregatorCore.xml +221 -0
- data/fixtures/cmodels/ldpd_sdep.DynamicAggregator.xml +171 -0
- data/fixtures/cmodels/ldpd_sdep.DynamicAggregatorCore.xml +215 -0
- data/fixtures/cmodels/ldpd_sdep.JP2Image.xml +220 -0
- data/fixtures/cmodels/ldpd_sdep.JP2ImageAggregator.xml +167 -0
- data/fixtures/cmodels/ldpd_sdep.JP2ImageCore.xml +229 -0
- data/fixtures/cmodels/ldpd_sdep.MODSMetadata.xml +158 -0
- data/fixtures/cmodels/ldpd_sdep.MODSMetadataCore.xml +227 -0
- data/fixtures/cmodels/ldpd_sdep.PTIFImage.xml +222 -0
- data/fixtures/cmodels/ldpd_sdep.PTIFImageAggregator.xml +167 -0
- data/fixtures/cmodels/ldpd_sdep.PTIFImageCore.xml +215 -0
- data/fixtures/cmodels/ldpd_sdep.StaticImage.xml +210 -0
- data/fixtures/cmodels/ldpd_sdep.StaticImageAggregator.xml +186 -0
- data/fixtures/cmodels/ldpd_sdep.StaticImageCore.xml +220 -0
- data/fixtures/cmodels/ore_Proxy.xml +50 -0
- data/fixtures/spec/BLOB/test001.jpg +0 -0
- data/fixtures/spec/CUL_DC/dc.xml +5 -0
- data/fixtures/spec/CUL_MODS/mods-001.xml +25 -0
- data/fixtures/spec/CUL_MODS/mods-all.xml +65 -0
- data/fixtures/spec/CUL_MODS/mods-bad-repo.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-date-created-range.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-date-created-single.xml +6 -0
- data/fixtures/spec/CUL_MODS/mods-date-end-with-all-u-characters.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-date-issued-range.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-date-issued-single.xml +6 -0
- data/fixtures/spec/CUL_MODS/mods-date-other-range.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-date-other-single.xml +6 -0
- data/fixtures/spec/CUL_MODS/mods-date-range-short-years.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-date-start-with-all-u-characters.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-dates-with-all-u-characters.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-dates-with-some-u-characters.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-item.xml +31 -0
- data/fixtures/spec/CUL_MODS/mods-names.xml +35 -0
- data/fixtures/spec/CUL_MODS/mods-notes.xml +8 -0
- data/fixtures/spec/CUL_MODS/mods-ns.xml +2 -0
- data/fixtures/spec/CUL_MODS/mods-origin-info.xml +9 -0
- data/fixtures/spec/CUL_MODS/mods-part.xml +22 -0
- data/fixtures/spec/CUL_MODS/mods-physical-description.xml +12 -0
- data/fixtures/spec/CUL_MODS/mods-physical-location.xml +9 -0
- data/fixtures/spec/CUL_MODS/mods-record-info.xml +4 -0
- data/fixtures/spec/CUL_MODS/mods-relateditem-project.xml +8 -0
- data/fixtures/spec/CUL_MODS/mods-subjects.xml +73 -0
- data/fixtures/spec/CUL_MODS/mods-textual-date.xml +8 -0
- data/fixtures/spec/CUL_MODS/mods-titles.xml +33 -0
- data/fixtures/spec/CUL_MODS/mods-top-level-location-vs-relateditem-location.xml +21 -0
- data/fixtures/spec/CUL_MODS/mods-unmapped-project.xml +7 -0
- data/fixtures/spec/CUL_SOLR/mods-001.xml +1 -0
- data/fixtures/spec/CUL_SOLR/mods-001.yml +30 -0
- data/fixtures/spec/FOXML/content-aggregator.xml +64 -0
- data/fixtures/spec/FOXML/content-cmodel.xml +48 -0
- data/fixtures/spec/FOXML/image-cmodel.xml +48 -0
- data/fixtures/spec/FOXML/resource-max.xml +83 -0
- data/fixtures/spec/FOXML/resource-screen.xml +273 -0
- data/fixtures/spec/FOXML/resource-thumb.xml +86 -0
- data/fixtures/spec/FOXML/static-image-aggregator.xml +31 -0
- data/fixtures/spec/STRUCTMAP/structmap-examples.xml +21 -0
- data/fixtures/spec/STRUCTMAP/structmap-nested.xml +10 -0
- data/fixtures/spec/STRUCTMAP/structmap-recto.xml +4 -0
- data/fixtures/spec/STRUCTMAP/structmap-seq.xml +5 -0
- data/fixtures/spec/STRUCTMAP/structmap-unordered-seq.xml +5 -0
- data/lib/cul_hydra.rb +20 -0
- data/lib/cul_hydra/access_controls_enforcement.rb +53 -0
- data/lib/cul_hydra/controllers.rb +13 -0
- data/lib/cul_hydra/controllers/aggregates.rb +93 -0
- data/lib/cul_hydra/controllers/aggregator_controller_helper.rb +27 -0
- data/lib/cul_hydra/controllers/catalog.rb +12 -0
- data/lib/cul_hydra/controllers/content_aggregators.rb +81 -0
- data/lib/cul_hydra/controllers/datastreams.rb +145 -0
- data/lib/cul_hydra/controllers/helpers.rb +10 -0
- data/lib/cul_hydra/controllers/helpers/active_fedora_helper_behavior.rb +9 -0
- data/lib/cul_hydra/controllers/helpers/application_helper_behavior.rb +16 -0
- data/lib/cul_hydra/controllers/helpers/dc_metadata_helper_behavior.rb +9 -0
- data/lib/cul_hydra/controllers/helpers/hydra_assets_helper_behavior.rb +46 -0
- data/lib/cul_hydra/controllers/helpers/hydra_autocomplete_helper_behavior.rb +35 -0
- data/lib/cul_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb +34 -0
- data/lib/cul_hydra/controllers/helpers/resources_helper_behavior.rb +159 -0
- data/lib/cul_hydra/controllers/resources.rb +161 -0
- data/lib/cul_hydra/controllers/static_image_aggregators.rb +105 -0
- data/lib/cul_hydra/controllers/suggestions.rb +126 -0
- data/lib/cul_hydra/controllers/terms.rb +205 -0
- data/lib/cul_hydra/engine.rb +31 -0
- data/lib/cul_hydra/fedora.rb +41 -0
- data/lib/cul_hydra/fedora/dummy_object.rb +37 -0
- data/lib/cul_hydra/fedora/rubydora_patch.rb +16 -0
- data/lib/cul_hydra/fedora/url_helper_behavior.rb +32 -0
- data/lib/cul_hydra/indexer.rb +102 -0
- data/lib/cul_hydra/om.rb +7 -0
- data/lib/cul_hydra/om/standard_mods.rb +115 -0
- data/lib/cul_hydra/risearch_members.rb +92 -0
- data/lib/cul_hydra/solrizer.rb +10 -0
- data/lib/cul_hydra/solrizer/extractor.rb +27 -0
- data/lib/cul_hydra/solrizer/mods_fieldable.rb +473 -0
- data/lib/cul_hydra/solrizer/terminology_based_solrizer.rb +35 -0
- data/lib/cul_hydra/solrizer/value_mapper.rb +46 -0
- data/lib/cul_hydra/solrizer_patch.rb +172 -0
- data/lib/cul_hydra/version.rb +8 -0
- data/lib/cul_hydra/version.rb~ +8 -0
- data/lib/tasks/cmodel.rake +122 -0
- data/lib/tasks/cul_hydra_dev.rake +54 -0
- data/lib/tasks/index.rake +73 -0
- data/lib/tasks/transform.rake +23 -0
- metadata +503 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
<foxml:digitalObject xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1" PID="test:si_agg" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
|
2
|
+
<foxml:objectProperties>
|
3
|
+
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
|
4
|
+
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Untitled"/>
|
5
|
+
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
|
6
|
+
</foxml:objectProperties>
|
7
|
+
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
|
8
|
+
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/">
|
9
|
+
<foxml:xmlContent>
|
10
|
+
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" 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">
|
11
|
+
<dc:identifier>prd.custord.070103.003</dc:identifier>
|
12
|
+
<dc:type>Image</dc:type>
|
13
|
+
<dc:title>Untitled</dc:title>
|
14
|
+
</oai_dc:dc>
|
15
|
+
</foxml:xmlContent>
|
16
|
+
</foxml:datastreamVersion>
|
17
|
+
</foxml:datastream>
|
18
|
+
<foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
|
19
|
+
<foxml:datastreamVersion ID="RELS-EXT1.0" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0">
|
20
|
+
<foxml:xmlContent>
|
21
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
22
|
+
<rdf:Description rdf:about="info:fedora/test:si_agg">
|
23
|
+
<type xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:resource="http://purl.oclc.org/NET/CUL/Aggregator"/>
|
24
|
+
<hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/ldpd:StaticImageAggregator"/>
|
25
|
+
<memberOf xmlns="http://purl.oclc.org/NET/CUL/" rdf:resource="info:fedora/test:c_agg"/>
|
26
|
+
</rdf:Description>
|
27
|
+
</rdf:RDF>
|
28
|
+
</foxml:xmlContent>
|
29
|
+
</foxml:datastreamVersion>
|
30
|
+
</foxml:datastream>
|
31
|
+
</foxml:digitalObject>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<mets:structMap TYPE="physical" LABEL="Sides" xmlns:mets="http://www.loc.gov/METS/">
|
2
|
+
<mets:div ORDER="1" LABEL="Recto" CONTENTIDS="rbml_css_0702r" />
|
3
|
+
<mets:div ORDER="2" LABEL="Verso" CONTENTIDS="rbml_css_0702v" />
|
4
|
+
</mets:structMap>
|
5
|
+
|
6
|
+
<mets:structMap TYPE="logical" LABEL="Sequence" xmlns:mets="http://www.loc.gov/METS/">
|
7
|
+
<mets:div ORDER="1" LABEL="Item 1" CONTENTIDS="prd.custord.060108.001" />
|
8
|
+
<mets:div ORDER="2" LABEL="Item 2" CONTENTIDS="prd.custord.060108.002" />
|
9
|
+
<mets:div ORDER="3" LABEL="Item 3" CONTENTIDS="prd.custord.060108.003" />
|
10
|
+
</mets:structMap>
|
11
|
+
|
12
|
+
<mets:structMap TYPE="physical" LABEL="Leaves" xmlns:mets="http://www.loc.gov/METS/">
|
13
|
+
<mets:div ORDER="1" LABEL="Leaf">
|
14
|
+
<mets:div ORDER="1" LABEL="Recto" CONTENTIDS="rbml_css_0702r" />
|
15
|
+
<mets:div ORDER="2" LABEL="Verso" CONTENTIDS="rbml_css_0702v" />
|
16
|
+
</div>
|
17
|
+
<mets:div ORDER="2" LABEL="Leaf">
|
18
|
+
<mets:div ORDER="1" LABEL="Recto" CONTENTIDS="rbml_css_0703r" />
|
19
|
+
<mets:div ORDER="2" LABEL="Verso" CONTENTIDS="rbml_css_0703v" />
|
20
|
+
</div>
|
21
|
+
</mets:structMap>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<mets:structMap TYPE="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Filesystem" LABEL="Device" xmlns:mets="http://www.loc.gov/METS/">
|
2
|
+
<mets:div ORDER="1" LABEL="Leaf1">
|
3
|
+
<mets:div ORDER="1" LABEL="Recto" CONTENTIDS="rbml_css_0702r" />
|
4
|
+
<mets:div ORDER="2" LABEL="Verso" CONTENTIDS="rbml_css_0702v" />
|
5
|
+
</div>
|
6
|
+
<mets:div ORDER="2" LABEL="Leaf2">
|
7
|
+
<mets:div ORDER="1" LABEL="Recto" CONTENTIDS="rbml_css_0703r" />
|
8
|
+
<mets:div ORDER="2" LABEL="Verso" CONTENTIDS="rbml_css_0703v" />
|
9
|
+
</div>
|
10
|
+
</mets:structMap>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<mets:structMap TYPE="logical" LABEL="Sequence" xmlns:mets="http://www.loc.gov/METS/">
|
2
|
+
<mets:div ORDER="1" LABEL="Item 1" CONTENTIDS="prd.custord.060108.001" />
|
3
|
+
<mets:div ORDER="2" LABEL="Item 2" CONTENTIDS="prd.custord.060108.002" />
|
4
|
+
<mets:div ORDER="3" LABEL="Item 3" CONTENTIDS="prd.custord.060108.003" />
|
5
|
+
</mets:structMap>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<mets:structMap TYPE="logical" LABEL="Sequence" xmlns:mets="http://www.loc.gov/METS/">
|
2
|
+
<mets:div ORDER="2" LABEL="Item 2" CONTENTIDS="prd.custord.060108.002" />
|
3
|
+
<mets:div ORDER="1" LABEL="Item 1" CONTENTIDS="prd.custord.060108.001" />
|
4
|
+
<mets:div ORDER="3" LABEL="Item 3" CONTENTIDS="prd.custord.060108.003" />
|
5
|
+
</mets:structMap>
|
data/lib/cul_hydra.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'hydra/head'
|
2
|
+
require 'active_fedora_relsint'
|
3
|
+
require 'cul_hydra/solrizer_patch'
|
4
|
+
module Cul
|
5
|
+
module Hydra
|
6
|
+
autoload :Controllers, 'cul_hydra/controllers'
|
7
|
+
autoload :Fedora, 'cul_hydra/fedora'
|
8
|
+
autoload :Om, 'cul_hydra/om'
|
9
|
+
autoload :Solrizer, 'cul_hydra/solrizer'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require "cul_hydra/access_controls_enforcement"
|
14
|
+
require "cul_hydra/controllers"
|
15
|
+
require "cul_hydra/om"
|
16
|
+
require "cul_hydra/indexer"
|
17
|
+
require "cul_hydra/risearch_members"
|
18
|
+
require "cul_hydra/solrizer"
|
19
|
+
require "cul_hydra/version"
|
20
|
+
require "cul_hydra/engine" if defined? Rails
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Cul::Hydra::AccessControlsEnforcement
|
2
|
+
|
3
|
+
private
|
4
|
+
|
5
|
+
def build_lucene_query(user_query)
|
6
|
+
q = ""
|
7
|
+
# start query of with user supplied query term
|
8
|
+
q << "_query_:\"{!dismax qf=$qf_dismax pf=$pf_dismax}#{user_query}\""
|
9
|
+
|
10
|
+
# Append the exclusion of Resources
|
11
|
+
q << " AND NOT _query_:\"info\\\\:fedora/ldpd\\\\:Resource\""
|
12
|
+
|
13
|
+
# Append the query responsible for adding the users discovery level
|
14
|
+
permission_types = ["edit","discover","read"]
|
15
|
+
field_queries = []
|
16
|
+
embargo_query = ""
|
17
|
+
permission_types.each do |type|
|
18
|
+
field_queries << "_query_:\"#{type}_access_group_t:public\""
|
19
|
+
end
|
20
|
+
|
21
|
+
unless current_user.nil?
|
22
|
+
# for roles
|
23
|
+
RoleMapper.roles(current_user.login).each do |role|
|
24
|
+
permission_types.each do |type|
|
25
|
+
field_queries << "_query_:\"#{type}_access_group_t:#{role}\""
|
26
|
+
end
|
27
|
+
end
|
28
|
+
# for individual person access
|
29
|
+
permission_types.each do |type|
|
30
|
+
field_queries << "_query_:\"#{type}_access_person_t:#{current_user.login}\""
|
31
|
+
end
|
32
|
+
if current_user.is_being_superuser?(session)
|
33
|
+
permission_types.each do |type|
|
34
|
+
field_queries << "_query_:\"#{type}_access_person_t:[* TO *]\""
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# if it is the depositor and it is under embargo, that is ok
|
39
|
+
# otherwise if it not the depositor and it is under embargo, don't show it
|
40
|
+
embargo_query = " OR ((_query_:\"embargo_release_date_dt:[NOW TO *]\" AND _query_:\"depositor_t:#{current_user.login}\") AND NOT (NOT _query_:\"depositor_t:#{current_user.login}\" AND _query_:\"embargo_release_date_dt:[NOW TO *]\"))"
|
41
|
+
end
|
42
|
+
|
43
|
+
# remove anything with an embargo release date in the future
|
44
|
+
#embargo_query = " AND NOT _query_:\"embargo_release_date_dt:[NOW TO *]\"" if embargo_query.blank?
|
45
|
+
field_queries << " NOT _query_:\"embargo_release_date_dt:[NOW TO *]\"" if embargo_query.blank?
|
46
|
+
|
47
|
+
q << " AND (#{field_queries.join(" OR ")})"
|
48
|
+
q << embargo_query
|
49
|
+
return q
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Cul::Hydra
|
2
|
+
module Controllers
|
3
|
+
autoload :Aggregates, 'cul_hydra/controllers/aggregates'
|
4
|
+
autoload :Catalog, 'cul_hydra/controllers/catalog'
|
5
|
+
autoload :ContentAggregators, 'cul_hydra/controllers/content_aggregators'
|
6
|
+
autoload :Datastreams, 'cul_hydra/controllers/datastreams'
|
7
|
+
autoload :Helpers, 'cul_hydra/controllers/helpers'
|
8
|
+
autoload :Resources, 'cul_hydra/controllers/resources'
|
9
|
+
autoload :StaticImageAggregators, 'cul_hydra/controllers/static_image_aggregators'
|
10
|
+
autoload :Suggestions, 'cul_hydra/controllers/suggestions'
|
11
|
+
autoload :Terms, 'cul_hydra/controllers/terms'
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
require 'cul_hydra/controllers/aggregator_controller_helper'
|
2
|
+
require 'cul_hydra/controllers/helpers/resources_helper_behavior'
|
3
|
+
module Cul::Hydra::Controllers
|
4
|
+
module Aggregates
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
included do
|
7
|
+
include Hydra::AssetsControllerHelper
|
8
|
+
include Cul::Hydra::Controllers::AggregatorControllerHelper
|
9
|
+
include Cul::Hydra::Controllers::Helpers::ResourcesHelperBehavior
|
10
|
+
include Hydra::RepositoryController
|
11
|
+
include MediaShelf::ActiveFedoraHelper
|
12
|
+
include Blacklight::SolrHelper
|
13
|
+
before_filter :load_resources, :only=>[:index]
|
14
|
+
prepend_before_filter :sanitize_update_params
|
15
|
+
end
|
16
|
+
|
17
|
+
def index
|
18
|
+
|
19
|
+
if params[:layout] == "false"
|
20
|
+
layout = false
|
21
|
+
end
|
22
|
+
container_uri = "info:fedora/#{params[:asset_id]}"
|
23
|
+
escaped_uri = container_uri.gsub(/(:)/, '\\:')
|
24
|
+
extra_controller_params = {:q=>"cul_member_of_s:#{escaped_uri}"}
|
25
|
+
@response, @document_list = get_search_results( extra_controller_params )
|
26
|
+
|
27
|
+
# Including this line so permissions tests can be run against the container
|
28
|
+
@container_response, @document = get_solr_response_for_doc_id(params[:asset_id])
|
29
|
+
|
30
|
+
render :action=>params[:action], :layout=>layout
|
31
|
+
end
|
32
|
+
|
33
|
+
def load_aggregate
|
34
|
+
if params.has_key? :aggregate_id
|
35
|
+
af_base = ActiveFedora::Base.load_instance(params[:aggregate_id])
|
36
|
+
else
|
37
|
+
af_base = ActiveFedora::Base.load_instance(params[:id])
|
38
|
+
end
|
39
|
+
the_model = ActiveFedora::ContentModel.known_models_for( af_base ).first
|
40
|
+
if the_model.nil? or the_model == ActiveFedora::Base
|
41
|
+
the_model = DcDocument
|
42
|
+
end
|
43
|
+
|
44
|
+
@resource = the_model.load_instance(af_base.pid)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Creates and Saves a Parent - Child relationship in the Child's RELS-EXT
|
48
|
+
# If container_id is provided:
|
49
|
+
# * the File Asset will use RELS-EXT to assert that it's a part of the specified container
|
50
|
+
# * the method will redirect to the container object's edit view after saving
|
51
|
+
def create
|
52
|
+
if params.has_key?(:aggregate_id)
|
53
|
+
@resource = load_aggregate
|
54
|
+
logger.debug @resource.class
|
55
|
+
logger.debug @resource.datastreams["RELS-EXT"].content
|
56
|
+
logger.debug @resource.to_rels_ext(@resource.pid)
|
57
|
+
if !params[:asset_id].nil?
|
58
|
+
associate_resource_with_container(@resource, params[:asset_id])
|
59
|
+
@resource.save
|
60
|
+
flash[:notice] = "Aggregated #{@resource.pid} under #{params[:asset_id]}."
|
61
|
+
else
|
62
|
+
flash[:notice] = "You must specify a container for the aggregate."
|
63
|
+
end
|
64
|
+
else
|
65
|
+
flash[:notice] = "You must specify a resource to aggregate."
|
66
|
+
end
|
67
|
+
|
68
|
+
if !params[:asset_id].nil?
|
69
|
+
redirect_params = {:controller=>"aggregates", :id=>params[:asset_id], :action=>:index}
|
70
|
+
end
|
71
|
+
|
72
|
+
redirect_params ||= {:action=>:index}
|
73
|
+
|
74
|
+
redirect_to redirect_params
|
75
|
+
end
|
76
|
+
|
77
|
+
# Common destroy method for all AssetsControllers
|
78
|
+
def destroy
|
79
|
+
@resource = load_aggregate
|
80
|
+
remove_resource_from_container(@resource, params[:asset_id])
|
81
|
+
@resource.save
|
82
|
+
|
83
|
+
flash[:notice] = "Deleted #{params[:id]} from #{params[:asset_id]}."
|
84
|
+
if !params[:asset_id].nil?
|
85
|
+
redirect_params = {:controller=>"aggregates", :id=>params[:asset_id], :action=>:index}
|
86
|
+
end
|
87
|
+
|
88
|
+
redirect_params ||= {:action=>:index}
|
89
|
+
|
90
|
+
redirect_to redirect_params
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'active-fedora'
|
2
|
+
module Cul::Hydra::Controllers
|
3
|
+
module AggregatorControllerHelper
|
4
|
+
def load_fedora_document
|
5
|
+
if params.has_key? :asset_id
|
6
|
+
af_base = ActiveFedora::Base.load_instance(params[:asset_id])
|
7
|
+
else
|
8
|
+
af_base = ActiveFedora::Base.load_instance(params[:id])
|
9
|
+
end
|
10
|
+
the_model = ActiveFedora::ContentModel.known_models_for( af_base ).first
|
11
|
+
if the_model.nil? or the_model == ActiveFedora::Base
|
12
|
+
the_model = DcDocument
|
13
|
+
end
|
14
|
+
|
15
|
+
@document_fedora = af_base.adapt_to the_model
|
16
|
+
end
|
17
|
+
def load_resources
|
18
|
+
@document_fedora ||= load_fedora_document
|
19
|
+
if @document_fedora.is_a? Cul::Hydra::ActiveFedora::Model::Aggregator
|
20
|
+
@resources = @document_fedora.resources
|
21
|
+
else
|
22
|
+
logger.debug "Only aggregators have parts!"
|
23
|
+
end
|
24
|
+
@resources
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'cul_hydra/controllers/aggregator_controller_helper'
|
2
|
+
require 'cul_hydra/controllers/helpers/active_fedora_helper_behavior'
|
3
|
+
module Cul::Hydra::Controllers
|
4
|
+
module Catalog
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
included do
|
7
|
+
include Cul::Hydra::Controllers::AggregatorControllerHelper
|
8
|
+
include Cul::Hydra::Controllers::Helpers::ActiveFedoraHelperBehavior
|
9
|
+
before_filter :load_resources, :only=>[:show, :edit]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'cul_hydra/controllers/helpers/resources_helper_behavior'
|
2
|
+
module Cul::Hydra::Controllers
|
3
|
+
module ContentAggregators
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
included do
|
6
|
+
include Hydra::AssetsControllerHelper
|
7
|
+
include Cul::Hydra::Controllers::Helpers::ResourcesHelperBehavior
|
8
|
+
include Hydra::RepositoryController
|
9
|
+
include MediaShelf::ActiveFedoraHelper
|
10
|
+
include Blacklight::SolrHelper
|
11
|
+
prepend_before_filter :sanitize_update_params
|
12
|
+
end
|
13
|
+
|
14
|
+
def index
|
15
|
+
if params[:layout] == "false"
|
16
|
+
# action = "index_embedded"
|
17
|
+
layout = false
|
18
|
+
end
|
19
|
+
if !params[:container_id].nil?
|
20
|
+
container_uri = "info:fedora/#{params[:container_id]}"
|
21
|
+
escaped_uri = container_uri.gsub(/(:)/, '\\:')
|
22
|
+
extra_controller_params = {:q=>"cul_member_of_s:#{escaped_uri}"}
|
23
|
+
@response, @document_list = get_search_results( extra_controller_params )
|
24
|
+
|
25
|
+
# Including this line so permissions tests can be run against the container
|
26
|
+
@container_response, @document = get_solr_response_for_doc_id(params[:container_id])
|
27
|
+
|
28
|
+
# Including these lines for backwards compatibility (until we can use Rails3 callbacks)
|
29
|
+
@container = ActiveFedora::Base.load_instance(params[:container_id])
|
30
|
+
@solr_result = @container.file_objects(:response_format=>:solr)
|
31
|
+
else
|
32
|
+
# @solr_result = ActiveFedora::SolrService.instance.conn.query('has_model_field:info\:fedora/ldpd\:Resource', @search_params)
|
33
|
+
@solr_result = Resource.find_by_solr(:all)
|
34
|
+
end
|
35
|
+
render :action=>params[:action], :layout=>layout
|
36
|
+
end
|
37
|
+
|
38
|
+
def new
|
39
|
+
@asset = ContentAggregator.new
|
40
|
+
apply_depositor_metadata(@asset)
|
41
|
+
set_collection_type(@asset, params[:content_type])
|
42
|
+
if !params[:container_id].nil?
|
43
|
+
associate_resource_with_container(@asset, params[:container_id])
|
44
|
+
end
|
45
|
+
@asset.save
|
46
|
+
msg = "Created a Content Aggregator with pid #{@asset.pid}. Now it's ready to be edited."
|
47
|
+
flash[:notice]= msg
|
48
|
+
|
49
|
+
session[:scripts] = params[:combined] == "true"
|
50
|
+
redirect_to url_for(:action=>"edit", :id=>@asset.pid, :new_asset=>true, :controller=>'catalog')
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
# Common destroy method for all AssetsControllers
|
55
|
+
def destroy
|
56
|
+
# The correct implementation, with garbage collection:
|
57
|
+
# if params.has_key?(:container_id)
|
58
|
+
# container = ActiveFedora::Base.load_instance(params[:container_id])
|
59
|
+
# container.file_objects_remove(params[:id])
|
60
|
+
# FileAsset.garbage_collect(params[:id])
|
61
|
+
# else
|
62
|
+
|
63
|
+
# The dirty implementation (leaves relationship in container object, deletes regardless of whether the file object has other containers)
|
64
|
+
ActiveFedora::Base.load_instance(params[:id]).delete
|
65
|
+
render :text => "Deleted #{params[:id]} from #{params[:container_id]}."
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
def show
|
70
|
+
@image_agg = ContentAggregator.find(params[:id])
|
71
|
+
if (@image_agg.nil?)
|
72
|
+
logger.warn("No such object: " + params[:id])
|
73
|
+
flash[:notice]= "No such object."
|
74
|
+
redirect_to(:action => 'index', :q => nil , :f => nil)
|
75
|
+
else
|
76
|
+
@id_array = @image_agg.containers(:response_format => :id_array)
|
77
|
+
end
|
78
|
+
render :action=>params[:action], :layout=>(params[:layout]=="false")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
require 'cul_hydra/controllers/helpers/application_helper_behavior'
|
2
|
+
module Cul::Hydra::Controllers
|
3
|
+
module Datastreams
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
include Cul::Hydra::Controllers::Helpers::ApplicationHelperBehavior
|
8
|
+
include Hydra::AssetsControllerHelper
|
9
|
+
include Hydra::AssetsControllerHelper
|
10
|
+
include Hydra::FileAssetsHelper
|
11
|
+
include Hydra::RepositoryController
|
12
|
+
include MediaShelf::ActiveFedoraHelper
|
13
|
+
include Blacklight::SolrHelper
|
14
|
+
prepend_before_filter :sanitize_update_params
|
15
|
+
end
|
16
|
+
|
17
|
+
def index
|
18
|
+
if params[:layout] == "false"
|
19
|
+
# action = "index_embedded"
|
20
|
+
layout = false
|
21
|
+
end
|
22
|
+
unless params[:asset_id].nil?
|
23
|
+
|
24
|
+
# Including this line so permissions tests can be run against the container
|
25
|
+
@container_response, @document = get_solr_response_for_doc_id(params[:asset_id])
|
26
|
+
|
27
|
+
# Including these lines for backwards compatibility (until we can use Rails3 callbacks)
|
28
|
+
@container = ActiveFedora::Base.load_instance(params[:asset_id])
|
29
|
+
@ds = @container.datastreams(params[:id])
|
30
|
+
else
|
31
|
+
# What are we doing here without a containing object?
|
32
|
+
raise "called DatastreamsController#index without containing object"
|
33
|
+
end
|
34
|
+
render :action=>params[:action], :layout=>layout
|
35
|
+
end
|
36
|
+
|
37
|
+
def new
|
38
|
+
render :partial=>"new", :layout=>false
|
39
|
+
end
|
40
|
+
|
41
|
+
# Creates and Saves a Datastream to contain the the Uploaded file
|
42
|
+
def create
|
43
|
+
if params[:asset_id].nil?
|
44
|
+
raise "Cannot created a datastream without a containing object"
|
45
|
+
else
|
46
|
+
@container = ActiveFedora::Base.load_instance(params[:asset_id])
|
47
|
+
end
|
48
|
+
|
49
|
+
if params[:id].nil?
|
50
|
+
raise "Cannot created a datastream without a datastream id"
|
51
|
+
end
|
52
|
+
|
53
|
+
if params.has_key?(:Filedata)
|
54
|
+
file_name = filename_from_params
|
55
|
+
mime_type = params[:mime_type] || mime_type(file_name)
|
56
|
+
@container.add_file_datastream(posted_file, :dsid=>params[:id], :label=>file_name, :mimeType=>mime_type, :size=>posted_file.size)
|
57
|
+
@container.save
|
58
|
+
# apply_depositor_metadata(@file_asset)
|
59
|
+
|
60
|
+
flash[:notice] = "The file #{params[:Filename]} has been saved as #{params[:datastream_id]} in <a href=\"#{asset_url(@container.pid)}\">#{@container.pid}</a>."
|
61
|
+
|
62
|
+
## Apply any posted file metadata
|
63
|
+
unless params[:asset].nil?
|
64
|
+
# logger.debug("applying submitted file metadata: #{@sanitized_params.inspect}")
|
65
|
+
# apply_file_metadata
|
66
|
+
end
|
67
|
+
# If redirect_params has not been set, use {:action=>:index}
|
68
|
+
logger.debug "Created #{@container.pid}##{params[:datastream_id]}."
|
69
|
+
elsif params.has_key?(:Source)
|
70
|
+
file_name = filename_from_url(params[:Source])
|
71
|
+
mime_type = params[:mime_type] || mime_type(file_name)
|
72
|
+
ds_props = {:dsid=>params[:id], :label=>file_name, :mimeType=>mime_type, :dsLocation=>params[:Source]}
|
73
|
+
@container.add_datastream(ActiveFedora::Datastream.new(ds_props))
|
74
|
+
@container.save
|
75
|
+
|
76
|
+
flash[:notice] = "#{params[:Source]} has been saved as #{params[:datastream_id]} in <a href=\"#{asset_url(@container.pid)}\">#{@container.pid}</a>."
|
77
|
+
else
|
78
|
+
flash[:notice] = "You must specify a file to upload or a source URL."
|
79
|
+
end
|
80
|
+
|
81
|
+
unless params[:container_id].nil?
|
82
|
+
redirect_params = {:controller=>"catalog", :id=>params[:asset_id], :action=>:edit}
|
83
|
+
end
|
84
|
+
|
85
|
+
redirect_params ||= {:action=>:index}
|
86
|
+
|
87
|
+
redirect_to redirect_params
|
88
|
+
end
|
89
|
+
|
90
|
+
# Datastream destroy method
|
91
|
+
def destroy
|
92
|
+
@container = ActiveFedora::Base.load_instance(params[:asset_id])
|
93
|
+
@container.datastreams[params[:datastream_id]].delete
|
94
|
+
render :text => "Deleted #{params[:datastream_id]} from #{params[:asset_id]}."
|
95
|
+
# Does the index need to be updated on delete here?
|
96
|
+
@container.save
|
97
|
+
end
|
98
|
+
|
99
|
+
def update
|
100
|
+
self.create
|
101
|
+
end
|
102
|
+
|
103
|
+
def show
|
104
|
+
@container = ActiveFedora::Base.find(params[:asset_id])
|
105
|
+
if (@container.nil?)
|
106
|
+
logger.warn("No such fedora object: " + params[:asset_id])
|
107
|
+
flash[:notice]= "No such fedora object."
|
108
|
+
redirect_to(:action => 'index', :q => nil , :f => nil)
|
109
|
+
return
|
110
|
+
else
|
111
|
+
# get array of parent (container) objects for this FileAsset
|
112
|
+
@downloadable = false
|
113
|
+
# A FileAsset is downloadable iff the user has read or higher access to a parent
|
114
|
+
@response, @document = get_solr_response_for_doc_id(params[:asset_id])
|
115
|
+
if reader?
|
116
|
+
@downloadable = true
|
117
|
+
end
|
118
|
+
|
119
|
+
if @downloadable
|
120
|
+
if @container.datastreams_in_memory.include?(params[:id])
|
121
|
+
ds = @container.datastreams_in_memory[params[:id]]
|
122
|
+
opts = {:filename => ds.label}
|
123
|
+
if params[:mime_type].nil?
|
124
|
+
opts[:type] = ds.attributes["mimeType"]
|
125
|
+
else
|
126
|
+
opts[:type] = params[:mime_type]
|
127
|
+
end
|
128
|
+
if params[:disposition].nil?
|
129
|
+
opts[:disposition] = "attachment"
|
130
|
+
else
|
131
|
+
opts[:disposition] = params[:disposition]
|
132
|
+
end
|
133
|
+
logger.debug opts.inspect
|
134
|
+
send_data ds.content, opts
|
135
|
+
return
|
136
|
+
end
|
137
|
+
else
|
138
|
+
flash[:notice]= "You do not have sufficient access privileges to download this document, which has been marked private."
|
139
|
+
redirect_to(:action => 'index', :q => nil , :f => nil)
|
140
|
+
return
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|