Dictionary/webroot/jsp/relatedTermForm.jsf

64 lines
2.3 KiB
Text
Raw Normal View History

<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!--relatedTermForm.jsf-->
<c:out value='<a name="${ component }" ></a>' escapeXml="false" />
<c:choose>
<c:when test="${ ! empty param.formMode && param.formMode == 'insert'}">
<c:set var="updateMode" value="${ false }" />
<c:set var="newCmd" value="insert" />
<c:set var="relatedTerm" value="" />
<c:set var="relatedTermType" value="" />
<c:set var="metaId" value="" />
<%-- <c:set var="precedence" value="1" /> --%>
</c:when>
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
<c:set var="updateMode" value="${ true }" />
<c:set var="newCmd" value="update" />
<c:set var="relatedTerm" value="${ component.relatedTerm }" />
<c:set var="relatedTermType" value="${ component.relatedTermType }" />
<c:set var="metaId" value="${ component.metaId }" />
<%-- <c:set var="precedence" value="${ component.precedence }" /> --%>
</c:when>
<c:otherwise>
<c:set var="updateMode" value="${ false }" />
<c:set var="newCmd" value="" />
<c:set var="relatedTerm" value="ERROR" />
<c:set var="relatedTermType" value="ERROR" />
</c:otherwise>
</c:choose>
<form id="newCompForm" action="/lex/action" method="post">
<p>
<input type="hidden" name="comp" value="relatedTerm" />
<c:if test="${ updateMode }">
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
</c:if>
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
Related Term: <br />
<textarea name="relatedTerm" rows="8" cols="90"><c:out value='${ relatedTerm }' /></textarea>
<br />
Related Term Type:
<select name="relatedTermType">
<c:forEach var="relTermTypes" items="${ applicationScope.flatData.relatedTermTypes }" >
<c:set var="sel" value="" />
<c:if test="${ relTermTypes.key == relatedTermType }">
<c:set var="sel" value="selected='selected'" />
</c:if>
<c:out value="<option value='${ relTermTypes.key }' ${sel}>${ relTermTypes.value }</option>" escapeXml="false" /> <br />
</c:forEach>
</select>
<br />
<%-- Precedence: <c:out value='<input type="text" value="${ precedence }" name="precedence" size="3"/>' escapeXml='false' /> --%> <br />
<jsp:include page="metaForm.jsf" />
<input type="submit" value="Submit Related Term" />
</p>
</form>