📄 list.jsp
字号:
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored ="false" %>
<%@ page import="org.jboss.portal.core.portlet.cms.admin.AdminCMSConstants,
java.util.Vector,
org.jboss.portal.core.portlet.cms.WebDAVUtil" %>
<portlet:defineObjects/>
<%
Vector collList = (Vector)request.getAttribute("collList");
WebDAVUtil wdUtil = new WebDAVUtil();
String sCurrPath = (String)request.getAttribute("currpath");
String sRootPath = (String)request.getAttribute("rootpath");
%>
<table width="100%">
<th colspan="5" class="portlet-section-header">${n:i18n("TITLE_HEAD")} :: ${n:i18n("TITLE_BROWSE")}</th>
<tr><td height="10" colspan="5"></td></tr>
<tr class="portlet-section-header"><td colspan="5"><font class="portlet-font"><b>Current Directory: <%= sCurrPath %></b></font></td></tr>
<tr><td height="5" colspan="5"></td></tr>
<tr class="portlet-section-body"><td colspan="5">
<table width="100%">
<tr>
<td align="center">
<span class="portlet-menu-item"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRM_CREATE_COLLECTION %>"/>
<portlet:param name="path"
value="<%= sCurrPath %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/createfolder.gif" alt="create directory" border="0"><br>Create New Directory
</a></span>
</td><td align="center">
<span class="portlet-menu-item"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CREATENEWTEXT %>"/>
<portlet:param name="path"
value="<%= sCurrPath %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/createfile.gif" alt="create file" border="0"><br>Create New Text/HTML File
</a></span>
</td><td align="center">
<span class="portlet-menu-item"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_UPLOADCONFIRM %>"/>
<portlet:param name="path"
value="<%= sCurrPath %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/upload.gif" alt="${n:i18n("TITLE_UPLOAD")}" border="0"><br>${n:i18n("TITLE_UPLOAD")}
</a></span>
</td><td align="center">
<span class="portlet-menu-item"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMCOPY %>"/>
<portlet:param name="path"
value="<%= sCurrPath %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/copy.gif" alt="copy directory" border="0"><br>Copy Directory
</a></span>
</td><td align="center">
<span class="portlet-menu-item"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMMOVE %>"/>
<portlet:param name="path"
value="<%= sCurrPath %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/move.gif" alt="move directory" border="0"><br>Move Directory
</a></span>
</td><td align="center">
<%
if (!sCurrPath.equalsIgnoreCase(sRootPath))
{
%>
<span class="portlet-menu-item"><a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMDELETE %>"/>
<portlet:param name="path"
value="<%= sCurrPath %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/delete.gif" alt="delete" border="0"><br>Delete Directory
</a></span>
<%
}
%>
</td></tr>
</table>
</td></tr>
<tr><td height="15" colspan="5"></td></tr>
<tr>
<td class="portlet-section-alternate"><b>Operations</b></td>
<td class="portlet-section-alternate"><b>DisplayName</b></td>
<td class="portlet-section-alternate"><b>File Size (in bytes)</b></td>
<td class="portlet-section-alternate"><b>Content-Type</b></td>
<td class="portlet-section-alternate"><b>Last Modified</b></td>
</tr>
<%
for (int i=0; i < collList.size(); i++)
{
String[] sAItem = (String[])collList.elementAt(i);
String sDisplayname = sAItem[0];
String sFileSize = sAItem[1];
String sIsColl = sAItem[2];
String sModDate = sAItem[3];
%>
<tr class="portlet-section-body">
<%
if ("COLLECTION".equals(sIsColl))
{
%>
<td>
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CHANGE_DIR %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:actionURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/view.gif" alt="view" border="0"></a>
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CHANGE_DIR %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:actionURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/edit.gif" alt="edit" border="0"></a>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMCOPY %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/copy.gif" alt="copy" border="0"></a>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMMOVE %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/move.gif" alt="move" border="0"></a>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMDELETE %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/delete.gif" alt="delete" border="0"></a>
</td>
<td>
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CHANGE_DIR %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:actionURL>">
/<%= sDisplayname %>
</a>
</td>
<td>--</td>
<td><img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/folder.gif" alt="directory" border="0"></td>
<td><%= sModDate %></td>
<%
} else {
%>
<td>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_VIEWFILE %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/view.gif" alt="view" border="0"></a>
<%
if ("text/html".equals(sIsColl) || "text/plain".equals(sIsColl))
{
%>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_EDIT %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/edit.gif" alt="edit" border="0"></a>
<% } else { %>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_EDIT_BINARY %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/edit.gif" alt="edit" border="0"></a>
<%
}
%>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMCOPY %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/copy.gif" alt="copy" border="0"></a>
<%
// dont allow home page deletion!
String comp1 = sCurrPath + "/" + sDisplayname;
String comp2 = sRootPath + "/index.html";
comp1 = wdUtil.cleanDoubleSlashes(comp1);
comp2 = wdUtil.cleanDoubleSlashes(comp2);
if (!comp1.equals(comp2))
{
%>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMMOVE %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/move.gif" alt="move" border="0"></a>
<%
}
if (comp1.equals(comp2))
{
// show blank?
}
else
{
%>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CONFIRMDELETE %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/delete.gif" alt="delete" border="0"></a>
<%
}
%>
</td>
<td>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_VIEWFILE %>"/>
<portlet:param name="path"
value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<%= sDisplayname %>
</a></td>
<td><%= sFileSize %></td>
<td>
<%
if ("text/html".equals(sIsColl) || "text/plain".equals(sIsColl))
{
%>
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH %>/file.gif" alt="<%= sIsColl %>" border="0">
<% } else { %>
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH %>/binaryfile.gif" alt="<%= sIsColl %>" border="0">
<% } %>
</td>
<td><%= sModDate %></td>
<%
}
%>
</tr>
<%
}
%>
</table>
<br><br>
<%
// dont allow movement above rootdir!
if (!(sCurrPath.equals(sRootPath)))
{
%>
<div align="center">
<span class="portlet-menu-item"><a href="<portlet:actionURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_DISPLAY_PARENT_DIR %>"/>
<portlet:param name="path" value="<%= sCurrPath + "/"%>"/>
</portlet:actionURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/up.gif" alt="Back to parent directory" border="0"><br>Back to parent directory
</a></span>
</div>
<%
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -