How to detect confluence edit mode in code

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.
January 31, 2018

I want to detect the confluence page mode whether EDIT or VIEW in my confluence macro plugin code. Help me to find out the way. Thanks.

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 31, 2018

This sounds like a very broken requirement.  I can't think of a single useful reason to do this, and it's useless anyway.

When a macro is in "view", your code provides the users with functions.  When a macro is in edit mode, it's actually just a display for capturing the parameters, there's no code running when it's on the page.  It will run in the preview, but what's the point in doing that?

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.
January 31, 2018

Thanks Nic for your quick response.

I am trying to develop a macro for confluence. It has one parameter (i.e any non-admin group).

When user selects the group he should be able to join to the selected group.

So this functionality I want to provide through macro insert/preview while editing the page and not on the page view. If I can detect the page edit then I will use the condition in macro execute() method to execute action on page edit only.

Michael Eskin July 11, 2018

Gliffy seems to be able to render previews in edit mode without image markup in their macro body. Any idea how they accomplish this? Their macro rich-text bodies are empty if you examine the page storage format...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events