diff options
author | TATTAVARADA <statta@research.att.com> | 2017-04-27 07:53:18 -0400 |
---|---|---|
committer | st782s <statta@research.att.com> | 2017-04-27 08:31:27 -0400 |
commit | 6beb446925c967aca92f5513adf36c5db77c00d6 (patch) | |
tree | 9392057ed0739de2445c5b2a2a8bee6dcdacbcf7 /ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree | |
parent | 246b225194e3e8dc1926294de591a94fd9787fa7 (diff) |
[PORTAL-7] Rebase
This rebasing includes common libraries and common overlays projects
abstraction of components
Change-Id: Ia1efa4deacdc5701e6205104ac021a6c80ed60ba
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree/folderNav.jsp | 464 | ||||
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree/testTree.jsp | 229 |
2 files changed, 693 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree/folderNav.jsp b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree/folderNav.jsp new file mode 100644 index 0000000..3895199 --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree/folderNav.jsp @@ -0,0 +1,464 @@ +<%@page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> +<%@page import="org.openecomp.portalsdk.analytics.model.runtime.ReportRuntime"%> +<%@page import="org.openecomp.portalsdk.analytics.util.AppConstants"%> +<%@page import="org.openecomp.portalsdk.analytics.system.Globals"%> + +<% + boolean isFolderAllowed = false; + ReportRuntime rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); + boolean adminUser = AppUtils.isAdminUser(request); + if (Globals.isFolderTreeAllowed()) { + if(adminUser) { + isFolderAllowed = true; + } else if (!Globals.isFolderTreeAllowedOnlyForAdminUsers()) { + isFolderAllowed = true; + } else isFolderAllowed = false; + } + + + +%> + + +<script src='dwr/engine.js'></script> +<script src='dwr/util.js'></script> +<script src='dwr/interface/folderNavAjax.js'></script> + + +<script> + var imgFolder = '<%=AppUtils.getImgFolderURL()%>'; + var isFolderAllowed = '<%= isFolderAllowed%>'; +</script> +<script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/tree/ajax.js"></script> +<script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/tree/context-menu.js"></script> +<script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/tree/drag-drop-folder-tree.js"> +<script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/raptor.js"> +</script> +<link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/raptor.css"> +<link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/tree/drag-drop-folder-tree.css"> +<link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/tree/context-menu.css"> +<style type="text/css"> +/* CSS for the demo */ +img{ + border:0px; +} +</style> +<script> + var doCollapse = '<%=request.getParameter("doCollapseTree")%>'; + var selectedFolderId; + var ajaxObjects = new Array(); + + // Use something like this if you want to save data by Ajax. + function saveMyTree() + { + saveString = treeObj.getNodeOrders(); + alert(saveString); + var ajaxIndex = ajaxObjects.length; + ajaxObjects[ajaxIndex] = new sack(); + var url = 'tree'; + //var url = 'tree'; + ajaxObjects[ajaxIndex].requestFile = url; // Specifying which file to get + ajaxObjects[ajaxIndex].onCompletion = function() { saveComplete(ajaxIndex); } ; // Specify function that will be executed after file has been found + ajaxObjects[ajaxIndex].runAJAX(url); // Execute AJAX function + + } + function saveComplete(index) + { + alert(ajaxObjects[index].response); + } + + + // Call this function if you want to save it by a form. + function saveMyTree_byForm() + { + displayFolderInfo(); + var data=folderNavAjax.saveFolderStructure(treeObj.getNodeOrders(), "<%=AppUtils.getUserID(request)%>", fillFolderStructure); + + } + + function cancelMyTree_byForm(){ + //document.treeFrm.submit(); + displayFolderInfo(); + var data=folderNavAjax.getFolderListString("<%=AppUtils.getUserID(request)%>", fillFolderStructure); + } + + function deleteMyTree_byForm() + { + //document.treeForm.submit(); + displayFolderInfo(); + var data=folderNavAjax.deleteFolderStructure(document.treeFrm.deleteIds.value, "<%=AppUtils.getUserID(request)%>", fillFolderStructure); + } + + function addMyTree_byForm() + { + //document.treeFrm.submit(); + displayFolderInfo(); + selectedFolderId = document.treeFrm.saveString.value; + var data=folderNavAjax.createNewFolder(document.treeFrm.saveString.value, document.treeFrm.newName.value, "<%=AppUtils.getUserID(request)%>", fillFolderStructure); + + } + + function renameMyTree_byForm() + { + //document.treeFrm.submit(); + displayFolderInfo(); + var data=folderNavAjax.renameFolder(document.treeFrm.renameId.value, document.treeFrm.newName.value, "<%=AppUtils.getUserID(request)%>", fillFolderStructure); + + } + + function createFolder(){ + if(JSTreeObj.selectedItem == null || JSTreeObj.selectedItem.parentNode.id.substr(0,3) == '000') + return; + if (JSTreeObj.isAddAllowed(JSTreeObj.selectedItem.parentNode.id) == false){ + alert("You do not have rights on this folder"); + return; + } + selectedFolderId = JSTreeObj.selectedItem.parentNode.id; + displayFolderInfo(); + if (JSTreeObj.addItem(JSTreeObj.selectedItem, JSTreeObj.selectedItem) == false){ + hideFolderInfo(); + } + } + + function deleteFolder(){ + if(JSTreeObj.selectedItem == null) { + return; + } + var id = JSTreeObj.selectedItem.parentNode.id.replace(/[^0-9]/gi,''); + if (JSTreeObj.isDeleteAllowed(id) == false){ + alert("You do not have rights on this folder"); + return; + } + if(id.substr(0,3) == '000') { + return; + } + displayFolderInfo(); + if (JSTreeObj.deleteItem(JSTreeObj.selectedItem, JSTreeObj.selectedItem) == false){ + hideFolderInfo(); + } + } + + function runReport() + { + + if (JSTreeObj == null || JSTreeObj.selectedItem == null){ + return; + } + + var id = JSTreeObj.selectedItem.parentNode.id.replace(/[^0-9]/gi,''); + if(id.substr(0,3) != '000') { + return; + } + //displayFolderInfo(); + id = id.substr(3, id.length); + addBreadCrumb(true, id); + if (window.frames && window.frames[0] && window.frames[0].name == 'content_Iframe'){ + window.frames[0].location='<%= AppUtils.getRaptorActionURL() %>report.run&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + } + else if (document.getElementById('searchContentContainer')){ + document.getElementById('searchContentContainer').innerHTML = "<div id='breadCrumbArea'> </div><iframe name='content_Iframe' frameborder='0' id='content_Iframe' src='<%= AppUtils.getRaptorActionURL() %>report.run&c_master=" + id + "&PAGE_ID=HOME&refresh=Y' width='100%' height='450' ></iframe>"; + //document.getElementById('content_Iframe').height=document.body.offsetHeight - 210; + resizeWindow(); + document.getElementById('content_Iframe').location = '<%= AppUtils.getRaptorActionURL() %>report.run&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + + }else{ + + document.treeFrm.action='<%= AppUtils.getRaptorActionURL() %>report.run&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + document.treeFrm.submit(); + } + + } + function editReport() + { + if (JSTreeObj == null || JSTreeObj.selectedItem == null){ + return; + } + + var id = JSTreeObj.selectedItem.parentNode.id.replace(/[^0-9]/gi,''); + if(id.substr(0,3) != '000') { + return; + } + id = id.substr(3, id.length); + if (window.frames && window.frames[0] && window.frames[0].name == 'content_Iframe'){ + window.frames[0].location='<%= AppUtils.getRaptorActionURL() %>report.edit&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + } + else if (document.getElementById('searchContentContainer')){ + document.getElementById('searchContentContainer').innerHTML = "<div id='breadCrumbArea'> </div><iframe name='content_Iframe' frameborder='0' id='content_Iframe' src='<%= AppUtils.getRaptorActionURL() %>report.edit&c_master=" + id + "&PAGE_ID=HOME&refresh=Y' width='100%' height='450' ></iframe>"; + //document.getElementById('content_Iframe').height=document.body.offsetHeight - 210; + resizeWindow(); + document.getElementById('content_Iframe').location = '<%= AppUtils.getRaptorActionURL() %>report.edit&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + + }else{ + document.treeFrm.action='<%= AppUtils.getRaptorActionURL() %>report.edit&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + document.treeFrm.submit(); + } + } + function deleteReport() + { + if (JSTreeObj == null || JSTreeObj.selectedItem == null){ + return; + } + + var id = JSTreeObj.selectedItem.parentNode.id.replace(/[^0-9]/gi,''); + if(id.substr(0,3) != '000') { + return; + } + id = id.substr(3, id.length); + if (window.frames && window.frames[0] && window.frames[0].name == 'content_Iframe'){ + window.frames[0].location='<%= AppUtils.getRaptorActionURL() %>report.delete&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + } + else if (document.getElementById('searchContentContainer')){ + document.getElementById('searchContentContainer').innerHTML = "<div id='breadCrumbArea'> </div><iframe name='content_Iframe' frameborder='0' id='content_Iframe' src='<%= AppUtils.getRaptorActionURL() %>report.delete&c_master=" + id + "&PAGE_ID=HOME&refresh=Y' width='100%' height='450' ></iframe>"; + //document.getElementById('content_Iframe').height=document.body.offsetHeight - 210; + resizeWindow(); + document.getElementById('content_Iframe').location = '<%= AppUtils.getRaptorActionURL() %>report.delete&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + + } + else{ + document.treeFrm.action='<%= AppUtils.getRaptorActionURL() %>report.delete&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + document.treeFrm.submit(); + } + + } + function createReport() + { + if (JSTreeObj == null || JSTreeObj.selectedItem == null){ + return; + } + var id = JSTreeObj.selectedItem.parentNode.id.replace(/[^0-9]/gi,''); + addBreadCrumb(false, id); + if (window.frames && window.frames[0] && window.frames[0].name == 'content_Iframe'){ + window.frames[0].location='<%= AppUtils.getRaptorActionURL() %>report.create&folder_id=' + id + '&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + } + else if (document.getElementById('searchContentContainer')){ + document.getElementById('searchContentContainer').innerHTML = "<div id='breadCrumbArea'> </div><iframe name='content_Iframe' frameborder='0' id='content_Iframe' src='<%= AppUtils.getRaptorActionURL() %>report.create&folder_id=" + id + "&c_master=' + id + '&PAGE_ID=HOME&refresh=Y' width='100%' height='450' ></iframe>"; + //document.getElementById('content_Iframe').height=document.body.offsetHeight - 210; + resizeWindow(); + document.getElementById('content_Iframe').location = '<%= AppUtils.getRaptorActionURL() %>report.create.container&folder_id=' + id + '&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + + } + else{ + displayFolderInfo(); + document.treeFrm.action='<%= AppUtils.getRaptorActionURL() %>report.create.container&folder_id=' + id + '&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + document.treeFrm.submit(); + } + } + function getFolderReports(id) + { + addBreadCrumb(false, id); + if (window.frames && window.frames[0] && window.frames[0].name == 'content_Iframe'){ + window.frames[0].location='<%= AppUtils.getRaptorActionURL() %>report.folderlist_iframe&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + } + else if (document.getElementById('searchContentContainer')){ + document.getElementById('searchContentContainer').innerHTML = "<div id='breadCrumbArea'> </div><iframe name='content_Iframe' frameborder='0' id='content_Iframe' src='<%= AppUtils.getRaptorActionURL() %>report.folderlist_iframe&c_master=" + id + "&PAGE_ID=HOME&refresh=Y' width='100%' height='450' ></iframe>"; + //document.getElementById('content_Iframe').height=document.body.offsetHeight - 210; + resizeWindow(); + document.getElementById('content_Iframe').location = "<%= AppUtils.getRaptorActionURL() %>report.folderlist_iframe&c_master=" + id + "&PAGE_ID=HOME&refresh=Y"; + + } + else{ + document.treeFrm.action='<%= AppUtils.getRaptorActionURL() %>report.folderlist&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + document.treeFrm.submit(); + } + } + + function getAllFolderReports() + { + var id = JSTreeObj.selectedItem.parentNode.id.replace(/[^0-9]/gi,''); + document.treeFrm.action='<%= AppUtils.getRaptorActionURL() %>report.folderlist&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + document.treeFrm.submit(); + } + + + function displayFolderInfo() + { + var infoDiv = document.getElementById('loadingMessageDiv'); + if (infoDiv == null) + return; + infoDiv.style.left = document.body.offsetWidth - 100 ; + infoDiv.style.top = document.getElementById('scrollableTable').style.top; + infoDiv.style.display='block'; + } + function hideFolderInfo() + { + var infoDiv = document.getElementById('loadingMessageDiv'); + if (infoDiv == null) + return; + infoDiv.style.display='none'; + } + + function displayTree(id){ + if (isFolderAllowed ){ + if (id != null) + selectedFolderId = id; + if (document.getElementById('reportFolderTree') == null){ + displayFolderInfo(); + var data=folderNavAjax.getFolderListString("<%=AppUtils.getUserID(request)%>", fillFolderStructure); + } + document.getElementById('expandedTree').style.display='block'; + document.getElementById('collapsedTree').style.display='none'; + if (document.getElementById('folderTreeContainer')) + document.getElementById('folderTreeContainer').width="25%"; + + //document.getElementById('scrollableTable').style.height=window.screen.height - 320; + //document.getElementById('scrollableTable').style.height=document.body.offsetHeight - 260; + resizeWindow(); + folderNavAjax.displayTree(); + } + + + } + function hideTree(){ + document.getElementById('expandedTree').style.display='none'; + document.getElementById('collapsedTree').style.display='block'; + //GET BREAD CRUMBS and assign + if (document.getElementById('folderTreeContainer')) + document.getElementById('folderTreeContainer').width="2px"; + folderNavAjax.hideTree(); + } + function refreshTree(id){ + + if (isFolderAllowed ){ + if (id != null) + selectedFolderId = id; + displayFolderInfo(); + var data=folderNavAjax.getFolderListString("<%=AppUtils.getUserID(request)%>", fillFolderStructure); + + document.getElementById('expandedTree').style.display='block'; + document.getElementById('collapsedTree').style.display='none'; + if (document.getElementById('folderTreeContainer')) + document.getElementById('folderTreeContainer').width="25%"; + + //document.getElementById('scrollableTable').style.height=document.body.offsetHeight - 210; + resizeWindow(); + folderNavAjax.displayTree(selectedFolderId); + } + } + function addBreadCrumb(isReport, id){ + // if (id != null) + // var data=folderNavAjax.getBreadCrumb(isReport, id, addBreadCrumbCallback); + + } + function addBreadCrumbCallback(data){ + var collapsedTree = document.getElementById('breadCrumbArea'); + if (collapsedTree == null) + return; + collapsedTree.innerHTML = "<font class=rtabletext style='background-color:white'>" + data + "</font>"; + } + function collapseAllTree(){ + treeObj.collapseAll(); + } +</script> + +<form name='treeFrm' method='post'> + + <input type='hidden' id='newName' name='newName'/> + <input type='hidden' id='saveString' name='saveString'/> + <input type='hidden' id='deleteIds' name='deleteIds'/> + <input type='hidden' id='renameId' name='renameId'/> + + + <tr id="def" height="0"> + <td colspan="10"></td> + </tr> + + <tr width="100%" ><td valign='top' width='300'> + <% if(isFolderAllowed) { %> + <div id="expandedTree" style="position:absoulte;top:0;width:100%;height:25px;display:none;"> + <table width="100%" border="0" cellspacing="1" align="left"> + <tr> + <td colspan=2 align="right"><img border="0" src="<%= AppUtils.getImgFolderURL() %>tree/grnarrowleft.gif" onClick="javascript:hideTree()" alt='Hide Folder Tree' style='cursor:hand'> + + </td> + + </tr> + <tr> + <td colspan=3> + <div id="scrollableTable" class="scrollableTable" style="position:absoulte;top:0;width:100%;height:430px;display:block;overflow:scroll"> + <table id="folderTree" width="100%" border="0" cellspacing="1" align="center"> + <tr> + <td nowrap> + </td> + </tr> + </table> + </div> + <div id='loadingMessageDiv' style="position:absolute;top:150;left:650;width:40px;height:25px;display:none"> + <table><tr bgcolor='red'><td class=rcolheader> Loading...</td></tr></table> + </div> + + </td> + </tr> + <tr> + <td class=rtabletext width='100%'> + <a href="#" onclick='javascript:createFolder();'>New Folder</a> | + <a href="#" onclick='javascript:deleteFolder();'>Delete Folder</a> | + <a href="#" onclick='javascript:runReport();'>Run</a> | + <a href="#" onclick="treeObj.collapseAll()">Collapse</a> | + <a href="#" onclick="treeObj.expandAll()">Expand</a> | + <a href="#" onclick="javascript:refreshTree()">Refresh Tree</a> + </td> + <td ></td> + </tr> + + </table> + </div> + <% } %> + + + </td></tr> + <% if(isFolderAllowed) { %> + <div id="collapsedTree" style="position:absolute;top=122;display:block;width:550"> + <img border="0" src="<%= AppUtils.getImgFolderURL() %>tree/grnarrowright.gif" onClick="javascript:displayTree()" alt='Show Folder Tree' style='cursor:hand'> + </div> + <% } %> + + + +</form> + + +<script type="text/javascript"> + + <% if(isFolderAllowed) { %> + document.body.scroll="no"; + <% } %> + + //window.onscroll = floatMenu; + window.onresize = resizeWindow; + + function floatMenu() + { + var elem = document.getElementById("def"); + var sy = document.body.scrollTop; + //elem.style.left = startX; + if (sy == null || sy == 0) + sy = 1; + elem.height = sy ; + } + + + function fillFolderStructure(data){ + document.getElementById("folderTree").childNodes[0].childNodes[0].childNodes[0].innerHTML=data; + initializeTree(); + hideFolderInfo(); + + } + + function initializeTree(){ + treeObj = new JSDragDropTree(); + treeObj.setTreeId('reportFolderTree'); + treeObj.setMaximumDepth(7); + treeObj.setMessageMaximumDepthReached('Maximum depth reached'); // If you want to show a message when maximum depth is reached, i.e. on drop. + treeObj.initTree(selectedFolderId); + treeObj.expandAll(); + treeObj.collapseAll(); + if (selectedFolderId && selectedFolderId != '0') + treeObj.showSelectedNode(selectedFolderId); + + } + + if (doCollapse == 'N') + refreshTree(); +</script> + + diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree/testTree.jsp b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree/testTree.jsp new file mode 100644 index 0000000..1521790 --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/tree/testTree.jsp @@ -0,0 +1,229 @@ +<%@page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> + + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <jsp:include page="header.jsp" flush="true" /> +<head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Folder tree with Drag and Drop capabilities</title> + <script> + var imgFolder = '<%=AppUtils.getImgFolderURL()%>'; + </script> + <script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/tree/ajax.js"></script> + <script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/tree/context-menu.js"></script> + <script type="text/javascript" src="<%= AppUtils.getBaseFolderURL() %>js/tree/drag-drop-folder-tree.js"> + + /************************************************************************************************************ + (C) www.dhtmlgoodies.com, July 2006 + + Update log: + + + This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website. + + Terms of use: + You are free to use this script as long as the copyright message is kept intact. + + For more detailed license information, see http://www.dhtmlgoodies.com/index.html?page=termsOfUse + + Thank you! + + www.dhtmlgoodies.com + Alf Magne Kalleland + + ************************************************************************************************************/ + </script> + <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/raptor.css"> + <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/tree/drag-drop-folder-tree.css"> + <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/tree/context-menu.css"> + + <style type="text/css"> + /* CSS for the demo */ + img{ + border:0px; + } + </style> + <script type="text/javascript"> + //-------------------------------- + // Save functions + //-------------------------------- + var ajaxObjects = new Array(); + + // Use something like this if you want to save data by Ajax. + function saveMyTree() + { + saveString = treeObj.getNodeOrders(); + alert(saveString); + var ajaxIndex = ajaxObjects.length; + ajaxObjects[ajaxIndex] = new sack(); + var url = 'tree'; + //var url = 'tree'; + ajaxObjects[ajaxIndex].requestFile = url; // Specifying which file to get + ajaxObjects[ajaxIndex].onCompletion = function() { saveComplete(ajaxIndex); } ; // Specify function that will be executed after file has been found + ajaxObjects[ajaxIndex].runAJAX(url); // Execute AJAX function + + } + function saveComplete(index) + { + alert(ajaxObjects[index].response); + } + + + // Call this function if you want to save it by a form. + function saveMyTree_byForm() + { + document.myForm.elements['saveString'].value = treeObj.getNodeOrders(); + document.myForm.elements['task'].value = 'save'; + document.myForm.submit(); + } + + function cancelMyTree_byForm(){ + document.myForm.elements['task'].value = ''; + document.myForm.submit(); + } + + function deleteMyTree_byForm() + { + document.myForm.elements['task'].value = 'delete'; + document.myForm.submit(); + } + + function addMyTree_byForm() + { + document.myForm.elements['task'].value = 'new'; + document.myForm.submit(); + } + + function runReport() + { + var id = JSTreeObj.selectedItem.parentNode.id.replace(/[^0-9]/gi,''); + alert("123" + id); + //document.myForm.action='<%=AppUtils.getReportExecuteActionURL()%>'+JSTreeObj.selectedItem; + document.myForm.action='dispatcher?action=raptor&r_action=report.run&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + + document.myForm.submit(); + } + + function editReport() + { + var id = JSTreeObj.selectedItem.parentNode.id.replace(/[^0-9]/gi,''); + alert("123" + id); + document.myForm.action='dispatcher?action=raptor&r_action=report.edit&c_master=' + id + '&PAGE_ID=HOME&refresh=Y'; + document.myForm.submit(); + } + + function expandTree(){ + document.getElementById('expandedTree').style.display='block'; + document.getElementById('expandedTreeHeader').style.display='block'; + document.getElementById('collapsedTree').style.display='none'; + } + function collapseTree(){ + document.getElementById('expandedTree').style.display='none'; + document.getElementById('expandedTreeHeader').style.display='none'; + document.getElementById('collapsedTree').style.display='block'; + } + </script> + +</head> +<body> + <form name="reportForm" method="post"> + <table width="94%" border="0" cellspacing="1" align="center"> + <tr><td> + <div id="collapsedTree" style="position:absoulte;top:0;width:100%;height:25px;display:none;"> + <table width="94%" border="0" cellspacing="1" align="left"> + <tr> + <td class=rtabletext align=left> + <img border="0" src="<%= AppUtils.getImgFolderURL() %>tree/dhtmlgoodies_plus.gif" onClick="javascript:expandTree()" alt='Show Folder Tree'> + Root Node + </td> + </tr> + </table> + </div> + </td></tr> + + + <tr><td> + <div id="expandedTreeHeader" style="position:absoulte;top:0;width:100%;height:25px;display:block;"> + <table width="94%" border="0" cellspacing="1" align="left"> + <tr> + <td class=rtabletext > + <img border="0" src="<%= AppUtils.getImgFolderURL() %>tree/dhtmlgoodies_minus.gif" onClick="javascript:collapseTree()" alt='Hide Folder Tree'> + + <!--<input type='button' class=rsmallbutton id='createFolder' value='Create Folder' onclick='javascript:JSTreeObj.addItem(JSTreeObj.selectedItem, JSTreeObj.selectedItem);'/> + <input type='button' class=rsmallbutton id='createFolder' value='Run' onclick='javascript:JSTreeObj.addItem(JSTreeObj.selectedItem, JSTreeObj.selectedItem);'/> + <input type='button' class=rsmallbutton id='createFolder' value='Edit' onclick='javascript:JSTreeObj.addItem(JSTreeObj.selectedItem, JSTreeObj.selectedItem);'/>--> + <a href="#" onclick='javascript:JSTreeObj.addItem(JSTreeObj.selectedItem, JSTreeObj.selectedItem);'>Create Folder</a> | + <a href="#" onclick='javascript:JSTreeObj.deleteItem(JSTreeObj.selectedItem, JSTreeObj.selectedItem);'>Delete Fodler</a> | + <a href="#" onclick='javascript:runReport();'>Run Report</a> | + <a href="#" onclick='javascript:editReport();'>Edit Report</a> + </td> + </tr> + </table> + </div> + </td></tr> + <tr> + <td> + <div id="expandedTree" style="position:absoulte;top:0;width:100%;height:160px;display:block"> + <table> + <tr> + + <td width="50%"> + <div id="scrollableTable" class="scrollableTable" style="position:absoulte;top:0;width:100%;height:150px;display:block"> + <table width="94%" border="0" cellspacing="1" align="center"> + <tr> + <td > + <%=request.getAttribute("folderList")%> + </td> + </tr> + </table> + </div> + </td> + <td width="50%" valign="bottom"> + <table> + <tr><td width="100%" class=rtabletext > + <a href="#" onclick="treeObj.collapseAll()">Collapse all</a> | + <a href="#" onclick="treeObj.expandAll()">Expand all</a> + </td></tr> + <tr><td width="100%"> + <input type="button" class=rsmallbutton onclick="saveMyTree_byForm()" value="Save"> + <input type="button" class=rsmallbutton onclick="cancelMyTree_byForm()" value="Cancel"> + </td></tr> + </table> + + </td> + </tr> + + </table> + </div> + </td> + </tr> + <tr><td colspan=2> + <div class="scrollableTable" style="width:100%;height:400px;"> + <iframe id="reportFrame" name="reportFrame" width="100%" height="100%"> + + </iframe> + </div> + </td></tr> + </table> + </Form> + <script type="text/javascript"> + treeObj = new JSDragDropTree(); + treeObj.setTreeId('reportFolderTree'); + treeObj.setMaximumDepth(7); + treeObj.setMessageMaximumDepthReached('Maximum depth reached'); // If you want to show a message when maximum depth is reached, i.e. on drop. + treeObj.initTree(); + treeObj.expandAll(); + + </script> + + <!-- Form - if you want to save it by form submission and not Ajax --> + <form name="myForm" action="tree" method="post"> + <input type="hidden" name="saveString"> + <input type="hidden" name="task"> + <input type="hidden" name="newName"> + <input type="hidden" name="deleteIds"> + </form> + +</body> +</html>
\ No newline at end of file |