451 |
25 Apr 05 |
nicklas |
1 |
<%-- $Id$ |
451 |
25 Apr 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Gregory Vincic |
451 |
25 Apr 05 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
6 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
7 |
Available at http://base.thep.lu.se/ |
451 |
25 Apr 05 |
nicklas |
8 |
|
451 |
25 Apr 05 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
451 |
25 Apr 05 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
11 |
as published by the Free Software Foundation; either version 3 |
451 |
25 Apr 05 |
nicklas |
12 |
of the License, or (at your option) any later version. |
451 |
25 Apr 05 |
nicklas |
13 |
|
451 |
25 Apr 05 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
451 |
25 Apr 05 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
451 |
25 Apr 05 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
451 |
25 Apr 05 |
nicklas |
17 |
GNU General Public License for more details. |
451 |
25 Apr 05 |
nicklas |
18 |
|
451 |
25 Apr 05 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
451 |
25 Apr 05 |
nicklas |
21 |
------------------------------------------------------------------ |
451 |
25 Apr 05 |
nicklas |
22 |
|
451 |
25 Apr 05 |
nicklas |
23 |
This page lists all news in case they are too many to be shown |
451 |
25 Apr 05 |
nicklas |
24 |
on the fron page. |
451 |
25 Apr 05 |
nicklas |
25 |
|
451 |
25 Apr 05 |
nicklas |
26 |
@author Nicklas |
451 |
25 Apr 05 |
nicklas |
27 |
@version 2.0 |
451 |
25 Apr 05 |
nicklas |
28 |
--%> |
5426 |
24 Sep 10 |
nicklas |
29 |
<%@ page pageEncoding="UTF-8" session="false" |
451 |
25 Apr 05 |
nicklas |
30 |
import="net.sf.basedb.core.SessionControl" |
451 |
25 Apr 05 |
nicklas |
31 |
import="net.sf.basedb.core.DbControl" |
451 |
25 Apr 05 |
nicklas |
32 |
import="net.sf.basedb.core.News" |
1418 |
07 Oct 05 |
nicklas |
33 |
import="net.sf.basedb.core.ItemQuery" |
1418 |
07 Oct 05 |
nicklas |
34 |
import="net.sf.basedb.core.ItemResultList" |
451 |
25 Apr 05 |
nicklas |
35 |
import="net.sf.basedb.core.query.Orders" |
1418 |
07 Oct 05 |
nicklas |
36 |
import="net.sf.basedb.core.query.Hql" |
451 |
25 Apr 05 |
nicklas |
37 |
import="net.sf.basedb.core.query.Expressions" |
451 |
25 Apr 05 |
nicklas |
38 |
import="net.sf.basedb.clients.web.Base" |
451 |
25 Apr 05 |
nicklas |
39 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
40 |
import="net.sf.basedb.util.Values" |
2942 |
22 Nov 06 |
nicklas |
41 |
import="net.sf.basedb.util.formatter.Formatter" |
2942 |
22 Nov 06 |
nicklas |
42 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
5479 |
08 Nov 10 |
nicklas |
43 |
import="net.sf.basedb.clients.web.servlet.RssNewsFeed" |
2942 |
22 Nov 06 |
nicklas |
44 |
import="java.util.Date" |
451 |
25 Apr 05 |
nicklas |
45 |
%> |
451 |
25 Apr 05 |
nicklas |
46 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
451 |
25 Apr 05 |
nicklas |
47 |
<% |
522 |
04 May 05 |
nicklas |
48 |
final SessionControl sc = Base.getSessionControl(pageContext, true); |
522 |
04 May 05 |
nicklas |
49 |
final String ID = sc.getId(); |
7954 |
12 May 21 |
nicklas |
50 |
final DbControl dc = sc.newDbControl(":News"); |
2007 |
16 Feb 06 |
gregory |
51 |
final String root = request.getContextPath()+"/"; |
1418 |
07 Oct 05 |
nicklas |
52 |
ItemResultList<News> news = null; |
5478 |
05 Nov 10 |
nicklas |
53 |
String broadcastTitle = (String)application.getAttribute("broadcast.title"); |
5478 |
05 Nov 10 |
nicklas |
54 |
String broadcastMessage = (String)application.getAttribute("broadcast.message"); |
5478 |
05 Nov 10 |
nicklas |
55 |
boolean denyLogin = Boolean.TRUE.equals(application.getAttribute("broadcast.deny-login")); |
5478 |
05 Nov 10 |
nicklas |
56 |
|
451 |
25 Apr 05 |
nicklas |
57 |
try |
451 |
25 Apr 05 |
nicklas |
58 |
{ |
2942 |
22 Nov 06 |
nicklas |
59 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
451 |
25 Apr 05 |
nicklas |
60 |
%> |
451 |
25 Apr 05 |
nicklas |
61 |
<base:page type="default" title=""> |
6177 |
22 Oct 12 |
nicklas |
62 |
<base:head styles="login.css" /> |
5977 |
20 Feb 12 |
nicklas |
63 |
<base:body style="padding-top: 5em;"> |
2007 |
16 Feb 06 |
gregory |
64 |
|
5977 |
20 Feb 12 |
nicklas |
65 |
<table style="margin: auto; width: 600px;"> |
6177 |
22 Oct 12 |
nicklas |
66 |
<tr><td><base:icon image="goback.png" /><a href="<%=root%>main.jsp?ID=<%=ID%>">Back to login</a></td></tr> |
451 |
25 Apr 05 |
nicklas |
67 |
<tr> |
451 |
25 Apr 05 |
nicklas |
68 |
<td> |
5977 |
20 Feb 12 |
nicklas |
69 |
<h3 style="margin-top: 1em;">News and announcements |
5479 |
08 Nov 10 |
nicklas |
70 |
<% |
5479 |
08 Nov 10 |
nicklas |
71 |
if (RssNewsFeed.isEnabled()) |
5479 |
08 Nov 10 |
nicklas |
72 |
{ |
5977 |
20 Feb 12 |
nicklas |
73 |
%> |
5977 |
20 Feb 12 |
nicklas |
74 |
<a href="info/news.rss" |
5479 |
08 Nov 10 |
nicklas |
75 |
title="Subscribe to news from this BASE server" |
5977 |
20 Feb 12 |
nicklas |
76 |
><base:icon image="rss.png" style="float: right; margin-top: 1px;"/></a> |
5479 |
08 Nov 10 |
nicklas |
77 |
<% |
5479 |
08 Nov 10 |
nicklas |
78 |
} |
5479 |
08 Nov 10 |
nicklas |
79 |
%> |
5479 |
08 Nov 10 |
nicklas |
80 |
</h3> |
460 |
26 Apr 05 |
nicklas |
81 |
<div id="news" class="news"> |
451 |
25 Apr 05 |
nicklas |
82 |
<% |
5478 |
05 Nov 10 |
nicklas |
83 |
if (broadcastTitle != null) |
5478 |
05 Nov 10 |
nicklas |
84 |
{ |
5478 |
05 Nov 10 |
nicklas |
85 |
%> |
7394 |
09 Jun 17 |
nicklas |
86 |
<div class="item note sticky"> |
5977 |
20 Feb 12 |
nicklas |
87 |
<div class="headline"> |
5977 |
20 Feb 12 |
nicklas |
88 |
<a name="broadcast"></a> |
5977 |
20 Feb 12 |
nicklas |
89 |
<span class="date"><%=dateFormatter.format(new Date())%></span> |
5977 |
20 Feb 12 |
nicklas |
90 |
<%=HTML.encodeTags(broadcastTitle)%><%=denyLogin ? " (login disabled)" : "" %> |
5977 |
20 Feb 12 |
nicklas |
91 |
</div> |
5977 |
20 Feb 12 |
nicklas |
92 |
<div class="text"><%=HTML.niceFormat(broadcastMessage)%></div> |
5478 |
05 Nov 10 |
nicklas |
93 |
</div> |
5478 |
05 Nov 10 |
nicklas |
94 |
<% |
5478 |
05 Nov 10 |
nicklas |
95 |
} |
1418 |
07 Oct 05 |
nicklas |
96 |
ItemQuery<News> query = News.getQuery(); |
7394 |
09 Jun 17 |
nicklas |
97 |
query.order(Orders.desc(Hql.property("sticky"))); |
1418 |
07 Oct 05 |
nicklas |
98 |
query.order(Orders.desc(Hql.property("newsDate"))); |
4576 |
13 Oct 08 |
nicklas |
99 |
query.order(Orders.desc(Hql.property("id"))); |
959 |
19 Jul 05 |
nicklas |
100 |
query.setCacheResult(true); |
1418 |
07 Oct 05 |
nicklas |
101 |
news = query.list(dc); |
959 |
19 Jul 05 |
nicklas |
102 |
for (News n : news) |
451 |
25 Apr 05 |
nicklas |
103 |
{ |
451 |
25 Apr 05 |
nicklas |
104 |
%> |
7394 |
09 Jun 17 |
nicklas |
105 |
<div class="item <%=n.isSticky() ? "note sticky" : ""%>"> |
5977 |
20 Feb 12 |
nicklas |
106 |
<div class="headline"> |
5977 |
20 Feb 12 |
nicklas |
107 |
<a name="<%=n.getId() + "-" + n.getVersion()%>"></a> |
5977 |
20 Feb 12 |
nicklas |
108 |
<span class="date"><%=dateFormatter.format(n.getNewsDate())%></span> |
5977 |
20 Feb 12 |
nicklas |
109 |
<%=HTML.encodeTags(n.getName())%> |
5977 |
20 Feb 12 |
nicklas |
110 |
</div> |
5977 |
20 Feb 12 |
nicklas |
111 |
<div class="text"><%=Values.getString(n.getDescription())%></div> |
451 |
25 Apr 05 |
nicklas |
112 |
</div> |
451 |
25 Apr 05 |
nicklas |
113 |
<% |
451 |
25 Apr 05 |
nicklas |
114 |
} |
451 |
25 Apr 05 |
nicklas |
115 |
%> |
451 |
25 Apr 05 |
nicklas |
116 |
</div> |
451 |
25 Apr 05 |
nicklas |
117 |
</td> |
451 |
25 Apr 05 |
nicklas |
118 |
</tr> |
6177 |
22 Oct 12 |
nicklas |
119 |
<tr><td><base:icon image="goback.png" /><a href="<%=root%>main.jsp?ID=<%=ID%>">Back to login</a></td></tr> |
451 |
25 Apr 05 |
nicklas |
120 |
</table> |
451 |
25 Apr 05 |
nicklas |
121 |
</base:body> |
451 |
25 Apr 05 |
nicklas |
122 |
</base:page> |
451 |
25 Apr 05 |
nicklas |
123 |
<% |
451 |
25 Apr 05 |
nicklas |
124 |
} |
451 |
25 Apr 05 |
nicklas |
125 |
finally |
451 |
25 Apr 05 |
nicklas |
126 |
{ |
451 |
25 Apr 05 |
nicklas |
127 |
if (dc != null) dc.close(); |
451 |
25 Apr 05 |
nicklas |
128 |
} |
451 |
25 Apr 05 |
nicklas |
129 |
%> |
451 |
25 Apr 05 |
nicklas |
130 |
|