com.atlassian.jira.upgrade.util
Class AbstractLegacyPortletUpgradeTask

java.lang.Object
  extended by com.atlassian.jira.upgrade.util.AbstractLegacyPortletUpgradeTask
All Implemented Interfaces:
LegacyPortletUpgradeTask
Direct Known Subclasses:
SimpleLegacyPortletUpgradeTask

public abstract class AbstractLegacyPortletUpgradeTask
extends java.lang.Object
implements LegacyPortletUpgradeTask

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

Since:
v4.0

Field Summary
protected static java.lang.String MULTIVALUE_SEPARATOR
          Separator used by new gadgets
protected static java.lang.String SEPARATOR_ENCODED
          If a multivalue value contains a '|' then Shindig will %encode it to this
 
Constructor Summary
AbstractLegacyPortletUpgradeTask()
           
 
Method Summary
protected  java.lang.String convertMultiSelectValue(java.lang.String values)
           
 java.util.Map<java.lang.String,java.lang.String> convertUserPrefs(com.opensymphony.module.propertyset.PropertySet propertySet)
          Converts the propertySet in use by this portletConfiguration to a Map.
abstract  java.net.URI getGadgetUri()
          Returns the gadget URI to be used for this portlet.
abstract  java.lang.String getPortletKey()
          Returns the portletKey that this upgrade task can convert.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MULTIVALUE_SEPARATOR

protected static final java.lang.String MULTIVALUE_SEPARATOR
Separator used by new gadgets

See Also:
Constant Field Values

SEPARATOR_ENCODED

protected static final java.lang.String SEPARATOR_ENCODED
If a multivalue value contains a '|' then Shindig will %encode it to this

See Also:
Constant Field Values
Constructor Detail

AbstractLegacyPortletUpgradeTask

public AbstractLegacyPortletUpgradeTask()
Method Detail

getPortletKey

public abstract java.lang.String getPortletKey()
Description copied from interface: LegacyPortletUpgradeTask
Returns the portletKey that this upgrade task can convert. Note that this is the full key that can be contained via Portlet.getId(). For example: 'com.atlassian.jira.plugin.system.portlets:inprogress'

Specified by:
getPortletKey in interface LegacyPortletUpgradeTask
Returns:
the portletKey that this upgrade task can convert.

getGadgetUri

public abstract java.net.URI getGadgetUri()
Description copied from interface: LegacyPortletUpgradeTask
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'

Specified by:
getGadgetUri in interface LegacyPortletUpgradeTask
Returns:
the gadget URI to be used for this portlet.

convertUserPrefs

public java.util.Map<java.lang.String,java.lang.String> convertUserPrefs(com.opensymphony.module.propertyset.PropertySet propertySet)
Description copied from interface: LegacyPortletUpgradeTask
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.

Specified by:
convertUserPrefs in interface LegacyPortletUpgradeTask
Parameters:
propertySet - the old portletConfiguration propertySet to be converted
Returns:
the propertySet converted to a map of key -> value pairs.

convertMultiSelectValue

protected java.lang.String convertMultiSelectValue(java.lang.String values)


Copyright © 2002-2010 Atlassian. All Rights Reserved.