comparison src/main/webapp/pages/search.jsp @ 94:d0dcbe8254f5

New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
author Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
date Mon, 03 Jul 2017 23:43:44 +0200
parents 910cfd8521dd
children b27a99201cbe
comparison
equal deleted inserted replaced
93:88a485937f9a 94:d0dcbe8254f5
1 <%@page import="de.mpiwg.gazetteer.bo.LGBranch"%> 1 <%@page import="de.mpiwg.gazetteer.bo.LGBranch"%>
2 <%@page import="de.mpiwg.gazetteer.bo.LGTopicSectionRelation"%> 2 <%@page import="de.mpiwg.gazetteer.bo.LGTopicSectionRelation"%>
3 <%@page import="org.apache.commons.lang.StringUtils"%> 3 <%@page import="org.apache.commons.lang.StringUtils"%>
4 <%@page import="de.mpiwg.gazetteer.db.DBBook"%>
4 <%@page import="de.mpiwg.gazetteer.db.DBSection"%> 5 <%@page import="de.mpiwg.gazetteer.db.DBSection"%>
5 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 6 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
6 7
7 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" /> 8 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
8 9
608 src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/> 609 src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
609 </td> 610 </td>
610 </tr> 611 </tr>
611 </table> 612 </table>
612 </th> 613 </th>
614
615 <th>
616 <table class="sortTable">
617 <tr>
618 <td><label class="tableTitle">Book Year</label></td>
619 <td>
620 <table>
621 <tr><td>
622 <input type="image"
623 onclick="setAction('sortByBookYearUp', 'searchForm');"
624 src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>
625 </td></tr>
626 <tr><td>
627 <input type="image"
628 onclick="setAction('sortByBookYearDown', 'searchForm');"
629 src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>
630 </td></tr>
631 </table>
632 </td>
633 </tr>
634 <tr>
635 <td>
636 <input type="text" class="filterInput" name="bookYearFilter" id="bookYearFilter" value="<%= sessionBean.getSearchPage().getBookYearFilter()%>"/>
637 </td>
638 <td>
639 <input type="image"
640 onclick="setAction('filter', 'searchForm');"
641 src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
642 </td>
643 </tr>
644 </table>
645 </th>
646 <th>
647 <table class="sortTable">
648 <tr>
649 <td><label class="tableTitle">Edition Year</label></td>
650 <td>
651 <table>
652 <tr><td>
653 <input type="image"
654 onclick="setAction('sortByEditionYearUp', 'searchForm');"
655 src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>
656 </td></tr>
657 <tr><td>
658 <input type="image"
659 onclick="setAction('sortByEditionYearDown', 'searchForm');"
660 src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>
661 </td></tr>
662 </table>
663 </td>
664 </tr>
665 <tr>
666 <td>
667 <input type="text" class="filterInput" name="editionYearFilter" id="editionYearFilter" value="<%= sessionBean.getSearchPage().getEditionYearFilter()%>"/>
668 </td>
669 <td>
670 <input type="image"
671 onclick="setAction('filter', 'searchForm');"
672 src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
673 </td>
674 </tr>
675 </table>
676 </th>
677
613 <th> 678 <th>
614 <table class="sortTable"> 679 <table class="sortTable">
615 <tr> 680 <tr>
616 <td><label class="tableTitle">Source</label></td> 681 <td><label class="tableTitle">Source</label></td>
617 <td> 682 <td>
706 <th><label class="tableTitle">Existing Tasks</label></th> 771 <th><label class="tableTitle">Existing Tasks</label></th>
707 </tr> 772 </tr>
708 773
709 <% 774 <%
710 long userId = sessionBean.getUser().getId(); 775 long userId = sessionBean.getUser().getId();
711 long userDefaultTopicId = sessionBean.getTopicListPage().getDefaultTopicId(userId); 776 long userDefaultTopicId = sessionBean.getTopicListPage().getDefaultTopicId(userId);
712 String extractionInterfaceUrl = sessionBean.getApplicationBean().getExtractionInterfaceUrl(); 777 String extractionInterfaceUrl = sessionBean.getApplicationBean().getExtractionInterfaceUrl();
778 DBBook aBook;
779 String BookName;
713 780
714 for (DBSection section : sessionBean.getSearchPage().getDisplaySectionList()) { 781 for (DBSection section : sessionBean.getSearchPage().getDisplaySectionList()) {
782 aBook = section.getBook();
715 %> 783 %>
716 <tr> 784 <tr>
717 <td> 785 <td>
718 <a href="<%=sessionBean.getApplicationBean().getTocInterfaceUrl()%>/check_sections_details.php?book_id=<%=section.getBook().getId() %>&amp;count=100&amp;sessionId=<%= session.getId()%>" target="blank"> 786 <a href="<%=sessionBean.getApplicationBean().getTocInterfaceUrl()%>/check_sections_details.php?book_id=<%=section.getBookId() %>&amp;count=100&amp;sessionId=<%= session.getId()%>" target="blank">
719 <%=section.getBook().getId()%> 787 <%=section.getBookId()%>
720 </a> 788 </a>
721 <img title="More Information" src="<%=sessionBean.getApplicationBean().getMoreInfoImage()%>" data-section-id="<%=section.getId()%>" class="moreInfo"/> 789 <img title="More Information" src="<%=sessionBean.getApplicationBean().getMoreInfoImage()%>" data-section-id="<%=section.getId()%>" class="moreInfo"/>
722 </td> 790 </td>
723 <td><%=section.getBook().getName()%></td> 791 <%if(aBook == null){
724 <td><%=section.getBook().getLevel1()%></td> 792 BookName = "";
725 <td><%=section.getBook().getLevel2()%></td> 793 %>
726 <td><%=section.getBook().getDynasty()%></td> 794
727 <td><%=section.getBook().getPeriod()%></td> 795 <td></td>
728 <td><%=section.getBook().getAdmin_type() %></td> 796 <td></td>
729 <td><%=section.getBook().getSource() %></td> 797 <td></td>
798 <td></td>
799 <td></td>
800 <td></td>
801 <td></td>
802 <td></td>
803 <td></td>
804 <%} else {
805 BookName = aBook.getName();%>
806 <td><%=BookName%></td>
807 <td><%=aBook.getLevel1()%></td>
808 <td><%=aBook.getLevel2()%></td>
809 <td><%=aBook.getDynasty()%></td>
810 <td><%=aBook.getPeriod()%></td>
811 <td><%=aBook.getAdmin_type() %></td>
812 <td><%=aBook.getBookYear() %></td>
813 <td><%=aBook.getEditionYear() %></td>
814 <td><%=aBook.getSource() %></td>
815 <%}%>
816
730 <td><%=section.getName()%></td> 817 <td><%=section.getName()%></td>
731 <td><%=section.getPages()%></td> 818 <td><%=section.getPages()%></td>
732 819
733 820
734 <!-- View text in Ext-Interface --> 821 <!-- View text in Ext-Interface -->
735 <td> 822 <td>
736 <a href="#" 823 <a href="#"
737 title="Show Section in Extraction Interface" 824 title="Show Section in Extraction Interface"
738 onclick="sectionInExtractionInterface('<%=section.getId() %>', '<%=section.getName() %>', '<%=section.getBook().getId() %>', '<%=section.getBook().getName() %>', '<%=userDefaultTopicId %>', '<%=userId %>','<%=extractionInterfaceUrl%>');"> 825 onclick="sectionInExtractionInterface('<%=section.getId() %>', '<%=section.getName() %>', '<%=section.getBookId() %>', '<%=BookName %>', '<%=userDefaultTopicId %>', '<%=userId %>','<%=extractionInterfaceUrl%>');">
739 826
740 <img title="Show Section in Extraction Interface" src="<%=sessionBean.getApplicationBean().getShowImage()%>"> 827 <img title="Show Section in Extraction Interface" src="<%=sessionBean.getApplicationBean().getShowImage()%>">
741 </a> 828 </a>
742 829
743 </td> 830 </td>