r40 - in trunk/src/main: java/org/chorem/bow webapp
Author: bbrossaud Date: 2010-05-28 16:12:51 +0200 (Fri, 28 May 2010) New Revision: 40 Url: http://chorem.org/repositories/revision/bow/40 Log: addition link on home Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java trunk/src/main/webapp/home.jsp trunk/src/main/webapp/search.jsp Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java =================================================================== --- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-05-28 13:49:55 UTC (rev 39) +++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-05-28 14:12:51 UTC (rev 40) @@ -48,7 +48,6 @@ protected Model model = new Model(); protected String version = ""; - public ControllerServlet() throws ArgumentsParserException { ApplicationConfig config = new ApplicationConfig(); config.setConfigFileName("bow.properties"); @@ -76,7 +75,6 @@ String token = request.getParameter("token"); // token or not if (token != null && !token.isEmpty()) { user = checkToken(token, session); - log.debug(session.getAttribute("user")); } String action = request.getParameter("action"); if (action != null) { @@ -204,14 +202,17 @@ this.actionOpenSearchResult(request, response, user, token); request.getRequestDispatcher("openSearchResult.jsp").forward(request, response); } else { - request.getRequestDispatcher("error.jsp").forward(request, response); + if (user != null) { + request.getRequestDispatcher("error.jsp").forward(request, response); + } else { + request.getRequestDispatcher("login.jsp").forward(request, response); + } } } else { request.getRequestDispatcher("login.jsp").forward(request, response); } } catch (Exception eee) { - throw new ServletException("DO GET ERROR", eee); -// request.getRequestDispatcher("error.jsp").forward(request, response); + request.getRequestDispatcher("error.jsp").forward(request, response); } } @@ -726,7 +727,7 @@ op.close(); } - private void actionAddAlias(HttpServletRequest request, HttpServletResponse response) + private void actionAddAlias(HttpServletRequest request, HttpServletResponse response) throws IOException { String alias = request.getParameter("alias"); if (alias != null && !alias.isEmpty()) { Modified: trunk/src/main/webapp/home.jsp =================================================================== --- trunk/src/main/webapp/home.jsp 2010-05-28 13:49:55 UTC (rev 39) +++ trunk/src/main/webapp/home.jsp 2010-05-28 14:12:51 UTC (rev 40) @@ -28,7 +28,10 @@ <link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="<%=url%>bow?action=permanentXml" /> <body> <div id="table"> - <h1 class="result">Home</h1> + <h1 class="result"> + <a style="float: left;font-size: 12px; margin-left: 10px;" href="<%=url%>bow?action=home">home</a> + Home + </h1> <% if (bookmarkActions != null) { List<Bookmark> bookmarkList = bookmarkActions.getBookmarks(); Modified: trunk/src/main/webapp/search.jsp =================================================================== --- trunk/src/main/webapp/search.jsp 2010-05-28 13:49:55 UTC (rev 39) +++ trunk/src/main/webapp/search.jsp 2010-05-28 14:12:51 UTC (rev 40) @@ -12,17 +12,15 @@ <% TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); - String temporaryToken = tokenActions.getTemporaryToken(); - String permanentToken = tokenActions.getPermanentToken(); BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); - String searchLine = ""; - if (bookmarkActions != null) { - searchLine = bookmarkActions.getSearchLine(); - } - String url = request.getRequestURL().toString(); - int index = url.indexOf("search.jsp"); - url = url.substring(0, index); - String version = (String) request.getAttribute("version"); + if (tokenActions != null && bookmarkActions != null) { + String temporaryToken = tokenActions.getTemporaryToken(); + String permanentToken = tokenActions.getPermanentToken(); + String searchLine = bookmarkActions.getSearchLine(); + String url = request.getRequestURL().toString(); + int index = url.indexOf("search.jsp"); + url = url.substring(0, index); + String version = (String) request.getAttribute("version"); %> <html> @@ -31,11 +29,14 @@ <link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="<%=url%>bow?action=permanentXml" /> <body> <div id="table"> - <h1 class="result">My Bookmarks</h1> + <h1 class="result"> + <a style="float: left;font-size: 12px; margin-left: 10px;" href="<%=url%>bow?action=home">home</a> + My Bookmarks + </h1> <% - if (bookmarkActions != null) { - List<Bookmark> bookmarkList = bookmarkActions.getBookmarks(); - if (!bookmarkList.isEmpty()) { + if (bookmarkActions != null) { + List<Bookmark> bookmarkList = bookmarkActions.getBookmarks(); + if (!bookmarkList.isEmpty()) { %> <table class="result"> <tr class="result"> @@ -70,8 +71,8 @@ </th> </tr> <% - SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - for (Bookmark bookmark : bookmarkList) { + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + for (Bookmark bookmark : bookmarkList) { %> <tr class="result"> <td class="result"> @@ -84,7 +85,7 @@ </td> <td class="result"> <a href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a> - <form method="POST" action="bow?action=addAlias&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>" style="display: inline"> + <form method="POST" action="bow?action=addAlias&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>" style="display: inline"> <input type="text" name="alias" size="10" value="<%=bookmark.getAlias()%>" /> <input style="display: inline;" type="submit" value="Add alias" /> </form> @@ -95,9 +96,9 @@ </td> <td class="result" style="text-align: left"> <% - Set<String> tagList = bookmark.getTags(); - if (tagList != null && !tagList.isEmpty()) { - for (String tag : tagList) { + Set<String> tagList = bookmark.getTags(); + if (tagList != null && !tagList.isEmpty()) { + for (String tag : tagList) { %> <div style="display: inline"> <a style="text-decoration:none" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>&searchLine=<%=searchLine%>"> @@ -106,8 +107,8 @@ <%=tag%> </div> <% + } } - } %> <form method="POST" action="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>"> <input type="text" name="tags" size="35" value="<%=BookmarkActions.getBookmarkTagsString(bookmark)%>" /> @@ -119,15 +120,15 @@ </td> </tr> <% - } + } %> </table> <% - } else { + } else { %> <h2 class="result">No Bookmarks</h2> <% } - } + } %> </div> <div id="menu"> @@ -154,16 +155,16 @@ <div class="menu"> <div class="tagCloud"> <% if (bookmarkActions != null) { - Map<String, Integer> tagsCloud = bookmarkActions.getTagsCloud(); - Set<String> tags = tagsCloud.keySet(); - for (String tag : tags) { - int value = tagsCloud.get(tag); - int font = bookmarkActions.getFont(value); + Map<String, Integer> tagsCloud = bookmarkActions.getTagsCloud(); + Set<String> tags = tagsCloud.keySet(); + for (String tag : tags) { + int value = tagsCloud.get(tag); + int font = bookmarkActions.getFont(value); %> <a href="bow?action=search&addTag=<%=tag%>&searchLine=<%=searchLine%>" title="<%=value%> results" class="tag" style="font-size: <%=font%>px;"><%=tag%></a> <% + } } - } %> <form method="POST" action="bow?action=search" style="text-align: center;margin-left: 20px;"> <input style="float: left" type="text" name="searchLine" size="15" value="<%=searchLine%>" /> @@ -182,4 +183,5 @@ <a shape="rect" href="http://list.chorem.org/cgi-bin/mailman/listinfo/bow-users">Support utilisateur</a> </div> </body> -</html> \ No newline at end of file +</html> +<%}%> \ No newline at end of file
participants (1)
-
bbrossaudï¼ users.chorem.org