All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlassian.clientpluginsdemorefapp.MagicHiddenPageCondition Maven / Gradle / Ivy

Go to download

Demonstrates how product developers and plugin developers can make use of the Client-side Extensions APIs.

There is a newer version: 4.0.0-jakarta-m001-6cdaaa6-m5gf9rqt
Show newest version
package com.atlassian.clientpluginsdemorefapp;

import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.servlet.PluginHttpRequestWrapper;
import com.atlassian.plugin.web.Condition;

import java.util.Map;

public class MagicHiddenPageCondition implements Condition {
    @Override
    public void init(Map params) throws PluginParseException {
    }

    @Override
    public boolean shouldDisplay(Map context) {
        boolean shouldDisplay = false;

        if (context.containsKey("request")) {
            PluginHttpRequestWrapper request = (PluginHttpRequestWrapper) context.get("request");
            String query = request.getQueryString();

            shouldDisplay = query != null && query.equals("__MAGIC_STRING_FOR_DISPLAYING_HIDDEN_PAGE__");
        }

        return shouldDisplay;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy