public abstract class

AbstractLegacyPortletUpgradeTask

extends Object
implements LegacyPortletUpgradeTask
java.lang.Object
   ↳ com.atlassian.jira.upgrade.util.AbstractLegacyPortletUpgradeTask
Known Direct Subclasses

Class Overview

Abstract implementation that provides a default way of converting properties to the new userpreferences format.

Summary

Constants
String MULTIVALUE_SEPARATOR Separator used by new gadgets
String PORTLET_MULTI_VALUE_SEPARATOR
String SEPARATOR_ENCODED If a multivalue value contains a '|' then Shindig will %encode it to this
Public Constructors
AbstractLegacyPortletUpgradeTask()
Public Methods
Map<StringString> convertUserPrefs(PropertySet propertySet)
Converts the propertySet in use by this portletConfiguration to a Map.
abstract URI getGadgetUri()
Returns the gadget URI to be used for this portlet.
abstract String getPortletKey()
Returns the portletKey that this upgrade task can convert.
Protected Methods
String convertMultiSelectValue(String values)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.upgrade.util.LegacyPortletUpgradeTask

Constants

protected static final String MULTIVALUE_SEPARATOR

Separator used by new gadgets

Constant Value: "|"

public static final String PORTLET_MULTI_VALUE_SEPARATOR

Constant Value: "_*|*_"

protected static final String SEPARATOR_ENCODED

If a multivalue value contains a '|' then Shindig will %encode it to this

Constant Value: "%7C"

Public Constructors

public AbstractLegacyPortletUpgradeTask ()

Public Methods

public Map<StringString> convertUserPrefs (PropertySet propertySet)

Converts the propertySet in use by this portletConfiguration to a Map. Please note that multi value values (values separated by _*|*_ in the propertyset) should be converted to values simply separated by '|'. If '|' occurs in a value it needs to be % encoded to '%7C'.

Implementations may choose to convert properties to userprefs depending on the new gadgets requirements. This doesn't have to represent a 1 to 1 mapping.

Parameters
propertySet the old portletConfiguration propertySet to be converted
Returns
  • the propertySet converted to a map of key -> value pairs.

public abstract URI getGadgetUri ()

Returns the gadget URI to be used for this portlet. Should be a relative URI pointing to the gadget replacing this portlet. For example: 'rest/gadgets/1.0/g/com.atlassian.jira.gadgets/gadgets/filter-results-gadget.xml'

Returns
  • the gadget URI to be used for this portlet.

public abstract String getPortletKey ()

Returns the portletKey that this upgrade task can convert. Note that this is the full key that can be contained via com.atlassian.jira.portal.Portlet#getId(). For example: 'com.atlassian.jira.plugin.system.portlets:inprogress'

Returns
  • the portletKey that this upgrade task can convert.

Protected Methods

protected String convertMultiSelectValue (String values)