From: John W. <jwe...@us...> - 2007-01-31 20:01:53
|
Update of /cvsroot/dlese/dds-project/web/admin/reporting In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv20548/web/admin/reporting Modified Files: ucar-member-institutions-report.jsp Log Message: added totals for inst report Index: ucar-member-institutions-report.jsp =================================================================== RCS file: /cvsroot/dlese/dds-project/web/admin/reporting/ucar-member-institutions-report.jsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ucar-member-institutions-report.jsp 31 Jan 2007 18:38:15 -0000 1.2 --- ucar-member-institutions-report.jsp 31 Jan 2007 20:01:39 -0000 1.3 *************** *** 41,44 **** --- 41,45 ---- <c:set var="instCount" value="0"/> + <c:set var="concatInstNames" value=""/> <table border=1 cellpadding=4 cellspacing=0> *************** *** 69,72 **** --- 70,74 ---- query = "itemContent:(\"" + instName + "\")"; + query = "(" + query + ") AND xmlFormat:adn"; resultDocs = index.searchDocs(query); pageContext.setAttribute("numContent", (resultDocs == null ? 0 : resultDocs.length) ); *************** *** 74,77 **** --- 76,80 ---- query = "organizationInstName:(\"" + instName + "\")"; + query = "(" + query + ") AND xmlFormat:adn"; resultDocs = index.searchDocs(query); pageContext.setAttribute("numInst", (resultDocs == null ? 0 : resultDocs.length) ); *************** *** 79,82 **** --- 82,86 ---- query = "(\"" + instName + "\")"; + query = "(" + query + ") AND xmlFormat:adn"; resultDocs = index.searchDocs(query); pageContext.setAttribute("numMetadata", (resultDocs == null ? 0 : resultDocs.length) ); *************** *** 84,87 **** --- 88,92 ---- query = "(\"" + instName + "\") OR itemContent:(\"" + instName + "\") OR organizationInstName:(\"" + instName + "\")"; + query = "(" + query + ") AND xmlFormat:adn"; resultDocs = index.searchDocs(query); pageContext.setAttribute("numAnywhere", (resultDocs == null ? 0 : resultDocs.length) ); *************** *** 99,103 **** </td> <td style="text-align: left; text-transform: capitalize"> ! ${instName} <%-- <ul> <x:forEach var="dept" varStatus="j" select="$inst//ul//li/a"> --- 104,110 ---- </td> <td style="text-align: left; text-transform: capitalize"> ! ${instName} ! <c:set var="concatInstNames">${concatInstNames}${i.count < 3 ? ' ' : ' OR '}"${instName}"</c:set> ! <%-- <ul> <x:forEach var="dept" varStatus="j" select="$inst//ul//li/a"> *************** *** 133,141 **** </x:otherwise> </x:choose> ! </x:forEach> </table> <br/><br/><br/> ! </body> </html> --- 140,244 ---- </x:otherwise> </x:choose> ! </x:forEach> ! ! <% ! try { ! String instName = (String) pageContext.getAttribute("concatInstNames"); ! instName = instName.replaceAll("\\s+", " "); ! ! ResultDoc[] resultDocs = null; ! SimpleLuceneIndex index = (SimpleLuceneIndex) application.getAttribute("index"); ! ! String query = null; ! ! query = "itemContent:(" + instName + ")"; ! query = "(" + query + ") AND xmlFormat:adn"; ! resultDocs = index.searchDocs(query); ! pageContext.setAttribute("numContent", (resultDocs == null ? 0 : resultDocs.length) ); ! pageContext.setAttribute("numContentQuery", query ); ! ! query = "organizationInstName:(" + instName + ")"; ! query = "(" + query + ") AND xmlFormat:adn"; ! resultDocs = index.searchDocs(query); ! pageContext.setAttribute("numInst", (resultDocs == null ? 0 : resultDocs.length) ); ! pageContext.setAttribute("numInstQuery", query ); ! ! query = "(" + instName + ")"; ! query = "(" + query + ") AND xmlFormat:adn"; ! resultDocs = index.searchDocs(query); ! pageContext.setAttribute("numMetadata", (resultDocs == null ? 0 : resultDocs.length) ); ! pageContext.setAttribute("numMetadataQuery", query ); ! ! query = "(" + instName + ") OR itemContent:(" + instName + ") OR organizationInstName:(" + instName + ")"; ! query = "(" + query + ") AND xmlFormat:adn"; ! resultDocs = index.searchDocs(query); ! pageContext.setAttribute("numAnywhere", (resultDocs == null ? 0 : resultDocs.length) ); ! pageContext.setAttribute("numAnywhereQuery", query ); ! ! query = "xmlFormat:adn"; ! resultDocs = index.searchDocs(query); ! pageContext.setAttribute("totalResources", (resultDocs == null ? 0 : resultDocs.length) ); ! pageContext.setAttribute("totalResourcesQuery", query ); ! ! } catch ( Throwable t ) { ! System.out.println("Error: " + t ); ! t.printStackTrace(); ! } ! %> ! ! <th colspan="6">All Institutions Combined</th> ! <tr> ! <td> </td> ! <td style="text-align: left;"> ! Any Institution (At least one or more institution name appears) ! </td> ! <td> ! <c:url var="qUrl" value='/admin/query.do'> ! <c:param name="q">${numInstQuery}</c:param> ! </c:url> ! <a href="${qUrl}">${numInst}</a> ! </td> ! <td> ! <c:url var="qUrl" value='/admin/query.do'> ! <c:param name="q">${numMetadataQuery}</c:param> ! </c:url> ! <a href="${qUrl}">${numMetadata}</a> ! </td> ! <td> ! <c:url var="qUrl" value='/admin/query.do'> ! <c:param name="q">${numContentQuery}</c:param> ! </c:url> ! <a href="${qUrl}">${numContent}</a> ! </td> ! <td> ! <c:url var="qUrl" value='/admin/query.do'> ! <c:param name="q">${numAnywhereQuery}</c:param> ! </c:url> ! <a href="${qUrl}">${numAnywhere}</a> ! </td> ! </tr> ! ! <tr> ! <td> </td> ! <td colspan="4" style="text-align: left;"> ! Total number of resources in library: ! </td> ! <td> ! <c:url var="qUrl" value='/admin/query.do'> ! <c:param name="q">${totalResourcesQuery}</c:param> ! </c:url> ! <a href="${qUrl}">${totalResources}</a> ! </td> ! </tr> ! </table> + <br/><br/><br/> ! ! ! ! ! </body> </html> |