Once you've created your task, you have the option of setting up
a demo for the task. Tutorial 4
shows you what this demo looks like in the sample task.
In your task directory, create an empty file named demo.xml.
Create a toplevel <demo> element, and give your demo a
name:
<demo name="My Widget Demo">
</demo>
This name is the name the user will see as the heading and title
of the demo page.
You'll probably want to describe the demo to your audience. You
can do this using the <description> element, which can
contain arbitrary HTML if you mark it explicitly as XML CDATA:
<demo name="My Widget Demo">
<description>
<![CDATA[
<p>This demo shows the widget task.
<p>Contact <a href="mailto:me@myhost.com">me</a> for more details.
]]>
</description>
</demo>
There might be a number of activities the user can do on the demo
page, especially if you've customized your task. Typically,
however, there will be a single activity, namely to tag documents.
The <engine_settings> element defines the arguments to
MATEngine which maps the input document to the outputs. You can
also make it possible to enable blank documents (i.e., allow empty
documents that the user can type into):
...
<activity name="Tag" enable_blank_document="yes">
<description>Automatically locate widgets in the document.</description>
<engine_settings task = "My Widget Task" workflow="Demo" steps="zone,tokenize,tag"/>
<sample_document description="Sample article #1"
file_type = "raw"
relative_location="examples/doc1.txt"/>
...
</activity>
You can have multiple sample documents.
One reason to have multiple activities might be if you want to
prepare some documents ahead of time, e.g., to zone and tokenize
the document.
Note that in order for automated tagging to work, you must either
have a default model specified in your task (and already built),
or you must provide the path to an existing model as part of the
<engine_settings>.
If your task isn't already installed, use the MATManagePluginDirs
tool to ensure that MAT knows about your task directory. If
<dir> is your task directory:
Unix:
% $MAT_PKG_HOME/bin/MATManagePluginDirs install <dir>
Windows native:
> %MAT_PKG_HOME%\bin\MATManagePluginDirs.cmd install <dir>
Once you have a task, a demo, and a model specified and built for the task, you can view and interact with your demo by surfing to http://localhost:7801/tasks/<lastpathcomponent>/demo, where <lastpathcomponent> is the last path component of the directory path of your task.