Rev 1766 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1713 | jmachado | 1 | <%@ page import="jomm.utils.MessageResources" %> |
1814 | jmachado | 2 | <%@ page import="pt.estgp.estgweb.domain.typesgen.repositorydocuments.DocumentPerson" %> |
3 | <%@ page import="pt.estgp.estgweb.domain.typesgen.repositorydocuments.DocumentPersons" %> |
||
1713 | jmachado | 4 | <%@ page import="java.io.PrintWriter" %> |
1714 | jmachado | 5 | |
6 | <%@ page import="static org.hibernate.criterion.Restrictions.eq" %> |
||
7 | <%@ page import="static org.hibernate.criterion.Restrictions.or" %> |
||
1814 | jmachado | 8 | <%@ page import="pt.estgp.estgweb.domain.typesgen.repositorydocuments.InterfaceBlock" %> |
1703 | jmachado | 9 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
10 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
12 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
13 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
1714 | jmachado | 14 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
1703 | jmachado | 15 | <%@ taglib tagdir="/WEB-INF/tags" prefix="bacoTags" %> |
16 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
||
1713 | jmachado | 17 | |
18 | <%! |
||
19 | private String printMetadata(String key,String value,HttpServletRequest request,PrintWriter out) |
||
20 | { |
||
21 | if(value != null && value.trim().length() > 0) |
||
22 | { |
||
23 | String msg = MessageResources.getMessage(request,key); |
||
1762 | jmachado | 24 | return " <tr style=\"border: 1px dashed lightgray\">\n" + |
25 | " <td style=\"padding:5px;text-align:right; width: 1%; white-space: nowrap;\">\n" + |
||
1713 | jmachado | 26 | " <span class=\"glyphicon glyphicon-tag\"></span>\n" + |
27 | " <span class=\"label label-primary\">" + msg + "</span>\n" + |
||
1762 | jmachado | 28 | " </td>\n" + |
29 | " <td style=\"padding:5px\">\n" + |
||
1713 | jmachado | 30 | " <i>" + value + "</i>\n" + |
1762 | jmachado | 31 | " </td>\n" + |
32 | " </tr>"; |
||
1713 | jmachado | 33 | } |
34 | return ""; |
||
35 | } |
||
36 | |||
37 | private String printMetadataPersons(String key,DocumentPersons persons,HttpServletRequest request,PrintWriter out) |
||
38 | { |
||
39 | StringBuilder str = new StringBuilder(); |
||
40 | if(persons != null && persons.getPersons()!= null && persons.getPersons().size() > 0) |
||
41 | { |
||
42 | for(DocumentPerson p: persons.getPersons()) |
||
43 | { |
||
44 | str.append(printMetadata(key,p.getFirstNames() + " " + p.getLastName(),request,out)); |
||
45 | } |
||
46 | } |
||
47 | return str.toString(); |
||
48 | } |
||
49 | %> |
||
50 | |||
51 | |||
52 | |||
1814 | jmachado | 53 | <jsp:useBean id="interfaceBlock" scope="request" type="pt.estgp.estgweb.domain.typesgen.repositorydocuments.InterfaceBlock"/> |
1703 | jmachado | 54 | <nested:iterate id="doc" name="documents" type="pt.estgp.estgweb.domain.RepositoryDocumentImpl"> |
55 | |||
56 | <div class="repository-document"> |
||
1713 | jmachado | 57 | <div class="repository-intro"> |
58 | <div class="repository-title clearfix" style="padding-bottom: 4px;padding-top: 4px"> |
||
59 | <span class="glyphicon glyphicon-file btn-xs"></span> |
||
60 | <span class="title">${doc.title}</span> |
||
1758 | jmachado | 61 | <baco:hasRole role="admin,all,repositoryDocs,repositoryDeposit"> |
1760 | jmachado | 62 | <html:link styleClass="btn btn-warning pull-right" action="/user/repositoryEditDocument?repositoryDocumentId=${doc.id}" target="_blank"> |
1714 | jmachado | 63 | <span class="glyphicon glyphicon-pencil"></span> |
64 | </html:link> |
||
65 | </baco:hasRole> |
||
1713 | jmachado | 66 | <span class="badge pull-right"> |
1717 | jmachado | 67 | <%=interfaceBlock.getDatesFormat().getDateStrFormatted(doc.getPublishDate())%> |
1713 | jmachado | 68 | </span> |
69 | </div> |
||
70 | <%--<div class="repository-description">${doc.description}</div>--%> |
||
71 | <nested:equal value="true" name="interfaceBlock" property="showDocumentMetaData"> |
||
1762 | jmachado | 72 | |
1713 | jmachado | 73 | <%String subTitle = printMetadata("document.repository.metadata.subTitle",doc.getSubtitle(),request,response.getWriter());%> |
74 | <%String internalIdentifier = printMetadata("document.repository.metadata.internalIdentifier",doc.getInternalIdentifier(),request,response.getWriter());%> |
||
75 | <%String closeDateStr = printMetadata("document.repository.metadata.closeDateStr",doc.getCloseDateStr(),request,response.getWriter());%> |
||
76 | <%String author = printMetadataPersons("document.repository.metadata.author", doc.getAuthorsJson(), request, response.getWriter());%> |
||
1762 | jmachado | 77 | <%String contributor = printMetadataPersons("document.repository.metadata.contributor",doc.getContributorsJson(),request,response.getWriter());%> |
1713 | jmachado | 78 | <%String publisher = printMetadata("document.repository.metadata.publisher", doc.getPublisher(), request, response.getWriter());%> |
79 | <%String description = printMetadata("document.repository.metadata.description", doc.getDescription(), request, response.getWriter());%> |
||
1766 | jmachado | 80 | <%String subject = printMetadata("document.repository.metadata.subject", doc.getSubject(), request, response.getWriter());%> |
1713 | jmachado | 81 | <% |
82 | if(subTitle.length() > 0 || |
||
83 | internalIdentifier.length() > 0 || |
||
84 | //publishDateStr.length() > 0 || |
||
85 | description.length() > 0 || |
||
1766 | jmachado | 86 | subject.length() > 0 || |
1713 | jmachado | 87 | closeDateStr.length() > 0 || |
88 | author.length() > 0 || |
||
89 | contributor.length() > 0 || |
||
90 | publisher.length() > 0) |
||
91 | { |
||
92 | %> |
||
93 | <div class="repository-metadata clearfix"> |
||
1762 | jmachado | 94 | <table border="0" style="border: 0;width: 100%"> |
95 | <tbody> |
||
1766 | jmachado | 96 | <%=subTitle%> |
97 | <%=subject%> |
||
1762 | jmachado | 98 | <%=description%> |
99 | <%=internalIdentifier%> |
||
100 | <%=closeDateStr%> |
||
101 | <%=author%> |
||
102 | <%=contributor%> |
||
103 | <%=publisher%> |
||
104 | </tbody> |
||
105 | </table> |
||
106 | |||
1713 | jmachado | 107 | </div> |
108 | <% |
||
109 | } |
||
110 | %> |
||
111 | </nested:equal> |
||
1703 | jmachado | 112 | </div> |
113 | <div class=" repository-document-files" style="width: 100%"> |
||
114 | <logic:iterate id="docFile" name="doc" property="repositoryDocumentFiles" type="pt.estgp.estgweb.domain.RepositoryDocumentFile"> |
||
115 | <logic:equal value="true" name="docFile" property="visible"> |
||
116 | <div class="repository-document-file" style="width: 100%"> |
||
117 | <% |
||
118 | String repoTitleBorderBottom = ""; |
||
119 | %> |
||
120 | <nested:equal value="false" name="interfaceBlock" property="showFileDescription"> |
||
121 | <% |
||
122 | repoTitleBorderBottom = "border-radius-bottom"; |
||
123 | %> |
||
124 | </nested:equal> |
||
125 | <nested:empty name="docFile" property="description"> |
||
126 | <% |
||
127 | repoTitleBorderBottom = "border-radius-bottom"; |
||
128 | %> |
||
129 | </nested:empty> |
||
130 | <% |
||
131 | request.setAttribute("repoTitleBorderBottom",repoTitleBorderBottom); |
||
132 | %> |
||
133 | <div class="repository-title ${repoTitleBorderBottom}"> |
||
1757 | jmachado | 134 | <baco:hasRole role="admin,all,repositoryDocs,repositoryDeposit"> |
1723 | jmachado | 135 | <nested:equal value="true" name="interfaceBlock" property="showFileTitle"> |
136 | <%--label="${docFile.repositoryFileProxy.repositoryFile.lastVersion.name}--%> |
||
1765 | jmachado | 137 | <bacoTags:repositoryFile target="_blank" transactional="true" showHistory="true" iconClasses="pull-left repository-file-icon" repositoryStream="${docFile.repositoryFileProxy.repositoryStream}" label="${docFile.title}"/> |
1723 | jmachado | 138 | </nested:equal> |
139 | <nested:notEqual value="true" name="interfaceBlock" property="showFileTitle"> |
||
1765 | jmachado | 140 | <bacoTags:repositoryFile target="_blank" transactional="true" showHistory="true" iconClasses="pull-left repository-file-icon" repositoryStream="${docFile.repositoryFileProxy.repositoryStream}"/> |
1723 | jmachado | 141 | </nested:notEqual> |
142 | </baco:hasRole> |
||
1757 | jmachado | 143 | <baco:hasNotRole role="admin,all,repositoryDocs,repositoryDeposit"> |
1723 | jmachado | 144 | <nested:equal value="true" name="interfaceBlock" property="showFileTitle"> |
145 | <%--label="${docFile.repositoryFileProxy.repositoryFile.lastVersion.name}--%> |
||
1765 | jmachado | 146 | <bacoTags:repositoryFile target="_blank" transactional="true" showHistory="false" iconClasses="pull-left repository-file-icon" repositoryStream="${docFile.repositoryFileProxy.repositoryStream}" label="${docFile.title}"/> |
1723 | jmachado | 147 | </nested:equal> |
148 | <nested:notEqual value="true" name="interfaceBlock" property="showFileTitle"> |
||
1765 | jmachado | 149 | <bacoTags:repositoryFile target="_blank" transactional="true" showHistory="false" iconClasses="pull-left repository-file-icon" repositoryStream="${docFile.repositoryFileProxy.repositoryStream}"/> |
1723 | jmachado | 150 | </nested:notEqual> |
151 | </baco:hasNotRole> |
||
152 | |||
1703 | jmachado | 153 | </div> |
154 | |||
155 | |||
156 | <nested:equal value="true" name="interfaceBlock" property="showFileDescription"> |
||
157 | <nested:notEmpty name="docFile" property="description"> |
||
158 | <div class="repository-description"> |
||
159 | ${docFile.description} |
||
160 | </div> |
||
161 | </nested:notEmpty> |
||
162 | </nested:equal> |
||
163 | |||
164 | </div> |
||
165 | </logic:equal> |
||
166 | </logic:iterate> |
||
167 | </div> |
||
168 | </div> |
||
169 | |||
170 | </nested:iterate> |