Module: HydraPbcore
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/hydra-pbcore.rb,
lib/hydra_pbcore/version.rb,
lib/hydra_pbcore/behaviors.rb
Defined Under Namespace
Modules: Conversions, Datastream, Methods, Templates Classes: Behaviors, Mapper
Constant Summary collapse
- DocumentNodes =
[ "pbcoreAssetType", "pbcoreAssetDate", "pbcoreIdentifier", "pbcoreTitle", "pbcoreSubject", "pbcoreDescription", "pbcoreGenre", "pbcoreRelation", "pbcoreCoverage", "pbcoreAudienceLevel", "pbcoreAudienceRating", "pbcoreCreator", "pbcoreContributor", "pbcorePublisher", "pbcoreRightsSummary", "pbcoreInstantiation", "pbcoreAnnotation", "pbcorePart", "pbcoreExtension", ]
- InstantiationNodes =
[ "instantiationIdentifier", "instantiationDate", "instantiationDimensions", "instantiationPhysical", "instantiationDigital", "instantiationStandard", "instantiationLocation", "instantiationMediaType", "instantiationGenerations", "instantiationFileSize", "instantiationTimeStart", "instantiationDuration", "instantiationDataRate", "instantiationColors", "instantiationTracks", "instantiationChannelConfiguration", "instantiationLanguage", "instantiationAlternativeModes", "instantiationEssenceTrack", "instantiationRelation", "instantiationRights", "instantiationAnnotation", "instantiationPart", "instantiationExtension", ]
- VERSION =
"2.2.1"
Class Method Summary collapse
-
.blank ⇒ Object
Returns a blank pbccoreDocument.
-
.is_valid?(xml) ⇒ Boolean
Validates a supplied xml document against the PBCore schema.
- .version ⇒ Object
Class Method Details
.blank ⇒ Object
Returns a blank pbccoreDocument
64 65 66 67 |
# File 'lib/hydra-pbcore.rb', line 64 def self.blank xml = '<?xml version="1.0"?><pbcoreDescriptionDocument xmlns="http://www.pbcore.org/PBCore/PBCoreNamespace.html" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.pbcore.org/PBCore/PBCoreNamespace.html" xsi:schemaLocation="http://www.pbcore.org/PBCore/PBCoreNamespace.html"></pbcoreDescriptionDocument>' Nokogiri::XML(xml) end |
.is_valid?(xml) ⇒ Boolean
Validates a supplied xml document against the PBCore schema. This differs from HydraPbcore::Methods.valid? which validates self, instead of the supplied argument. Argument must be a Nokogiri::XML::Document.
72 73 74 75 |
# File 'lib/hydra-pbcore.rb', line 72 def self.is_valid? xml xsd = Nokogiri::XML::Schema(open("http://pbcore.org/xsd/pbcore-2.0.xsd")) xsd.validate(xml) end |
.version ⇒ Object
59 60 61 |
# File 'lib/hydra-pbcore.rb', line 59 def self.version HydraPbcore::VERSION end |