Class: CaTissue::Annotation::AnnotationService
- Inherits:
-
CaRuby::PersistenceService
- Object
- CaRuby::PersistenceService
- CaTissue::Annotation::AnnotationService
- Defined in:
- lib/catissue/database/annotation/annotation_service.rb
Overview
An AnnotationService queries and saves CaTissue annotations.
Instance Method Summary collapse
-
#create(annotation) ⇒ Annotation
Augments the
CaRuby::PersistenceService
create method to handle caTissue annotation service peculiarities, e.g.: * assigns the identifier, since assignment is not done automatically as is the case with the default application service * associate the annotation to the hook object * Save all referenced annotation objects. -
#initialize(database, name, integrator) ⇒ AnnotationService
constructor
Creates an AnnotationService for the given CaTissue::Database, service name and options.
Constructor Details
#initialize(database, name, integrator) ⇒ AnnotationService
Creates an AnnotationService for the given CaTissue::Database, service name and options.
14 15 16 17 18 19 |
# File 'lib/catissue/database/annotation/annotation_service.rb', line 14 def initialize(database, name, integrator) super(name, database.access_properties) @database = database @database.add_persistence_service(self) @intgtr = integrator end |
Instance Method Details
#create(annotation) ⇒ Annotation
Augments the CaRuby::PersistenceService
create method to handle caTissue annotation service peculiarities, e.g.:
-
assigns the identifier, since assignment is not done automatically as is the case with the default application service
-
associate the annotation to the hook object
-
Save all referenced annotation objects
This method is only called on Metadata#primary? annotation objects.
32 33 34 35 36 37 |
# File 'lib/catissue/database/annotation/annotation_service.rb', line 32 def create(annotation) logger.debug { "Creating annotation #{annotation.qp}..." } time { create_annotation(annotation) } logger.debug { "Created annotation #{annotation}." } annotation end |