From: John W. <jwe...@us...> - 2006-05-04 23:38:24
|
Update of /cvsroot/dlese/dds-project/web/services/examples/ddsws/templates/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5576/web/services/examples/ddsws/templates/includes Modified Files: links_to_annotations.jsp web_service_connection.jsp Log Message: -updated template to work with new anno service output and anno v0.1 - needs updating to handle anno v1.0 too Index: links_to_annotations.jsp =================================================================== RCS file: /cvsroot/dlese/dds-project/web/services/examples/ddsws/templates/includes/links_to_annotations.jsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** links_to_annotations.jsp 4 May 2006 15:15:20 -0000 1.3 --- links_to_annotations.jsp 4 May 2006 23:38:19 -0000 1.4 *************** *** 21,32 **** </c:set> <c:choose> ! <c:when test="${numTextAnnos == 1}"> <div style="padding-top:6px"> <img src="${urlToMyDir}/images/paper.gif" style="margin-right:3px;border:0px"/> ! <x:set select="$record/head/additionalMetadata/annotatedBy/record/metadata/annotationRecord/item/statusOf[@status='Text annotation completed']" var="annotation"/> ! See <a href='<x:out select="$annotation/url"/>' class="dleseTmpl" target='_blank'>reviews, comments, teaching tips, etc.</a> for this resource. </div> ! </c:when> ! <c:when test="${numTextAnnos > 1}"> <div style="padding-top:6px"> <img src="${urlToMyDir}/images/paper.gif" style="margin-right:3px;border:0px"/> --- 21,32 ---- </c:set> <c:choose> ! <%-- <c:when test="${numTextAnnos == 1}"> <div style="padding-top:6px"> <img src="${urlToMyDir}/images/paper.gif" style="margin-right:3px;border:0px"/> ! <x:set select="$record/head/additionalMetadata/annotatedBy/record/metadata/annotationRecord[item/statusOf[@status='Text annotation completed']]" var="annotationRecord"/> ! See <a href='<x:out select="$annotationRecord/item/content/url"/>' class="dleseTmpl" target='_blank'>reviews, comments, teaching tips, etc.</a> for this resource. </div> ! </c:when> --%> ! <c:when test="${numTextAnnos > 0}"> <div style="padding-top:6px"> <img src="${urlToMyDir}/images/paper.gif" style="margin-right:3px;border:0px"/> *************** *** 37,42 **** <div style="display:none; padding-top:2px;" id='anno_<x:out select="$record/head/id"/>'> <ul class="annos"> ! <x:forEach select="$record/head/additionalMetadata/annotatedBy[@status='Text annotation completed']" varStatus="status" var="annotation"> ! <li class="dleseTmpl"><a href='<x:out select="$annotation/url"/>' class="dleseTmpl" target='_blank'><x:out select="$annotation/@type"/></a> <i>from <x:out select="@collectionLabel"/></i></li> </x:forEach> </ul> --- 37,42 ---- <div style="display:none; padding-top:2px;" id='anno_<x:out select="$record/head/id"/>'> <ul class="annos"> ! <x:forEach select="$record/head/additionalMetadata/annotatedBy/record[metadata/annotationRecord/item/statusOf[@status='Text annotation completed']]" varStatus="status" var="annoRecord"> ! <li class="dleseTmpl"><a href='<x:out select="$annoRecord/metadata/annotationRecord/item/content/url"/>' class="dleseTmpl" target='_blank'><x:out select="$annoRecord/metadata/annotationRecord/item/type"/></a> <i>from <x:out select="$annoRecord/head/collection"/></i></li> </x:forEach> </ul> *************** *** 51,58 **** <x:choose> <%-- If this resources is currently under review, add a link to the review system and the comment submission form --%> ! <x:when select="$record/head/additionalMetadata/annotatedBy[@status='Text annotation in progress'][@type='Review']"> <a href="http://crs.dlese.org/submit/comments/?id=<x:out select='$record/head/id'/>" class="dleseTmpl" target="_blank"><img src="${urlToMyDir}/images/pencil-gray.gif" style="margin-right:3px;border:0px"/>Submit a comment or teaching tip</a>, or ! <a href='<x:out select="$record/head/additionalMetadata/annotatedBy[@status='Text annotation in progress'][@type='Review']/url"/>' class="dleseTmpl" target="_blank">submit a review</a> </x:when> <%-- If this resources is not under review, just link to the comment submission form --%> --- 51,58 ---- <x:choose> <%-- If this resources is currently under review, add a link to the review system and the comment submission form --%> ! <x:when select="$record/head/additionalMetadata/annotatedBy/record/metadata/annotationRecord/item/statusOf[@status='Text annotation in progress'][../type='Review']"> <a href="http://crs.dlese.org/submit/comments/?id=<x:out select='$record/head/id'/>" class="dleseTmpl" target="_blank"><img src="${urlToMyDir}/images/pencil-gray.gif" style="margin-right:3px;border:0px"/>Submit a comment or teaching tip</a>, or ! <a href='<x:out select="$record/head/additionalMetadata/annotatedBy/record/metadata/annotationRecord/item/statusOf[@status='Text annotation in progress'][../type='Review']/../content/url"/>' class="dleseTmpl" target="_blank">submit a review</a> </x:when> <%-- If this resources is not under review, just link to the comment submission form --%> Index: web_service_connection.jsp =================================================================== RCS file: /cvsroot/dlese/dds-project/web/services/examples/ddsws/templates/includes/web_service_connection.jsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** web_service_connection.jsp 27 Apr 2006 23:12:36 -0000 1.6 --- web_service_connection.jsp 4 May 2006 23:38:19 -0000 1.7 *************** *** 33,36 **** --- 33,53 ---- </c:set> + <%-- XSL that removes all namespaces from XML, making xPath easier to work with --%> + <c:set var="removeNamespacesXsl"> + <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > + <xsl:template match="@*" > + <xsl:attribute name="{local-name()}" > + <xsl:value-of select="." /> + </xsl:attribute> + <xsl:apply-templates/> + </xsl:template> + <xsl:template match ="*" > + <xsl:element name="{local-name()}" > + <xsl:apply-templates select="@* | node()" /> + </xsl:element> + </xsl:template> + </xsl:stylesheet> + </c:set> + <%-- Cache the custom smart link menu DOM and other related variables --%> <c:catch> *************** *** 165,172 **** <%-- Issue the request to the Web service server and store the response in variable 'xmlResponse' --%> <c:import url="${webServiceRequest}" var="xmlResponse" charEncoding="UTF-8" /> ! <%-- Parse the XML response and store it in an XML DOM variable named 'searchXmlDom' --%> ! <x:parse var="searchXmlDom"> ! <c:out value="${xmlResponse}" escapeXml="false"/> ! </x:parse> </c:catch> </c:if> --- 182,189 ---- <%-- Issue the request to the Web service server and store the response in variable 'xmlResponse' --%> <c:import url="${webServiceRequest}" var="xmlResponse" charEncoding="UTF-8" /> ! ! <%-- Remove namespaces from the XML and create the DOM --%> ! <x:transform xslt="${removeNamespacesXsl}" xml="${xmlResponse}" var="searchXmlDom"/> ! </c:catch> </c:if> *************** *** 208,215 **** <%-- Issue the request to the Web service server and store the response in variable 'xmlResponse' --%> <c:import url="${webServiceRequest}" var="xmlResponse" charEncoding="UTF-8" /> ! <%-- Parse the XML response and store it in an XML DOM variable named 'getRecordXmlDom' --%> ! <x:parse var="getRecordXmlDom"> ! <c:out value="${xmlResponse}" escapeXml="false"/> ! </x:parse> </c:catch> </c:if> --- 225,231 ---- <%-- Issue the request to the Web service server and store the response in variable 'xmlResponse' --%> <c:import url="${webServiceRequest}" var="xmlResponse" charEncoding="UTF-8" /> ! ! <%-- Remove namespaces from the XML and create the DOM --%> ! <x:transform xslt="${removeNamespacesXsl}" xml="${xmlResponse}" var="getRecordXmlDom"/> </c:catch> </c:if> |