projectdoc Toolbox

The projectdoc Toolbox for Confluence provides a macro to merge tables. The macro also allows to filter on table rows. This tip provides a short overview.

Audience
Type
Level of Experience
Expected Duration
5 min

Discard Parameter in Macro Editor

Merging tables, especially when tables are generated, is a useful concept. The Table Merger Macro allows to merge tables and – despite its name – also lists, including definition lists. The macro also provides a parameter named Discard, to filter on table rows while merging tables. Also despite its name, the macro can also be applied to a single table.

This short tip shows how the different values of the Discard Parameter can be used as part of the projectdoc Toolbox (version 4.5) for Confluence.

Prerequisites

For an introduction on how to use the Table Merger Macro to actually merge tables, please refer to Merging Tables and Lists.

Discard Parameter Values

The Discard Parameter of the Table Merger Macro can have one of the following values.

  1. empty
  2. no-links
  3. no-items
  4. no-links+ no-items
  5. full
  6. partial

empty

The value empty allows to discard empty lines. Suppose a table uses the Wiki Link Macro with the option to render a blank in case the referenced document does not exist, the static table would have an empty line. This would be discarded if a value of empty is selected.

Typically this option is used for definition, numbered, or bullet lists.

no-items

This is a special check that looks for the CSS class named projectdoc-no-docs. This class is set if the link points to a home page without document instances, but could be used for different use cases.

Typically this option is used for numbered, or bullet lists.

Note that in case of definition lists the check is applied to both, the term and the data.

no-links + no-items

This is simply a check that there has to be a link and the link must not point to a home page without documents.

Typically this option is used for numbered or bullet lists.

Note that in case of definition lists the check is applied to both, the term and the data.

full

This option allows to discard table rows where every row cell has a non-empty value. This may also be applied to list items.

Why would you like to discard fully filled table rows? In case your team adds information incrementally, you may want to keep track on which documents already have the specified minimum information. To track the documents that still need to be worked on, you may want to discard all documents that are already finished according to the standard.

Simply use the Display Table Macro to select on the documents to track. Put this macro inside the Table Merger Macro with the Discard Parameter set to full.

 

Suppose your team creates a glossary. Typically the Iteration property would track the state of each document. But to track the current state of each glossary item more precisely the team decides that every item requires – besides the mandatory name and short description – at least a description (document section), a list of translations (document section), and Linguistic Information (property).

The initial glossary (of four items) looks like this:

We add the progress tracker on a Space Index and may configure access restrictions so that this page is only visible to page authors.

The display table shown above is now enclosed in a Table Merger Macro with the Discard Parameter set to full.

So the following items will be shown as incomplete.

Adding the Linguistic Information (document property) does not remove any entry.

After adding translations (document sections) to the remaining three, only two items are rendered as incomplete.

And after adding a description section (document section) for the doctype item, there is only one item marked as incomplete.

partial

This option allows to discard rows where at least on cell has an empty value. This may be convenient to show only references to documents where all required information is already set.

This value has no effect on lists. 

Resources

Table Merger Macro
Merges tables (and lists) into one table (or list).
Merging Tables and Lists
References listed in tables and lists may come from different sources. The Table Merger Macro allows to render a number of tables (or lists) as one table (or list).
Table Merger Macro Param Discard
Allows to discard list items.
projectdoc-no-docs
Tags links that refer to a home page without having an index page attached. This is a quick check if at least one document has been created since this launches the creation of the index page for this document type.
Wiki Link Macro
Allows to render a link to a wiki page.