You are here: Applications » TopicType

TopicType
TopicType of all TopicTypes

02 May 2019 - 09:27 | Version 1 |
Icon:
Editor: Applications.TopicTypeEditTemplate
Template: Applications.TopicTypeTemplate
Topic Naming Mode: default

Install TopicType

Target web:

Select a web where to deploy this component.

Documentation

The TopicType is the root of the type system of the WikiWorbench. Every WikiTopic has got one or more TopicTypes. TopicTypes always define a DataForm, where a type indicates the properties and use of the form being attached to a topic.

TopicTypes overcome Foswiki's limitation to only allow one form to be attached to a topic. If you'd like to attach a second form to a topic, create a new DataForm that mixes two others and indicate this by merging the resulting TopicType properties. This procedure is the recommended way to derive new TopicTypes from existing ones building on top of them, e.g. by augmenting a CategorizedTopic with additional formfields.

TopicTypes have a special property that you might use to indicate a special way of derivation by means of inheritance. There is no real inheritance in Foswiki but the way of thinking when dealing with objects and types can be clarified this way.

When you start writing a WikiApplication, first think of the data objects you will need and create TopicTypes for each.

Topics of type 'TopicType'

Create a new TopicType

Title:

Summary:

Short description of the role of this topic

topic index TopicTitle Icon WikiApplication Editor Changed

TopicType form

Name: Type: Size: Values: Description: Attributes: Default:
TopicType label 1 TopicType, DataForm, DocuTopic, ApplicationTopic, WikiTopic topic type   TopicType, DataForm, DocuTopic, ApplicationTopic, WikiTopic
TopicTitle text 75        
Summary text 75   Short description of the role of this topic c  
Icon icon 30 cat="fonticon" icon to be displayed in the topic creator    
Editor topic+values 30 url="/Applications/TopicType?baseWeb=Applications&section=editors&skin=text&contenttype=application/json&t=1732107178" editor for this topic type    
Template topic+values 30 url="/Applications/TopicType?baseWeb=Applications&section=templates&skin=text&contenttype=application/json&t=1732107178" topic template to be used for this topic type    
Topic Naming Mode radio 3 default, template, derived     default
Topic Name Template text 80   a template for the name of topics being created, e.g. ProjectAUTOINC0    
Topic Name Source text 80   jQuery selector of input elements to construct the topic name from   [name=TopicTitle]
Topic Name Prefix text 30   string to be prefixed to the topic name    
Topic Name Suffix text 30   string to be appended to the topic name    
Topic Name Transliterate radio+values 2 yes=true, no=false flag indicating character transliteration to a unicode safe subset   true
WikiApplication wikiapp 1   Application this topic belongs to    

editors

%STARTSECTION{"editors"}%<literal>%DBQUERY{
   "TopicType=~'\bTopicView\b' AND topic~'EditTemplate$' AND %FORMATLIST{
      "%IF{
        "'%URLPARAM{"q"}%'=''" 
        then="." 
        else="%URLPARAM{"q"}%"
      }%" 
      split="\s+" 
      format="lc(topic)=~lc('$1')" 
      separator=" AND "
   }%"
   web="%URLPARAM{"baseWeb"}%" 
   skip="%CALCULATE{"$EVAL(%URLPARAM{"limit" default="10"}%*(%URLPARAM{"page" default="1"}%-1))"}%"
   limit="%URLPARAM{"limit" default="10"}%"
   format="  {
      \"id\":\"$web.$topic\",
      \"text\":\"$topic\"
   }"
   separator=",$n"
   header="{\"results\":[$n"
   footer="$n], \"total\":$count}"
}%</literal>%ENDSECTION{"editors"}%

templates

%STARTSECTION{"templates"}%<literal>%DBQUERY{
   "TopicType=~'\bTopicTemplate\b' AND %FORMATLIST{
      "%IF{
        "'%URLPARAM{"q"}%'=''" 
        then="." 
        else="%URLPARAM{"q"}%"
      }%" 
      split="\s+" 
      format="lc(topic)=~lc('$1')" 
      separator=" AND "
   }%"
   web="%URLPARAM{"baseWeb"}%" 
   skip="%CALCULATE{"$EVAL(%URLPARAM{"limit" default="10"}%*(%URLPARAM{"page" default="1"}%-1))"}%"
   limit="%URLPARAM{"limit" default="10"}%"
   format="  {
      \"id\":\"$web.$topic\",
      \"text\":\"$topic\"
   }"
   separator=",$n"
   header="{\"results\":[$n"
   footer="$n], \"total\":$count}"
}%</literal>%ENDSECTION{"templates"}%
This site is powered by FoswikiCopyright © 2002-2024 by contributors to Wasserstoff-Fahrer Forum ImpressumDatenschutz  Feedback
This website is using cookies. More info. That's Fine