| java.lang.Object com.mvnforum.admin.ImportWebHelper com.mvnforum.admin.importexport.mvnforum.ImportMvnForum
ImportMvnForum | public class ImportMvnForum extends ImportWebHelper (Code) | | author: Igor Manic version: $Revision: 1.15 $, $Date: 2007/06/22 09:08:30 $ version:
version: ImportMvnForum class encapsulates processing version: of MVN Forum's XML or ZIP backups, and imports all the data into MVN Forum. version: For details see ImportMvnForum.importXml(File,HttpServletRequest,HttpServletResponse,int,String,Calendar,String,boolean,int) version: and ImportMvnForum.importZip(File,HttpServletRequest,HttpServletResponse,int,String,Calendar,String,boolean,int) version:
version: This class cannot be instantiated. |
Method Summary | |
public static void | addImportantMessage(String message) Adds important (bold) message to the output stream that was setup in
ImportMvnForum.importXml(File,HttpServletRequest,HttpServletResponse,int,String,Calendar,String,boolean,int) . | public static void | addMessage(String message) Adds message to the output stream that was setup in
ImportMvnForum.importXml(File,HttpServletRequest,HttpServletResponse,int,String,Calendar,String,boolean,int) . | public static void | createDefaultContents() Ensure that default entries in MVN Forum (admin and virtual guest members, rank titles,
Registered Members group, ...) are created.
This method was made public to be available to MVN Forum XML processing classes.
Since these defaults will be imported from XML (they are supposed to be
in the XML), this method won't do anything. | public static void | importXml(File importFile, HttpServletRequest request, HttpServletResponse response, int logonMemberID, String logonMemberName, Calendar importTime, String importIP, boolean clearIfError, int messageLevel) This method performs processing of MVN Forum's XML backup file importFile
and imports the data into the MVN Forum system. | public static void | importZip(File importFile, HttpServletRequest request, HttpServletResponse response, int logonMemberID, String logonMemberName, Calendar importTime, String importIP, boolean clearIfError, int messageLevel) This method performs processing of MVN Forum's ZIP backup file importFile
and imports the data into the MVN Forum system. | protected static void | processXml(File inputFile, Calendar importTime) This method performs actual processing of MVN Forum's XML file inputFile
and imports the data into the MVN Forum system.
Don't use this method directly. |
importXml | public static void importXml(File importFile, HttpServletRequest request, HttpServletResponse response, int logonMemberID, String logonMemberName, Calendar importTime, String importIP, boolean clearIfError, int messageLevel) throws ImportException(Code) | | This method performs processing of MVN Forum's XML backup file importFile
and imports the data into the MVN Forum system. It clears the database
and files, does neccessary setup (including startup of message output),
and calls
ImportMvnForum.processXml(File,Calendar) to do actual processing.
Parameters: importFile - MVN Forum XML backup file to be imported. Parameters: request - Current session's HttpServletRequest object. Parameters: response - Current session's HttpServletResponse object. Parameters: logonMemberID - MemberID of user who is logged in, and who initiated import process. Parameters: logonMemberName - MemberName of user who is logged in, and who initiated import process. Parameters: importTime - The moment when import process was started. Parameters: importIP - From this IP address admin requested import. Parameters: clearIfError - Should it clear/reset the database in case of error. Parameters: messageLevel - What messages should be written to output during the process.For details see com.mvnforum.MVNForumConfig.MESSAGE_LEVEL_ALL_MESSAGES,com.mvnforum.MVNForumConfig.MESSAGE_LEVEL_IMPORTANT_MESSAGES andcom.mvnforum.MVNForumConfig.MESSAGE_LEVEL_ONLY_ERRORS. exception: ImportException - If there is an error during the process. See net.myvietnam.mvncore.exception.ImportException. |
importZip | public static void importZip(File importFile, HttpServletRequest request, HttpServletResponse response, int logonMemberID, String logonMemberName, Calendar importTime, String importIP, boolean clearIfError, int messageLevel) throws ImportException(Code) | | This method performs processing of MVN Forum's ZIP backup file importFile
and imports the data into the MVN Forum system. It clears the database
and files, does neccessary setup (including startup of message output),
extracts the files from ZIP, and calls
ImportMvnForum.processXml(File,Calendar) to do actual processing of the main XML file (found in ZIP).
Parameters: importFile - MVN Forum ZIP backup file to be imported. Parameters: request - Current session's HttpServletRequest object. Parameters: response - Current session's HttpServletResponse object. Parameters: logonMemberID - MemberID of user who is logged in, and who initiated import process. Parameters: logonMemberName - MemberName of user who is logged in, and who initiated import process. Parameters: importTime - The moment when import process was started. Parameters: importIP - From this IP address admin requested import. Parameters: clearIfError - If true , the database will be cleared/resetin case of error rises during the import. Default Guest and Admin users will be created. Parameters: messageLevel - What amount of messages (informational, important, error)will be written to output. exception: ImportException - If there is an error during the process. See net.myvietnam.mvncore.exception.ImportException. |
processXml | protected static void processXml(File inputFile, Calendar importTime) throws IOException, SAXException, ImportException(Code) | | This method performs actual processing of MVN Forum's XML file inputFile
and imports the data into the MVN Forum system.
Don't use this method directly. Instead, you should use
ImportMvnForum.importXml(File,HttpServletRequest,HttpServletResponse,int,String,Calendar,String,boolean,int) .
Parameters: inputFile - MVN Forum XML file to be imported. Parameters: importTime - The moment when import process was started. exception: IOException - If there is an I/O error while processing XML file. exception: SAXException - If there is an error while parsing XML file. exception: ImportException - If there is some other error during the import. |
Methods inherited from com.mvnforum.admin.ImportWebHelper | protected static void addErrorMessage(String message)(Code)(Java Doc) protected static void addFinalErrorHandling(HttpServletRequest request, boolean clearIfError)(Code)(Java Doc) protected static void addImportantMessage(String message)(Code)(Java Doc) protected static void addMessage(String message)(Code)(Java Doc) protected static void addSuccessMessage(HttpServletRequest request)(Code)(Java Doc) protected static void clearDatabase() throws DatabaseException(Code)(Java Doc) protected static void clearFiles(ServletContext context) throws IOException(Code)(Java Doc) public static void createDefaultAdminMember() throws ObjectNotFoundException, CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException(Code)(Java Doc) public static void createDefaultAdminMember(String adminName) throws ObjectNotFoundException, CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException(Code)(Java Doc) public static void createDefaultContents() throws DuplicateKeyException, ObjectNotFoundException, CreateException, DatabaseException, ForeignKeyNotFoundException(Code)(Java Doc) public static void createDefaultGuestMember() throws DuplicateKeyException, ObjectNotFoundException, CreateException, DatabaseException, ForeignKeyNotFoundException(Code)(Java Doc) public static void createDefaultGuestMember(String guestName) throws DuplicateKeyException, ObjectNotFoundException, CreateException, DatabaseException, ForeignKeyNotFoundException(Code)(Java Doc) public static void createDefaultRanks() throws CreateException, DuplicateKeyException, ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException(Code)(Java Doc) public static void createDefaultRegisteredMembersGroup() throws CreateException, DuplicateKeyException, ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException(Code)(Java Doc) public static void createDefaultRegisteredMembersGroup(String groupOwnerName) throws CreateException, DuplicateKeyException, ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException(Code)(Java Doc) protected static void endHtml()(Code)(Java Doc) protected static int execUpdateQuery(String query) throws DatabaseException(Code)(Java Doc) protected static void setMessageOutputLevel(int messageLevel)(Code)(Java Doc) protected static void setOutputHtmlWriter(PrintWriter outWriter)(Code)(Java Doc) protected static void startHtml(HttpServletRequest request)(Code)(Java Doc)
|
|
|