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