|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectplanet.survey.plugin.api.PluginUtil
Utility class for the plugins.
Field Summary | |
static int |
LOGGING_LEVEL_ERROR
Loggs only errors. |
static int |
LOGGING_LEVEL_MESSAGE
Loggs all messages, warnings and errors |
static int |
LOGGING_LEVEL_WARNING
Loggs all warnings and errors |
Constructor Summary | |
PluginUtil()
|
Method Summary | |
static java.lang.String |
getPluginVersion()
Return the version of the plugin api. |
static java.lang.String |
getSurveySystemVersion()
Return the version of the survey system. |
static java.lang.String |
getSurveyUrl(javax.servlet.http.HttpServletRequest request,
long surveyId)
Gets the url to the survey module (where respondent answer the survey). |
static java.lang.String |
getSystemHome()
Get system home: location of the opinio files. |
static User |
getSystemUser()
Get system user. |
static void |
log(java.lang.String logText,
int level)
Loggs a message. |
static void |
log(java.lang.Throwable e)
Loggs an error with level LOGGING_LEVEL_ERROR |
static void |
sendEmail(java.lang.String fromName,
java.lang.String fromEmail,
java.lang.String toEmail,
java.lang.String subject,
java.lang.String message,
java.lang.String emailType)
Send email. |
static void |
storeProps(java.util.Properties properties,
java.io.File file)
Stores a property object to an output stream |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LOGGING_LEVEL_ERROR
public static final int LOGGING_LEVEL_MESSAGE
public static final int LOGGING_LEVEL_WARNING
Constructor Detail |
public PluginUtil()
Method Detail |
public static java.lang.String getPluginVersion()
public static java.lang.String getSurveySystemVersion()
public static java.lang.String getSurveyUrl(javax.servlet.http.HttpServletRequest request, long surveyId) throws SurveySystemException
http://server-address/opinio/s?s=surveyId (or customId)
request
- Request objectsurveyId
- Survey id
SurveySystemException
- If any error occurs.public static User getSystemUser()
public static void log(java.lang.String logText, int level)
logText
- Message to log.level
- Logging level(defined above)public static void log(java.lang.Throwable e)
e
- Exception to log.public static void sendEmail(java.lang.String fromName, java.lang.String fromEmail, java.lang.String toEmail, java.lang.String subject, java.lang.String message, java.lang.String emailType) throws java.lang.IllegalArgumentException, javax.mail.internet.AddressException, SurveySystemException
fromName
- Who sends the message
(name)fromEmail
- Who sends the message(email
address)toEmail
- Recipient's addressesubject
- The subject of the emailmessage
- The body of the messageemailType
- The type og th emessage
(text or html)
javax.mail.internet.AddressException
- If invalid fromEmail or
toEmail
SurveySystemException
- If error occurs.
java.lang.IllegalArgumentException
- If illegal parameters.public static void storeProps(java.util.Properties properties, java.io.File file) throws java.io.IOException
properties
- The property object to storefile
- File to store properties to
java.io.IOException
- IOExceptionpublic static java.lang.String getSystemHome()
|
Copyright © ObjectPlanet Inc. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |