Class: CmisServer::DocumentType
- Defined in:
- lib/cmis_server/document_type.rb
Instance Attribute Summary collapse
-
#content_stream_allowed ⇒ Object
Returns the value of attribute content_stream_allowed.
-
#versionable ⇒ Object
Returns the value of attribute versionable.
Attributes inherited from Type
#base_id, #controllable_acl, #controllable_policy, #creatable, #description, #display_name, #fileable, #fulltext_indexed, #id, #included_in_supertype_query, #local_name, #local_namespace, #parent_type, #query_name, #queryable, #self_property_definitions
Class Method Summary collapse
Instance Method Summary collapse
- #adapter_class ⇒ Object
-
#initialize(attrs = {}) ⇒ DocumentType
constructor
notallowed A content stream MUST NOT be included.
Methods inherited from Type
#base_type, #parent_id, #parent_property_definitions, #property_definitions
Constructor Details
#initialize(attrs = {}) ⇒ DocumentType
notallowed A content stream MUST NOT be included.
allowed
A content stream MAY be included.
required
A content stream MUST be included (i.e. MUST be included when the object is created, and MUST NOT be deleted).
13 14 15 16 17 |
# File 'lib/cmis_server/document_type.rb', line 13 def initialize(attrs={}) @versionable = attrs.fetch(:versionable, false) @content_stream_allowed = attrs.fetch(:content_stream_allowed, :allowed) super end |
Instance Attribute Details
#content_stream_allowed ⇒ Object
Returns the value of attribute content_stream_allowed.
4 5 6 |
# File 'lib/cmis_server/document_type.rb', line 4 def content_stream_allowed @content_stream_allowed end |
#versionable ⇒ Object
Returns the value of attribute versionable.
4 5 6 |
# File 'lib/cmis_server/document_type.rb', line 4 def versionable @versionable end |
Class Method Details
.base ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/cmis_server/document_type.rb', line 24 def self.base @base||=new(id: 'cmis:document', parent_type: nil, description: "A CMIS document", display_name: 'Document', creatable: true, fileable: true, queryable: true, property_definitions: [ CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:name'.freeze, type: String, required: true, updatability: :readwrite}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:description'.freeze, type: String, required: false, updatability: :readwrite}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:objectId'.freeze, type: CmisServer::Id, required: true, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:baseTypeId'.freeze, type: CmisServer::Id, required: true, updatability: :readonly, value: ->(obj) { obj.type.base_id }}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:objectTypeId'.freeze, type: CmisServer::Id, required: true, updatability: :oncreate, value: ->(obj) { obj.type.id }}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:createdBy'.freeze, type: String, required: false, updatability: :readonly, queryable: true, orderable: true}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:creationDate'.freeze, type: DateTime, required: false, updatability: :readonly, queryable: true, orderable: true}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:lastModifiedBy'.freeze, type: String, required: false, updatability: :readonly, queryable: true, orderable: true}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:lastModificationDate'.freeze, type: DateTime, required: false, updatability: :readonly, queryable: true, orderable: true}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:changeToken'.freeze, type: String, required: false, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:isImmutable'.freeze, type: Boolean, required: false, updatability: :readonly, default: false}), # Versionning properties CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:isLatestVersion'.freeze, type: Boolean, required: false, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:isMajorVersion'.freeze, type: Boolean, required: false, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:isLatestMajorVersion'.freeze, type: Boolean, required: false, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:isPrivateWorkingCopy'.freeze, type: Boolean, required: false, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:versionLabel'.freeze, type: String, required: false, cardinality: :single, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:versionSeriesId'.freeze, type: CmisServer::Id, required: false, cardinality: :single, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:isVersionSeriesCheckedOut'.freeze, type: Boolean, required: false, cardinality: :single, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:versionSeriesCheckedOutBy'.freeze, type: String, required: false, cardinality: :single, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:versionSeriesCheckedOutId'.freeze, type: Id, required: false, cardinality: :single, updatability: :readonly}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:checkinComment'.freeze, type: String, required: false, cardinality: :single, updatability: :readonly}), # ContentStream properties CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:contentStreamLength'.freeze, type: Integer, required: false, cardinality: :single, updatability: :readonly, value: ->(obj) { obj.content_stream&.length }}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:contentStreamMimeType'.freeze, type: String, required: false, cardinality: :single, updatability: :readonly, value: ->(obj) { obj.content_stream&.media_type }}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:contentStreamFileName'.freeze, type: String, required: false, cardinality: :single, updatability: :readonly, value: ->(obj) { obj.content_stream&.filename }}), CmisServer::PropertyDefinition.register_property_definition({id: 'cmis:contentStreamId'.freeze, type: String, required: false, cardinality: :single, updatability: :readonly, value: ->(obj) { obj.content_stream&.id }}), ]) end |
Instance Method Details
#adapter_class ⇒ Object
19 20 21 |
# File 'lib/cmis_server/document_type.rb', line 19 def adapter_class DocumentAdapter end |