Rev 1153 | Rev 1306 | 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 | |||
18 | <body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" onload="horizontal();" > |
||
19 | |||
20 | <div class="container"> |
||
21 | <h1>Serviço de Histórico do Baco</h1> |
||
22 | <form action="data.jsp"> |
||
23 | |||
24 | Colque aqui o identificador do Ficheiro: <input name="id"><br/> |
||
25 | <input type="submit"> |
||
26 | </form> |
||
27 | |||
28 | <table class="tablesorterfiltered" border="1" style="border:1px solid black"> |
||
29 | <thead> |
||
30 | <tr> |
||
31 | <th>Nome do Ficheiro</th> |
||
32 | <th>Content Type</th> |
||
33 | <th>Descrição</th> |
||
34 | <th>Tamanho Kb</th> |
||
35 | <th>Data</th> |
||
36 | </tr> |
||
37 | </thead> |
||
38 | <tbody> |
||
39 | |||
40 | <% |
||
41 | String id = request.getParameter("id"); |
||
42 | if(id != null) |
||
43 | { |
||
44 | pt.utl.ist.berserk.logic.serviceManager.IServiceManager sm = pt.utl.ist.berserk.logic.serviceManager.ServiceManager.getInstance(); |
||
45 | String[] names = new String[]{}; |
||
46 | Object[] args = new Object[]{id}; |
||
47 | //pt.estgp.estgweb.domain.RepositoryFileImpl view |
||
48 | // = (pt.estgp.estgweb.domain.RepositoryFileImpl) |
||
49 | // sm.execute(pt.estgp.estgweb.web.utils.RequestUtils.getRequester(request, response), "LoadRepositoryFileView", args, names); |
||
50 | jomm.dao.utils.HibernateUtils.getCurrentSession().beginTransaction(); |
||
51 | pt.estgp.estgweb.domain.RepositoryFileImpl view = new pt.estgp.estgweb.services.data.RepositoryService().loadView(id); |
||
52 | if(view != null) |
||
53 | { |
||
54 | java.util.List<pt.estgp.estgweb.domain.RepositoryFileVersion> lista = new java.util.ArrayList<pt.estgp.estgweb.domain.RepositoryFileVersion>(view.getRepositoryFileVersions()); |
||
55 | java.util.Collections.sort(lista,new java.util.Comparator<pt.estgp.estgweb.domain.RepositoryFileVersion>() |
||
56 | { |
||
57 | public int compare(RepositoryFileVersion o1, RepositoryFileVersion o2) { |
||
58 | return (int) (o2.getId() - o1.getId()); |
||
59 | } |
||
60 | }); |
||
61 | for(pt.estgp.estgweb.domain.RepositoryFileVersion version: lista) |
||
62 | { |
||
63 | |||
64 | %> |
||
65 | <tr> |
||
66 | <td><a href="<%=request.getContextPath()%>/repositoryStreamVersion/<%=version.getId()%>"><%=version.getName()%></a></td> |
||
67 | <td><%=version.getContentType()%></td> |
||
68 | <td><%=version.getDescription()%></td> |
||
69 | <td><%=(version.getSize()/1024)%></td> |
||
70 | <td><%=version.getSaveDate()%></td> |
||
71 | |||
72 | </tr> |
||
73 | <% |
||
74 | |||
75 | } |
||
76 | } |
||
77 | jomm.dao.utils.HibernateUtils.getCurrentSession().getTransaction().commit(); |
||
78 | } |
||
79 | %> |
||
80 | </tbody> |
||
81 | </table> |
||
82 | |||
83 | <div id="footer"> |
||
1154 | jmachado | 84 | <jsp:include page="/layout/footer.jsp"/> |
1153 | jmachado | 85 | <!-- Fundo --> |
86 | </div> |
||
87 | |||
88 | </div> |
||
89 | </body> |
||
90 | </html:html> |
||
91 |