<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0">
  <jsp:output omit-xml-declaration="yes" />

  <jsp:directive.attribute name="id" type="java.lang.String" required="true" description="The identifier for this tag (do not change!)" />
  <jsp:directive.attribute name="object" type="java.lang.Object" required="true" description="The form backing object" />
  <jsp:directive.attribute name="path" type="java.lang.String" required="true" description="Specify the URL path" />
  <jsp:directive.attribute name="list" type="java.lang.Boolean" required="false" description="Include 'list' link into table (default true)" />
  <jsp:directive.attribute name="create" type="java.lang.Boolean" required="false" description="Include 'create' link into table (default true)" />
  <jsp:directive.attribute name="update" type="java.lang.Boolean" required="false" description="Include 'update' link into table (default true)" />
  <jsp:directive.attribute name="delete" type="java.lang.Boolean" required="false" description="Include 'delete' link into table (default true)" />
  <jsp:directive.attribute name="label" type="java.lang.String" required="false" description="The label used for this object, will default to a message bundle if not supplied" />
  <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" />
  <jsp:directive.attribute name="openPane" type="java.lang.Boolean" required="false" description="Control if the title pane is opened or closed by default (default: true)" />
  <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" />

  <c:if test="${empty render or render}">
    <c:if test="${empty label}">
      <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" />
    </c:if>

    <c:if test="${empty list}">
      <c:set var="list" value="true" />
    </c:if>
    
    <c:if test="${empty create}">
      <c:set var="create" value="true" />
    </c:if>

    <c:if test="${empty update}">
      <c:set var="update" value="true" />
    </c:if>

    <c:if test="${empty delete}">
      <c:set var="delete" value="true" />
    </c:if>

    <c:set var="typeName" value="${fn:split(id,'_')[fn:length(fn:split(id,'_')) - 1]}" />

    <spring:message arguments="${label}" code="entity_show" var="title_msg" />
    <util:panel id="${id}" title="${title_msg}" openPane="${openPane}">
      <c:choose>
        <c:when test="${not empty object}">
          <jsp:doBody />
          <div class="quicklinks">
            <span>
              <c:if test="${delete}">
                <spring:url value="${path}/${itemId}" var="delete_form_url" />
                <spring:url value="/resources/images/delete.png" var="delete_image_url" />
                <form:form action="${fn:escapeXml(delete_form_url)}" method="DELETE">
                  <spring:message arguments="${typeName}" code="entity_delete" var="delete_label" />
                  <input alt="${fn:escapeXml(delete_label)}" class="image" src="${fn:escapeXml(delete_image_url)}" title="${fn:escapeXml(delete_label)}" type="image" value="${fn:escapeXml(delete_label)}" />
                </form:form>
              </c:if>
            </span>
            <span>
              <c:if test="${update}">
                <spring:url value="${path}/${itemId}" var="update_form_url">
                  <spring:param name="form" />
                </spring:url>
                <spring:url value="/resources/images/update.png" var="update_image_url" />
                <spring:message arguments="${typeName}" code="entity_update" var="update_label" />
                <a href="${fn:escapeXml(update_form_url)}" alt="${fn:escapeXml(update_label)}" title="${fn:escapeXml(update_label)}">
                  <img alt="${fn:escapeXml(update_label)}" class="image" src="${fn:escapeXml(update_image_url)}" title="${fn:escapeXml(update_label)}" />
                </a>
              </c:if>
            </span>
            <span>
              <c:if test="${create}">
                <spring:url value="${path}" var="create_form_url">
                  <spring:param name="form" />
                </spring:url>
                <spring:url value="/resources/images/create.png" var="create_image_url" />
                <spring:message arguments="${typeName}" code="entity_create" var="create_label" />
                <a href="${fn:escapeXml(create_form_url)}" alt="${fn:escapeXml(create_label)}" title="${fn:escapeXml(create_label)}">
                  <img alt="${fn:escapeXml(create_label)}" class="image" src="${fn:escapeXml(create_image_url)}" title="${fn:escapeXml(create_label)}" />
                </a>
              </c:if>
            </span>
            <span>
              <c:if test="${list}">
                <spring:url value="${path}" var="list_form_url" />
                <spring:url value="/resources/images/list.png" var="list_image_url" />
                <a href="${fn:escapeXml(list_form_url)}" alt="${fn:escapeXml(list_label)}" title="${fn:escapeXml(list_label)}">
                  <img alt="${fn:escapeXml(list_label)}" class="image" src="${fn:escapeXml(list_image_url)}" title="${fn:escapeXml(list_label)}" />
                </a>
              </c:if>
            </span>
          </div>
        </c:when>
        <c:otherwise>
          <spring:message arguments="${label}" code="entity_not_found_single" />
        </c:otherwise>
      </c:choose>
    </util:panel>
  </c:if>
</jsp:root>