Keep your copyright information up to date. Always. Automagically.

 

Benefits

Keep your copyright information up to date. Always. Automagically.

This plugin provides a Velocity context item that can be used in space decorators and custom themes to embed configurable copyright information text with dates being updated automatically.

A macro is also provided to insert similar copyright information text inside the page content. Several user-friendly preset options are available.

Velocity Context Item

The module is invoked using $copyrightHelper.copyright() within the Velocity code. The arguments of the copyright call must include the appropriate copyright message, and Java MessageFormat patterns where you wish to include the current year. These patterns can use either index 0 (which provides the year as a String) or index 1 (which provides a Date object for further formatting) as parameters.

Using the year:

$copyrightHelper.copyright("© Copyright {0} TechTime Initiative Group")


would print:

© Copyright 2017 TechTime Initiative Group

Using the date:

$copyrightHelper.copyright("&copy Copyright {1,date,yyyy MMMM}")


would print (for example):

© Copyright 2017 January

Macro

The macro can be accessed using:

{copyright}


within a Confluence page or comment edit window, or by using the Insert Macro dialog. It can either be used with the easier preset options, or the more advanced custom template input.

The presets comprise of:

  • Preset Prefix - what will be displayed at the start of the copyright text.
  • Company/Individual Name - allows input of who the copyright is for (e.g. TechTime Initiative Group Limited)
  • Month Toggle - if you wish to have the current month displayed after the year.
  • The advanced template input requires a MessageFormat string for the copyright to be added into.
    This is parsed exactly the same way as the argument of the Velocity context item (see above for examples of use). If this is left blank, a default message will be supplied ("© Copyright 2013" for example).

Examples of Advanced templates:

Copyright {0} - will result in "Copyright 2017"
Copyright {1,date,yyyy} - will also result in "Copyright 2017"
Copyright {1,date,MMMM, yyyy} - will result in "Copyright January, 2017
Copyright 2010-{1,date,yyyy} - will result in "Copyright 2010-2017"


Localisation and timezones are applied automatically based on the Confluence settings, including per-user ones.

There are four further parameters which are used with either of the above two options:

  • alignment: Determines the position of the copyright statement, using standard HTML text alignment options (left,right,center,inherit,justify)
  • style (optional): Includes the given CSS style in the resulting HTML tag
  • id (optional): Includes the given id in the resulting HTML tag - useful to apply external CSS styles to the copyright statement
  • class (optional): Includes the given class in the resulting HTML tag - useful to apply external CSS styles to the copyright statement


Other Documentation


Feel free to flick us a message and tell us how we can help you, we will be in contact with you straight away.

Contact us