|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.eng.spagobi.commons.utilities.GeneralUtilities
public class GeneralUtilities
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 java.lang.String |
checkForSystemProperty(java.lang.String input)
Checks if the String in input contains a reference to System property with the syntax ${property_name}, and, in case, substitutes the reference with the actual value. |
static java.lang.String |
cleanString(java.lang.String original)
Cleans a string from spaces and tabulation characters. |
static it.eng.spago.security.IEngUserProfile |
createNewUserProfile(java.lang.String userId)
Creates a new user profile, given his identifier. |
static java.lang.String |
decode(java.lang.String input)
Questo metodo implementa la stessa logica della funzione javascript escape. |
static boolean |
deleteContentDir(java.io.File dir)
Delete contents of a directory. |
static boolean |
deleteDir(java.io.File dir)
Delete a folder and its contents. |
static java.lang.String |
encode(java.lang.String input)
Questo metodo implementa la stessa logica della funzione javascript escape. |
static java.lang.String[] |
findAttributeValues(java.lang.String attributeValue)
Find the attribute values in case of multi value attribute. |
static java.lang.String |
findUserId(javax.servlet.http.HttpServletRequest httpRequest)
Finds the user identifier from http request or from SSO system (by the http request in input). |
static java.lang.String |
findUserId(it.eng.spago.base.SourceBean serviceRequest,
javax.servlet.http.HttpServletRequest httpRequest)
Finds the user identifier from service request or from SSO system (by the http request in input). |
static void |
flushFromInputStreamToOutputStream(java.io.InputStream is,
java.io.OutputStream os,
boolean closeStreams)
Given an InputStream as input flushs the content into an
OutputStream and then close the input and output stream. |
static java.lang.String |
fromListToString(java.util.List values,
java.lang.String separator)
From list to string. |
static java.util.HashMap |
getAllProfileAttributes(it.eng.spago.security.IEngUserProfile profile)
Gets the all profile attributes. |
static byte[] |
getByteArrayFromInputStream(java.io.InputStream is)
Given an InputStream as input, gets the correspondent
bytes array. |
static java.util.Locale |
getDefaultLocale()
Gets the default locale. |
static java.lang.String |
getLocalIPAddressAsString()
Returns a string containing the localhost IP address. |
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 |
getRelativeFileNames(java.lang.String completeFileName)
From a String identifying the complete name for a file, gets the relative file names, which are substrings of the starting String, according to the java separator "/". |
static java.lang.String |
getSpagoAdapterHttpUrl()
Gets the spago adapter http url. |
static java.lang.String |
getSpagoBiContext()
Returns the context for SpagoBI |
static java.lang.String |
getSpagoBiDashboardServlet()
Gets the spagoBI's dashboards servlet information as a string. |
static java.lang.String |
getSpagoBiHost()
Returns the address for SpagoBI as an URL and puts it into a string. |
static java.lang.String |
getSpagoBIProfileBaseUrl(java.lang.String userId)
Returns the complete HTTP URL and puts it into a string. |
static int |
getTemplateMaxSize()
|
static boolean |
isErrorHandlerContainingOnlyValidationError(it.eng.spago.error.EMFErrorHandler errorHandler)
Checks if the Spago errorHandler contains only validation errors. |
static void |
main(java.lang.String[] args)
The Main method. |
static java.lang.String |
quote(java.lang.String s)
Quote. |
static java.lang.String |
replace(java.lang.String toParse,
java.lang.String replacing,
java.lang.String replaced)
Questo metodo permette di sostituire una parte di una stringa con un'altra. |
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. |
static java.lang.String |
substituteParametersInString(java.lang.String statement,
java.util.Map valuesMap)
Substitutes parameters with sintax "$P{parameter_name}" whose value is set in the map. |
static java.lang.String |
substituteProfileAttributesInString(java.lang.String statement,
it.eng.spago.security.IEngUserProfile profile)
Substitutes the profile attributes with sintax "${attribute_name}" with the correspondent value in the string passed at input. |
static java.lang.String |
substituteQuotesIntoString(java.lang.String value)
Substitute quotes into string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_DEFAULT_TEMPLATE_SIZE
public static java.lang.String SPAGOBI_HOST
Constructor Detail |
---|
public GeneralUtilities()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- String for command line argumentspublic static java.lang.String getSpagoAdapterHttpUrl()
public static java.util.Locale getDefaultLocale()
public static java.lang.String cleanString(java.lang.String original)
original
- The input string
public static boolean isErrorHandlerContainingOnlyValidationError(it.eng.spago.error.EMFErrorHandler errorHandler)
errorHandler
- The error handler to check
public static byte[] getByteArrayFromInputStream(java.io.InputStream is)
InputStream
as input, gets the correspondent
bytes array.
is
- The input straeam
public static void flushFromInputStreamToOutputStream(java.io.InputStream is, java.io.OutputStream os, boolean closeStreams)
InputStream
as input flushs the content into an
OutputStream and then close the input and output stream.
is
- The input streamos
- The output streamcloseStreams
- the close streamspublic static java.lang.String getRelativeFileNames(java.lang.String completeFileName)
completeFileName
- The string representing the file name
public static java.lang.String getLocalIPAddressAsString()
public static java.lang.String getSpagoBiContext()
public static java.lang.String getSpagoBiHost()
public static java.lang.String getSpagoBIProfileBaseUrl(java.lang.String userId)
userId
- the user id
public static java.lang.String getSpagoBiDashboardServlet()
public static java.lang.String substituteParametersInString(java.lang.String statement, java.util.Map valuesMap) throws java.lang.Exception
statement
- The string to be modified (tipically a query)valuesMap
- Map name-value
java.lang.Exception
- the exceptionpublic static java.lang.String substituteProfileAttributesInString(java.lang.String statement, it.eng.spago.security.IEngUserProfile profile) throws java.lang.Exception
statement
- The string to be modified (tipically a query)profile
- The IEngUserProfile object
java.lang.Exception
- the exceptionpublic static java.lang.String quote(java.lang.String s)
s
- the s
public static java.lang.String[] findAttributeValues(java.lang.String attributeValue) throws java.lang.Exception
attributeValue
- The String representing the list of attribute values
java.lang.Exception
- in case of sintax errorpublic static java.util.HashMap getAllProfileAttributes(it.eng.spago.security.IEngUserProfile profile) throws it.eng.spago.error.EMFInternalError
profile
- the profile
it.eng.spago.error.EMFInternalError
- the EMF internal errorpublic static boolean deleteDir(java.io.File dir)
dir
- The java file object of the directory
public static boolean deleteContentDir(java.io.File dir)
dir
- The java file object of the directory
public static java.lang.String replaceInternationalizedMessages(java.lang.String message)
PortletUtilities.getMessage(key, bundle)
.
message
- The string to be modified
public static java.lang.String replace(java.lang.String toParse, java.lang.String replacing, java.lang.String replaced)
toParse
- stringa da manipolare.replacing
- parte di stringa da sostituire.replaced
- stringa nuova.
public static java.lang.String encode(java.lang.String input)
input
- stringa da manipolare.
public static java.lang.String decode(java.lang.String input)
input
- stringa da manipolare.
public static void subsituteBIObjectParametersLovProfileAttributes(BIObject obj, it.eng.spago.base.SessionContainer session) throws java.lang.Exception, it.eng.spago.error.EMFInternalError
obj
- the objsession
- the session
java.lang.Exception
- the exception
it.eng.spago.error.EMFInternalError
- the EMF internal errorpublic static java.lang.String substituteQuotesIntoString(java.lang.String value)
value
- the value
public static java.lang.String getLovMapResult(java.util.Map lovs)
lovs
- the lovs
public static java.lang.String getLovResult(java.lang.String lovLabel) throws java.lang.Exception
lovLabel
- the lov label
java.lang.Exception
- the exceptionpublic static java.lang.String getLovResult(java.lang.String lovLabel, it.eng.spago.security.IEngUserProfile profile) throws java.lang.Exception
lovLabel
- the lov labelprofile
- the profile
java.lang.Exception
- the exceptionpublic static java.lang.String fromListToString(java.util.List values, java.lang.String separator)
values
- the valuesseparator
- the separator
public static it.eng.spago.security.IEngUserProfile createNewUserProfile(java.lang.String userId) throws java.lang.Exception
userId
- The user identifier
java.lang.Exception
- the exceptionpublic static java.lang.String findUserId(javax.servlet.http.HttpServletRequest httpRequest) throws java.lang.Exception
httpRequest
- The http request
java.lang.Exception
- in case the SSO is enabled and the user identifier specified on http request is different from the SSO detected one.public static java.lang.String findUserId(it.eng.spago.base.SourceBean serviceRequest, javax.servlet.http.HttpServletRequest httpRequest) throws java.lang.Exception
httpRequest
- The http requestserviceRequest
- the service request
java.lang.Exception
- in case the SSO is enabled and the user identifier specified on service request is different from the SSO detected one.public static java.lang.String checkForSystemProperty(java.lang.String input)
public static int getTemplateMaxSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |