📄 data.jsp
字号:
<tr><td bgcolor="#eeeeee" align="center"><font size="-2" face="verdana"> </font></td> <td bgcolor="#eeeeee" align="center"><font size="-2" face="verdana"><b> FILENAME </b></font></td> <td bgcolor="#eeeeee" align="center"><font size="-2" face="verdana"><b> SIZE </b></font></td> <td bgcolor="#eeeeee" align="center"><font size="-2" face="verdana"><b> LAST MODIFIED </b></font></td> </tr> <% // Get a list of xml files from the data dir: File dataDir = new File(JiveGlobals.getJiveHome(), "data"); boolean error = false; boolean foundFile = false; if (!dataDir.exists() || !dataDir.canRead()) { error = true; %> <tr bgcolor="#ffffff"> <td align="center" colspan="4"> <font size="-1"> <i><%= JiveGlobals.getJiveHome() + File.separator + "data" %> does not exist or your appserver can not read it. </i> </font> </td> </tr> <% } else { String[] files = dataDir.list(); for (int i=0; i<files.length; i++) { String fname = files[i]; if (fname.endsWith(".xml")) { foundFile = true; File file = new File(dataDir, fname); String filesize = "n/a"; long bytes = file.length(); if (bytes < 1024) { filesize = bytes + " b"; } else if (bytes >= 1024 && bytes < (1024*1024)) { filesize = (bytes/1024) + " K"; } else { filesize = (bytes/(1024*1024)) + " MB"; } %> <tr bgcolor="#ffffff"> <td><input type="radio" name="file" value="<%= StringUtils.encodeHex(fname.getBytes()) %>" id="<%= i %>"></td> <td><font size="-1"> <label for="<%= i %>"><%= fname %></label> </font> </td> <td><font size="-1"> <%= filesize %> </font> </td> <td><font size="-1"> <%= SkinUtils.formatDate(request,pageUser,new Date(file.lastModified())) %> </font> </td> </tr> <% } } if (!foundFile) { %> <tr bgcolor="#ffffff"> <td align="center" colspan="4"> <font size="-1"> <i>No XML import files were found.</i> </font> </td> </tr> <% } } %> </table> </td></tr> </table><p> <% if (!error && foundFile) { %> <input type="submit" value="Import File" name="startImport"> <% } %> </form> <% // Options for exporting } else if (doExport) { %> <font size="-1"> <b>Export Options</b> </font><p> <font size="-1"> Choose either a standard data export or a custom one. If you choose a custom one, please use the form below to pick and choose what data you want exported. </font><p> <form action="data.jsp"> <input type="hidden" name="mode" value="export"> <table cellpadding="2" cellspacing="0" border="0"> <tr> <td rowspan="99" nowrap> </td> <td valign="top"> <input type="radio" name="type" value="standard" id="rb01"<%= (standard?" checked":"") %> onclick="disable(this.form,true);"> </td> <td> <font size="-1"> <label for="rb01"> Standard Export </label> -- All users, groups, permissions and forums are exported to <tt><%= JiveGlobals.getJiveHome() + File.separator %>data<%= File.separator + exporter.getFilename() %></tt> </font> </td> </tr> <tr> <td valign="top"> <input type="radio" name="type" value="custom" id="rb02"<%= (custom?" checked":"") %> onclick="disable(this.form,false);"> </td> <td> <font size="-1"> <label for="rb02"> Custom Export </label> -- Please customize your export by selecting the following options: </font> </td> </tr> <tr> <td> </td> <td> <table cellpadding="2" cellspacing="0" border="0" width="100%"> <tr> <td width="1%" nowrap> <input type="checkbox" name="exportIDs" id="cb01" onclick="this.form.type[this.form.type.length-1].checked=true;" <%= (exportIDs?" checked":"") %>> </td> <td width="1%" nowrap> <font size="-1"> <label for="cb01"> Export all object IDs </label> </font> </td> <td width="98%"> <a href="#" onclick="helpwin('data','export_all_ids');return false;" title="Click for help" ><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8"></a> </td> </tr> <tr> <td width="1%" nowrap><input type="checkbox" name="exportUsers" id="cb02" onclick="this.form.type[this.form.type.length-1].checked=true;" <%= (exportUsers?" checked":"") %>> </td> <td width="1%" nowrap> <font size="-1"> <label for="cb02"> Export all users </label> </font> </td> <td width="98%"> <a href="#" onclick="helpwin('data','export_all_users');return false;" title="Click for help" ><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8"></a> </td> </tr> <tr> <td width="1%" nowrap> <input type="checkbox" name="exportGroups" id="cb03" onclick="this.form.type[this.form.type.length-1].checked=true;" <%= (exportGroups?" checked":"") %>> </td> <td width="1%" nowrap> <font size="-1"> <label for="cb03"> Export all groups </label> </font> </td> <td width="98%"> <a href="#" onclick="helpwin('data','export_all_groups');return false;" title="Click for help" ><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8"></a> </td> </tr> <tr> <td width="1%" nowrap> <input type="checkbox" name="exportPerms" id="cb04" onclick="this.form.type[this.form.type.length-1].checked=true;" <%= (exportPerms?" checked":"") %>> </td> <td width="1%" nowrap> <font size="-1"> <label for="cb04"> Export all permissions </label> </font> </td> <td width="98%"> <a href="#" onclick="helpwin('data','export_perms');return false;" title="Click for help" ><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8"></a> </td> </tr> <tr> <td width="1%" nowrap> <input type="checkbox" name="exportForums" id="cb05" onclick="this.form.type[this.form.type.length-1].checked=true;" <%= (exportForums?" checked":"") %>> </td> <td width="1%" nowrap> <font size="-1"> <label for="cb05"> Export all forums </label> </font> </td> <td width="98%"> <a href="#" onclick="helpwin('data','export_forums');return false;" title="Click for help" ><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8"></a> </td> </tr> <% if (startExport && exportFilenameError) { %> <tr> <td colspan="3"> <font size="-1" color="#ff0000"> Error: Invalid filename. Only alphanumeric characters and dashes and one "." are allowed. </font> </td> </tr> <% } %> <tr> <td colspan="3"> <font size="-1"> <label for="cb06"> Custom File Name: </label> </font> <input type="text" name="customFilename" value="<%= exporter.getFilename() %>" size="30" maxlength="50" onclick="this.form.type[this.form.type.length-1].checked=true;"> <a href="#" onclick="helpwin('data','custom_filename');return false;" title="Click for help" ><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8"></a> </td> </tr> </table> </td> </tr> <tr> <td> </td> <td> <br> <input type="submit" value="Start Data Export" name="startExport"> <input type="submit" name="cancel" value="Cancel"> </td> </tr> </table> </form> <% } // end else if doExport %><% } // end else to if !doImport && !doExport %></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -