1 | <!-- Projet Ether - $Id: media_gestion.jsp,v 1.3 2003/10/23 14:08:07 pn Exp $ --> |
---|
2 | <html> |
---|
3 | <META HTTP-EQUIV="Cache-Control" content="no-cache"> |
---|
4 | <META HTTP-EQUIV="Pragma" content="no-cache"> |
---|
5 | <META HTTP-EQUIV="Expires" content="Mon, 01 Jan 1990 12:00:00 GMT"> |
---|
6 | |
---|
7 | <%@ page import="fr.alcatel.ether.tools.*" %> |
---|
8 | <%@ page import="fr.alcatel.ether.app.order.media.*" %> |
---|
9 | <%@ page import="fr.alcatel.ether.app.common.*" %> |
---|
10 | <%@ page import="fr.alcatel.ether.app.user.*"%> |
---|
11 | <%@ page import="org.apache.ecs.html.*" %> |
---|
12 | <%@ page import="java.util.Locale" %> |
---|
13 | <%@ page import="java.util.Collection" %> |
---|
14 | <%@ page import="java.util.Iterator" %> |
---|
15 | |
---|
16 | |
---|
17 | <jsp:useBean scope="request" id="mediaBean" class = "fr.alcatel.ether.bean.HashMapBean"> |
---|
18 | </jsp:useBean> |
---|
19 | |
---|
20 | <head> |
---|
21 | |
---|
22 | <% MultiLanguage ml = MultiLanguage.instance((Locale) JSPUtils.getSessionParameter(request, "langue")); %> |
---|
23 | |
---|
24 | <title>Gestion des services</title> |
---|
25 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
26 | <link rel="stylesheet" href="/ether/ether.css"></head> |
---|
27 | |
---|
28 | <SCRIPT language="JavaScript"> |
---|
29 | |
---|
30 | function help(url) |
---|
31 | { |
---|
32 | newWindow = window.open(url,'Help',' <%=Config.winParam %> '); |
---|
33 | newWindow.focus(); |
---|
34 | } |
---|
35 | |
---|
36 | function proprietes(id) |
---|
37 | { |
---|
38 | newWindow = window.open('/ether/servlet/MediaServlet?<%= Config.ACTION %>=<%= Constants.MEDIA_PROPERTY %>&<%= Constants.INDEX %>=' + id,'propMedia','scrollbars=yes,resizable=yes,width=550,height=400'); |
---|
39 | newWindow.focus(); |
---|
40 | } |
---|
41 | |
---|
42 | function changeValue() |
---|
43 | { |
---|
44 | document.mediaform.action="/ether/servlet/MediaServlet?<%= Config.ACTION %>=<%= Config.MEDIA_LIST%>"; |
---|
45 | document.mediaform.target="_self"; |
---|
46 | document.mediaform.submit(); |
---|
47 | } |
---|
48 | |
---|
49 | function supprimer(id) |
---|
50 | { |
---|
51 | newWindow = window.open('/ether/servlet/MediaServlet?<%= Config.ACTION %>=<%= Constants.MEDIA_DELETE%>&<%= Constants.INDEX %>=' + id,'supMedia','scrollbars=yes,resizable=yes,width=300,height=200'); |
---|
52 | newWindow.focus(); |
---|
53 | } |
---|
54 | |
---|
55 | </SCRIPT> |
---|
56 | |
---|
57 | <body> |
---|
58 | <%Config.getConfig(); |
---|
59 | UserManager userManager = (UserManager)UserManager.instance( UserManager.class.toString() ); |
---|
60 | int userId = -1; |
---|
61 | if ( session.getAttribute(Constants.MEDIA_USER_ID) != null ) |
---|
62 | { |
---|
63 | userId = Integer.parseInt((String) session.getAttribute(Constants.MEDIA_USER_ID)); |
---|
64 | } |
---|
65 | %> |
---|
66 | <p class="titrePage" align="left">Gestion des médias </p> |
---|
67 | <FORM NAME="mediaform" METHOD="POST" ACTION=""> |
---|
68 | <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> |
---|
69 | <tr valign="baseline"> |
---|
70 | <td width="40%"> |
---|
71 | <p class="petit"><b>Utilisateur : </b> |
---|
72 | <select name="<%= Constants.MEDIA_USER_ID %>" size="1" onChange="javascript:changeValue()"> |
---|
73 | <option value="-1">Tous</option> |
---|
74 | <% |
---|
75 | Iterator iteUser = userManager.getUsers().iterator(); |
---|
76 | User tempUser; |
---|
77 | while ( iteUser.hasNext()) |
---|
78 | { |
---|
79 | tempUser = (User) iteUser.next(); |
---|
80 | %><option value=<%=tempUser.getId()%> <% |
---|
81 | if ( tempUser.getId() == userId ){%> SELECTED <%} |
---|
82 | %> ><%=tempUser.getLogin()%></option><% |
---|
83 | }%> |
---|
84 | </select> |
---|
85 | </p> |
---|
86 | </td> |
---|
87 | </tr> |
---|
88 | </table> |
---|
89 | <p class="titrePage" align="left"><b><%= Config.tag_image_ligne %></b></p> |
---|
90 | <br> |
---|
91 | <% |
---|
92 | |
---|
93 | // Creer le tableau des medias |
---|
94 | EtherHTMLTable table = new EtherHTMLTable( mediaBean.size(), 8 ); |
---|
95 | |
---|
96 | table.setAlign( "center" ); |
---|
97 | table.setWidth( "100%" ); |
---|
98 | table.setCellPadding("2"); |
---|
99 | table.setTitles( new String[]{"Nom","Répertoire","Contenu","Etat","Date","Vérrouillé","Propriété","Suppression"}); |
---|
100 | int indexTable = 0; |
---|
101 | |
---|
102 | MediaOrder media ; |
---|
103 | |
---|
104 | Collection col = mediaBean.getElements(); |
---|
105 | Iterator ite = col.iterator(); |
---|
106 | while (ite.hasNext()) |
---|
107 | { |
---|
108 | media = (MediaOrder) ite.next(); |
---|
109 | table.setCellContent( indexTable,0,media.getName() ); |
---|
110 | table.setCellContent( indexTable,1,media.getDirectory()); |
---|
111 | table.setCellContent( indexTable,2,media.getContent()); |
---|
112 | table.setCellContent( indexTable,3,media.getMediaStatus().toString(ml,media.isWaitingPreparation())); |
---|
113 | table.setCellContent( indexTable,4,Config.dateFormatters[1].format(media.getChangeDate())); |
---|
114 | if ( media.isLocked() ) |
---|
115 | { |
---|
116 | table.setCellContent( indexTable,5,"Oui" ); |
---|
117 | } |
---|
118 | else |
---|
119 | { |
---|
120 | table.setCellContent( indexTable,5,"Non" ); |
---|
121 | } |
---|
122 | table.setCellContent( indexTable,6,"<a href=\"javascript:proprietes(" + media.getId() + ");\">" + Config.getIcone( Config.icone_proprietes, "icone_proprietes", ml) + "</a>" ); |
---|
123 | int currentStatus = media.getMediaStatus().getStatus(); |
---|
124 | if ( currentStatus >= MediaStatus.PREPARING ) |
---|
125 | { |
---|
126 | table.setCellContent( indexTable,7,"<a href=\"javascript:supprimer(" + media.getId() + ");\">" + Config.getIcone( Config.icone_supprimer, "icone_supprimer", ml) + "</a>" ); |
---|
127 | } |
---|
128 | else |
---|
129 | { |
---|
130 | table.setCellContent( indexTable,7," " ); |
---|
131 | } |
---|
132 | indexTable++; |
---|
133 | } |
---|
134 | |
---|
135 | out.println( table.generate() ); |
---|
136 | %> |
---|
137 | </form> |
---|
138 | |
---|
139 | <br> |
---|
140 | <p class="petit" align="left"> <b><%= Config.tag_image_ligne %></b></p> |
---|
141 | <br> |
---|
142 | |
---|
143 | <a href=<%= ml.get("commun.adresseHomeAdmin") %> Target="_top"> <%= Config.getIcone( Config.icone_home, "icone_home", ml) %></a> |
---|
144 | |
---|
145 | <a href=mailto:<%= Config.mailAdmin %>><%= Config.getIcone( Config.icone_mail, "icone_mail", ml) %></a> |
---|
146 | |
---|
147 | <a href="javascript:help('<%=ml.get("commun.adresseHelp_Gest_Media")%>')" > |
---|
148 | <%=Config.getIcone(Config.icone_help,"icone_help",ml) %></a> |
---|
149 | |
---|
150 | <br> <span class="petit"><%= ml.get("commun.CopyRight") %> |
---|
151 | |
---|
152 | </p> |
---|
153 | |
---|
154 | </body> |
---|
155 | </html> |
---|