noosphere.org background software discuss links changes (printable)
IDCommons hardhats idcommons zwiki

VariousTemplateUseCases

Various different templates might be appropriate for the presentation of some object. Some of the use cases follow:

  • The name of the default template to use is determined by consulting the registry of templates associated with the various base domains (i.e. python class names). See the transformers module for the various subclasses of templated_producer.

  • If instead an url (partial or absolute) is found in the http query with the key with_template. The associated file is loaded and interpreted as a NooronPageTemplate?. Note the security implications of this.

  • An object is an instance of multiple knowledge classes (thanks both to multiple inheritance and simple inheritance in both knowledge representation and python). It might not be possible to know which of these classes is the primary one. (On the other hand, some specific indication might be available, but is not yet.) Templates are available for more than one of the above classes.

    Proposed processing:

    Keep going down the list until a template is indicated.

    • check for query variable with_template

    • check for query variable with_template_for_class

    • ask the user for their presentation_template_for_a_topic with scope the topic

    • ask the user for their presentation_template_for_class_instances with scope of the topic's classes

    • ask the user to figure out the template based on evaluations TBD!

    • ask the site for its presentation_template_for_a_topic with scope the topic

    • ask the site for its presentation_template_for_class_instances with scope of the topic's classes

    • ask the topic for its presentation_template_for_me

    • use the topic's classes first found presentation_template_for_my_instances

  • Which revision (in the CVS sense) of a template to use is determined by consulting either:

    • The query string key with_template_revision.

    • User, knowledgebase and site preferences are consulted somehow.

    • Otherwise the HEAD revision is the one to use.

Questions:

Q. What role does the CVS tag concept have in all of this?
A. It seems like it should be possible to have a default tag value on a user, knowledgebase, site basis as well as on a per-hit basis.

Q. Should the registry know about all of the variously named templates?
A. It seems like such a registry makes sense (at some point, at least). Should it be knowledge? Sigh, seems so.