Rev 1712 | Rev 1714 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1712 | Rev 1713 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | <%@ page import="pt.estgp.estgweb.domain.RepositoryDocumentInterfaceImpl" %> |
11 | <%@ page import="pt.estgp.estgweb.domain.RepositoryDocumentInterfaceImpl" %> |
12 | <%@ page import="jomm.dao.DaoException" %> |
12 | <%@ page import="jomm.dao.DaoException" %> |
13 | <%@ page import="pt.estgp.estgweb.services.data.repositorydocuments.interfaces.RepositoryInterface" %> |
13 | <%@ page import="pt.estgp.estgweb.services.data.repositorydocuments.interfaces.RepositoryInterface" %> |
14 | <%@ page import="pt.estgp.estgweb.domain.RepositoryDocumentCollection" %> |
14 | <%@ page import="pt.estgp.estgweb.domain.RepositoryDocumentCollection" %> |
15 | <%@ page import="org.hibernate.mapping.Collection" %> |
15 | <%@ page import="org.hibernate.mapping.Collection" %> |
- | 16 | <%@ page import="jomm.utils.MessageResources" %> |
|
- | 17 | <%@ page import="pt.estgp.estgweb.services.data.repositorydocuments.DocumentPersons" %> |
|
- | 18 | <%@ page import="pt.estgp.estgweb.services.data.repositorydocuments.DocumentPerson" %> |
|
- | 19 | <%@ page import="java.io.PrintWriter" %> |
|
16 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
20 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
17 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
21 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
18 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
22 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
19 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
23 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
20 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
24 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
21 | <%@ taglib tagdir="/WEB-INF/tags" prefix="bacoTags" %> |
25 | <%@ taglib tagdir="/WEB-INF/tags" prefix="bacoTags" %> |
22 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
26 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
- | 27 | ||
- | 28 | <%! |
|
- | 29 | private String printMetadata(String key,String value,HttpServletRequest request,PrintWriter out) |
|
- | 30 | { |
|
- | 31 | if(value != null && value.trim().length() > 0) |
|
- | 32 | { |
|
- | 33 | String msg = MessageResources.getMessage(request,key); |
|
- | 34 | return " <div class=\"row\">\n" + |
|
- | 35 | " <div class=\"col-md-4\" style=\"text-align:right\">\n" + |
|
- | 36 | " <span class=\"glyphicon glyphicon-tag\"></span>\n" + |
|
- | 37 | " <span class=\"label label-primary\">" + msg + "</span>\n" + |
|
- | 38 | " </div>\n" + |
|
- | 39 | " <div class=\"col-md-8\">\n" + |
|
- | 40 | " <i>" + value + "</i>\n" + |
|
- | 41 | " </div>\n" + |
|
- | 42 | " </div>"; |
|
- | 43 | } |
|
- | 44 | return ""; |
|
- | 45 | } |
|
- | 46 | ||
- | 47 | private String printMetadataPersons(String key,DocumentPersons persons,HttpServletRequest request,PrintWriter out) |
|
- | 48 | { |
|
- | 49 | StringBuilder str = new StringBuilder(); |
|
- | 50 | if(persons != null && persons.getPersons()!= null && persons.getPersons().size() > 0) |
|
- | 51 | { |
|
- | 52 | for(DocumentPerson p: persons.getPersons()) |
|
- | 53 | { |
|
- | 54 | str.append(printMetadata(key,p.getFirstNames() + " " + p.getLastName(),request,out)); |
|
- | 55 | } |
|
- | 56 | } |
|
- | 57 | return str.toString(); |
|
- | 58 | } |
|
- | 59 | %> |
|
- | 60 | ||
- | 61 | ||
- | 62 | ||
- | 63 | <jsp:useBean id="interfaceBlock" scope="request" type="pt.estgp.estgweb.services.data.repositorydocuments.interfaces.InterfaceBlock"/> |
|
23 | <nested:iterate id="doc" name="documents" type="pt.estgp.estgweb.domain.RepositoryDocumentImpl"> |
64 | <nested:iterate id="doc" name="documents" type="pt.estgp.estgweb.domain.RepositoryDocumentImpl"> |
24 | 65 | ||
25 | <div class="repository-document"> |
66 | <div class="repository-document"> |
- | 67 | <div class="repository-intro"> |
|
26 | <div class="repository-title clearfix" style="padding-bottom: 4px;padding-top: 4px"> |
68 | <div class="repository-title clearfix" style="padding-bottom: 4px;padding-top: 4px"> |
27 | <span class="glyphicon glyphicon-file btn-xs"></span> |
69 | <span class="glyphicon glyphicon-file btn-xs"></span> |
28 | <span class="title">${doc.title}</span> |
70 | <span class="title">${doc.title}</span> |
29 | <span class="badge pull-right"> |
71 | <span class="badge pull-right"> |
30 | ${doc.publishDateStr} |
72 | ${doc.publishDateStr} |
31 | </span> |
73 | </span> |
- | 74 | </div> |
|
- | 75 | <%--<div class="repository-description">${doc.description}</div>--%> |
|
- | 76 | <nested:equal value="true" name="interfaceBlock" property="showDocumentMetaData"> |
|
- | 77 | <%String subTitle = printMetadata("document.repository.metadata.subTitle",doc.getSubtitle(),request,response.getWriter());%> |
|
- | 78 | <%String internalIdentifier = printMetadata("document.repository.metadata.internalIdentifier",doc.getInternalIdentifier(),request,response.getWriter());%> |
|
- | 79 | <%String closeDateStr = printMetadata("document.repository.metadata.closeDateStr",doc.getCloseDateStr(),request,response.getWriter());%> |
|
- | 80 | <%String author = printMetadataPersons("document.repository.metadata.author", doc.getAuthorsJson(), request, response.getWriter());%> |
|
- | 81 | <%String contributor = printMetadataPersons("document.repository.metadata.contributor",doc.getAuthorsJson(),request,response.getWriter());%> |
|
- | 82 | <%String publisher = printMetadata("document.repository.metadata.publisher", doc.getPublisher(), request, response.getWriter());%> |
|
- | 83 | <%String description = printMetadata("document.repository.metadata.description", doc.getDescription(), request, response.getWriter());%> |
|
- | 84 | <% |
|
- | 85 | if(subTitle.length() > 0 || |
|
- | 86 | internalIdentifier.length() > 0 || |
|
- | 87 | //publishDateStr.length() > 0 || |
|
- | 88 | description.length() > 0 || |
|
- | 89 | closeDateStr.length() > 0 || |
|
- | 90 | author.length() > 0 || |
|
- | 91 | contributor.length() > 0 || |
|
- | 92 | publisher.length() > 0) |
|
- | 93 | { |
|
- | 94 | %> |
|
- | 95 | <div class="repository-metadata clearfix"> |
|
- | 96 | <%=description%> |
|
- | 97 | <%=subTitle%> |
|
- | 98 | <%=internalIdentifier%> |
|
- | 99 | <%=closeDateStr%> |
|
- | 100 | <%=author%> |
|
- | 101 | <%=contributor%> |
|
- | 102 | <%=publisher%> |
|
- | 103 | </div> |
|
- | 104 | <% |
|
- | 105 | } |
|
- | 106 | %> |
|
- | 107 | </nested:equal> |
|
32 | </div> |
108 | </div> |
33 | <div class="repository-description">${doc.description}</div> |
- | |
34 | <div class=" repository-document-files" style="width: 100%"> |
109 | <div class=" repository-document-files" style="width: 100%"> |
35 | <logic:iterate id="docFile" name="doc" property="repositoryDocumentFiles" type="pt.estgp.estgweb.domain.RepositoryDocumentFile"> |
110 | <logic:iterate id="docFile" name="doc" property="repositoryDocumentFiles" type="pt.estgp.estgweb.domain.RepositoryDocumentFile"> |
36 | <logic:equal value="true" name="docFile" property="visible"> |
111 | <logic:equal value="true" name="docFile" property="visible"> |
37 | <div class="repository-document-file" style="width: 100%"> |
112 | <div class="repository-document-file" style="width: 100%"> |
38 | <% |
113 | <% |