Rev 1310 | Rev 1814 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1153 | jmachado | 1 | <%@page contentType="text/html"%> |
2 | <%@page pageEncoding="UTF-8"%> |
||
3 | <%@ page import="pt.estgp.estgweb.domain.RepositoryFileVersion" %> |
||
4 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
5 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
6 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
7 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
8 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
9 | <%@ page import="pt.estgp.estgweb.Globals" %> |
||
10 | |||
11 | <html:html locale="true"> |
||
12 | <head> |
||
13 | <title>Histórico de Ficheiros</title> |
||
14 | <jsp:include page="/layout/scripts.jsp"/> |
||
15 | </head> |
||
16 | |||
17 | |||
1312 | jmachado | 18 | <body> |
1153 | jmachado | 19 | |
1312 | jmachado | 20 | <div class="container"> |
1153 | jmachado | 21 | |
1312 | jmachado | 22 | <div class="panel panel-primary"> |
23 | <div class="panel-heading"> |
||
24 | <bean:message key="data.history.title"/> |
||
25 | </div> |
||
26 | <div class="panel-body" id="contentBody"> |
||
27 | <div class="panel panel-default"> |
||
28 | <div class="panel-body" id="contentForm"> |
||
29 | <form class="form-horizontal" action="data.jsp"> |
||
30 | <div class="form-group"> |
||
31 | <label class="control-label col-sm-4" for="id"><bean:message key="data.history.form.input"/></label> |
||
32 | <div class="col-sm-6"> |
||
33 | <input type="text" id="id" class="form-control"/> |
||
34 | </div> |
||
35 | </div> |
||
36 | <input type="button" class="btn btn-default" onclick="submitDataVersionForm()" value="<bean:message key="submit"/>"/> |
||
37 | </form> |
||
38 | </div> |
||
39 | </div> |
||
40 | <div class="panel panel-default"> |
||
41 | <div class="panel-body" id="contentVersions"> |
||
42 | <table class="tablesorterfiltered" border="1" style="border:1px solid black"> |
||
43 | <thead> |
||
44 | <tr> |
||
45 | <th>Nome do Ficheiro</th> |
||
46 | <th>Content Type</th> |
||
47 | <th>Descrição</th> |
||
48 | <th>Tamanho Kb</th> |
||
49 | <th>Data</th> |
||
50 | </tr> |
||
51 | </thead> |
||
52 | <tbody> |
||
1153 | jmachado | 53 | |
1312 | jmachado | 54 | <% |
55 | String id = request.getParameter("id"); |
||
56 | if(id != null) |
||
57 | { |
||
58 | pt.utl.ist.berserk.logic.serviceManager.IServiceManager sm = pt.utl.ist.berserk.logic.serviceManager.ServiceManager.getInstance(); |
||
59 | String[] names = new String[]{}; |
||
60 | Object[] args = new Object[]{id}; |
||
61 | //pt.estgp.estgweb.domain.RepositoryFileImpl view |
||
62 | // = (pt.estgp.estgweb.domain.RepositoryFileImpl) |
||
63 | // sm.execute(pt.estgp.estgweb.web.utils.RequestUtils.getRequester(request, response), "LoadRepositoryFileView", args, names); |
||
64 | jomm.dao.utils.HibernateUtils.getCurrentSession().beginTransaction(); |
||
65 | pt.estgp.estgweb.domain.RepositoryFileImpl view = new pt.estgp.estgweb.services.data.RepositoryService().loadView(id); |
||
66 | if(view != null) |
||
67 | { |
||
68 | java.util.List<pt.estgp.estgweb.domain.RepositoryFileVersion> lista = new java.util.ArrayList<pt.estgp.estgweb.domain.RepositoryFileVersion>(view.getRepositoryFileVersions()); |
||
69 | java.util.Collections.sort(lista,new java.util.Comparator<pt.estgp.estgweb.domain.RepositoryFileVersion>() |
||
70 | { |
||
71 | public int compare(RepositoryFileVersion o1, RepositoryFileVersion o2) { |
||
72 | return (int) (o2.getId() - o1.getId()); |
||
73 | } |
||
74 | }); |
||
75 | for(pt.estgp.estgweb.domain.RepositoryFileVersion version: lista) |
||
76 | { |
||
77 | request.setAttribute("version",version); |
||
1153 | jmachado | 78 | |
1312 | jmachado | 79 | %> |
80 | <tr> |
||
81 | <td><a href="<%=request.getContextPath()%>/repositoryStreamVersion/<%=version.getId()%>"><%=version.getName()%></a></td> |
||
82 | <td><%=version.getContentType()%></td> |
||
83 | <td><%=version.getDescription()%></td> |
||
84 | <td><%=(version.getSize()/1024)%></td> |
||
85 | <td style="white-space: nowrap">${version.saveDateFormated}</td> |
||
1153 | jmachado | 86 | |
1312 | jmachado | 87 | </tr> |
88 | <% |
||
1153 | jmachado | 89 | |
1312 | jmachado | 90 | } |
91 | } |
||
92 | jomm.dao.utils.HibernateUtils.getCurrentSession().getTransaction().commit(); |
||
93 | } |
||
94 | %> |
||
95 | </tbody> |
||
96 | </table> |
||
97 | </div> |
||
98 | </div> |
||
99 | </div> |
||
100 | </div> |
||
1153 | jmachado | 101 | |
1312 | jmachado | 102 | </div> |
1154 | jmachado | 103 | <jsp:include page="/layout/footer.jsp"/> |
1153 | jmachado | 104 | </body> |
105 | </html:html> |
||
106 |