[vlma-devel] commit: Add stream channels to the welcome page. (Adrien Grand )
git version control
git at videolan.org
Thu May 29 14:08:43 CEST 2008
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Thu May 29 14:10:05 2008 +0200| [6410dac21fde2a8a1c77a3c66611b9a4a11b52a0]
Add stream channels to the welcome page.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=6410dac21fde2a8a1c77a3c66611b9a4a11b52a0
---
.../vlma/web/welcome/WelcomeController.java | 26 ++++++-----
.../webapp/WEB-INF/jsp/welcome/welcome_right.jsp | 48 +++++++++++++++++++-
2 files changed, 60 insertions(+), 14 deletions(-)
diff --git a/vlma-webapp/src/main/java/org/videolan/vlma/web/welcome/WelcomeController.java b/vlma-webapp/src/main/java/org/videolan/vlma/web/welcome/WelcomeController.java
index cffa8a6..c387f0e 100644
--- a/vlma-webapp/src/main/java/org/videolan/vlma/web/welcome/WelcomeController.java
+++ b/vlma-webapp/src/main/java/org/videolan/vlma/web/welcome/WelcomeController.java
@@ -32,36 +32,38 @@ import org.videolan.vlma.Data;
import org.videolan.vlma.model.media.FilesChannel;
import org.videolan.vlma.model.media.Media;
import org.videolan.vlma.model.media.SatChannel;
+import org.videolan.vlma.model.media.StreamChannel;
import org.videolan.vlma.model.media.TNTChannel;
public class WelcomeController implements Controller {
public ModelAndView handleRequest(HttpServletRequest arg0,
HttpServletResponse arg1) throws Exception {
- List<SatChannel> channelsSat = new ArrayList<SatChannel>();
- List<TNTChannel> channelsTNT = new ArrayList<TNTChannel>();
+ List<SatChannel> satChannels = new ArrayList<SatChannel>();
+ List<TNTChannel> tNTChannels = new ArrayList<TNTChannel>();
List<FilesChannel> fileChannels = new ArrayList<FilesChannel>();
+ List<StreamChannel> streamChannels = new ArrayList<StreamChannel>();
for (Media media : data.getMedias())
if (media.getProgram() != null)
if (media.getClass().equals(SatChannel.class))
{
SatChannel channel = (SatChannel) media;
- channelsSat.add(channel);
- }
- else if (media.getClass().equals(TNTChannel.class))
- {
+ satChannels.add(channel);
+ } else if (media.getClass().equals(TNTChannel.class)) {
TNTChannel channel = (TNTChannel) media;
- channelsTNT.add(channel);
- }
- else if (media.getClass().equals(FilesChannel.class))
- {
+ tNTChannels.add(channel);
+ } else if (media.getClass().equals(FilesChannel.class)) {
FilesChannel channel = (FilesChannel) media;
fileChannels.add(channel);
+ } else if (media.getClass().equals(StreamChannel.class)) {
+ StreamChannel channel = (StreamChannel) media;
+ streamChannels.add(channel);
}
ModelAndView mav = new ModelAndView();
- mav.addObject("channelsSat", channelsSat);
- mav.addObject("channelsTNT", channelsTNT);
+ mav.addObject("satChannels", satChannels);
+ mav.addObject("tNTChannels", tNTChannels);
mav.addObject("fileChannels", fileChannels);
+ mav.addObject("streamChannels", streamChannels);
mav.addObject("servers", data.getServers());
return mav;
}
diff --git a/vlma-webapp/src/main/webapp/WEB-INF/jsp/welcome/welcome_right.jsp b/vlma-webapp/src/main/webapp/WEB-INF/jsp/welcome/welcome_right.jsp
index 6147209..61de0d9 100644
--- a/vlma-webapp/src/main/webapp/WEB-INF/jsp/welcome/welcome_right.jsp
+++ b/vlma-webapp/src/main/webapp/WEB-INF/jsp/welcome/welcome_right.jsp
@@ -37,7 +37,7 @@
<h3><fmt:message key="medias.listTNT" /></h3>
<table>
- <c:forEach items="${channelsTNT}" var="channelTNT">
+ <c:forEach items="${tNTChannels}" var="channelTNT">
<tr>
<td>
<strong>
@@ -81,7 +81,7 @@
<h3><fmt:message key="medias.fulllistSat" /></h3>
<table>
- <c:forEach items="${channelsSat}" var="channelSat">
+ <c:forEach items="${satChannels}" var="channelSat">
<tr>
<td>
<strong>
@@ -167,3 +167,47 @@
</tr>
</c:forEach>
</table>
+
+<h3><fmt:message key="streams.list" /></h3>
+
+<table>
+ <c:forEach items="${streamChannels}" var="streamChannel">
+ <tr>
+ <td>
+ <strong>
+ <a name="<c:out value="${streamChannel.id}" />">
+ <c:out value="${streamChannel.name}" />
+ </a>
+ </strong>
+ </td>
+ <c:choose><c:when test="${streamChannel.program == null}">
+ <td><fmt:message key="medias.list.status.non-programmed" /></td></c:when>
+ <c:otherwise><td>
+ <c:choose>
+ <c:when test="${streamChannel.program.player == null}">
+ <fmt:message key="welcome.program.nonrunning">
+ <fmt:param value="${streamChannel.program.priority}" />
+ </fmt:message>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="${streamChannel.program.broadcastState}">
+ <fmt:message key="welcome.program.running">
+ <fmt:param value="${streamChannel.program.priority}" />
+ <fmt:param value="${streamChannel.program.playerHostName}" />
+ </fmt:message>
+ </c:when>
+ <c:otherwise>
+ <fmt:message key="welcome.program.assigned">
+ <fmt:param value="${streamChannel.program.priority}" />
+ <fmt:param value="${streamChannel.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