[vlma-devel] commit: Add a view of filechannel programing states on the home page. ( Adrien Maglo )
git version control
git at videolan.org
Thu Apr 17 15:38:55 CEST 2008
vlma | branch: master | Adrien Maglo <magsoft at videolan.org> | Sun Apr 13 15:19:31 2008 +0200| [f47f9ac2809b5b50909a0fc71eb9fc2bbba8e81e]
Add a view of filechannel programing states on the home page.
Problems with CRLF ...
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=f47f9ac2809b5b50909a0fc71eb9fc2bbba8e81e
---
.../vlma/web/welcome/WelcomeFormController.java | 52 +++++++++++--------
.../webapp/WEB-INF/jsp/welcome/welcome_right.jsp | 43 ++++++++++++++++
2 files changed, 73 insertions(+), 22 deletions(-)
diff --git a/web/src/main/java/org/videolan/vlma/web/welcome/WelcomeFormController.java b/web/src/main/java/org/videolan/vlma/web/welcome/WelcomeFormController.java
index 8d31346..b3a84db 100644
--- a/web/src/main/java/org/videolan/vlma/web/welcome/WelcomeFormController.java
+++ b/web/src/main/java/org/videolan/vlma/web/welcome/WelcomeFormController.java
@@ -33,32 +33,40 @@ import org.springframework.web.servlet.mvc.Controller;
import org.videolan.vlma.common.IVlData;
import org.videolan.vlma.common.medias.IVlMedia;
import org.videolan.vlma.common.medias.VlTNTChannel;
+import org.videolan.vlma.common.medias.VlFilesChannel;
import org.videolan.vlma.common.medias.VlSatChannel;
public class WelcomeFormController implements Controller {
- public ModelAndView handleRequest(HttpServletRequest arg0,
- HttpServletResponse arg1) throws Exception {
- Map<String, Object> params = new HashMap<String, Object>();
- List<VlSatChannel> channelsSat = new ArrayList<VlSatChannel>();
- List<VlTNTChannel> channelsTNT = new ArrayList<VlTNTChannel>();
- for (IVlMedia media : data.getMedias())
- if (media.getProgram() != null)
- if (media.getClass().equals(VlSatChannel.class))
- {
- VlSatChannel channel = (VlSatChannel) media;
- channelsSat.add(channel);
- }
- else if (media.getClass().equals(VlTNTChannel.class))
- {
- VlTNTChannel channel = (VlTNTChannel) media;
- channelsTNT.add(channel);
- }
- params.put("channelsSat", channelsSat);
- params.put("channelsTNT", channelsTNT);
- params.put("servers", data.getServers());
- return new ModelAndView("welcome/welcome", params);
- }
+ public ModelAndView handleRequest(HttpServletRequest arg0,
+ HttpServletResponse arg1) throws Exception {
+ Map<String, Object> params = new HashMap<String, Object>();
+ List<VlSatChannel> channelsSat = new ArrayList<VlSatChannel>();
+ List<VlTNTChannel> channelsTNT = new ArrayList<VlTNTChannel>();
+ List<VlFilesChannel> fileChannels = new ArrayList<VlFilesChannel>();
+ for (IVlMedia media : data.getMedias())
+ if (media.getProgram() != null)
+ if (media.getClass().equals(VlSatChannel.class))
+ {
+ VlSatChannel channel = (VlSatChannel) media;
+ channelsSat.add(channel);
+ }
+ else if (media.getClass().equals(VlTNTChannel.class))
+ {
+ VlTNTChannel channel = (VlTNTChannel) media;
+ channelsTNT.add(channel);
+ }
+ else if (media.getClass().equals(VlFilesChannel.class))
+ {
+ VlFilesChannel channel = (VlFilesChannel) media;
+ fileChannels.add(channel);
+ }
+ params.put("channelsSat", channelsSat);
+ params.put("channelsTNT", channelsTNT);
+ params.put("fileChannels", fileChannels);
+ params.put("servers", data.getServers());
+ return new ModelAndView("welcome/welcome", params);
+ }
private IVlData data;
diff --git a/web/src/main/webapp/WEB-INF/jsp/welcome/welcome_right.jsp b/web/src/main/webapp/WEB-INF/jsp/welcome/welcome_right.jsp
index c002185..8262840 100644
--- a/web/src/main/webapp/WEB-INF/jsp/welcome/welcome_right.jsp
+++ b/web/src/main/webapp/WEB-INF/jsp/welcome/welcome_right.jsp
@@ -124,3 +124,46 @@
</c:forEach>
</table>
+<h3><fmt:message key="files.list" /></h3>
+
+<table>
+ <c:forEach items="${fileChannels}" var="fileChannel">
+ <tr>
+ <td>
+ <strong>
+ <a name="<c:out value="${fileChannel.id}" />">
+ <c:out value="${fileChannel.name}" />
+ </a>
+ </strong>
+ </td>
+ <c:choose><c:when test="${fileChannel.program == null}">
+ <td><fmt:message key="medias.list.status.non-programmed" /></td></c:when>
+ <c:otherwise><td>
+ <c:choose>
+ <c:when test="${fileChannel.program.player == null}">
+ <fmt:message key="welcome.program.nonrunning">
+ <fmt:param value="${fileChannel.program.priority}" />
+ </fmt:message>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="${fileChannel.program.broadcastState}">
+ <fmt:message key="welcome.program.running">
+ <fmt:param value="${fileChannel.program.priority}" />
+ <fmt:param value="${fileChannel.program.playerHostName}" />
+ </fmt:message>
+ </c:when>
+ <c:otherwise>
+ <fmt:message key="welcome.program.assigned">
+ <fmt:param value="${fileChannel.program.priority}" />
+ <fmt:param value="${fileChannel.program.playerHostName}" />
+ </fmt:message>
+ </c:otherwise>
+ </c:choose>
+ </c:otherwise>
+ </c:choose></td>
+ </c:otherwise>
+ </c:choose>
+ </tr>
+ </c:forEach>
+</table>
More information about the vlma-devel
mailing list