it.eng.spagobi.commons.utilities
Class GeneralUtilities

java.lang.Object
  extended by it.eng.spagobi.commons.utilities.SpagoBIUtilities
      extended by it.eng.spagobi.commons.utilities.GeneralUtilities

public class GeneralUtilities
extends it.eng.spagobi.commons.utilities.SpagoBIUtilities

Contains some SpagoBI's general utilities.


Field Summary
static int MAX_DEFAULT_TEMPLATE_SIZE
           
static java.lang.String SPAGOBI_HOST
           
 
Constructor Summary
GeneralUtilities()
           
 
Method Summary
static it.eng.spago.security.IEngUserProfile createNewUserProfile(java.lang.String userId)
          Creates a new user profile, given his identifier.
static java.lang.String getLovMapResult(java.util.Map lovs)
          Gets the lov map result.
static java.lang.String getLovResult(java.lang.String lovLabel)
          Gets the lov result.
static java.lang.String getLovResult(java.lang.String lovLabel, it.eng.spago.security.IEngUserProfile profile)
          Gets the lov result.
static java.lang.String getSpagoBIProfileBaseUrl(java.lang.String userId)
          Returns the complete HTTP URL and puts it into a string.
static java.lang.String replaceInternationalizedMessages(java.lang.String message)
          Substitutes the substrings with sintax "${code,bundle}" or "${code}" (in the second case bundle is assumed to be the default value "messages") with the correspondent internationalized messages in the input String.
static void subsituteBIObjectParametersLovProfileAttributes(BIObject obj, it.eng.spago.base.SessionContainer session)
          Subsitute bi object parameters lov profile attributes.
 
Methods inherited from class it.eng.spagobi.commons.utilities.SpagoBIUtilities
checkForSystemProperty, cleanString, decode, deleteContentDir, deleteDir, encode, findAttributeValues, flushFromInputStreamToOutputStream, fromListToString, getAllProfileAttributes, getByteArrayFromInputStream, getCurrentLocale, getDefaultLocale, getLocaleDateFormat, getLocalIPAddressAsString, getRelativeFileNames, getServerDateFormat, getSpagoAdapterHttpUrl, getSpagoBiContext, getSpagoBiDashboardServlet, getSpagoBiHost, getTemplateMaxSize, isErrorHandlerContainingOnlyValidationError, main, quote, replace, substituteParametersInString, substituteProfileAttributesInString, substituteProfileAttributesInString, substituteQuotesIntoString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DEFAULT_TEMPLATE_SIZE

public static final int MAX_DEFAULT_TEMPLATE_SIZE
See Also:
Constant Field Values

SPAGOBI_HOST

public static java.lang.String SPAGOBI_HOST
Constructor Detail

GeneralUtilities

public GeneralUtilities()
Method Detail

replaceInternationalizedMessages

public static java.lang.String replaceInternationalizedMessages(java.lang.String message)
Substitutes the substrings with sintax "${code,bundle}" or "${code}" (in the second case bundle is assumed to be the default value "messages") with the correspondent internationalized messages in the input String. This method calls PortletUtilities.getMessage(key, bundle).

Parameters:
message - The string to be modified
Returns:
The message with the internationalized substrings replaced.

subsituteBIObjectParametersLovProfileAttributes

public static void subsituteBIObjectParametersLovProfileAttributes(BIObject obj,
                                                                   it.eng.spago.base.SessionContainer session)
                                                            throws java.lang.Exception,
                                                                   it.eng.spago.error.EMFInternalError
Subsitute bi object parameters lov profile attributes.

Parameters:
obj - the obj
session - the session
Throws:
java.lang.Exception - the exception
it.eng.spago.error.EMFInternalError - the EMF internal error

getLovMapResult

public static java.lang.String getLovMapResult(java.util.Map lovs)
Gets the lov map result.

Parameters:
lovs - the lovs
Returns:
the lov map result

getLovResult

public static java.lang.String getLovResult(java.lang.String lovLabel)
                                     throws java.lang.Exception
Gets the lov result.

Parameters:
lovLabel - the lov label
Returns:
the lov result
Throws:
java.lang.Exception - the exception

getLovResult

public static java.lang.String getLovResult(java.lang.String lovLabel,
                                            it.eng.spago.security.IEngUserProfile profile)
                                     throws java.lang.Exception
Gets the lov result.

Parameters:
lovLabel - the lov label
profile - the profile
Returns:
the lov result
Throws:
java.lang.Exception - the exception

createNewUserProfile

public static it.eng.spago.security.IEngUserProfile createNewUserProfile(java.lang.String userId)
                                                                  throws java.lang.Exception
Creates a new user profile, given his identifier.

Parameters:
userId - The user identifier
Returns:
The newly created user profile
Throws:
java.lang.Exception - the exception

getSpagoBIProfileBaseUrl

public static java.lang.String getSpagoBIProfileBaseUrl(java.lang.String userId)
Returns the complete HTTP URL and puts it into a string.

Parameters:
userId - the user id
Returns:
A String with complete HTTP Url