file.jsp

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

JSP
234
字号
<%@ 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="editUrl" value="/fileForm.action">
	<c:param name="method" value="edit"/>
	<c:param name="path" value="${docManFile.filePath}"/>
</c:url>
<c:url var="moveUrl" value="/getFileDest.action">
	<c:param name="method" value="moveFile"/>
	<c:param name="path" value="${docManFile.filePath}"/>
</c:url>
<c:url var="deleteUrl" value="/deleteFile.action">
	<c:param name="method" value="delete"/>
	<c:param name="path" value="${docManFile.filePath}"/>
	<c:param name="name" value="${docManFile.name}"/>
	<c:param name="parentId" value="${docManFile.parentId}"/>
</c:url>
<c:url var="downloadUrl" value="/downloadFile.action">
	<c:param name="method" value="download"/>
	<c:param name="path" value="${docManFile.filePath}"/>
</c:url>
<c:url var="cancelUrl" value="/docMan.action">
	<c:param name="path" value="${docManFile.parentId}"/>
</c:url>
<c:url var="versionUrl" value="/fileVersions.action">
	<c:param name="method" value="version"/>
	<c:param name="path" value="${docManFile.filePath}"/>
</c:url>
<c:url var="publishFileUrl" value="/publishFile.action">
	<c:param name="method" value="publish"/>
	<c:param name="path" value="${docManFile.filePath}"/>
	<c:param name="version" value="${docManFile.version}"/>
</c:url>
<c:url var="publishUrl" value="/docPub/${docManFile.filePath}" />
<c:url var="viewLatestUrl" value="/docAdmin/${docManFile.filePath}" />
<c:url var="viewPublishedUrl" value="/docPub/${docManFile.filePath}" />


