com.endeca.portal.util
Class UpgradeUtil

java.lang.Object
  extended by com.endeca.portal.util.UpgradeUtil

public class UpgradeUtil
extends java.lang.Object


Constructor Summary
UpgradeUtil()
           
 
Method Summary
static boolean getJsonBoolean(java.util.Map<java.lang.String,java.lang.Object> json, java.lang.String key, boolean defaultValue)
          Gets a boolean from a Jackson-mapped JSON object, by key, defaulting to a specified value if not found
static int getJsonInt(java.util.Map<java.lang.String,java.lang.Object> json, java.lang.String key, int defaultValue)
          Gets an integer from a Jackson-mapped JSON object, by key, defaulting to a specified value if not found
static java.lang.String getJsonString(java.util.Map<java.lang.String,java.lang.Object> json, java.lang.String key, java.lang.String defaultValue)
          Gets a string from a Jackson-mapped JSON object, by key, defaulting to a specified value if not found
static PortletUpgrader getPortletUpgrader(java.lang.String portletId)
           
static int getSchemaBuildNumber()
           
static int getVersionFromPreferences(javax.portlet.PortletPreferences prefs)
          Gets the EIDStudioVersion preference for a portlet, defaulting to the schema build number if it cannot be determined.
static boolean isPortletRemoved(java.lang.String portletId)
           
protected static java.lang.String simplifyPortletId(java.lang.String portletId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpgradeUtil

public UpgradeUtil()
Method Detail

getPortletUpgrader

public static PortletUpgrader getPortletUpgrader(java.lang.String portletId)

isPortletRemoved

public static boolean isPortletRemoved(java.lang.String portletId)

simplifyPortletId

protected static java.lang.String simplifyPortletId(java.lang.String portletId)

getSchemaBuildNumber

public static int getSchemaBuildNumber()

getVersionFromPreferences

public static int getVersionFromPreferences(javax.portlet.PortletPreferences prefs)
Gets the EIDStudioVersion preference for a portlet, defaulting to the schema build number if it cannot be determined.

Parameters:
prefs - portlet preferences
Returns:

getJsonString

public static java.lang.String getJsonString(java.util.Map<java.lang.String,java.lang.Object> json,
                                             java.lang.String key,
                                             java.lang.String defaultValue)
Gets a string from a Jackson-mapped JSON object, by key, defaulting to a specified value if not found

Parameters:
json - a map representing a JSON object
key - key of object to retrieve
defaultValue - value to use if key cannot be found
Returns:

getJsonBoolean

public static boolean getJsonBoolean(java.util.Map<java.lang.String,java.lang.Object> json,
                                     java.lang.String key,
                                     boolean defaultValue)
Gets a boolean from a Jackson-mapped JSON object, by key, defaulting to a specified value if not found

Parameters:
json - a map representing a JSON object
key - key of object to retrieve
defaultValue - value to use if key cannot be found
Returns:

getJsonInt

public static int getJsonInt(java.util.Map<java.lang.String,java.lang.Object> json,
                             java.lang.String key,
                             int defaultValue)
Gets an integer from a Jackson-mapped JSON object, by key, defaulting to a specified value if not found

Parameters:
json - a map representing a JSON object
key - key of object to retrieve
defaultValue - value to use if key cannot be found
Returns: