detail.jsp 11.9 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 import="pt.keep.metarepository.core.solr.SolrClient"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="pt.keep.metarepository.modules.webui.transform.*" %>
<%@ 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.modules.bibliographicinfo.export.*" %>
<%@ page import="pt.keep.metarepository.core.util.*" %>
<%@ page import="pt.keep.metarepository.modules.webui.servlets.SearchServlet" %>
<%@ page import="pt.keep.metarepository.core.solr.SolrClient" %>
<%@ taglib uri="keep/tags/KeepTags.tld" prefix="KEEP" %>
<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=utf-8" %>
<% String lang = LocalizationFetcher.getLocaleString(request,response); %>


<html xmlns="http://www.w3.org/1999/xhtml" lang="<%=lang%>" xml:lang="<%=lang%>">

<%
	// Get Item Data
	DocumentInterface docInterface = new DocumentInterface(getServletContext());
	ArchiveInterface arqInterface = new ArchiveInterface(getServletContext());
	
	String id = request.getParameter("id");
	if (id != null) session.setAttribute(Constants.SESSION_DOCUMENT_ID,id);
	else id = (String) session.getAttribute(Constants.SESSION_DOCUMENT_ID);
	
	Document doc = SolrClient.getInstance().getDocumentById(id);
	Archive arq = arqInterface.findArchiveByID(doc.getArchive_id());
	List<Archive> inactiveArchives = arqInterface.findAllInactive();
	List<Document> docs = SolrClient.getInstance().findRelated(doc,inactiveArchives);
	docInterface.incrementViews(doc.getId());
	
	arqInterface.closeConnection();
	docInterface.closeConnection();
	
	// Transformations
	DocumentTransform document = new DocumentTransform(doc,lang);
	List<DocumentTransform> documents = DocumentTransform.castFrom(docs,lang);
	
	String urlToShare = StringUtils.urlEncodeFromUTF8(ConfigurationManager.getProperty("site.url", "http://www.rcaap.pt")+"/detail.jsp?id="+document.getId());
	String titleToShare = StringUtils.urlEncodeFromUTF8(document.getAllTitle(false));
	titleToShare = titleToShare.replaceAll(":", "%3A");
	titleToShare = titleToShare.replaceAll("/", "%2F");
	titleToShare = titleToShare.replaceAll("#", "%23");
	titleToShare = titleToShare.replaceAll("&", "%26");

%>

<head>
<!--	<meta property="og:title" content="<%=document.getTitle() %>"/>
	<meta property="og:image" content="<%=ConfigurationManager.getProperty("site.url","www.rcaap.pt") %>/_img/logotipo_rcaap.png"/>
	<meta property="og:type" content="website"/>
	<meta property="og:url" content="<%=ConfigurationManager.getProperty("site.url","www.rcaap.pt") %>/detail.jsp?id=<%=document.getId() %>"/>
	<meta property="fb:admins" content="piskeirinho"/>-->
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<jsp:include page="./metatags.jsp"></jsp:include>
	<title>RCAAP - <%=document.getTitle() %></title>
	<link rel="icon" href="favicon.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
	<link rel="alternate" type="application/rss+xml" title="RCAAP RSS" href="<KEEP:url url='/rss.xml' />" />

	<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">
		function popup(mylink, windowname){
			if (! window.focus) return true;
			var href;
			if (typeof(mylink) == 'string')
		   		href=mylink;
			else
		   		href=mylink.href;
			window.open(href, windowname, 'width=500,height=400,scrollbars=yes');
			return false;
		}
	</script>	
	<!--[if IE]>
	<link rel="stylesheet" href="_css/results_ie.css" type="text/css" media="screen,projection" />
	<![endif]-->
</head>

