📄 report.jsp
字号:
"</html>\n";
function start() {
isRunning = true;
initButtons();
updateReportImage();
}
function stop() {
isRunning = false;
if (document.main.<%= CmsDialog.PARAM_THREAD_HASNEXT %>) {
document.main.<%= CmsDialog.PARAM_THREAD_HASNEXT %>.value = "false";
}
enableButtons("buttonrowcontinue");
enableButtons("buttonrowok");
updateReport();
updateReportImage();
}
// sets the report image correct depending on the current state of the report
function updateReportImage() {
if (reportType != "simple") {
// return if the report is in not in "simple" mode currently
return;
}
if (isRunning) {
report.document.images["report_img"].src = report_running.src;
} else {
if (hasError) {
report.document.images["report_img"].src = report_error.src;
} else {
report.document.images["report_img"].src = report_ok.src;
}
}
}
// flush the arrays with the report formats and messages
function flushArray() {
reportOutputFormats = new Array();
reportOutputMessages = new Array();
}
// updates the report, builds the HTML string from the JavaScript input
function update() {
var size = <%= CmsReport.REPORT_UPDATE_SIZE %>;
// resize the HTML string
if (htmlText.length > size) {
htmlText = htmlText.substring(htmlText.length - size, htmlText.length);
var pos = htmlText.indexOf("\n");
if (pos > 0) {
// cut output at the first linebreak to have a "nice" start
htmlText = htmlText.substring(pos, htmlText.length);
}
}
// append the HTML of the extended report format to the HTML string
htmlText += getContentExtended();
// write the HTML output to the iframe
updateReport();
}
// writes the HTML output to the iframe
// this function gets also invoked when the report output format is toggled
function updateReport() {
if (reportType == "<%= I_CmsReport.REPORT_TYPE_SIMPLE %>") {
if (!isRunning && hasError) {
pageBody =
pageStartSimple +
"<span class='head'>" + lastHeadline + "</span><br>\n" +
"<%= wp.key("report.error") %>" + lastError + "\n" +
"<%= wp.key("report.error.details") %>" +
pageEndSimple;
} else {
pageBody =
pageStartSimple +
"<span class='head'>" + lastHeadline + "</span><br>\n" +
pageEndSimple;
}
document.getElementById("report").style.border = "<%= borderSimpleStyle %>";
} else {
pageBody = pageStartExtended + htmlText + pageEndExtended;
document.getElementById("report").style.border = "<%= borderStyle %>";
}
report.document.open();
report.document.write(pageBody);
report.document.close();
setTimeout('doScroll();', 1);
}
// builds the HTML string from the JavaScript input
function getContentExtended() {
var htmlStr = "";
var i = 0;
for (i=0;i<reportOutputFormats.length && i<reportOutputMessages.length;i++) {
switch (reportOutputFormats[i]) {
case FORMAT_WARNING :
htmlStr += "<span class='warn'>";
htmlStr += reportOutputMessages[i];
htmlStr += "</span>";
break;
case FORMAT_ERROR :
htmlStr += "<span class='err'>";
htmlStr += reportOutputMessages[i];
htmlStr += "</span>";
break;
case FORMAT_HEADLINE :
htmlStr += "<span class='head'>";
htmlStr += reportOutputMessages[i];
htmlStr += "</span>";
break;
case FORMAT_NOTE :
htmlStr += "<span class='note'>";
htmlStr += reportOutputMessages[i];
htmlStr += "</span>";
break;
case FORMAT_OK :
htmlStr += "<span class='ok'>";
htmlStr += reportOutputMessages[i];
htmlStr += "</span>";
break;
case FORMAT_NEWLINE :
htmlStr += "\n";
break;
case FORMAT_THROWABLE :
htmlStr += "<span class='throw'>";
htmlStr += reportOutputMessages[i];
htmlStr += "</span>";
break;
case FORMAT_DEFAULT :
default :
htmlStr += "<span>";
htmlStr += reportOutputMessages[i];
htmlStr += "</span>";
}
}
return htmlStr;
}
function doScroll() {
var pos = 1000000;
report.window.scrollTo(0, pos);
}
function isContinueChecked() {
if (document.main.continuereport && document.main.continuereport.checked == true) {
return true;
} else {
return false;
}
}
function displayButtonRowContinue() {
displayButtonRow("buttonrowcontinue", true);
displayButtonRow("checkcontinue", true);
displayButtonRow("buttonrowok", false);
}
function displayButtonRowOk() {
displayButtonRow("buttonrowcontinue", false);
toggleButton("continuereport", true);
displayButtonRow("buttonrowok", true);
}
function displayButtonRow(rowId, show) {
if (show) {
document.getElementById(rowId).className = "show";
} else {
document.getElementById(rowId).className = "hide";
}
}
function enableButtons(rowId) {
if (rowId == "buttonrowcontinue") {
toggleButton("contok", false);
toggleButton("contcancel", false);
} else {
toggleButton("okclose", false);
}
}
function disableButtons(rowId) {
if (rowId == "buttonrowcontinue") {
toggleButton("contok", true);
toggleButton("contcancel", true);
} else {
toggleButton("okclose", true);
toggleButton("okcancel", true);
}
}
function toggleButton(buttonId, disableButton) {
if (document.getElementById(buttonId)) {
document.getElementById(buttonId).disabled = disableButton;
}
}
function initButtons() {
if (document.main.<%= CmsDialog.PARAM_THREAD_HASNEXT %> && document.main.<%= CmsDialog.PARAM_THREAD_HASNEXT %>.value == "true"
&& document.main.<%= CmsReport.PARAM_REPORT_CONTINUEKEY %> && document.main.<%= CmsReport.PARAM_REPORT_CONTINUEKEY %>.value != "") {
displayButtonRowContinue();
} else {
displayButtonRowOk();
}
disableButtons("buttonrowcontinue");
disableButtons("buttonrowok");
buttonsInitialized = true;
}
function submitActionRefresh(para1, para2, para3) {
<% if (Boolean.valueOf(wp.getParamRefreshWorkplace()).booleanValue()) {
// workplace must be refresehd (reloaded)
%>
top.location.href = "<%= org.opencms.main.OpenCms.getSystemInfo().getOpenCmsContext() + CmsWorkplace.VFS_PATH_VIEWS %>workplace.jsp";
<%
} else {
// no workplace refresh required
%>
return submitAction(para1, para2, para3);
<% } %>
}
//-->
</script>
<%= wp.bodyStart(null, "onLoad=\"start();\"") /*"dialog"*/%>
<%= wp.dialogStart() %>
<form name="main" action="<%= wp.getDialogRealUri() %>" method="post" class="nomargin" onsubmit="return submitActionRefresh('<%= CmsDialog.DIALOG_OK %>', null, 'main');">
<%= wp.dialogContentStart(wp.getParamTitle()) %>
<%= wp.paramsAsHidden() %>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="400">
<tr>
<td><iframe name="report" id="report" src="about:blank" frameborder="0" style="width:99.8%; height:400px; padding: 0; margin: 0; border: <%= borderStyle %>;"></iframe></td>
</tr>
</table>
<%= wp.dialogContentEnd() %>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="100%" id="buttonrowcontinue" class="hide">
<%= wp.dialogButtonsContinue("id=\"contok\" onclick=\"updateWin.continueReport();\"", "id=\"contcancel\"", "id=\"contdetails\"") %>
</td></tr>
<tr><td width="100%" id="buttonrowok" class="hide">
<%= wp.dialogButtonsOkCancelDetails("id=\"okclose\"", "id=\"okcancel\"", "id=\"details\"") %>
</td></tr>
<tr><td>
<iframe src="<%= wp.getDialogRealUri() %>?<%= CmsToolDialog.PARAM_STYLE%>=<%=wp.getParamStyle()%>&<%= CmsDialog.PARAM_ACTION %>=<%= CmsDialog.REPORT_UPDATE %>&<%=
CmsDialog.PARAM_THREAD %>=<%= wp.getParamThread() %>&<%= CmsReport.PARAM_REPORT_TYPE %>=<%= wp.getParamReportType() %>&<%= CmsDialog.PARAM_THREAD_HASNEXT %>=<%=
wp.getParamThreadHasNext() %>&resource=<%= wp.getParamResource() %>" name="updateWin" style="width:20px; height:20px; margin: 0px;" marginwidth="0"
marginheight="0" frameborder="0" framespacing="0" scrolling="no" class='hide'></iframe>
</td></tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" align="center"><tr>
<td class="hide" style="width: 100%; text-align: center;" id="checkcontinue"><input type="checkbox" name="continuereport" id="continuereport" value="true"> <%= wp.key(wp.getParamReportContinueKey()) %></td>
</tr></table>
</form>
<%= wp.dialogEnd() %>
<%= wp.bodyEnd() %>
<%= wp.htmlEnd() %>
<%
break;
}
//////////////////// end of switch statement
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -