Rev 1310 | Rev 1814 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1310 | Rev 1312 | ||
---|---|---|---|
Line 13... | Line 13... | ||
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 class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" onload="horizontal();" > |
- | |
- | 18 | <body> |
|
19 | 19 | ||
20 | <div class="container"> |
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 | 21 | ||
- | 22 | <div class="panel panel-primary"> |
|
- | 23 | <div class="panel-heading"> |
|
- | 24 | <bean:message key="data.history.title"/> |
|
83 | <div id="footer"> |
25 | </div> |
84 | <jsp:include page="/layout/footer.jsp"/> |
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> |
|
- | 53 | ||
- | 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); |
|
- | 78 | ||
- | 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> |
|
- | 86 | ||
- | 87 | </tr> |
|
- | 88 | <% |
|
- | 89 | ||
- | 90 | } |
|
- | 91 | } |
|
- | 92 | jomm.dao.utils.HibernateUtils.getCurrentSession().getTransaction().commit(); |
|
- | 93 | } |
|
- | 94 | %> |
|
- | 95 | </tbody> |
|
- | 96 | </table> |
|
- | 97 | </div> |
|
- | 98 | </div> |
|
85 | <!-- Fundo --> |
99 | </div> |
86 | </div> |
100 | </div> |
87 | 101 | ||
88 | </div> |
102 | </div> |
- | 103 | <jsp:include page="/layout/footer.jsp"/> |
|
89 | </body> |
104 | </body> |
90 | </html:html> |
105 | </html:html> |
91 | 106 |