Module: ActiveFedora
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/active_fedora.rb,
lib/active_fedora/rdf.rb,
lib/active_fedora/base.rb,
lib/active_fedora/core.rb,
lib/active_fedora/file.rb,
lib/active_fedora/type.rb,
lib/active_fedora/common.rb,
lib/active_fedora/config.rb,
lib/active_fedora/errors.rb,
lib/active_fedora/fedora.rb,
lib/active_fedora/orders.rb,
lib/active_fedora/schema.rb,
lib/active_fedora/cleaner.rb,
lib/active_fedora/pathing.rb,
lib/active_fedora/railtie.rb,
lib/active_fedora/scoping.rb,
lib/active_fedora/version.rb,
lib/active_fedora/checksum.rb,
lib/active_fedora/indexers.rb,
lib/active_fedora/indexing.rb,
lib/active_fedora/property.rb,
lib/active_fedora/querying.rb,
lib/active_fedora/relation.rb,
lib/active_fedora/solr_hit.rb,
lib/active_fedora/callbacks.rb,
lib/active_fedora/ldp_cache.rb,
lib/active_fedora/attributes.rb,
lib/active_fedora/change_set.rb,
lib/active_fedora/files_hash.rb,
lib/active_fedora/reflection.rb,
lib/active_fedora/type/value.rb,
lib/active_fedora/aggregation.rb,
lib/active_fedora/datastreams.rb,
lib/active_fedora/inheritance.rb,
lib/active_fedora/persistence.rb,
lib/active_fedora/validations.rb,
lib/active_fedora/versionable.rb,
lib/active_fedora/associations.rb,
lib/active_fedora/identifiable.rb,
lib/active_fedora/ldp_resource.rb,
lib/active_fedora/solr_service.rb,
lib/active_fedora/test_support.rb,
lib/active_fedora/type/boolean.rb,
lib/active_fedora/file_relation.rb,
lib/active_fedora/null_relation.rb,
lib/active_fedora/om_datastream.rb,
lib/active_fedora/scoping/named.rb,
lib/active_fedora/serialization.rb,
lib/active_fedora/sparql_insert.rb,
lib/active_fedora/with_metadata.rb,
lib/active_fedora/attached_files.rb,
lib/active_fedora/fixity_service.rb,
lib/active_fedora/log_subscriber.rb,
lib/active_fedora/nom_datastream.rb,
lib/active_fedora/rspec_matchers.rb,
lib/active_fedora/versions_graph.rb,
lib/active_fedora/rdf/persistence.rb,
lib/active_fedora/relation/merger.rb,
lib/active_fedora/scoping/default.rb,
lib/active_fedora/association_hash.rb,
lib/active_fedora/associations/rdf.rb,
lib/active_fedora/clean_connection.rb,
lib/active_fedora/file_persistence.rb,
lib/active_fedora/indexing_service.rb,
lib/active_fedora/model_classifier.rb,
lib/active_fedora/runtime_registry.rb,
lib/active_fedora/attribute_methods.rb,
lib/active_fedora/fedora_attributes.rb,
lib/active_fedora/file_configurator.rb,
lib/active_fedora/file_path_builder.rb,
lib/active_fedora/nested_attributes.rb,
lib/active_fedora/caching_connection.rb,
lib/active_fedora/loadable_from_json.rb,
lib/active_fedora/rdf/rdf_datastream.rb,
lib/active_fedora/solr_query_builder.rb,
lib/active_fedora/delegated_attribute.rb,
lib/active_fedora/orders/ordered_list.rb,
lib/active_fedora/orders/target_proxy.rb,
lib/active_fedora/relation/delegation.rb,
lib/active_fedora/association_relation.rb,
lib/active_fedora/attribute_assignment.rb,
lib/active_fedora/autosave_association.rb,
lib/active_fedora/containers/container.rb,
lib/active_fedora/default_model_mapper.rb,
lib/active_fedora/ldp_resource_service.rb,
lib/active_fedora/query_result_builder.rb,
lib/active_fedora/solr_instance_loader.rb,
lib/active_fedora/inheritable_accessors.rb,
lib/active_fedora/rdf/rdfxml_datastream.rb,
lib/active_fedora/relation/calculations.rb,
lib/active_fedora/attribute_methods/read.rb,
lib/active_fedora/attributes/primary_key.rb,
lib/active_fedora/attributes/serializers.rb,
lib/active_fedora/relation/query_methods.rb,
lib/active_fedora/relation/spawn_methods.rb,
lib/active_fedora/aggregation/list_source.rb,
lib/active_fedora/attribute_methods/dirty.rb,
lib/active_fedora/attribute_methods/write.rb,
lib/active_fedora/initializing_connection.rb,
lib/active_fedora/orders/collection_proxy.rb,
lib/active_fedora/relation/finder_methods.rb,
lib/active_fedora/associations/association.rb,
lib/active_fedora/profile_indexing_service.rb,
lib/active_fedora/schema_indexing_strategy.rb,
lib/active_fedora/associations/singular_rdf.rb,
lib/active_fedora/containers/direct_container.rb,
lib/active_fedora/inbound_relation_connection.rb,
lib/active_fedora/rdf/ntriples_rdf_datastream.rb,
lib/active_fedora/with_metadata/metadata_node.rb,
lib/active_fedora/associations/container_proxy.rb,
lib/active_fedora/associations/collection_proxy.rb,
lib/active_fedora/containers/indirect_container.rb,
lib/active_fedora/associations/association_scope.rb,
lib/active_fedora/datastreams/nokogiri_datastreams.rb,
lib/active_fedora/qualified_dublin_core_datastream.rb,
lib/generators/active_fedora/model/model_generator.rb,
lib/active_fedora/associations/contains_association.rb,
lib/active_fedora/associations/has_many_association.rb,
lib/active_fedora/associations/singular_association.rb,
lib/active_fedora/attributes/active_triple_attribute.rb,
lib/generators/active_fedora/config/config_generator.rb,
lib/active_fedora/associations/belongs_to_association.rb,
lib/active_fedora/associations/collection_association.rb,
lib/generators/active_fedora/config/solr/solr_generator.rb,
lib/active_fedora/associations/basic_contains_association.rb,
lib/active_fedora/associations/has_subresource_association.rb,
lib/generators/active_fedora/config/fedora/fedora_generator.rb,
lib/active_fedora/associations/directly_contains_association.rb,
lib/active_fedora/associations/indirectly_contains_association.rb,
lib/active_fedora/associations/directly_contains_one_association.rb,
lib/active_fedora/associations/has_and_belongs_to_many_association.rb
Overview
This is the parent class of BasicContainsAssociation, DirectlyContainsAssociation and IndirectlyContainsAssociation
Defined Under Namespace
Modules: Aggregation, Associations, AttachedFiles, AttributeAssignment, AttributeMethods, Attributes, AutosaveAssociation, Calculations, Callbacks, Cleaner, Common, Core, Datastreams, Delegation, FedoraAttributes, FilePersistence, FinderMethods, Identifiable, Indexers, Indexing, InheritableAccessors, Inheritance, LoadableFromJson, NestedAttributes, NullRelation, Orders, Pathing, Persistence, QueryMethods, QueryResultBuilder, Querying, RDF, Reflection, RspecMatchers, Schema, Scoping, Serialization, SolrQueryBuilder, SpawnMethods, TestSupport, Type, Validations, Versionable, WithMetadata Classes: ActiveFedoraError, ActiveTripleAttribute, AlreadyPersistedError, AssociationHash, AssociationNotFoundError, AssociationRelation, AssociationTypeMismatch, Base, CachingConnection, ChangeSet, Checksum, CleanConnection, Config, ConfigGenerator, ConfigurationError, ConstraintError, Container, DangerousAttributeError, DefaultModelMapper, DelegatedAttribute, DeleteRestrictionError, DirectContainer, Fedora, FedoraSolrMismatchError, FedoraStatement, File, FileConfigurator, FilePathBuilder, FileRelation, FilesHash, FixityService, IllegalOperation, InboundRelationConnection, IndexingService, IndirectContainer, InitializingConnection, InverseOfAssociationNotFoundError, LdpCache, LdpResource, LdpResourceService, LogSubscriber, MaybeHashUri, Merged, ModelClassifier, ModelGenerator, NomDatastream, NtriplesRDFDatastream, ObjectNotFoundError, OmDatastream, ProfileIndexingService, Property, QualifiedDublinCoreDatastream, RDFDatastream, RDFXMLDatastream, Railtie, ReadOnlyRecord, RecordInvalid, RecordNotDestroyed, RecordNotSaved, Relation, Rollback, RuntimeRegistry, SchemaIndexingStrategy, SolrHit, SolrInstanceLoader, SolrService, SparqlInsert, UnknownAttributeError, VersionLacksCreateDate, VersionsGraph
Constant Summary collapse
- VERSION =
"10.2.0".freeze
Class Attribute Summary collapse
-
.config_options ⇒ Object
readonly
Returns the value of attribute config_options.
-
.configurator ⇒ Object
Returns the value of attribute configurator.
-
.fedora_config ⇒ Object
readonly
Returns the value of attribute fedora_config.
-
.solr_config ⇒ Object
readonly
Returns the value of attribute solr_config.
Class Method Summary collapse
-
.class_from_string(*args) ⇒ Object
Convenience method for getting class constant based on a string.
- .config ⇒ Object
- .enable_solr_updates? ⇒ Boolean
-
.environment ⇒ String
Determine what environment we’re running in.
- .fedora ⇒ Object
- .id_field ⇒ Object
- .index_field_mapper ⇒ Object
- .init(options = {}) ⇒ Object
- .model_mapper ⇒ Object
- .root ⇒ Object
- .solr ⇒ Object
- .version ⇒ Object
Class Attribute Details
.config_options ⇒ Object (readonly)
Returns the value of attribute config_options.
169 170 171 |
# File 'lib/active_fedora.rb', line 169 def @config_options end |
.configurator ⇒ Object
Returns the value of attribute configurator.
170 171 172 |
# File 'lib/active_fedora.rb', line 170 def configurator @configurator end |
.fedora_config ⇒ Object (readonly)
Returns the value of attribute fedora_config.
169 170 171 |
# File 'lib/active_fedora.rb', line 169 def fedora_config @fedora_config end |
.solr_config ⇒ Object (readonly)
Returns the value of attribute solr_config.
169 170 171 |
# File 'lib/active_fedora.rb', line 169 def solr_config @solr_config end |
Class Method Details
.class_from_string(*args) ⇒ Object
Convenience method for getting class constant based on a string
248 249 250 |
# File 'lib/active_fedora.rb', line 248 def class_from_string(*args) ActiveFedora::ModelClassifier.class_from_string(*args) end |
.config ⇒ Object
195 196 197 |
# File 'lib/active_fedora.rb', line 195 def config fedora_config end |
.enable_solr_updates? ⇒ Boolean
270 271 272 273 274 275 276 |
# File 'lib/active_fedora.rb', line 270 def enable_solr_updates? if defined?(ENABLE_SOLR_UPDATES) ENABLE_SOLR_UPDATES else true end end |
.environment ⇒ String
Determine what environment we’re running in. Order of preference is:
-
Rails.env
-
development
209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/active_fedora.rb', line 209 def environment if .fetch(:environment, nil) return [:environment] elsif defined?(Rails.env) && !Rails.env.nil? return Rails.env.to_s elsif defined?(ENV['environment']) && !ENV['environment'].nil? return ENV['environment'] elsif defined?(ENV['RAILS_ENV']) && !ENV['RAILS_ENV'].nil? raise "You're depending on RAILS_ENV for setting your environment. Please use ENV['environment'] for non-rails environment setting: 'rake foo:bar environment=test'" else ENV['environment'] = 'development' end end |
.fedora ⇒ Object
227 228 229 |
# File 'lib/active_fedora.rb', line 227 def fedora ActiveFedora::Fedora.instance end |
.id_field ⇒ Object
260 261 262 263 264 265 266 267 268 |
# File 'lib/active_fedora.rb', line 260 def id_field if defined?(SOLR_DOCUMENT_ID) && !SOLR_DOCUMENT_ID.nil? SOLR_DOCUMENT_ID elsif defined?(Solrizer) Solrizer.default_field_mapper.id_field else 'id'.freeze end end |
.index_field_mapper ⇒ Object
256 257 258 |
# File 'lib/active_fedora.rb', line 256 def index_field_mapper Solrizer.default_field_mapper end |
.init(options = {}) ⇒ Object
182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/active_fedora.rb', line 182 def init( = {}) # Make config_options into a Hash if nil is passed in as the value = {} if .nil? # For backwards compatibility, handle cases where config_path (a String) is passed in as the argument rather than a config_options hash # In all other cases, set config_path to config_options[:config_path], which is ok if it's nil if .is_a? String raise ArgumentError, "Calling ActiveFedora.init with a path as an argument has been removed. Use ActiveFedora.init(:fedora_config_path=>#{})" end @fedora_config = nil SolrService.reset! configurator.init() end |
.model_mapper ⇒ Object
252 253 254 |
# File 'lib/active_fedora.rb', line 252 def model_mapper ActiveFedora::DefaultModelMapper.new end |
.root ⇒ Object
231 232 233 |
# File 'lib/active_fedora.rb', line 231 def root ::File.('../..', __FILE__) end |
.solr ⇒ Object
223 224 225 |
# File 'lib/active_fedora.rb', line 223 def solr ActiveFedora::SolrService.instance end |
.version ⇒ Object
235 236 237 |
# File 'lib/active_fedora.rb', line 235 def version ActiveFedora::VERSION end |