TaskList Macro

    The TaskList macro allows authors to generate and track a simple list of tasks. Each line inside the macro body is parsed as a separate task. Each task will display with a graphic button for marking the task complete. When this happens, the userid is also recorded and displayed.

     

    The TaskListMacro applies authorization policies based on the surrounding context. In simpler terms, if you are an author for the piece of content, you can also edit the tasks.

     

    Example:

    • "open" document - any registered user can complete a task.

    • "closed" document with three authors (manny, moe, and jack) -- only those users can marke tasks complete.

    • your personal blog -- only you will be able to complete a task.

    • group blog -- any of the blog authors will be able to complete a task

    • discussion post -- only the author of that post can complete the tasks.

     

     

     

    Package Contents

    • build.xml -- Ant build file

    • plugin.xml -- plugin descriptor required by Clearspace

    • xwork-plugin.xml -- XWork file that maps actions to action classes

    • readme.txt -- macro usage instructions

    • tasklist.iml -- IntelliJ Idea module file.

    • src

      • plugin_i18n.properties -- internationalization

      • com.jivesoftware.clearspace.plugins.tasklist

        • TaskListMacro.java --  class that renders the macro

        • TaskListAction.java --  class that processes task list requests and persisting state

    • resources

      • task-list-html.ftl -- FreeMarker template for generating task list in HTML

      • task-list-text.ftl -- FreeMarker template for generating task list in plain text

      • jive-icon-task-chk-16x16.gif -- image for checked tasks

      • jive-icon-task-unchk-16x16.gif -- image for unchecked tasks

     

    How to Build and Deploy

    The Ant build.xml file at the root of the plugin includes a build.plugins target to compile the code and package it into a JAR file. The deploy.plugins target copies the JAR into the <jiveHome>/plugins directory in your Clearspace distribution.

     

    Paths into your test Clearspace distribution assume that this plugin project is in the standalone Clearspace distribution at: <root>/plugins/plugins/helloworld. You will need to update the target paths if you're testing another way, such as with the Clearspace WAR distribution.

     

    Dependencies

    In addition to Java 1.5, compilation depends on some libraries included in the Clearspace web application WEB-INF/lib directory:

     

    • clearspace-<version>.jar

    • webwork.jar

    • xwork.jar

    • rife-continuations.jar

     

    Alternative Deploy Process

    If you'd rather deploy the plugin manually, you can do that in one of two ways:

    Method 1:

    • Copy the plugin JAR file into the <jiveHome>/plugins directory - a running Clearspace instance will deploy it automatically.

    Method 2:

    • Open the Clearspace Administration console, navigate to System > Settings > Plugins

    • Browse to locate and upload the plugin JAR file.

     

    Additional Info

    If you compile and receive this error, "method removeAllFilterTargets - can not find symbol", then you have compiled the older v1.4 tasklist macro against the newer v1.6 Confluence Jar.

     

    More info from Nick, "In 1.6, we made it easier to get access to the render filter cache from a custom macro, as many custom macros needed the ability to clear the render cache for various events.... the new tasklist.jar and tasklist-src.jar compatible with 1.6. I renamed the previous plugin to tasklist-1.4.jar for those customers that are still stuck on older versions."

     

    Running the Samples

    1. Build and deploy the code.

    2. Open Clearspace and create a new discussion, document, or blog post. Add whatever text you like, but be sure to add the following macro markup:

    {tasklist}
    Write an example plugin
    Document the example plugin
    Provide a readme file for the plugin
    {tasklist}
    

     

     

    3. Preview or publish the discussion, document, or blog post to see the task list generated by the macro.

     

    Note: You can add a custom title to your task list by using the syntax  macro tag. Also, the spaces between the brackets should be removed, they are inserted here to prevent the macro from rendering the sample text.

     

    Clearspace 1.X Plugin Files Attached Below