📄 appnavigator.jsp
字号:
<%@ page contentType="text/html; charset=GBK"%>
<%@ taglib prefix="ww" uri="webwork"%>
<%@ page import="java.util.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%@ page import="cn.myapps.core.deploy.application.action.ApplicationHelper"%>
<%@ page import="cn.myapps.core.deploy.application.ejb.ApplicationVO"%>
<%@ page import="cn.myapps.core.deploy.module.ejb.ModuleVO"%>
<%@ page import="cn.myapps.core.user.ejb.UserVO,cn.myapps.constans.*"%>
<%String contextPath = request.getContextPath(); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
ApplicationHelper helper = new ApplicationHelper();
// Collection applist = helper.getAppList();
%>
<html>
<link rel="stylesheet" href='<ww:url value="/resource/css/main.css" />' type='text/css'>
<link rel="stylesheet" href='<ww:url value="/resource/css/dtree.css" />' type="text/css">
<link rel="stylesheet" href='<ww:url value="/resource/css/popupmenu.css" />' type="text/css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="<ww:url value='/script/tree.js'/>"></script>
<script>
var contextPath = '<%= contextPath %>';
d = new dTree('d');
var nowParam;
var firstapp;
<%
int i=0;
// Iterator it=applist.iterator();
// while(it.hasNext()) {
// ApplicationVO av=(ApplicationVO)it.next();
ApplicationVO av=helper.getApplicationById((String)session.getAttribute("APPLICATION"));
%>
<% if(i==0){%>
firstapp='<%=av.getId()%>';
<%i=1;}%>
nowParam='rightFunction(\'<%=av.getId()%>\',0)';
d.add('<%=av.getId()%>','-1','<%=av.getName()%>','<c:out value="${pageContext.request.contextPath}"/>/core/deploy/application/displayApplication.jsp?id=<%=av.getId()%>','','detail',null,null,null,nowParam);
<%
Collection modules=av.getModules();
if(modules!=null){
Iterator itmod=modules.iterator();
while(itmod.hasNext()){
ModuleVO mv=(ModuleVO)itmod.next();
if(mv.getSuperior()==null || mv.getSuperior().getId()==null || mv.getSuperior().getId().trim().length()<=0)
{%>
nowParam='rightFunction(\'<%=av.getId()%>\',\'<%=mv.getId()%>\')';
d.add('<%=mv.getId()%>','<%=av.getId()%>','<%=mv.getName()%>','<c:out value="${pageContext.request.contextPath}"/>/core/deploy/module/displayFormAndView.jsp?moduleid=<%=mv.getId()%>','','detail',null,null,null,nowParam);
<%}
else {
%>
nowParam='rightFunction(\'<%=mv.getSuperior().getId()%>\',\'<%=mv.getId()%>\')';
d.add('<%=mv.getId()%>','<%=mv.getSuperior().getId()%>','<%=mv.getName()%>','<c:out value="${pageContext.request.contextPath}"/>/core/deploy/module/displayFormAndView.jsp?moduleid=<%=mv.getId()%>','','detail',null,null,null,nowParam);
<%}
}
}
// }
%>
</script>
<script>
function refreshRightFrame(){
if ('<ww:property value="#parameters.refresh"/>'=='rightFrame') {
parent.detail.location.href="<ww:url value='/core/deploy/application/displayApplication.jsp?id='/>"+firstapp;
}
}
</script>
</head>
<body class="right-border" onload="refreshRightFrame()" rightmargin="0">
<div id=ie5menu class=menu style="text-align: left;position: absolute; visibility: hidden; width: 90px; z-index: 200;padding:1px">
<!-- <div class=link onMouseOver=this.className='overlink' onMouseOut=this.className='link' style='padding-top:2;padding-bottom:2;text-align: left' onclick="javascript:addApplication();"> {*[New App]*}</div> -->
<div class=link onMouseOver=this.className='overlink' onMouseOut=this.className='link' style='padding-top:2;padding-bottom:2;text-align: left' onclick="javascript:addModule();"> {*[New Module]*}</div>
<table width=100%>
<tr height=2><td width=100% BACKGROUND="<%=contextPath%>/resource/images/line.png"></td></tr>
</table>
<div class=link onMouseOver=this.className='overlink' onMouseOut=this.className='link' style='padding-top:2;padding-bottom:2;text-align: left' onclick="javascript:deleteSel();"> Delete </div>
</div>
<SCRIPT language="javascript">
//function addApplication(){
// parent.detail.location.href="<ww:url value='/core/deploy/application/new.action'/>";
// parent.frames[1].location.href="<ww:url value='/core/deploy/application/appnavigator.jsp'/>"
//}
function addModule(){
var appid=document.all.nowappid.value;
var moduleid=document.all.nowmoduleid.value;
parent.detail.location.href="<ww:url value='/core/deploy/module/new.action'/>";
// parent.frames[1].location.href="<ww:url value='/core/deploy/application/appnavigator.jsp'/>"
}
function deleteSel(){
var appid=document.all.nowappid.value;
var moduleid=document.all.nowmoduleid.value;
if(appid!=0){
if(moduleid!=0){
if(confirm('{*[Delete this module]*}?')){
// parent.detail.location.href="<ww:url value='/core/deploy/module/delete.action?'/>"+"_selects="+moduleid;
// parent.frames[1].location.href="<ww:url value='/core/deploy/application/appnavigator.jsp'/>"
document.forms[0].action ="<ww:url value='/core/deploy/module/moddelete.action'/>"+"?_selects="+moduleid;
document.forms[0].action = document.forms[0].action + "&refresh=rightFrame";
document.forms[0].submit();
}
}
else
{
if(confirm('{*[Delete this application]*}?')){
// parent.detail.location.href="<ww:url value='/core/deploy/application/delete.action?'/>"+"_selects="+appid;
// parent.frames[1].location.href="<ww:url value='/core/deploy/application/appnavigator.jsp'/>"
document.forms[0].action ="<ww:url value='/core/deploy/application/appdelete.action'/>"+"?_selects="+appid;
document.forms[0].action = document.forms[0].action + "&refresh=rightFrame";
document.forms[0].submit();
}
}
}
else { alert("{*[Please choose one appliction or module to delete]*}!");}
}
function showmenuie5(){
var rightedge=document.body.clientWidth-event.clientX;
var bottomedge=document.body.clientHeight-event.clientY-25;
if (rightedge<ie5menu.offsetWidth){
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth;
}else{
ie5menu.style.left=document.body.scrollLeft+event.clientX;
}
if (bottomedge<ie5menu.offsetHeight){
ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight;
}else{
ie5menu.style.top=document.body.scrollTop+event.clientY;
}
ie5menu.style.visibility="visible";
return false;
}
function hidemenuie5(){
ie5menu.style.visibility="hidden";
document.all.nowappid.value=0;
document.all.nowmoduleid.value=0;
}
function rightFunction(appid,moduleid){
//document.body.onclick=hidemenuie5;
//document.oncontextmenu = function() {
// alert(siteid);
// alert(channelid);
// return false;
//}
if(event.button==0||event.button==2){
document.all.nowappid.value=appid;
document.all.nowmoduleid.value=moduleid;
}
}
document.body.onclick=hidemenuie5;
document.oncontextmenu = function() {
showmenuie5();
return false;
}
// -->
</SCRIPT>
<input type="hidden" id="nowappid" name="nowappid" value="0">
<input type="hidden" id="nowmoduleid" name="nowmoduleid" value="0">
<%
UserVO user=null;
user =(UserVO)session.getAttribute(Web.SESSION_ATTRIBUTE_USER);
String username = user.getName();
%>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="20px">
<tr valign="top">
<td style='font-family: Arial, Helvetica, sans-serif;font-size: 12px;background-image: none;color: blue;'>
{*[Hello]*}, <a title="Edit Profile" class="message" href="<ww:url value='/core/user/editPersonal.action'><ww:param name='editPersonalId' value='#session["USER"].id'/></ww:url>" target="detail"><%=username %> [Edit]</a>
<td>
</tr>
</table>
<ww:form action="" method="post">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td>
<div class="dtree">
<script>
document.write(d);
</script>
</div>
<%
if (modules==null || modules.size()<=0) {
out.println("<br/>");
out.println("<div><font color='#bbbbbb'>{*[Right click ]*}</font><font color='gray'><b>HERE</b></font><font color='#bbbbbb'> {*[to getting start......]*}</font></div>");
}
%>
</td>
</tr>
</table>
<table>
<tr>
<td>
<ww:if test="hasFieldErrors()">
<span class="errorMessage"><br>
<ww:iterator value="fieldErrors">
<script>
window.setTimeout("alert('* '+'<ww:property value="value[0]" />'+' has Module,can not to delete')",200);
</script>
</ww:iterator> </span>
</ww:if>
</td>
</tr>
</table>
</ww:form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -