Sha256: 6881fddd44d7d5c1a47176e2aead2d27c54016d557572666e7b5b32e530aab92

Contents?: true

Size: 808 Bytes

Versions: 8

Compression:

Stored size: 808 Bytes

Contents

ActiveFedora::Datastream.class_eval do

  def active?
    dsState == 'A'
  end

  def current_version?
    @current_version ||= (new? || versions.empty? || dsVersionID == versions.first.dsVersionID)
  end

  def content_is_url?
    external? || redirect?
  end

  def content_is_downloadable?
    has_content? && (managed? || inline?)
  end

  def modifiable?
    !FcrepoAdmin.read_only && active? && current_version?
  end

  def content_is_uploadable?
    modifiable? && (managed? || inline?)
  end

  def content_is_editable?
    modifiable? && !content_is_url? && content_is_text? && dsSize <= FcrepoAdmin.max_editable_datastream_size
  end

  def content_is_text?
    has_content? && !mimeType.blank? && (mimeType.start_with?('text/') || FcrepoAdmin.extra_text_mime_types.include?(mimeType))
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fcrepo_admin-0.6.0 lib/fcrepo_admin/decorators/active_fedora/datastream_decorator.rb
fcrepo_admin-0.5.5 lib/fcrepo_admin/decorators/active_fedora/datastream_decorator.rb
fcrepo_admin-0.5.5.pre lib/fcrepo_admin/decorators/active_fedora/datastream_decorator.rb
fcrepo_admin-0.5.4 lib/fcrepo_admin/decorators/active_fedora/datastream_decorator.rb
fcrepo_admin-0.5.3 lib/fcrepo_admin/decorators/active_fedora/datastream_decorator.rb
fcrepo_admin-0.5.2 lib/fcrepo_admin/decorators/active_fedora/datastream_decorator.rb
fcrepo_admin-0.5.1 lib/fcrepo_admin/decorators/active_fedora/datastream_decorator.rb
fcrepo_admin-0.5.0 lib/fcrepo_admin/decorators/active_fedora/datastream_decorator.rb