fileversion.jsp

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

JSP
181
字号
<%@ 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="downloadUrl" value="/downloadFileVersion.action">
	<c:param name="method" value="download"/>
	<c:param name="path" value="${docManFile.filePath}"/>
	<c:param name="version" value="${docManFile.version}"/>
</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="cancelUrl" value="/fileVersions.action">
	<c:param name="path" value="${docManFile.filePath}"/>
</c:url>
<c:url var="publishUrl" value="/docPub/${docManFile.filePath}" />


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

	<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="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.publishThis"/>
			</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.publishMainThis"/>
			</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.version"/>:</td>
				<td>&nbsp;</td>
				<td>
					<c:out value="${docManFile.version}"/>
				</td>
			</tr>
			<c:choose>
				<c:when test="${docManFile.version == 0}">
			<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:when>
				<c:otherwise>
			<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:otherwise>
			</c:choose>
			<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 + -
显示快捷键?