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'
topic |
index |
TopicTitle |
Icon |
WikiApplication |
Editor |
Changed |
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§ion=editors&skin=text&contenttype=application/json&t=1732107178" |
editor for this topic type |
|
|
Template |
topic+values |
30 |
url="/Applications/TopicType?baseWeb=Applications§ion=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"}%