[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui ...
Christian Bauer
christian at hibernate.org
Thu Jan 10 03:37:46 EST 2008
User: cbauer
Date: 08/01/10 03:37:46
Modified: examples/wiki/src/main/org/jboss/seam/wiki/core/ui
FileServlet.java Converters.java FeedServlet.java
Log:
Better getInstance() calls
Revision Changes Path
1.13 +1 -1 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FileServlet.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FileServlet.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FileServlet.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- FileServlet.java 19 Dec 2007 04:29:22 -0000 1.12
+++ FileServlet.java 10 Jan 2008 08:37:46 -0000 1.13
@@ -62,7 +62,7 @@
userTx.begin();
}
- WikiNodeDAO wikiNodeDAO = (WikiNodeDAO)org.jboss.seam.Component.getInstance("wikiNodeDAO");
+ WikiNodeDAO wikiNodeDAO = (WikiNodeDAO)org.jboss.seam.Component.getInstance(WikiNodeDAO.class);
file = wikiNodeDAO.findWikiUpload(Long.parseLong(id));
if (startedTx) userTx.commit();
1.15 +1 -1 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/Converters.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Converters.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/Converters.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- Converters.java 30 Dec 2007 02:33:26 -0000 1.14
+++ Converters.java 10 Jan 2008 08:37:46 -0000 1.15
@@ -62,7 +62,7 @@
UIComponent arg1,
String arg2) throws ConverterException {
if (arg2 == null) return null;
- SearchRegistry searchRegistry = (SearchRegistry)Component.getInstance("searchRegistry");
+ SearchRegistry searchRegistry = (SearchRegistry)Component.getInstance(SearchRegistry.class);
return searchRegistry.getSearchableEntitiesByName().get(arg2);
}
1.17 +6 -6 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FeedServlet.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- FeedServlet.java 9 Jan 2008 21:04:18 -0000 1.16
+++ FeedServlet.java 10 Jan 2008 08:37:46 -0000 1.17
@@ -32,10 +32,10 @@
* <p>
* This servlet uses either the currently logged in user (session) or
* basic HTTP authorization if there is no user logged in or if the feed
- * requires a higher access level than currently available. The access level
- * of the feed is the read-access level of the directory the feed belongs to.
- * Feed entries are also read-access filtered, depending on the document they
- * belong to.
+ * requires a higher access level than currently available. Feed entries are also
+ * read-access filtered. Optionally, requests can enable/disable comments on the feed
+ * or filter by tag. It's up to the actual <tt>WikiFeedEntry</tt> instance how these
+ * filters are applied.
*
* @author Christian Bauer
*/
@@ -113,7 +113,7 @@
userTx.begin();
}
- FeedDAO feedDAO = (FeedDAO)Component.getInstance("feedDAO");
+ FeedDAO feedDAO = (FeedDAO)Component.getInstance(FeedDAO.class);
Feed feed = feedDAO.findFeed(Long.valueOf(feedIdParam));
if (feed == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Feed " + feedIdParam);
@@ -124,7 +124,7 @@
// Authenticate and authorize, first with current user (session) then with basic HTTP authentication
Integer currentAccessLevel = (Integer)Component.getInstance("currentAccessLevel");
if (feed.getReadAccessLevel() > currentAccessLevel) {
- boolean loggedIn = ((Authenticator)Component.getInstance("authenticator")).authenticateBasicHttp(request);
+ boolean loggedIn = ((Authenticator)Component.getInstance(Authenticator.class)).authenticateBasicHttp(request);
currentAccessLevel = (Integer)Component.getInstance("currentAccessLevel");
if (!loggedIn || feed.getReadAccessLevel() > currentAccessLevel) {
response.setHeader("WWW-Authenticate", "Basic realm=\"" + feed.getTitle().replace("\"", "'") + "\"");
More information about the jboss-cvs-commits
mailing list