repositoryInfo.jsp 8.8 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.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.util.*" %>
<%@ page import="pt.keep.metarepository.core.solr.SolrClient" %>

<%@ taglib uri="keep/tags/KeepTags.tld" prefix="KEEP" %>
<% String lang = LocalizationFetcher.getLocaleString(request,response); %>
<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" />

	<!--[if IE]>
	<link rel="stylesheet" href="_css/results_ie.css" type="text/css" media="screen,projection" />
	<![endif]-->

<%
	ArchiveInterface arqIface = new ArchiveInterface(getServletContext());
	String archiveId = request.getParameter("id");
	List<Archive> archives = null, inactiveArchives=null;
	if(archiveId!=null && !archiveId.equals("")){
		try{
			Archive archive = arqIface.findArchiveByID(archiveId);
			if(archive.isActive()){
%>
				<meta property="og:title" content="<%=archive.getName() %>"/>
				<meta property="og:image" content="<%=ConfigurationManager.getProperty("site.url","www.rcaap.pt") %>/images/repositories/<%=archive.getId() %>.jpg"/>
				<meta property="og:type" content="website"/>
				<meta property="og:url" content="<%=ConfigurationManager.getProperty("site.url","www.rcaap.pt") %>/repositoryInfo.jsp?id=<%=archive.getId() %>"/>
				<meta property="fb:admins" content="piskeirinho"/>
<% 
				archives = new ArrayList<Archive>();
				archives.add(archive);
			}
		}catch(Throwable t){ 
			archives = arqIface.findAllActive();
		}
	}else{
		archives = arqIface.findAllActive();
	}
	inactiveArchives = arqIface.findAllInactive();
	HashMap<String, Integer> number = SolrClient.getInstance().getNumberOfDocumentsCountByArchive(true, inactiveArchives);

	int i;
	boolean isPt = lang.equals("pt");
	arqIface.closeConnection();
%>
</head>
<body>
<div id="siteBox">
	<div id="container">
		<jsp:include page="header.jsp" />
		<div id="directoryBox">
	  		<h1><KEEP:lang lang='<%=lang %>' key="webui.directory.legend"/></h1>
			<% for (Archive arc : archives) {
				String urlToShare = StringUtils.urlEncodeFromUTF8(ConfigurationManager.getProperty("site.url", "http://www.rcaap.pt")+"/repositoryInfo.jsp?id="+arc.getId());
				String titleToShare = StringUtils.urlEncodeFromUTF8(arc.getName());
				titleToShare = titleToShare.replaceAll(":", "%3A");
				titleToShare = titleToShare.replaceAll("/", "%2F");
				titleToShare = titleToShare.replaceAll("#", "%23");
				titleToShare = titleToShare.replaceAll("&", "%26");
			%>
	  		<div class="sep"><hr /></div>
		 	<div class="floatBox">
		 		<div id="titlePlusSocial">
					<h2><a href="<%=arc.getHomePage() %>" target="_blank"><%=arc.getName() %></a></h2>
					<div id="social">
						<a href="http://delicious.com/post?url=<%=urlToShare%>&title=<%=titleToShare%>" target="_blank"><img src="_img/delicious_16.png" title="<KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.delicious.repository" />" alt="delicious logo" /></a>
						<a href="http://www.facebook.com/sharer.php?u=<%=urlToShare%>&t=<%=titleToShare%>" target="_blank"><img src="_img/facebook_16.png" title="<KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.facebook.repository" />" alt="facebook logo" /></a>
						<a href="http://www.linkedin.com/shareArticle?mini=true&url=<%=urlToShare%>&title=<%=titleToShare%>" target="_blank"><img src="_img/linkedin_16.png" title="<KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.linkedin.repository" />" alt="linkedin logo" /></a>
						<a href="http://twitter.com/home?status=<%=titleToShare%> - <%=urlToShare%>" target="_blank"><img src="_img/twitter_16.png" title="<KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.twitter.repository" />" alt="twitter logo" /></a>
					</div>
				</div>
		        <div class="colsBox">
					<div class="col1">
						<p><%=(isPt)?arc.getPtDescription():arc.getEnDescription()%></p>
						<ul>
							<li>
	  							<strong><KEEP:lang lang='<%=lang %>' key="webui.directory.contact" /></strong>
	  							<a href="mailto:<%=arc.getAdminEmail()%>"><%=arc.getAdminEmail() %></a>
	  						</li>
						</ul>
						<div id="features">
							<%
								if(arc.isDegois()){
							%>
								<a><img src="_img/degois.png" title="<KEEP:lang lang='<%=lang %>' key="webui.directory.degois" />" alt="degois logo"/></a>
							<%
								}
								if(arc.isOpenAire()){
							%>
								<a><img src="_img/openaire.png" title="<KEEP:lang lang='<%=lang %>' key="webui.directory.openaire" />" alt="openaire logo"/></a>
							<%
								}
								if(arc.harvestFullText()){
							%>
								<a><img src="_img/text.png" title="<KEEP:lang lang='<%=lang %>' key="webui.directory.fulltext" />" alt="fulltext logo"/></a>
							<%
								}
								if(arc.isDriver()){
							%>
								<a><img src="_img/driver.png" title="<KEEP:lang lang='<%=lang %>' key="webui.directory.driver" />" alt="driver logo"/></a>
							<%
								}
							%>
						</div>
	  				</div>	
					<div class="col2">
						<ul>
							<li>
								<strong><KEEP:lang lang='<%=lang %>' key="webui.directory.url.location" /></strong>
								<a title="<%=arc.getName() %>" href="<%=arc.getHomePage() %>" target="_blank"><%=arc.getHomePage() %></a>
							</li>
	  						<li>
	  							<strong><KEEP:lang lang='<%=lang %>' key="webui.directory.oai.interface" /></strong>
								<a href="<%=arc.getOaiUrl() %>" target="_blank"><%=arc.getOaiUrl() %></a>
							</li>
	  						
	  						<li>
	  							<strong><KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.directorio.luso.brasileiro" /></strong>
	  							<a href="<%=arc.getDirectoryURL()%>"><%=arc.getDirectoryURL() %></a>
	  						</li>
	  						<li class="num">
								<strong><KEEP:lang lang='<%=lang %>' key="webui.directory.number.of.documents" /></strong>
								<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>
							</li>
						</ul>
					</div>
					<div class="col3">
						<a href="<%=arc.getHomePage() %>" target="_blank"><img src="/images/repositories/<%=arc.getId() %>.jpg" alt="<%=arc.getName() %>" /></a>
						<a><img src="/images/repositoriesStatistics/<%=arc.getId() %>.png" title="<%=arc.getName() %>" alt="repository evolution"/></a>
					</div>
					<div id="backToDirectory">
						<a href="<KEEP:url url='/directory.jsp'/>"><KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.back.to.directory" /></a>
					</div>
				</div>
			</div>
			<% } %>
		</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>