<html>
	<head>
	    <title><fmt:message key="file.title"/></title>
	    <content tag="heading"><fmt:message key="file.heading"/></content>
	</head>
	<script LANGUAGE="JavaScript">
		function deleteFile(){
			bCancel=true;
			if (confirmDelete('File')) {
				window.location='<c:out value="${deleteUrl}" escapeXml="false"/>';
			}
		}
			
	</script>

	<body>
		<div class="separator"></div>
		<spring:bind path="docManFile.*">
		    <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="pageButtons">
			<button name="edit" type="button" style="margin-right: 5px" 
				onclick="window.location='<c:out value="${editUrl}"/>'">
				<fmt:message key="button.edit"/>
			</button>
			<button name="move" type="button" style="margin-right: 5px" 
				onclick="window.location='<c:out value="${moveUrl}"/>'">
				<fmt:message key="button.fileObject.move"/>
			</button>
			<button name="delete" type="button" style="margin-right: 5px" 
				onclick="javascript:deleteFile();">
				<fmt:message key="button.delete"/>
			</button>
			<button name="download" type="button" style="margin-right: 5px" 
				onclick="window.location='<c:out value="${downloadUrl}"/>'">
				<fmt:message key="button.fileObject.download"/>
			</button>
		    <c:if test="${empty docManFile.versionPublished || docManFile.version != docManFile.versionPublished}">
			<button name="publish" type="button" style="margin-right: 5px" 
				onclick="window.location='<c:out value="${publishFileUrl}"/>'">
				<fmt:message key="button.fileObject.publish"/>
			</button>
		    </c:if>
		    <c:if test="${docManFile.type == 'text/html' && !docManFile.mainPage}">
			<button name="publish" type="button" style="margin-right: 5px" 
				onclick="window.location='<c:out value="${publishFileUrl}"/>&mainPage=true'">
				<fmt:message key="button.fileObject.publishMain"/>
			</button>
		    </c:if>

			<button name="cancel" type="button" 
				onclick="window.location='<c:out value="${cancelUrl}"/>'">
	  		<fmt:message key="button.cancel"/>
	 		</button>
		</c:set>
		<c:out value="${pageButtons}" escapeXml="false" />
		
		<table class="detail">
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.name"/>:</td>
				<td>&nbsp;</td>
				<td>
					<a href="<c:out value="${downloadUrl}"/>">
						<c:out value="${docManFile.name}"/>
					</a>
				</td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.path"/>:</td>
				<td>&nbsp;</td>
				<td>//<docman:buildFolderPathLink fullPath="${docManFile.parentId}"/></td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.type"/>:</td>
				<td>&nbsp;</td>
				<td><img src="<c:url value="/images/"/><fmt:message key="${docManFile.type}"/>" alt="<c:out value="${docManFile.type}" />" border="0"  /><c:out value="${docManFile.type}"/></td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.size"/>:</td>
				<td>&nbsp;</td>
				<td><c:out value="${docManFile.size}"/></td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.version"/>:</td>
				<td>&nbsp;</td>
				<td>
		    		<c:choose>
		   				<c:when test="${docManFile.version > 0}">
					<a href="<c:out value="${versionUrl}"/>" id="version"><c:out value="${docManFile.version}"/></a>
						</c:when>
						<c:otherwise>
					<c:out value="${docManFile.version}"/>
						</c:otherwise>
		    		</c:choose>
				</td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.creator"/>:</td>
				<td>&nbsp;</td>
				<td>
					<c:out value="${docManFile.creator}"/>
				</td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.creationTime"/>:</td>
				<td>&nbsp;</td>
				<td><fmt:formatDate value="${docManFile.creationDate.time}" pattern="${datetimeformat}"/></td>
			</tr>
			<c:if test="${docManFile.version > 0}">
			<tr>
				<td><fmt:message key="fileObject.modifier"/>:</td>
				<td>&nbsp;</td>
				<td>
					<c:out value="${docManFile.modifier}"/>
				</td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.modificationDate"/>:</td>
				<td>&nbsp;</td>
				<td><fmt:formatDate value="${docManFile.modificationDate.time}" pattern="${datetimeformat}"/></td>
			</tr>
		 	</c:if>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td colspan="3"><hr></td>
			</tr>
			<tr>
				<td colspan="3">
				<fmt:message key="fileObject.pubInfo"/>
			    <c:if test="${!empty docManFile.versionPublished}">
				&nbsp;<img src="<c:url value="/images/dm_publishedView.gif"/>" alt="View Published Version" border="0" onclick="window.open('<c:out value="${viewPublishedUrl}"/>', 'publishView', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes')" />
			    </c:if>
				&nbsp;<img src="<c:url value="/images/dm_latestView.gif"/>" alt="View Latest Version" border="0" onclick="window.open('<c:out value="${viewLatestUrl}"/>', 'latestView', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes')" />
				</td>
			</tr>
		    <c:if test="${docManFile.type == 'text/html'}">
			<tr>
				<td colspan="3"><fmt:message key="fileObject.pubDisplayInfo"/></td>
			</tr>
		    </c:if>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.url"/>:</td>
				<td>&nbsp;</td>
				<td><c:out value="${publishUrl}"/></td>
			</tr>
			<tr>
				<td><fmt:message key="fileObject.versionPub"/>:</td>
				<td>&nbsp;</td>
				<td>
			    <c:if test="${!empty docManFile.versionPublished}">
					<c:out value="${docManFile.versionPublished}"/>
			    </c:if>
			    <c:if test="${empty docManFile.versionPublished}">-</c:if>
				</td>
			</tr>
		    <c:if test="${docManFile.type == 'text/html'}">
			<tr>
				<td><fmt:message key="fileObject.mainPage"/>:</td>
				<td>&nbsp;</td>
				<td>
			    <c:if test="${docManFile.mainPage}">Yes</c:if>
			    <c:if test="${!docManFile.mainPage}">No</c:if>
				</td>
			</tr>
		    </c:if>
			<tr>
				<td>&nbsp;</td>
			</tr>
		</table>
		<%-- Print out buttons - defined at top of form --%>
		<%-- This is so you can put them at the top and the bottom if you like --%>
		<c:out value="${pageButtons}" escapeXml="false" />

	</body>
</html>

⌨️ 快捷键说明

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