Moved content_types and content_type_webform_managers from CMS_RESPONSE to CMS_API.
Updated the way to output content (node, ...) to html page.
See CMS_CONTENT_TYPE_WEBFORM_MANAGER.append_cointent_as_html_to (...).
Added notion of "teaser" (short version of the content), as opposed to full content.
One can use CMS_API.html_encoder ... when possible, same for `formats', ...
Added bridge from CMS_MODULE_API to CMS_API's encoders.
Added new CMS_TAXONOMY_HOOK used to retrieve list of content associated with a specific term.
Moved up to CMS_RESPONSE a few features which was available only in specific descendants.
Added /taxonomy/term/{termid} implementation.
135 lines
3.7 KiB
Plaintext
135 lines
3.7 KiB
Plaintext
note
|
|
description: "[
|
|
Interface for accessing taxonomy data from storage.
|
|
]"
|
|
date: "$Date$"
|
|
revision: "$Revision$"
|
|
|
|
deferred class
|
|
CMS_TAXONOMY_STORAGE_I
|
|
|
|
feature -- Error Handling
|
|
|
|
error_handler: ERROR_HANDLER
|
|
-- Error handler.
|
|
deferred
|
|
end
|
|
|
|
feature -- Access
|
|
|
|
vocabulary_count: INTEGER_64
|
|
-- Count of vocabularies.
|
|
deferred
|
|
end
|
|
|
|
vocabularies (a_limit: NATURAL_32; a_offset: NATURAL_32): CMS_VOCABULARY_COLLECTION
|
|
-- List of vocabularies ordered by weight from `a_offset' to `a_offset + a_limit'.
|
|
deferred
|
|
end
|
|
|
|
vocabulary (a_id: INTEGER_64): detachable CMS_VOCABULARY
|
|
-- Vocabulary by id `a_id'.
|
|
require
|
|
valid_id: a_id > 0
|
|
deferred
|
|
end
|
|
|
|
vocabularies_for_type (a_type_name: READABLE_STRING_GENERAL): detachable CMS_VOCABULARY_COLLECTION
|
|
-- Vocabularies associated with content type `a_type_name'.
|
|
require
|
|
valid_type_name: not a_type_name.is_whitespace
|
|
deferred
|
|
end
|
|
|
|
terms_count: INTEGER_64
|
|
-- Number of terms.
|
|
deferred
|
|
end
|
|
|
|
term_by_id (tid: INTEGER_64): detachable CMS_TERM
|
|
-- Term associated with id `tid'.
|
|
deferred
|
|
ensure
|
|
Result /= Void implies Result.id = tid
|
|
end
|
|
|
|
term_by_text (a_term_text: READABLE_STRING_GENERAL; a_vocabulary: detachable CMS_VOCABULARY): detachable CMS_TERM
|
|
-- Term with text `a_term_text', included in vocabulary `a_vocabulary' if provided.
|
|
deferred
|
|
ensure
|
|
Result /= Void implies a_term_text.same_string (Result.text)
|
|
end
|
|
|
|
term_count_from_vocabulary (a_vocab: CMS_VOCABULARY): INTEGER_64
|
|
-- Number of terms from vocabulary `a_vocab'.
|
|
require
|
|
has_id: a_vocab.has_id
|
|
deferred
|
|
end
|
|
|
|
terms (a_vocab: CMS_VOCABULARY; a_limit: NATURAL_32; a_offset: NATURAL_32): CMS_TERM_COLLECTION
|
|
-- List of terms from vocabulary `a_vocab' ordered by weight from `a_offset' to `a_offset + a_limit'.
|
|
require
|
|
has_id: a_vocab.has_id
|
|
deferred
|
|
end
|
|
|
|
terms_of_entity (a_type_name: READABLE_STRING_GENERAL; a_entity: READABLE_STRING_GENERAL; a_vocabulary: detachable CMS_VOCABULARY): detachable CMS_TERM_COLLECTION
|
|
-- Terms related to `(a_type_name,a_entity)', and if `a_vocabulary' is set
|
|
-- constrain to be part of `a_vocabulary'.
|
|
deferred
|
|
end
|
|
|
|
entities_associated_with_term (a_term: CMS_TERM): detachable LIST [TUPLE [entity: READABLE_STRING_32; typename: detachable READABLE_STRING_32]]
|
|
-- Entities and related typename associated with `a_term'.
|
|
require
|
|
a_term_exists: a_term.has_id
|
|
deferred
|
|
end
|
|
|
|
feature -- Store
|
|
|
|
save_vocabulary (a_voc: CMS_VOCABULARY)
|
|
-- Insert or update vocabulary `a_voc'.
|
|
deferred
|
|
ensure
|
|
not error_handler.has_error implies a_voc.has_id and then vocabulary (a_voc.id) /= Void
|
|
end
|
|
|
|
save_term (t: CMS_TERM; voc: CMS_VOCABULARY)
|
|
-- Insert or update term `t' as part of vocabulary `voc'.
|
|
deferred
|
|
ensure
|
|
not error_handler.has_error implies t.has_id and then term_by_id (t.id) /= Void
|
|
end
|
|
|
|
associate_term_with_entity (a_term: CMS_TERM; a_type_name: READABLE_STRING_GENERAL; a_entity: READABLE_STRING_GENERAL)
|
|
-- Associate term `a_term' with `(a_type_name, a_entity)'.
|
|
require
|
|
existing_term: a_term.has_id
|
|
deferred
|
|
end
|
|
|
|
unassociate_term_from_entity (a_term: CMS_TERM; a_type_name: READABLE_STRING_GENERAL; a_entity: READABLE_STRING_GENERAL)
|
|
-- Unassociate term `a_term' from `(a_type_name, a_entity)'.
|
|
require
|
|
existing_term: a_term.has_id
|
|
deferred
|
|
end
|
|
|
|
associate_vocabulary_with_type (a_voc: CMS_VOCABULARY; a_type_name: READABLE_STRING_GENERAL)
|
|
-- Associate vocabulary `a_voc' with type `a_type_name'.
|
|
require
|
|
existing_term: a_voc.has_id
|
|
deferred
|
|
end
|
|
|
|
unassociate_vocabulary_with_type (a_voc: CMS_VOCABULARY; a_type_name: READABLE_STRING_GENERAL)
|
|
-- Un-associate vocabulary `a_voc' from type `a_type_name'.
|
|
require
|
|
existing_term: a_voc.has_id
|
|
deferred
|
|
end
|
|
|
|
end
|