doclist.jsp

来自「Java的框架」· JSP 代码 · 共 145 行

JSP
145
字号
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="/WEB-INF/tld/doc-man.tld" prefix="docman" %>

<c:set var="datetimeformat"><fmt:message key="datetime.format"/></c:set>
<c:url var="addFolderUrl" value="/folderForm.action">
	<c:param name="method" value="add"/>
	<c:param name="from" value="list"/>
	<c:param name="path" value="${docManFolder.folderPath}"/>
</c:url>
<c:url var="viewFolderUrl" value="/folder.action">
	<c:param name="method" value="view"/>
	<c:param name="from" value="list"/>
	<c:param name="path" value="${docManFolder.folderPath}"/>
</c:url>
<c:url var="addFileUrl" value="/fileForm.action">
	<c:param name="method" value="add"/>
	<c:param name="from" value="list"/>
	<c:param name="path" value="${docManFolder.folderPath}"/>
</c:url>
<c:url var="searchUrl" value="/searchDoc.action">
	<c:param name="method" value="search"/>
	<c:param name="from" value="list"/>
	<c:param name="path" value="${docManFolder.folderPath}"/>
</c:url>

<html>
	<head>
		<title><fmt:message key="docMans.title"/></title>
		<content tag="heading">
			<fmt:message key="docMans.heading"/>
		</content>
	</head>

	<body>
		<span id="message"><c:out value="${message}"/></span>
		<div class="separator"></div>
		<spring:bind path="docManFolder.*">
		    <c:if test="${not empty status.errorMessages}">
		    <div class="error">	
		        <c:forEach var="error" items="${status.errorMessages}">
		            <img src="<c:url value="/images/iconWarning.gif"/>"
		                alt="<fmt:message key="icon.warning"/>" class="icon" />
		            <c:out value="${error}" escapeXml="false"/><br />
		        </c:forEach>
		    </div>
		    </c:if>
		</spring:bind>
	<c:set var="buttons">
		<button type="button" style="margin-right: 5px" onclick="window.location='<c:out value="${addFolderUrl}"/>'">
  		<fmt:message key="button.folderObject.add"/>
 		</button>
		<button type="button" style="margin-right: 5px" onclick="window.location='<c:out value="${addFileUrl}"/>'">
  		<fmt:message key="button.fileObject.add"/>
 		</button>
	    <c:if test="${not empty docManFolder.folderPath}">
		<button type="button" style="margin-right: 5px" onclick="window.location='<c:out value="${viewFolderUrl}"/>'">
  		<fmt:message key="button.folderObject.view"/>
 		</button>
	    </c:if>
		<button type="button" style="margin-right: 5px" onclick="window.location='<c:out value="${searchUrl}"/>'">
  		<fmt:message key="button.search"/>
 		</button>
 		
 		<button type="button" onclick="window.location='<c:url value="/mainPage.action" />'">
  		<fmt:message key="button.cancel"/>
 		</button>
	</c:set>

	<c:out value="${buttons}" escapeXml="false" />

	<table>
		<tr>
			<td>
				<a href="<c:url value="/docMan.action"/>"><img src="<c:url value="/images/dm_home.gif"/>" alt="<fmt:message key="image.dmHome"/>" border="0"  /></a>
				<c:url var="docParentURL" value="/docMan.action">
					<c:param name="path" value="${docManFolder.parentId}"/>
				</c:url>   
				<a href="<c:out value="${docParentURL}"/>"><img src="<c:url value="/images/dm_up.gif"/>" alt="<fmt:message key="image.dmUp"/>" border="0"  /></a>
				//<docman:buildFolderPathLink fullPath="${docManFolder.folderPath}"/>
			</td>
		</tr>
	</table>
<mcaps:userPreference key="pageSize" name="pageSize" scope="page"/>

		<display:table name="${requestScope.docManFolderFileList}" cellspacing="0" cellpadding="0" requestURI="" defaultsort="1" id="docMan"
    		pagesize="${pageSize}" class="list" export="true">
 
    		<%-- Table columns --%>
    		<c:choose>
   				<c:when test="${docMan.type == 'File Folder'}">
   					<c:set var="imgName" value="fileFolder" />
		  			<c:url var="docListURL" value="/docMan.action">
						<c:param name="from" value="list"/>
						<c:param name="path" value="${docMan.folderPath}"/>
					</c:url>   
   				</c:when>
   				<c:otherwise>
   					<c:set var="imgName" value="${docMan.type}" />
		  			<c:url var="docListURL" value="/file.action">
						<c:param name="from" value="list"/>
						<c:param name="path" value="${docMan.filePath}"/>
					</c:url>   
					<c:url var="downloadUrl" value="/downloadFile.action">
						<c:param name="method" value="download"/>
						<c:param name="path" value="${docMan.filePath}"/>
					</c:url>
   				</c:otherwise>
   			</c:choose>
     		<display:column sortable="true" headerClass="sortable" titleKey="doclist.name">
    				<a href='<c:out value="${docListURL}" />'><img src="<c:url value="/images/"/><fmt:message key="${imgName}"/>" alt="<c:out value="${docMan.type}" />" border="0" id="<c:out value="${docMan.name}" />" />&nbsp;<c:out value="${docMan.name}" /></a>
				    <c:if test="${docMan.type != 'File Folder'}">
    				&nbsp;
    				<a href='<c:out value="${downloadUrl}" />'><img src="<c:url value="/images/dm_viewfile.gif"/>" alt="Download <c:out value="${docMan.name}" />" border="0"  /></a>
				    </c:if>
    		</display:column>
    
   			<display:column property="type" sortable="true" headerClass="sortable" 
   					autolink="true" titleKey="doclist.type" />
   					
  			<display:column sortable="true" headerClass="sortable" titleKey="doclist.modDate">
    			<fmt:formatDate value="${docMan.modificationDate.time}" pattern="${datetimeformat}"/>
    		</display:column>
        
    		<display:setProperty name="paging.banner.item_name" value="Object"/>
    
    		<display:setProperty name="paging.banner.items_name" value="Objects"/>

    		<display:setProperty name="export.excel.filename" value="Folder List.xls"/>
    
    		<display:setProperty name="export.csv.filename" value="Folder List.csv"/>
    
    		<display:setProperty name="export.pdf.filename" value="Folder List.pdf"/>
		</display:table>
		
	<c:out value="${buttons}" escapeXml="false" />
            
	<script type="text/javascript">
	<!--
		highlightTableRows("docMan");
	//-->
	</script>

	</body>
</html>
		

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?