Wikis are great for storing and managing unstructured data. But often your data isn't that unstructured at all. Especially in business. You'll often come to a point where you have areas (or namespaces as they are called in DokuWiki) that contain a bunch of pages which basically all follow the same rules or structure.
Namespace templates are one simple way to facilitate such structures in a page. An even more comfortable way is to use a custom form and query structured data from the user and consecutively build the page from that. The latter can easily be achieved using the Bureaucracy Plugin.
The bureaucracy plugin allows you to create a HTML
form right within DokuWiki. Input format validation is automatically handled by the plugin and requires no coding. User input can be emailed to a preconfigured address or used to create a new page using a (namespace) template.
The ICKE 2.0 project is all about applying the flexibility of Wikis to managing projects and development processes in the producing industry. Commonly, processes here are well defined and need to follow strict rules and regulations, requiring the documentation of many predefined steps.
The necessary steps are always the same but differ between different kind of projects. For example, creating a similar electronic part involves different documentation steps depending on whether the part is for use in the medical or in the automotive sector.
Additionally, a typical project in the targeted industry usually runs from 6 to 8 months, accumulating a lot of different types of specifications, meeting protocols and other documents.
One of our tasks in the project was to find a way to make it easy to create a new structure skeleton when such a project is started. Of course the Bureaucracy Plugin came to our minds, but it lacked a few features to be up to the task.
Over the last weeks, Adrian added features and remodeled the plugin and now we are happy to present the results.
The plugin is now able to create multiple pages. This of course needs more than a single template. The easiest way is to specify a namespace (terminated with a colon) of templates in the action line:
action template tpl:project: projects :
fieldset "Where to Create?"
textfield "New Namespace" @
If you're familar with the bureaucracy template action, then the above is nothing new to you. It's just a namespace instead of a single page as template. It will copy all pages (and namespace structures) below the
tpl:project namespace to the namespace you specify in the form. Of course placeholder replacements are then done in each of the new pages.
Now, this is nice to create a bunch of new pages using always the same set of page templates. But what's with the steps that are dependent on the type of a project for example? That's where the new
addpage command come into play. As the name suggests it let's you add more pages to the set of templates.
What makes it a solution to our problem is that it allows you to use placeholders in the template page name. Eg. to use a different template for automotive and medical projects, you could use the following:
select Type medical|automotive
addpage tpl:@@Type@@:start start
The @@Type@@ will be replaced with the value chosen in the select box. So for automotive projects the line evaluates to
tpl:automotive:start and that page will be copied to the target namespace.
By the way, both methods for selecting page templates can be combined. So you can use a namespace of common templates and extend it with a few special ones based on user input.
Not only templates may depend on input data. Forms often have dependent segments in itself. Some questions need only be asked when certain others where answered with a specific answer.
To make this possible, the bureaucracy plugin's fieldset syntax was extended to check the value of a given other field. Only when the condition is met, the fieldset will be shown to the user.
fieldset "Type of Project?"
select Type medical|automotive
fieldset "Automotive Project" "Type" "automotive"
textbox "Car Manufacturer"
The above defines two fieldsets, but the second will only be shown when the type was set to “automotive”.
Of course such dependent fieldsets can contain fields which again trigger other fieldsets. This allows for pretty complex scenarios.
Since all fields in hidden fieldsets are completely ignored, you can also combine it with the new
addpage syntax mentioned above. This gives you another way to add page templates depending on user input.
While Adrian was at it anyway, he also overhauled the whole way field types are implemented and made it more flexible and easier to extend. Similar to how Plugins work in DokuWiki, you can now create new field types by putting new class files in a subdirectory of the bureaucracy plugin.
Two new field types were added:
user field works like a normal text field, but will (again needing a current devel version of DokuWiki) autocomplete user names for you. It's stepbrother
users does the same but accepts a comma separated list of multiple users.
The new features make the Bureaucracy Plugin a very powerful tool to guide users with creating new structured content without taking away the flexibility of a Wiki. It's just one of the features we use in the ICKE 2.0 platform, so stay tuned for more.
If you need help integrating a Wiki in your company, get in contact with us.