How to check whether add-on installed first time or not

rambabu patina
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2018

I want to check whether my customised add-on installed first time or not in confluence. Any code sample for it would be most appreciated. Thanks.

1 answer

0 votes
Tobias Anstett _K15t_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 31, 2018

Hi,

If you want to execute certain code when your app is enabled you should:

  • create a component which implements org.springframework.beans.factory.InitializingBean
  • doing so you will need to implement the afterPropertiesSet() method which is called after the component was initialized
  • if you want to execute code only when it was installed the first time and not after each Confluence reboot etc, you will need to store some indicator for it e.g. using Bandana

Best,
Tobias

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events