<body>
<div id="siteBox">
	<div id="container">
		<jsp:include page="header.jsp" />
  		<!-- DETAIL	//-->
 		<div class="floatBox" id="detailColsBox">
  			<h1 id="detailTitle"><KEEP:lang lang='<%=lang %>' key='webui.details.legend' /></h1>
  			<div id="bgDetailCols" class="floatBox">
  				<div id="col1" class="floatLeft">
	  				<!-- DETAIL: MAIN INFO //-->
	  				<div id="detailBox">
	  					<% if (document.hasLink()) { %>
	  					<h2><a target="_blank" href="<%=document.getLink()%>"><%=document.getTitle()%></a></h2>
	  					<% } else { %>
	  					<h2><%=document.getTitle()%></h2>
	  					<% } %>
	  					<div id="mainInfo" class="floatLeft">
		  					<% if (document.hasAuthors()) { %>
		  					<p><strong><KEEP:lang lang='<%=lang %>' key='webui.details.author.label' />:</strong> 
		  					<%-- <%= document.getAllAuthors() %>--%>
		  					<%=document.getAllAuthorsWithLinkForEachAuthorPublications() %> <%-- adicionar title e alt??? --%>
		  					</p>
		  					<% } %>
							<% if (!document.getIssue_date().equals("")) { %>
		  					<p><strong><KEEP:lang lang='<%=lang %>' key='webui.details.issue.date.label' />:</strong> <%=document.getIssue_date() %> </p>
		  					<% } %>
		  					<% if (document.isPersistent()) { %>
							<p><strong><KEEP:lang lang='<%=lang %>' key='webui.details.identifier.label' />:</strong> <a target="_blank" href="<%=document.getLink()%>"><%=document.getLink()%></a></p>
							<% } %>
		  					<p><strong><KEEP:lang lang='<%=lang %>' key='webui.details.origin.label' />:</strong> <%=arq.getName() %></p>
							<% if (document.hasSubjects()) { %>
		  					<p class="subjects"><strong><KEEP:lang lang='<%=lang %>' key='webui.details.subject.label' />:</strong> <%=document.getAllSubjects() %></p>
							<% } %>
						</div>
	  					<br class="clear" />
	  					<% if (document.hasDescription()) { %>
	  					<div class="abstract">
	  						<strong><KEEP:lang lang='<%=lang %>' key='webui.details.abstract.label' /></strong><br />
	  						<%=document.getAllDescription() %>				
	  					</div>
						<% } %>
	  				</div>
	  				<!-- DETAIL: MORE INFO //-->
	  				<div id="info2Box" class="floatBox">
	  					<div class="floatLeft">
	  						<% if (document.hasDocumentType()) { %>
	  						<strong><KEEP:lang lang='<%=lang %>' key='webui.details.doctype.label' /></strong> 
	  						<span><%=document.getDocumentType() %></span><br />
	  						<% } %>
							<% if (document.hasLanguage()) { %>
	  						<strong><KEEP:lang lang='<%=lang %>' key='webui.details.language.label' /></strong> 
	  						<span><%=document.getLanguage() %></span><br />
							<% } %>
							<% if (document.hasAdvisors()) { %>
							<strong><KEEP:lang lang='<%=lang %>' key='webui.details.advisor.label' /></strong>
							<span><%=document.getAllAdvisors() %></span><br />
							<% } %>
							<% if (document.hasContributors()) { %>
							<strong><KEEP:lang lang='<%=lang %>' key='webui.details.editor.label' /></strong>
							<span><%=document.getAllContributors() %></span><br />
							<% } %>
	  					</div>
	  				</div>
	  				<div id="socialPlusBibliographicInfo">
						<div id="social">
							<a href="http://delicious.com/post?url=<%=urlToShare%>&amp;title=<%=titleToShare%>" target="_blank"><img src="_img/delicious_16.png" title="<KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.delicious" />" alt="delicious logo" /></a><span class="floatLeft">&nbsp;</span>
							<a href="http://www.facebook.com/sharer.php?u=<%=urlToShare%>&amp;t=<%=titleToShare%>" target="_blank"><img src="_img/facebook_16.png" title="<KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.facebook" />" alt="facebook logo" /></a><span class="floatLeft">&nbsp;</span>
							<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=<%=urlToShare%>&amp;title=<%=titleToShare%>" target="_blank"><img src="_img/linkedin_16.png" title="<KEEP:lang lang='<%=lang %>' key="webui.repositoryinfo.linkedin" />" alt="linkedin logo" /></a><span class="floatLeft">&nbsp;</span>
							<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" />" alt="twitter logo" /></a><span class="floatLeft">&nbsp;</span>
						</div>
						<div id="bibliographic">
							<% if(ConfigurationManager.getProperty("degois.active",false)){  %>
							<!--<a href="<KEEP:url url='/loginDeGois.jsp'/>?id=<%=document.getId()%>" onclick="return popup(this,'loginDeGois')"><img src="_img/degois2_18.png" title="<KEEP:lang lang='<%=lang %>' key="webui.detail.biblio.degois" />" alt="degois logo" /></a>-->
								<a href="<KEEP:url url='/loginDeGois.jsp'/>?id=<%=document.getId()%>" target="_blank"><img src="_img/degois2_18.png" title="<KEEP:lang lang='<%=lang %>' key="webui.detail.biblio.degois" />" alt="degois logo" /></a>
							<% }  %>
							<form action="exportBiblioInfo" method="post">
								<input name="biblioType" value="<%=BibTeX.class.getSimpleName() %>" type="hidden" />
								<input name="documentId" value="<%= document.getId()%>" type="hidden" />
								<input type="image" src="_img/bibtex_16.png" value="<%=BibTeX.class.getSimpleName() %>" title="<KEEP:lang lang='<%=lang %>' key="webui.detail.biblio.bibtex" />" alt="bibtex logo"></input>
							</form>
							<form action="exportBiblioInfo" method="post">
								<input name="biblioType" value="<%=RIS.class.getSimpleName() %>" type="hidden" />
								<input name="documentId" value="<%= document.getId()%>" type="hidden" />
								<input type="image" src="_img/ris_16.png" value="<%=RIS.class.getSimpleName() %>" title="<KEEP:lang lang='<%=lang %>' key="webui.detail.biblio.ris" />" alt="ris logo"></input>
							</form>
							<a target="_blank" href="<KEEP:url url='/detail.jsp'/>?id=<%=document.getId()%>" onkeypress="javascript:document.getElementsByTagName('body')[0].appendChild(document.createElement('script')).setAttribute('src','http://www.mendeley.com/min.php/bookmarklet');" onclick="javascript:document.getElementsByTagName('body')[0].appendChild(document.createElement('script')).setAttribute('src','http://www.mendeley.com/min.php/bookmarklet');"><img src="_img/mendeley_16.png" title="<KEEP:lang lang='<%=lang %>' key="webui.detail.biblio.coins" />" alt="mendeley logo"/></a>
						</div>
					</div>
	  			</div>
	  			<!--	RELATED	-->
	  			<div id="col2" class="floatRight">
	  				<div id="relatedCol">
	  					<h2><KEEP:lang lang='<%=lang %>' key='webui.details.related.label' /></h2>
	  					<% if (documents.size() <= 0) { %>
	  					<div class="nonerelated"><KEEP:lang lang='<%=lang %>' key='webui.details.related.none' /></div>
	  					<% } %>
	  					<% for (DocumentTransform related : documents) { %>
	  					<div class="related">
	  						<h2><a href="<KEEP:url url='/detail.jsp' />?id=<%=related.getId() %>"><%=related.getRelatedTitle() %></a></h2>
	  						<em><%=related.getRelatedAuthors()%></em>
	  						<p>
	  							<a title="<KEEP:lang lang='<%=lang %>' key='webui.details.related.more.info.about' /> <%=related.getTitle()%>" href="<KEEP:url url='/detail.jsp' />?id=<%=related.getId() %>"><KEEP:lang lang='<%=lang %>' key='webui.details.related.more.info.label' /></a>
	  						</p>
	  						<p class="date"><strong><KEEP:lang lang='<%=lang %>' key='webui.details.related.date.label' />:</strong> <%=related.getIssue_date() %> </p>
	  					</div>
						<% } %>
					</div>
	  			</div>
	  		</div>
	  	</div>
		<!-- Bibliographic tests BEGIN -->
		<% 
			COinS coins = null;
			try{
				coins = new COinS(doc);
			}catch(Throwable ex){
				
			}
			
		%>
		
		<%=	(coins!=null)?coins.generateBibliograpicInformation().toString():""%>
		<!-- Bibliographic tests END -->
		
	  	<!--	BOTTOM LINKS 	-->
	  	<jsp:include page="footer.jsp" />
	</div>
</div>
</body>
</html>