directory.jsp 6.83 KB
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" %>
<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="java.util.*" %>
<%@ page import="java.util.Set" %>
<%@ page import="java.sql.*" %>
<%@ page import="pt.keep.metarepository.core.database.sql.OrderType"%>
<%@ page import="pt.keep.metarepository.core.database.orm.interfaces.*"%>
<%@ page import="pt.keep.metarepository.core.database.orm.entities.*" %>
<%@ page import="pt.keep.metarepository.modules.webui.io.session.*" %>
<%@ page import="pt.keep.metarepository.core.configuration.*" %>
<%@ page import="pt.keep.metarepository.core.localization.*" %>
<%@ page import="pt.keep.metarepository.core.util.data.*" %>
<%@ page import="pt.keep.metarepository.core.solr.SolrClient" %>
<%@ taglib uri="keep/tags/KeepTags.tld" prefix="KEEP" %>
<% String lang = LocalizationFetcher.getLocaleString(request,response); %>

<%@page import="pt.keep.metarepository.core.util.StringUtils"%><html xmlns="http://www.w3.org/1999/xhtml" lang="<%=lang%>" xml:lang="<%=lang%>">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<jsp:include page="./metatags.jsp"></jsp:include>
	<title><KEEP:lang lang='<%=lang %>' key="webui.general.rcaap.title" /></title>
	<link rel="alternate" type="application/rss+xml" title="RCAAP RSS" href="<KEEP:url url='/rss.xml' />" />
	<link rel="icon" href="favicon.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
	<link rel="search" type="application/opensearchdescription+xml" href="opensearch.xml" title="RCAAP Search" />
	<link rel="stylesheet" href="_css/init.css" type="text/css" media="screen,projection" />
	<link rel="stylesheet" href="_css/results.css" type="text/css" media="screen,projection" />
	<link rel="stylesheet" href="_css/results_<%=lang%>.css" type="text/css" media="screen,projection" />
	<script type="text/javascript" src="_js/jquery.js"></script>
	<script type="text/javascript" src="_js/framework.js"></script>

	<!--[if IE]>
	<link rel="stylesheet" href="_css/results_ie.css" type="text/css" media="screen,projection" />
	<![endif]-->
</head>
<%
	boolean isPt = lang.equals("pt");
	ArchiveInterface arqIface = new ArchiveInterface(getServletContext());
	String searchTag = request.getParameter("tag");
	Pair<List<Archive>,Set<String>> archivesPlusAllTags = arqIface.findAllActiveByTag(searchTag,isPt);
	List<Archive> inactiveArchives = arqIface.findAllInactive();
	HashMap<String, Integer> number = SolrClient.getInstance().getNumberOfDocumentsCountByArchive(true, inactiveArchives);
	int i;
	arqIface.closeConnection(); // ver se não são necessárias mais abaixo
%>
<body>
	<div id="siteBox">
		<div id="container">
			<jsp:include page="header.jsp" />
			<div id="directoryBox2">
				<h1><KEEP:lang lang='<%=lang %>' key="webui.directory.legend"/></h1>
				<script type="text/javascript">
					/* <![CDATA[ */
               		document.write('<ul id="filter">');
                  	document.write('<li class="current"><a href="#" name="<%=(isPt?"Todos":"All") %>"><%=(isPt?"Todos":"All") %></a></li>'); // modificar "Todos" e "All" implica modificar script
               		<%
               		for(String tag : archivesPlusAllTags.getSecond()){
               		%>
                  		document.write('<li><a href="#" name="<%=tag.replaceAll(" ","_") %>"><%=tag %></a></li>');
               		<%
               		}
               		%>
               		document.write('</ul>');
					/* ]]> */
            	</script>
            	<noscript><span/></noscript>

				<ul id="portfolio">
					<%
					String unparsedTags;
					String parsedTags;
					for (Archive arc : archivesPlusAllTags.getFirst()) {
						unparsedTags = isPt?arc.getTags_pt():arc.getTags_en();
						parsedTags = "";
						for(String tag : unparsedTags.split("\\|")){
							tag = tag.trim().replaceAll(" ","_");
							if(parsedTags.equals("")){
								parsedTags+=tag;
							}else{
								parsedTags+=" "+tag;
							}
						}
					%>
						
						<li class="<%=parsedTags %>">
							<div class="repositoryInfo">
								<div class="repositoryImg">
									<a href="<%=arc.getHomePage()%>" target="_blank"><img src="/images/repositories/<%=arc.getId()%>.jpg" alt="<%=arc.getName() %>" /></a>
									<div style="visibility:hidden;">&nbsp;|&nbsp;</div>
								</div>
								<div class="repositoryName"><%=arc.getName() %></div>
								
								<div class="repositoryDetailedInfo">
									<div class="repositoryDetailedInfoCount">
										<a title="<KEEP:lang lang='<%=lang %>' key='webui.directory.number.of.documents.title'/> <%=arc.getName() %>" 
											href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.ADVANCED.toString()%>&amp;<%=Constants.REQUEST_REPOSITORY %>=<%=arc.getId() %>&amp;<%=Constants.INCLUDE_ALL_REPOSITORIES%>=yes&amp;<%=Constants.REQUEST_ORDER_COLUMN %>=<%=ColumnOrder.ISSUE_DATE.toString() %>&amp;<%=Constants.REQUEST_ORDER_TYPE %>=<%=OrderType.DESC.toString() %>">
											<%=number.get(arc.getId())!=null? number.get(arc.getId()).toString():"0"%>
										</a>
									</div>
									<div class="repositoryDetailedInfoFeatures">
										<%
											if(arc.isDegois()){
										%>
											<img src="_img/degois2_18.png" title="<KEEP:lang lang='<%=lang %>' key="webui.directory.degois" />" alt="degois logo" />
										<%
											}
											if(arc.isOpenAire()){
										%>
											<img src="_img/openaire_18.png" title="<KEEP:lang lang='<%=lang %>' key="webui.directory.openaire" />" alt="openaire logo" />
										<%
											}
											if(arc.isDriver()){
										%>
											<img src="_img/driver1_18.png" title="<KEEP:lang lang='<%=lang %>' key="webui.directory.driver" />" alt="driver logo" />
										<%
											}
										%>
									</div>															
									<div class="repositoryDetailedInfoMore">
										<a href="<KEEP:url url='/repositoryInfo.jsp' />?id=<%=arc.getId()%>" title="<KEEP:lang lang='<%=lang %>' key="webui.results.item.more.info" /> - <%= arc.getName()%>">
										<KEEP:lang lang='<%=lang %>' key="webui.results.item.more.info" /></a>
									</div>
								</div>
								
							</div>
						</li>
					<%
					}
					%>
				</ul>
			</div>
			<jsp:include page="footer.jsp" />
		</div>
	</div>
	<script type="text/javascript">
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
		document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	<noscript>
	Google Analytics
	</noscript>
	<script type="text/javascript">
		try {
			var pageTracker = _gat._getTracker("UA-6710497-1");
			pageTracker._trackPageview();
		} catch(err) {}
	</script>
	<noscript>
	Google Analytics
	</noscript>
</body>
</html>