Conveyed viewpage.action shows "View Page" button instead of "Edit" button in the upper right corner of a page

When conveying "viewpage.action" everything works as expected, besides when viewing a page now I no longer get the "Edit" button in the upper right corner, but instead a "View Page" button only. I noticed in page.vm and page.vmd files that a "mode" decides what is rendered there, but couldn't figure out why it changed due to my conveyed action.

The conveyor-config.xml contains the following:

    <package-override name="pages" namespace="/pages">
        <action-override name="viewpage" class="my.package.actions.ViewPageOverrideAction" inherit="true">

My ViewPageOverrideAction only adds text to the content of the page:

    public String execute() throws Exception {
        return super.execute();

    public String getPageXHtmlContent() {
        String pageXHtmlContent = super.getPageXHtmlContent();
        return pageXHtmlContent + "I was added";

Why is it that I get the "View Page" button instead of the "Edit" button. How can I fix it? Any help would be appreciated.

2 answers

1 accepted

0 votes
Answer accepted

Problem was that a method in ViewPageAction checks for the ViewPageClass.class. Solution is to override that method and exchange the class.

    public WebInterfaceContext getWebInterfaceContext() {
        DefaultWebInterfaceContext result = new DefaultWebInterfaceContext(super.getWebInterfaceContext());
        List<Label> labels = getPage() == null ? Collections.<Label> emptyList() : getPage().getLabelsForDisplay(
        result.setParameter("labels", labels);
        if (getClass().equals(ViewPageOverrideAction.class))
            result.setParameter(ViewingContentCondition.CONTEXT_KEY, Boolean.TRUE);
        return result;

Problem was that the WebInterfaceContext checks for the ViewPageAction.class. Overriding the following method and entering the ViewPageOverrideAction.class solves the problem.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in United States

Confluence Security Advisory

Good morning Members, Not sure if you are aware. Please read the following: More details: https://co...

57 views 1 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you