|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.objectplanet.survey.plugin.api.XMLHandler
public class XMLHandler
Handles translation to/from XML from/to business objects.
| Constructor Summary | |
|---|---|
XMLHandler()
|
|
| Method Summary | |
|---|---|
static void |
addQuestion(User user,
long surveyId,
java.lang.String questionXMLString)
Creates a Question object from an XML string, and adds it at the end of the survey. |
static long |
createSurvey(User user,
java.lang.String surveyXMLString,
long surveyGroupId)
Creates a survey object from an XML string, stores it in the database, and puts the survey in a folder. |
static java.lang.StringBuffer |
getQuestion(User user,
long surveyId,
int questionNo)
Gets the XML representation of a Question object. |
static java.lang.String |
getQuestionXMLHeader(java.lang.String encoding)
Gets the XML header for an XML file containing a question. |
static java.lang.StringBuffer |
getSurvey(User user,
long surveyId)
Gets the XML representation of a survey, by surveyId. |
static java.lang.StringBuffer |
getSurveyDTD()
Gets the internal Survey DTD to be included in the XML file when exporting a survey. |
static java.lang.String |
getSurveyXMLHeader(java.lang.String encoding)
Gets the XML header for an XML file containing a survey. |
static java.lang.String |
getXMLVersionHeader(java.lang.String encoding)
Gets the XML header for XML file where DTD is included. |
static void |
insertQuestion(User user,
long surveyId,
int questionNo,
java.lang.String questionXMLString)
Creates a Question object from an XML string, and inserts it in a survey. |
static void |
writeSurvey(User user,
long surveyId,
boolean includeReports,
boolean includeResponses,
java.io.OutputStream out)
Writes XML representation of a survey to the output steam. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLHandler()
| Method Detail |
|---|
public static java.lang.StringBuffer getQuestion(User user,
long surveyId,
int questionNo)
throws SurveySecurityException,
SurveySystemException
getQuestionXMLHeader() to get the
header.
user - User with access to the surveysurveyId - Id of the surveyquestionNo - The question number
SurveySecurityException - Thrown if the user is not authorized to
call this method.
SurveySystemException - If an error occurs in the system.public static java.lang.String getQuestionXMLHeader(java.lang.String encoding)
encoding - The encoding used. If null, default encoding will be used
(ISO-8859-1)
public static java.lang.StringBuffer getSurvey(User user,
long surveyId)
throws SurveySecurityException,
SurveySystemException
getSurveyXMLHeader() to get the header. Reports are not included.
user - User with access to the surveysurveyId - The survey id
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
public static void writeSurvey(User user,
long surveyId,
boolean includeReports,
boolean includeResponses,
java.io.OutputStream out)
throws SurveySecurityException,
SurveySystemException,
java.io.IOException
getSurveyXMLHeader() to get the header.
user - User with access to the surveysurveyId - The survey idincludeReports - True if include reports in the XMLincludeResponses - True if include responses in the XMLout - Output stream
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.io.IOExceptionpublic static java.lang.String getSurveyXMLHeader(java.lang.String encoding)
encoding - The encoding used. If null, default encoding will be used (ISO-8859-1)
public static java.lang.String getXMLVersionHeader(java.lang.String encoding)
encoding - The encoding used. If null, default encoding will be
used (ISO-8859-1)
public static java.lang.StringBuffer getSurveyDTD()
throws java.io.FileNotFoundException,
java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static void addQuestion(User user,
long surveyId,
java.lang.String questionXMLString)
throws ParsingException,
SurveySystemException
questionXMLString - XML representation of the questionuser - User with access to the surveysurveyId - Survey id
ParsingException - If an error occurred while parsing
SurveySystemException - If an error occurs in the system.
public static long createSurvey(User user,
java.lang.String surveyXMLString,
long surveyGroupId)
throws ParsingException,
SurveySystemException
surveyXMLString - XML representing a Surveyuser - User with access to the surveysurveyGroupId - Survey group to put the survey in
ParsingException - If an error occurred while parsing
SurveySystemException - If an error occurs in the system.
public static void insertQuestion(User user,
long surveyId,
int questionNo,
java.lang.String questionXMLString)
throws ParsingException,
SurveySystemException
questionXMLString - XML representation of the questionuser - User with access to the surveysurveyId - Survey idquestionNo - Position of the new question
ParsingException - If an error occurred while parsing
SurveySystemException - If an error occurs in the system.
|
Copyright ? ObjectPlanet Inc. All Rights Reserved. | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||