jive的扩展~采用banq的jf框架编写
源代码在线查看: data.jsp
/**
* $RCSfile: data.jsp,v $
* $Revision: 1.1.1.1 $
* $Date: 2002/09/09 13:50:25 $
*/
%>
java.util.*,
java.text.*,
com.jivesoftware.util.*,
com.jivesoftware.forum.*,
com.jivesoftware.forum.database.*,
com.jivesoftware.forum.util.*"
errorPage="error.jsp"
%>
// Date formatter for filenames
private static SimpleDateFormat fileDateFormatter =
new SimpleDateFormat("yyyy-MM-dd");
%>
boolean export = ParamUtils.getBooleanParameter(request,"export");
boolean doImport = ParamUtils.getBooleanParameter(request,"import");
String filename = ParamUtils.getParameter(request,"filename");
// Do an export
if (export) {
DbForumFactory dbForumFactory = (DbForumFactory)(((DbForumFactoryProxy)forumFactory).getProxiedForumFactory());
DbDataExport exporter = new DbDataExport(dbForumFactory);
exporter.export(false);
response.sendRedirect("data.jsp");
return;
}
// Do an import
if (doImport) {
DbForumFactory dbForumFactory = (DbForumFactory)(((DbForumFactoryProxy)forumFactory).getProxiedForumFactory());
DbDataImport importer = new DbDataImport(dbForumFactory);
Reader in = new FileReader(new File(JiveGlobals.getJiveHome() + System.getProperty("file.separator") + "data" + System.getProperty("file.separator") + filename));
importer.doImport(in);
response.sendRedirect("data.jsp");
return;
}
%>
String title = "Date Import & Export";
String[][] breadcrumbs = {
{"Main", "main.jsp"},
{"Date Import & Export", "data.jsp"}
};
%>
The import and export functions allow you to read data into and write
data from your Jive Forums installation. All data uses the Jive XML format.
Import Jive Data
Choose a file below to import:
try {
File jiveHomeDir = new File(JiveGlobals.getJiveHome() + System.getProperty("file.separator") + "data");
String[] filenames = jiveHomeDir.list();
for (int i=0; i if (filenames[i].endsWith(".xml")) {
foundXMLFiles = true;
%>
}
}
}
catch (Exception e) {}
if (!foundXMLFiles) {
%>
(No files to import.)
}
else {
%>
}
%>
Export Jive Data
%>
Export current Jive data to: