Bow-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
June 2010
- 3 participants
- 31 discussions
r68 - in trunk: . src/main/java/org/chorem/bow src/main/webapp src/main/webapp/css src/main/webapp/img src/main/xmi
by bbrossaud@users.chorem.org 08 Jun '10
by bbrossaud@users.chorem.org 08 Jun '10
08 Jun '10
Author: bbrossaud
Date: 2010-06-08 17:07:02 +0200 (Tue, 08 Jun 2010)
New Revision: 68
Url: http://chorem.org/repositories/revision/bow/68
Log:
integrated the new design, addition preference and remove buggs
Added:
trunk/src/main/webapp/bookmarkHome.jsp
trunk/src/main/webapp/bookmarkSearch.jsp
trunk/src/main/webapp/css/bookmark.css
trunk/src/main/webapp/css/connexion.css
trunk/src/main/webapp/img/aide.jpg
trunk/src/main/webapp/img/click.jpg
trunk/src/main/webapp/img/croix.jpg
trunk/src/main/webapp/img/edit.jpg
trunk/src/main/webapp/img/fdboutonV.jpg
trunk/src/main/webapp/img/fondbouton.jpg
trunk/src/main/webapp/img/fondconnexion.jpg
trunk/src/main/webapp/img/fondhead.jpg
trunk/src/main/webapp/img/livreG.jpg
trunk/src/main/webapp/img/logobow.jpg
trunk/src/main/webapp/img/moyen-livre.jpg
trunk/src/main/webapp/img/piedmenu.jpg
trunk/src/main/webapp/img/pointemenu.jpg
trunk/src/main/webapp/img/ptit-livre.jpg
trunk/src/main/webapp/img/tag.jpg
trunk/src/main/webapp/preference.jsp
trunk/src/main/webapp/preferences.jsp
Removed:
trunk/src/main/webapp/css/styles.css
Modified:
trunk/TODO.txt
trunk/src/main/java/org/chorem/bow/BowProxy.java
trunk/src/main/java/org/chorem/bow/ControllerServlet.java
trunk/src/main/webapp/footer.jsp
trunk/src/main/webapp/header.jsp
trunk/src/main/webapp/login.jsp
trunk/src/main/webapp/main.jsp
trunk/src/main/webapp/openSearchResult.jsp
trunk/src/main/webapp/register.jsp
trunk/src/main/xmi/bow.zargo
Modified: trunk/TODO.txt
===================================================================
--- trunk/TODO.txt 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/TODO.txt 2010-06-08 15:07:02 UTC (rev 68)
@@ -29,3 +29,7 @@
===> openSearch ==> proposer des url
===> facetisations
+
+===> getElementsByName();
+
+===> formulaire
Modified: trunk/src/main/java/org/chorem/bow/BowProxy.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowProxy.java 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/java/org/chorem/bow/BowProxy.java 2010-06-08 15:07:02 UTC (rev 68)
@@ -52,8 +52,6 @@
protected BowProxy(BowConfig config) {
WikittyService ws = new WikittyServiceJDBC(config.getFlatOptions());
- // fix me 04/06/2009
- ws = new WikittyServiceNotifier(ws);
ws = new WikittyServiceCached(ws);
setWikittyService(ws);
}
Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-08 15:07:02 UTC (rev 68)
@@ -164,29 +164,12 @@
log.debug("Going to actionEditBookmark");
}
this.actionEditBookmark(request, response, user);
- } else if (action.equals("orderAsc") && user != null) {
+ } else if (action.equals("order") && user != null) {
if (log.isDebugEnabled()) {
- log.debug("Going to actionOrderAsc");
+ log.debug("Going to actionOrder");
}
- this.actionOrderAsc(request, response, user);
+ this.actionOrder(request, response, user);
request.getRequestDispatcher("main.jsp").forward(request, response);
- } else if (action.equals("orderAscOS") && user != null) {
- if (log.isDebugEnabled()) {
- log.debug("Going to actionOrderAsc");
- }
- this.actionOrderAsc(request, response, user);
- request.getRequestDispatcher("openSearchResult.jsp").forward(request, response);
- } else if (action.equals("orderDesc") && user != null) {
- if (log.isDebugEnabled()) {
- log.debug("Going to actionOrderDesc");
- }
- this.actionOrderDesc(request, response, user);
- request.getRequestDispatcher("main.jsp").forward(request, response);
- } else if (action.equals("orderDescOS") && user != null) {
- if (log.isDebugEnabled()) {
- log.debug("Going to actionOrderDesc");
- }
- this.actionOrderDesc(request, response, user);
} else if (action.equals("addClick") && user != null) {
if (log.isDebugEnabled()) {
log.debug("Going to actionAddClic");
@@ -212,13 +195,24 @@
if (log.isDebugEnabled()) {
log.debug("Going to actionOpenSearchResult");
}
- this.actionOpenSearchResult(request, response, user, token);
+ this.actionOpenSearchResult(request, response, session, user, token);
} else if (action.equals("fullText") && user != null) {
if (log.isDebugEnabled()) {
log.debug("Going to actionFullText");
}
this.actionFullText(request, user);
request.getRequestDispatcher("main.jsp").forward(request, response);
+ } else if (action.equals("preferences") && user != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Going to actionPreferences");
+ }
+ request.getRequestDispatcher("preferences.jsp").forward(request, response);
+ } else if (action.equals("changePreferences") && user != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Going to actionChangePreferences");
+ }
+ this.actionChangePreferences(request, session, user);
+ request.getRequestDispatcher("preferences.jsp").forward(request, response);
} else {
if (user != null) {
request.getRequestDispatcher("error.jsp").forward(request, response);
@@ -243,12 +237,14 @@
* @throws ServletException if a servlet error occurs
* @description set the openSearch result
*/
- protected void actionOpenSearchResult(HttpServletRequest request, HttpServletResponse response, User user, String token)
- throws IOException, ServletException {
+ protected void actionOpenSearchResult(HttpServletRequest request, HttpServletResponse response, HttpSession session, User user, String token)
+ throws IOException, ServletException, NoSuchAlgorithmException {
String searchLine = request.getParameter("searchLine");
if (searchLine != null && searchLine.matches("^http://[^ ]*") && !searchLine.contains(" ")) {
response.sendRedirect(searchLine);
} else {
+ session.setAttribute("user", user);
+ initializeToken(session, user);
WikittyProxy proxy = BowProxy.getInstance();
Criteria criteria = getBookmarkListCriteriaByUser(user, searchLine);
criteria = criteria.addSortDescending(Bookmark.FQ_FIELD_CLICK);
@@ -256,7 +252,7 @@
BookmarkActions bookmarkActions = createBookmarkActions(request, result, searchLine);
request.setAttribute("bookmarkActions", bookmarkActions);
request.setAttribute("token", token);
- request.getRequestDispatcher("openSearchResult.jsp").forward(request, response);
+ request.getRequestDispatcher("main.jsp").forward(request, response);
}
}
@@ -340,7 +336,7 @@
* @throws ServletException if a servlet error occurs
* @description order the bookmarks by type
*/
- protected void actionOrderAsc(HttpServletRequest request, HttpServletResponse response, User user)
+ protected void actionOrder(HttpServletRequest request, HttpServletResponse response, User user)
throws IOException, ServletException {
String type = request.getParameter("type");
String searchLine = request.getParameter("searchLine");
@@ -348,42 +344,22 @@
if (type != null && baseCriteria != null && !type.isEmpty()) {
WikittyProxy proxy = BowProxy.getInstance();
PagedResult result = null;
- if (type.equals("name")) {
+ if (type.equals("ascName")) {
Criteria criteria = baseCriteria.addSortAscending(Bookmark.FQ_FIELD_DESCRIPTION);
result = proxy.findAllByCriteria(Bookmark.class, criteria);
- } else if (type.equals("date")) {
+ } else if (type.equals("ascDate")) {
Criteria criteria = baseCriteria.addSortAscending(Bookmark.FQ_FIELD_DATE);
result = proxy.findAllByCriteria(Bookmark.class, criteria);
- } else if (type.equals("click")) {
+ } else if (type.equals("ascClick")) {
Criteria criteria = baseCriteria.addSortAscending(Bookmark.FQ_FIELD_CLICK);
result = proxy.findAllByCriteria(Bookmark.class, criteria);
- }
- BookmarkActions bookmarkActions = createBookmarkActions(request, result, searchLine);
- request.setAttribute("bookmarkActions", bookmarkActions);
- }
- }
-
- /* @param request servlet request
- * @param response servlet response
- * @param user the user
- * @throws ServletException if a servlet error occurs
- * @description order the bookmarks by type
- */
- protected void actionOrderDesc(HttpServletRequest request, HttpServletResponse response, User user)
- throws IOException, ServletException {
- String searchLine = request.getParameter("searchLine");
- String type = request.getParameter("type");
- Criteria baseCriteria = getBookmarkListCriteriaByUser(user, searchLine);
- if (type != null && baseCriteria != null && !type.isEmpty()) {
- WikittyProxy proxy = BowProxy.getInstance();
- PagedResult result = null;
- if (type.equals("name")) {
+ } else if (type.equals("descName")) {
Criteria criteria = baseCriteria.addSortDescending(Bookmark.FQ_FIELD_DESCRIPTION);
result = proxy.findAllByCriteria(Bookmark.class, criteria);
- } else if (type.equals("date")) {
+ } else if (type.equals("descDate")) {
Criteria criteria = baseCriteria.addSortDescending(Bookmark.FQ_FIELD_DATE);
result = proxy.findAllByCriteria(Bookmark.class, criteria);
- } else if (type.equals("click")) {
+ } else if (type.equals("descClick")) {
Criteria criteria = baseCriteria.addSortDescending(Bookmark.FQ_FIELD_CLICK);
result = proxy.findAllByCriteria(Bookmark.class, criteria);
}
@@ -409,7 +385,6 @@
request.setAttribute("name", bookmark.getDescription());
request.setAttribute("alias", bookmark.getAlias());
request.setAttribute("tags", BookmarkActions.getBookmarkTagsString(bookmark));
- request.setAttribute("button", "Modify");
request.setAttribute("action", "bow?action=modifyBookmark");
request.setAttribute("bookmarkId", bookmarkId);
}
@@ -511,6 +486,10 @@
WikittyProxy proxy = BowProxy.getInstance();
Bookmark bookmark = proxy.restore(Bookmark.class, id);
if (bookmark != null) {
+ Criteria criteria = Search.query().eq(Bookmark.FQ_FIELD_ALIAS, alias).criteria();
+ if (proxy.findByCriteria(Bookmark.class, criteria) != null) {
+ alias = bookmark.getAlias();
+ }
BookmarkActions.updateBookmark(bookmark, name, link, tags, alias);
proxy.store(bookmark);
}
@@ -533,16 +512,20 @@
String link = request.getParameter("url"); // url of the website
String name = request.getParameter("name"); // website name
String alias = request.getParameter("alias");
+ WikittyProxy proxy = BowProxy.getInstance();
Bookmark bookmark = null;
if (name != null) {
String tags = request.getParameter("tags"); // tags
+ Criteria criteria = Search.query().eq(Bookmark.FQ_FIELD_ALIAS, alias).criteria();
+ if (proxy.findByCriteria(Bookmark.class, criteria) != null) {
+ alias = "";
+ }
bookmark = BookmarkActions.createBookmark(link, name, tags, user, alias, null);
} else { // this part is for the bookmark addition by script
String nameAndTags = request.getParameter("nameAndTags");
bookmark = BookmarkActions.createBookmark(link, nameAndTags, user);
}
if (bookmark != null) {
- WikittyProxy proxy = BowProxy.getInstance();
proxy.store(bookmark); // store the bookmark if all is Ok
if (log.isDebugEnabled()) {
log.debug("Adding URL");
@@ -678,6 +661,8 @@
request.getRequestDispatcher("error.jsp").forward(request, response);
} else {
session.setAttribute("user", login);
+ Preference preference = proxy.restore(Preference.class, login.getWikittyId());
+ session.setAttribute("preference", preference);
initializeToken(session, login);
actionHome(request, login);
request.getRequestDispatcher("main.jsp").forward(request, response);
@@ -698,7 +683,10 @@
password = StringUtil.encodeMD5(password);
User login = this.checkLogin(email, password); // check if the user exists
if (login != null) {
+ WikittyProxy proxy = BowProxy.getInstance();
session.setAttribute("user", login);
+ Preference preference = proxy.restore(Preference.class, login.getWikittyId());
+ session.setAttribute("preference", preference);
initializeToken(session, login);
actionHome(request, login);
request.getRequestDispatcher("main.jsp").forward(request, response);
@@ -971,4 +959,33 @@
}
return criteria;
}
+
+ private void actionChangePreferences(HttpServletRequest request, HttpSession session, User user)
+ throws NoSuchAlgorithmException {
+ String email = request.getParameter("email");
+ String password = request.getParameter("password");
+ if (email != null && !email.isEmpty()) {
+ user.setEmail(email);
+ }
+ if (password != null && !password.isEmpty()) {
+ password = StringUtil.encodeMD5(password);
+ user.setPassword(password);
+ }
+
+ WikittyProxy proxy = BowProxy.getInstance();
+ Preference preference = (Preference) session.getAttribute("preference");
+ String colors = request.getParameter("colors");
+ preference.setColors(colors);
+ String tags = request.getParameter("tags");
+ preference.setTags(Integer.valueOf(tags));
+ String bookmarks = request.getParameter("bookmarks");
+ preference.setBookmarks(Integer.valueOf(bookmarks));
+ String searchEngineSuggestions = request.getParameter("searchEngineUrlSuggestions");
+ preference.setSearchEngineUrlSuggestions(searchEngineSuggestions);
+ String searchEngineResults = request.getParameter("searchEngineUrlResults");
+ preference.setSearchEngineUrlResults(searchEngineResults);
+
+ proxy.store(preference);
+ request.setAttribute("preference", preference);
+ }
}
Added: trunk/src/main/webapp/bookmarkHome.jsp
===================================================================
--- trunk/src/main/webapp/bookmarkHome.jsp (rev 0)
+++ trunk/src/main/webapp/bookmarkHome.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -0,0 +1,281 @@
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="org.chorem.bow.BookmarkActions" %>
+<%@page import="java.text.SimpleDateFormat" %>
+<%@page import="java.util.Iterator" %>
+<%@page import="java.util.Set" %>
+<%@page import="java.util.ArrayList" %>
+<%@page import="java.util.List" %>
+<%@page import="org.chorem.bow.TokenActions" %>
+<%@page import="org.nuiton.wikitty.FacetTopic" %>
+<%@page import="org.chorem.bow.Bookmark" %>
+<%@page import="org.chorem.bow.Preference" %>
+
+
+<%
+ TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
+ BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
+ if (tokenActions != null && bookmarkActions != null) {
+ String temporaryToken = tokenActions.getTemporaryToken();
+ String permanentToken = tokenActions.getPermanentToken();
+ String url = (String) request.getAttribute("bowUrl");
+ int nbTags = 100;
+ int nbBookmarks = 10;
+ Preference preference = (Preference) session.getAttribute("preference");
+ if (preference != null) {
+ if (preference.getBookmarks() > 0) {
+ nbBookmarks = preference.getBookmarks();
+ }
+ if (preference.getTags() > 0) {
+ nbTags = preference.getTags();
+ }
+ }
+ String formLink = (String) request.getAttribute("link");
+ String formName = (String) request.getAttribute("name");
+ String formBookmarkId = (String) request.getAttribute("bookmarkId");
+ String formTags = (String) request.getAttribute("tags");
+ String formAlias = (String) request.getAttribute("alias");
+ String formAction = (String) request.getAttribute("action");
+
+ if (formLink == null) {
+ formLink = "URL";
+ }
+ if (formName == null) {
+ formName = "name";
+ }
+ if (formTags == null) {
+ formTags = "tag1 tag2...";
+ }
+ if (formAlias == null) {
+ formAlias = "alias";
+ }
+ if (formAction == null) {
+ formAction = "bow?action=addUrl";
+ }
+%>
+<body>
+ <div id="headback">
+ <div id="head">
+ <div id="headleft">
+ <a class="logo" href="<%=url%>bow?action=home">bow</a>(Bookmarks On the Web)
+ </div>
+ <div id="headright">
+ <form action="bow?action=logout">
+ <button>Logout</button>
+ </form>
+ <a href="#">Aide</a>
+ </div>
+ </div>
+ </div>
+
+ <div id="mainbodyback" class="clearfix">
+ <div id="mainbody">
+ <div id="content">
+
+ <div class="menu clearfix">
+ <p>The most used bookmarks</p>
+ </div>
+ <div id="contenu">
+ <%
+ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
+ List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
+ if (!bookmarkList.isEmpty()) {
+ int count = 0;
+ for (Bookmark bookmark : bookmarkList) {
+ String link = bookmark.getLink();
+ link = link.replace("'", "\\'");
+ %>
+ <div class="bookmark">
+ <div class="bookmarkhead clearfix">
+ <a href="<%=url + bookmark.getAlias()%>" title="<%=url + bookmark.getAlias()%>" target="_blank">
+ <%=bookmark.getAlias()%>
+ </a>
+ <span> (<%=sdf.format(bookmark.getDate())%>)</span>
+ <a class="edit" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');"></a>
+ <a class="supprim" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>"></a>
+ </div>
+ <div class="bookmarkcontenu clearfix">
+ <div class="screenshot"></div>
+ <div class="description">
+ <h3>Description :</h3>
+ <p>
+ <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
+ </p>
+ <p class="tags">
+ <strong>Tags :</strong>
+ <%
+ Set<String> tagList = bookmark.getTags();
+ if (tagList != null && !tagList.isEmpty()) {
+ for (String tag : tagList) {
+ if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) {
+ %>
+ <a style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <%} else {%>
+ <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <%}%>
+ <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
+ <%
+ }
+ }
+ %>
+ </p>
+ </div>
+ <div class="click"><%=bookmark.getClick()%></div>
+ </div>
+ </div>
+ <%
+ ++count;
+ if (count >= nbBookmarks) {
+ break;
+ }
+ }
+ } else {
+ %>
+ <h2>No Bookmarks</h2>
+ <% }
+ %>
+ </div>
+ <div class="menu clearfix">
+ <p>The last addition bookmarks</p>
+ </div>
+ <div id="contenu">
+
+ <%
+ List<Bookmark> lastBookmarks = bookmarkActions.getLastBookmarks();
+ if (!lastBookmarks.isEmpty()) {
+ int count = 0;
+ for (Bookmark bookmark : lastBookmarks) {
+ String link = bookmark.getLink();
+ link = link.replace("'", "\\'");
+ %>
+ <div class="bookmark">
+ <div class="bookmarkhead clearfix">
+ <a href="<%=url + bookmark.getAlias()%>" title="<%=url + bookmark.getAlias()%>" target="_blank">
+ <%=bookmark.getAlias()%>
+ </a>
+ <span> (<%=sdf.format(bookmark.getDate())%>)</span>
+ <a class="edit" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');"></a>
+ <a class="supprim" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>"></a>
+ </div>
+ <div class="bookmarkcontenu clearfix">
+ <div class="screenshot"></div>
+ <div class="description">
+ <h3>Description :</h3>
+ <p>
+ <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
+ </p>
+ <p class="tags">
+ <strong>Tags :</strong>
+ <%
+ Set<String> tagList = bookmark.getTags();
+ if (tagList != null && !tagList.isEmpty()) {
+ for (String tag : tagList) {
+ if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) {
+ %>
+ <a style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <%} else {%>
+ <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <%}%>
+ <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
+ <%
+ }
+ }
+ %>
+ </p>
+ </div>
+ <div class="click"><%=bookmark.getClick()%></div>
+ </div>
+ </div>
+
+ <%
+ ++count;
+ if (count >= nbBookmarks) {
+ break;
+ }
+ }
+ } else {
+ %>
+ <h2>No Bookmarks</h2>
+ <% }
+ %>
+ </div>
+ </div>
+ <div id="colonneD">
+ <ul class="droite">
+ <li><a href="bow?action=preferences">Preferences</a></li>
+ <li><a href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>bow?action=addUrl&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);">Temporary token</a></li>
+ <li><a href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>bow?action=addUrl&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);">Current permanent token</a></li>
+ <li><a href="bow?action=generateToken">Regenerate permanent token</a></li>
+ </ul>
+ <div id="add">
+ <h2>Add / Modify</h2>
+ <form id="bookmarkForm" method="POST" action="<%=formAction%>">
+ <div class="input"><label>URL</label><input type="text" name="url" value="<%=formLink%>" /></div>
+ <div class="input"><label>ALIAS</label><input type="text" name="alias" value="<%=formAlias%>" /></div>
+ <div class="input"><label>DESC</label><input type="text" name="name" value="<%=formName%>" /></div>
+ <div class="input"><label>TAGS</label><input type="text" name="tags" value="<%=formTags%>" /></div>
+ <button>Save</button>
+ </form>
+ </div>
+ <div id="nuage">
+ <% if (bookmarkActions != null) {
+ List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud();
+ int count = 0;
+ for (FacetTopic tag : tagCloud) {
+ int value = tag.getCount();
+ String tagName = tag.getTopicName();
+ int font = bookmarkActions.getFont(value);
+ %>
+ <a href="bow?action=search&addTag=<%=tagName%>" title="<%=value%> results" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a>
+ <%
+ ++count;
+ if (count >= nbTags) {
+ break;
+ }
+ }
+ }
+ %>
+ </div>
+ <div id="recherche">
+ <h2>Research</h2>
+ <form method="POST" action="bow?action=search">
+ <div class="input">
+ <input type="text" name="searchLine"/>
+ <button>Find</button>
+ </div>
+ </form>
+ </div>
+ <div id="recherche">
+ <h2>Full text research</h2>
+ <form method="POST" action="bow?action=fullText">
+ <div class="input">
+ <input type="text" name="fullTextLine" value="<%=bookmarkActions.getFullTextLine()%>" />
+ <button>Find</button>
+ </div>
+ </form>
+ </div>
+ <div id="import">
+ <h2>Import Bookmarks</h2>
+ <form method="POST" action="bow?action=importBookmarks" enctype="multipart/form-data">
+ <div class="input">
+ <input type="file" name="upfile" />
+ <button>Parcourir</button>
+ </div>
+ </form>
+ <a href="bow?action=exportBookmarks">Export bookmarks</a>
+ </div>
+ <div class="colonnebas"></div>
+ </div>
+
+ </div>
+
+ </div>
+</body>
+<%}%>
\ No newline at end of file
Added: trunk/src/main/webapp/bookmarkSearch.jsp
===================================================================
--- trunk/src/main/webapp/bookmarkSearch.jsp (rev 0)
+++ trunk/src/main/webapp/bookmarkSearch.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -0,0 +1,216 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="org.chorem.bow.Bookmark" %>
+<%@page import="org.chorem.bow.BookmarkActions" %>
+<%@page import="java.text.SimpleDateFormat" %>
+<%@page import="java.util.Iterator" %>
+<%@page import="java.util.Set" %>
+<%@page import="java.util.ArrayList" %>
+<%@page import="java.util.List" %>
+<%@page import="org.chorem.bow.TokenActions" %>
+<%@page import="org.nuiton.wikitty.FacetTopic" %>
+<%@page import="org.chorem.bow.Preference" %>
+
+<%
+ TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
+ BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
+ if (tokenActions != null && bookmarkActions != null) {
+ String temporaryToken = tokenActions.getTemporaryToken();
+ String permanentToken = tokenActions.getPermanentToken();
+ String searchLine = bookmarkActions.getSearchLine();
+ String fullText = bookmarkActions.getFullTextLine();
+ String url = (String) request.getAttribute("bowUrl");
+ Preference preference = (Preference) session.getAttribute("preference");
+ int nbTags = 100;
+ if (preference != null) {
+ if (preference.getTags() > 0) {
+ nbTags = preference.getTags();
+ }
+ }
+ String formLink = (String) request.getAttribute("link");
+ String formName = (String) request.getAttribute("name");
+ String formBookmarkId = (String) request.getAttribute("bookmarkId");
+ String formTags = (String) request.getAttribute("tags");
+ String formAlias = (String) request.getAttribute("alias");
+ String formAction = (String) request.getAttribute("action");
+
+ if (formLink == null) {
+ formLink = "URL";
+ }
+ if (formName == null) {
+ formName = "name";
+ }
+ if (formTags == null) {
+ formTags = "tag1 tag2...";
+ }
+ if (formAlias == null) {
+ formAlias = "alias";
+ }
+ if (formAction == null) {
+ formAction = "bow?action=addUrl";
+ }
+%>
+
+
+<body>
+ <div id="headback">
+ <div id="head">
+ <div id="headleft">
+ <a class="logo" href="<%=url%>bow?action=home">bow</a>(Bookmarks On the Web)
+ </div>
+ <div id="headright">
+ <form action="bow?action=logout">
+ <button>Logout</button>
+ </form>
+ <a href="#">Aide</a>
+ </div>
+ </div>
+ </div>
+ <div id="mainbodyback" class="clearfix">
+ <div id="mainbody">
+
+ <div id="content">
+ <div class="menu clearfix"><p>Search</p>
+ <form method="POST" action="bow?action=order&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <label>Order By :</label>
+ <select name="type">
+ <option value="ascName">Asc Name</option>
+ <option value="descName">Desc Name</option>
+ <option value="ascClick">Asc Click</option>
+ <option value="descClick">Desc Click</option>
+ <option value="ascDate">Asc Date</option>
+ <option value="descDate">Desc Date</option>
+ </select>
+ <button type="submit">OK</button>
+ </form>
+ </div>
+ <div id="contenu">
+ <%
+ List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
+ if (!bookmarkList.isEmpty()) {
+ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
+ for (Bookmark bookmark : bookmarkList) {
+ String link = bookmark.getLink();
+ link = link.replace("'", "\\'");
+ %>
+ <div class="bookmark">
+ <div class="bookmarkhead clearfix">
+ <a href="<%=url + bookmark.getAlias()%>" title="<%=url + bookmark.getAlias()%>" target="_blank">
+ <%=bookmark.getAlias()%>
+ </a>
+ <span> (<%=sdf.format(bookmark.getDate())%>)</span>
+ <a class="edit" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');"></a>
+ <a class="supprim" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>"></a>
+ </div>
+ <div class="bookmarkcontenu clearfix">
+ <div class="screenshot"></div>
+ <div class="description">
+ <h3>Description :</h3>
+ <p><a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a></p>
+ <p class="tags"><strong>Tags :</strong>
+ <%
+ Set<String> tagList = bookmark.getTags();
+ if (tagList != null && !tagList.isEmpty()) {
+ for (String tag : tagList) {
+ if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) {
+ %>
+ <a style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" >
+ <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <%} else {%>
+ <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" >
+ <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <%}%>
+ <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none;"><%=tag%></a>
+ <%
+ }
+ }
+ %>
+ </p>
+ </div>
+ <div class="click"><%=bookmark.getClick()%></div>
+ </div>
+ </div>
+ <%
+ }
+ } else {
+ %>
+ <h2>No Bookmarks</h2>
+ <%}%>
+ </div>
+ </div>
+
+ <div id="colonneD">
+ <ul class="droite">
+ <li><a href="bow?action=preferences">Preferences</a></li>
+ <li><a href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');var%20link='<%=url%>bow?action=addUrl&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);void(0);">Temporary token</a></li>
+ <li><a href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');var%20link='<%=url%>bow?action=addUrl&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);void(0);">Current permanent token</a></li>
+ <li><a href="bow?action=generateToken&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">Regenerate permanent token</a></li>
+ </ul>
+ <div id="add">
+ <h2>Add / Modify</h2>
+ <form id="bookmarkForm" method="POST" action="<%=formAction%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <div class="input"><label>URL</label><input type="text" name="url" value="<%=formLink%>" /></div>
+ <div class="input"><label>ALIAS</label><input type="text" name="alias" value="<%=formAlias%>" /></div>
+ <div class="input"><label>DESC</label><input type="text" name="name" value="<%=formName%>" /></div>
+ <div class="input"><label>TAGS</label><input type="text" name="tags" value="<%=formTags%>" /></div>
+ <button>Save</button>
+ </form>
+ </div>
+ <div id="nuage">
+ <% if (bookmarkActions != null) {
+ List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud();
+ int count = 0;
+ for (FacetTopic tag : tagCloud) {
+ int value = tag.getCount();
+ String tagName = tag.getTopicName();
+ int font = bookmarkActions.getFont(value);
+ %>
+ <a href="bow?action=search&addTag=<%=tagName%>&searchLine=<%=searchLine%>" title="<%=value%> results" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a>
+ <%
+ ++count;
+ if (count >= nbTags) {
+ break;
+ }
+ }
+ }
+ %>
+ </div>
+ <div id="recherche">
+ <h2>Research</h2>
+ <form method="POST" action="bow?action=search">
+ <div class="input">
+ <input type="text" name="searchLine" value="<%=searchLine%>" />
+ <button>Find</button>
+ </div>
+ </form>
+ </div>
+ <div id="recherche">
+ <h2>Full text research</h2>
+ <form method="POST" action="bow?action=fullText">
+ <div class="input">
+ <input type="text" name="fullTextLine" value="<%=bookmarkActions.getFullTextLine()%>" />
+ <button>Find</button>
+ </div>
+ </form>
+ </div>
+ <div id="import">
+ <h2>Import Bookmarks</h2>
+ <form method="post" action="bow?action=importBookmarks&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" enctype="multipart/form-data">
+ <div class="input">
+ <input type="file" name="upfile" />
+ <br/>
+ <button type="submit">Import</button>
+ </div>
+ </form>
+ <a href="bow?action=exportBookmarks&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">Export bookmarks</a>
+ </div>
+ <div class="colonnebas"></div>
+ </div>
+
+ </div>
+
+ </div>
+</body>
+<%}%>
\ No newline at end of file
Added: trunk/src/main/webapp/css/bookmark.css
===================================================================
--- trunk/src/main/webapp/css/bookmark.css (rev 0)
+++ trunk/src/main/webapp/css/bookmark.css 2010-06-08 15:07:02 UTC (rev 68)
@@ -0,0 +1,323 @@
+@charset "utf-8";
+/*CSS Document*/
+*{
+ padding:0;
+ margin:0;
+}
+
+/*.clearfix {
+ height:1%;
+}*/
+
+.clearfix:after {
+ content:".";
+ height:0;
+ line-height:0;
+ display:block;
+ visibility:hidden;
+ clear:both;
+}
+
+body{
+ font-size:10px;
+ font-family:Verdana, Arial, Helvetica, sans-serif;
+}
+
+#headback{
+ background:#FFFFFF url(/bow/img/fondhead.jpg) repeat-x;
+ width:auto;
+ height:100px;
+
+}
+
+#head{
+ clear:both;
+ width:1004px;
+ height:100px;
+ margin:0 auto;
+ position:relative;
+}
+
+#headleft{
+ width:740px;
+ float:left;
+ height:100px;
+}
+
+#headleft a.logo{
+ background:url(/bow/img/logobow.jpg);
+ width:290px;
+ height:100px;
+ text-indent:-99999px;
+ display:block;
+}
+
+#headright{
+ width:264px;
+ float:left;
+ background:#bf8a9c url(/bow/img/moyen-livre.jpg)no-repeat 30px 10px;
+ height:100px;
+}
+
+#headright a{
+ text-indent:-99999px;
+ background:url(/bow/img/aide.jpg) no-repeat;
+ display:block;
+ position:absolute;
+ right:10px;
+ bottom:5px;
+ height:34px;
+ width:34px;
+}
+
+#headright button{
+ background:url(/bow/img/fondbouton.jpg) repeat-x;
+ height:27px;
+ width:72px;
+ color:#9c7186;
+ border:none;
+ font-size:12px;
+ line-height:27px;
+ font-weight:bold;
+ position:absolute;
+ top:35px;
+ right:65px;
+}
+
+#mainbodyback{
+ background-color:#9edcf8;
+ min-height:100px;
+}
+
+#mainbody{
+ width:1004px;
+ margin:0 auto;
+ position:relative;
+ clear:both;
+}
+
+#mainbody .menu{
+ width:620px;
+ height:35px;
+ background:#804561 url(/bow/img/pointemenu.jpg) no-repeat right;
+ margin-bottom:20px;
+ padding:0 40px;
+ line-height:35px;
+}
+
+#mainbody .menu p{
+ color:#9edcf8;
+ font-size:18px;
+ font-weight:normal;
+ float:left;
+}
+
+#mainbody .menu form{
+ float:right;
+ color:#9edcf8;
+ font-size:12px;
+}
+
+#content{
+ width:740px;
+ float:left;
+ padding-top:20px;
+}
+
+#contenu{
+ width:660px;
+ margin:10px 40px;
+ background-color:#FFFFFF;
+}
+
+#colonneD{
+ width:264px;
+ float:left;
+ background-color:#804561;
+ font-size:140%;
+ color:#9edcf8;
+ margin-bottom:30px;
+}
+
+#colonneD a{
+ font-size:12px;
+ color:#9edcf8;
+}
+
+#colonneD ul.droite{
+ padding:10px 20px;
+ border-bottom:2px solid #9edcf8;
+}
+
+#colonneD ul.droite li{
+ list-style:none;
+ height:22px;
+}
+
+#colonneD ul.droite li a{
+ font-size:14px;
+ font-weight:normal;
+ text-decoration:none;
+ color:#9edcf8;
+}
+
+#colonneD ul.droite li a:hover{
+ text-decoration:underline;
+}
+
+#colonneD #add,
+#colonneD #nuage,
+#colonneD #recherche,
+#colonneD #import{
+ padding: 10px 20px;
+ border-bottom:2px solid #9edcf8;
+}
+
+#colonneD h2{
+ text-align:center;
+ color:#9edcf8;
+ font-size:170%;
+ font-weight:normal;
+}
+
+#colonneD #add form{
+ text-align:right;
+}
+
+#colonneD form .input{
+ padding:10px 0;
+}
+
+#colonneD form input{
+ height:22px;
+ width:146px;
+}
+
+#colonneD #add form label{
+ padding-right:10px;
+}
+
+#colonneD form button{
+ background:url(/bow/img/fondbouton.jpg) repeat-x 0 2px;
+ height:28px;
+ width:72px;
+ color:#9c7186;
+ border:none;
+ font-size:12px;
+ font-weight:bold;
+}
+
+#colonneD #nuage{
+ height:100px;
+}
+
+#colonneD #import{
+ border-bottom:none;
+}
+
+#colonneD .colonnebas{
+ background:url(/bow/img/piedmenu.jpg) no-repeat;
+ height:817px;
+}
+
+.bookmark{
+ width:660px;
+ border-bottom:2px solid #9edcf8;
+}
+
+.bookmark .bookmarkhead{
+ width:620px;
+ height:32px;
+ background-color:#bf8a9c;
+ padding:0 20px;
+ position:relative;
+}
+
+.bookmark .bookmarkhead a.edit{
+ background:url(/bow/img/edit.jpg) no-repeat;
+ height:32px;
+ position:absolute;
+ top:0;
+ right:32px;
+ border:none;
+ text-decoration:none;
+}
+
+.bookmark .bookmarkhead a.supprim{
+ background:url(/bow/img/croix.jpg) no-repeat;
+ height:32px;
+ position:absolute;
+ top:0;
+ right:0;
+ border:none;
+ text-decoration:none;
+}
+
+.bookmark .bookmarkhead a{
+ color:#FFF;
+ font-weight:bold;
+ font-size:14px;
+ line-height:32px;
+ padding-left:40px;
+ background:url(/bow/img/ptit-livre.jpg) no-repeat;
+ height:32px;
+ display:block;
+ text-decoration:none;
+}
+
+.bookmark .bookmarkcontenu{
+ position:relative;
+}
+
+.bookmark .screenshot{
+ float:left;
+ margin:5px 10px;
+ width:100px;
+ height:75px;
+ background:url(/bow/img/livreG.jpg) no-repeat;
+}
+
+.bookmark .description{
+ float:left;
+ margin:5px 5px;
+ color:#999999;
+ font-size:12px;
+ width:480px;
+}
+
+.bookmark .description h3{
+ color:#88516c;
+}
+
+.bookmark .description .tags{
+ color:#88516c;
+ background:url(/bow/img/tag.jpg) no-repeat left center;
+ font-size:12px;
+ padding-left:30px;
+ height:28px;
+ line-height:28px;
+ padding-top:10px;
+}
+
+.bookmark .click{
+ background:url(/bow/img/click.jpg) no-repeat;
+ padding-top:25px;
+ position:absolute;
+ bottom:0;
+ right:0;
+ height:27px;
+ width:31px;
+ margin:5px;
+ text-align: center;
+}
+#footer{
+ background-color:#804561;
+ padding-top:30px;
+}
+
+#footer p{
+ color:#bf8a9c;
+ font-size:14px;
+ text-align:center;
+ line-height:50px;
+}
\ No newline at end of file
Property changes on: trunk/src/main/webapp/css/bookmark.css
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/src/main/webapp/css/connexion.css
===================================================================
--- trunk/src/main/webapp/css/connexion.css (rev 0)
+++ trunk/src/main/webapp/css/connexion.css 2010-06-08 15:07:02 UTC (rev 68)
@@ -0,0 +1,125 @@
+@charset "utf-8";
+/* CSS Document */
+*{
+padding:0;
+margin:0;
+}
+.clearfix {height:1%}
+
+.clearfix:after {
+
+ content:".";
+
+ height:0;
+
+ line-height:0;
+
+ display:block;
+
+ visibility:hidden;
+
+ clear:both;
+
+}
+body{
+font-size:10px;
+font-family:Verdana, Arial, Helvetica, sans-serif;
+}
+#headback{
+background:#FFFFFF url(/bow/img/fondhead.jpg) repeat-x;
+width:auto;
+height:100px;
+
+}
+#head{
+clear:both;
+width:1004px;
+height:100px;
+margin:0 auto;
+position:relative;
+}
+#headleft{
+width:740px;
+float:left;
+height:100px;
+}
+#headleft a.logo{
+background:url(/bow/img/logobow.jpg);
+width:290px;
+height:100px;
+text-indent:-99999px;
+display:block;
+}
+
+#mainbodyback{
+background-color:#9edcf8;
+min-height:100px;
+}
+#mainbody{
+width:1004px;
+margin:0 auto;
+position:relative;
+clear:both;
+
+}
+
+#content{
+width:1004px;
+position:relative;
+margin:0 auto;
+padding-top:20px;
+}
+
+#contenu{
+width:225px;
+height:315px;
+background:url(/bow/img/fondconnexion.jpg) no-repeat;
+position:relative;
+margin:100px auto;
+padding:10px 70px;
+}
+#contenu h1{
+color:#804561;
+width:60px;
+position:relative;
+margin:20px auto;
+}
+#contenu form p{
+color:#804561;
+font-size:16px;
+font-weight:bold;
+padding:15px 0;
+}
+#contenu form input{
+width:225px;
+}
+#contenu form button{
+float:right;
+margin-top:20px;
+background:url(/bow/img/fdboutonV.jpg) repeat-x;
+height:31px;
+line-height:31px;
+width:60px;
+color:#FFFFFF;
+font-weight:bold;
+border:none;
+}
+#contenu a{
+color:#804561;
+position:absolute;
+bottom:50px;
+left:70px;
+font-size:14px;
+font-weight:bold;
+}
+#footer{
+background-color:#804561;
+height:50px;
+width:auto;
+}
+#footer p{
+color:#bf8a9c;
+font-size:14px;
+text-align:center;
+line-height:50px;
+}
\ No newline at end of file
Property changes on: trunk/src/main/webapp/css/connexion.css
___________________________________________________________________
Added: svn:executable
+ *
Deleted: trunk/src/main/webapp/css/styles.css
===================================================================
--- trunk/src/main/webapp/css/styles.css 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/webapp/css/styles.css 2010-06-08 15:07:02 UTC (rev 68)
@@ -1,175 +0,0 @@
-table.result {
- border:3px solid #6495ed;
- border-collapse:collapse;
- width:900px;
- margin:auto;
-}
-table.actions {
- border-collapse:collapse;
- width:90%;
- margin:auto;
-}
-
-th.result {
- font-family:monospace;
- border:1px dotted #6495ed;
- padding:5px;
- background-color:#EFF6FF;
-}
-
-.remove {
- width:5%;
-}
-
-.edit {
- width:36%;
-}
-
-.name {
- width:20%;
-}
-
-.click {
- width:14%;
-}
-
-.date {
- width:13%;
-}
-
-.tags {
- width:12%;
-}
-
-td.result {
- font-family:monospace;
- border:1px solid #6495ed;
- padding:5px;
- /*text-align:center;*/
-}
-caption {
- font-family:sans-serif;
-}
-
-a.logout {
-
-}
-
-div.tagCloud {
- background: #C5E3F7 none repeat scroll 0 0;
- max-width: 300px;
- min-width: 200px;
- padding-bottom: 5px;
- padding-left: 10px;
- padding-right: 10px;
- padding-top: 5px;
- margin-bottom: 5px;
- text-align: center;
- border-radius:40px;
- -webkit-border-radius:40px;
- -opera-border-radius:40px;
- -moz-border-radius:40px;
-}
-
-#menu {
- margin: 0;
- padding: 0;
- float: left;
- background-color:#eaf3f9;
- display: inline-block;
- position: relative;
- width: 20%;
-}
-
-#table {
- margin: 0;
- padding: 0;
- float: left;
- position: relative;
- width: 80%;
-}
-
-h1.result {
- font-family:monospace;
- color:#FF3F42;
- font-size:1.6em;
- font-weight:normal;
- line-height:20px;
- margin-bottom:20px;
- margin-left: 5px;
- margin-right: 5px;
- text-align: center;
- background-color: #C5E3F7;
- border-radius: 30px;
- -webkit-border-radius: 30px;
- -moz-border-radius: 30px;
- -opera-border-radius:30px;
-
-}
-
-h1.login {
- font-family:monospace;
- color:#FF3F42;
- border-bottom: 3px solid #C5E3F7;
- margin-bottom: 10px;
-}
-
-h2.result {
- font-family:monospace;
- color:#FF3F42;
- font-size:1em;
- font-weight:normal;
- line-height:20px;
- margin-top:50px;
- text-align: center;
-}
-
-div.menu{
- margin: 10px;
- border-bottom: 1px solid #ccc;
-}
-
-#meta{
- list-style-type: none;
- padding-left: 0px;
-}
-
-#meta li {
- margin-bottom: 5px;
-}
-
-a {
- font-family:monospace;
- color:#0078C8;
- padding: 0;
- margin: 0;
-}
-
-a:hover {
- color: #0095f8;
-}
-
-a.tag {
- font-family:monospace;
- color: #FF3F42;
- margin-left: 2px;
- margin-right: 2px;
- border-radius: 30px;
- -webkit-border-radius: 30px;
- -moz-border-radius: 30px;
- -opera-border-radius:30px;
- text-decoration:none;
-}
-a.tag:hover {
- background:#A9BCE1 none repeat scroll 0 0;
- color:#FFFFFF;
-}
-
-.test {
- text-align: center;
- float: right;
- position: relative;
- bottom: 1%;
- right: 0px;
- width: 4em;
-}
\ No newline at end of file
Modified: trunk/src/main/webapp/footer.jsp
===================================================================
--- trunk/src/main/webapp/footer.jsp 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/webapp/footer.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -4,15 +4,15 @@
String version = (String) request.getAttribute("version");
%>
<body>
- <br />
- <br />
- <div class="Index" id="footer" style="float: left">
- <a shape="rect" href="<%=url%>">bow</a>
- <a shape="rect" href="http://www.chorem.org/projects/list_files/bow"><%=version%></a> -
- <a shape="rect" href="http://www.gnu.org/licenses/agpl.html">Licence AGPL</a> -
- <span title="Copyright">©2010</span>
- <a shape="rect" href="http://www.codelutin.com">Code Lutin</a> -
- <a shape="rect" href="http://www.chorem.org/projects/bow/issues">Rapport de bug</a> -
- <a shape="rect" href="http://list.chorem.org/cgi-bin/mailman/listinfo/bow-users">Support utilisateur</a>
+ <div id="footer">
+ <p>
+ <a shape="rect" href="<%=url%>">bow</a>
+ <a shape="rect" href="http://www.chorem.org/projects/list_files/bow"><%=version%></a> -
+ <a shape="rect" href="http://www.gnu.org/licenses/agpl.html">Licence AGPL</a> -
+ <span title="Copyright">©2010</span>
+ <a shape="rect" href="http://www.codelutin.com">Code Lutin</a> -
+ <a shape="rect" href="http://www.chorem.org/projects/bow/issues">Rapport de bug</a> -
+ <a shape="rect" href="http://list.chorem.org/cgi-bin/mailman/listinfo/bow-users">Support utilisateur</a>
+ </p>
</div>
</body>
\ No newline at end of file
Modified: trunk/src/main/webapp/header.jsp
===================================================================
--- trunk/src/main/webapp/header.jsp 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/webapp/header.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -4,46 +4,26 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <meta name="description" content="Bookmark On Web" />
+ <meta name="description" content="Bookmark On the Web" />
<title>Bow</title>
- <link rel="stylesheet" type="text/css" href="./css/styles.css" />
<link rel="search" type="application/opensearchdescription+xml" title="bowTemporarySearchEngine" href="<%=url%>bow?action=temporaryXml" />
<link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="<%=url%>bow?action=permanentXml" />
+ <link rel="stylesheet" type="text/css" href="./css/bookmark.css" />
<script type="text/javascript">
<!--
- function modify(name, alias, tags, link, action, id) {
- var form = document.getElementById("bookmarkForm");
- form.elements["url"].value = link;
- form.elements["name"].value = name;
- form.elements["tags"].value = tags;
- form.elements["alias"].value = alias;
- form.elements["submit"].value = 'Modif';
- form.action = action;
- var del = null;
- var count = 0;
- for ((del = document.getElementById(id + count)); del != null; del = document.getElementById(id + count)) {
- del.style.display = 'inline';
- ++count;
- }
- return false;
+ function modify(name, alias, tags, link, action, id) {
+ var form = document.getElementById("bookmarkForm");
+ form.elements["url"].value = link;
+ form.elements["name"].value = name;
+ form.elements["tags"].value = tags;
+ form.elements["alias"].value = alias;
+ form.action = action;
+ var tab = document.getElementsByName(id);
+ for (var count = 0; count < tab.length; ++count) {
+ tab[count].style.display = 'inline';
}
-
- function modifyLast(name, alias, tags, link, action, id) {
- var form = document.getElementById("bookmarkForm");
- form.elements["url"].value = link;
- form.elements["name"].value = name;
- form.elements["tags"].value = tags;
- form.elements["alias"].value = alias;
- form.elements["submit"].value = 'Modif';
- form.action = action;
- var del = null;
- var count = 0;
- for ((del = document.getElementById(count + id)); del != null; del = document.getElementById(count + id)) {
- del.style.display = 'inline';
- ++count;
- }
- return false;
- }
+ return false;
+ }
//-->
</script>
</head>
\ No newline at end of file
Added: trunk/src/main/webapp/img/aide.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/aide.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/click.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/click.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/croix.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/croix.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/edit.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/edit.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/fdboutonV.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/fdboutonV.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/fondbouton.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/fondbouton.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/fondconnexion.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/fondconnexion.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/fondhead.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/fondhead.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/livreG.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/livreG.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/logobow.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/logobow.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/moyen-livre.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/moyen-livre.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/piedmenu.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/piedmenu.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/pointemenu.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/pointemenu.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/ptit-livre.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/ptit-livre.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/tag.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/tag.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/webapp/login.jsp
===================================================================
--- trunk/src/main/webapp/login.jsp 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/webapp/login.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -6,26 +6,47 @@
%>
<html>
- <jsp:include page="header.jsp" flush="true">
- <jsp:param name="bowUrl" value="<%=url%>"/>
- </jsp:include>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta name="description" content="Bookmark On the Web" />
+ <title>Bow</title>
+ <link rel="stylesheet" type="text/css" href="./css/connexion.css" />
+ </head>
<body>
- <h1 class="login">Login</h1>
- <form method="POST" action="bow?action=login">
- email <input type="text" name="email" size="20">
- <br />
- password <input type=password name="password" size="20">
- <br />
- <input type="submit" value="login">
- </form>
- <a href="bow?action=registration">register</a>
- <br />
- <%if (error != null) {%>
- <font color="red"><%=error%></font>
- <%}%>
- <jsp:include page="footer.jsp" flush="true" >
- <jsp:param name="bowUrl" value="<%=url%>" />
- <jsp:param name="version" value="<%=version%>" />
- </jsp:include>
+ <div id="headback">
+ <div id="head">
+ <div id="headleft">
+ <a class="logo" href="bow">bow</a>
+ </div>
+ </div>
+ </div>
+ <div id="mainbodyback">
+ <div id="mainbody">
+
+ <div id="content">
+
+ <div id="contenu">
+ <h1>Login</h1>
+ <form method="POST" action="bow?action=login" >
+ <p>Email :</p>
+ <input type="text" name="email" />
+ <p>Password :</p>
+ <input type=password name="password" />
+ <button type="submit">Login</button>
+ </form>
+ <a href="bow?action=registration">Register</a>
+ </div>
+ <br />
+ <%if (error != null) {%>
+ <font color="red"><%=error%></font>
+ <%}%>
+ </div>
+
+ </div>
+ <jsp:include page="footer.jsp" flush="true" >
+ <jsp:param name="bowUrl" value="<%=url%>" />
+ <jsp:param name="version" value="<%=version%>" />
+ </jsp:include>
+ </div>
</body>
</html>
\ No newline at end of file
Modified: trunk/src/main/webapp/main.jsp
===================================================================
--- trunk/src/main/webapp/main.jsp 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/webapp/main.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -15,18 +15,17 @@
String formBookmarkId = (String) request.getAttribute("bookmarkId");
String formTags = (String) request.getAttribute("tags");
String formAlias = (String) request.getAttribute("alias");
- String formButton = (String) request.getAttribute("button");
String formAction = (String) request.getAttribute("action");
%>
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml">
<jsp:include page="header.jsp" flush="true">
<jsp:param name="bowUrl" value="<%=url%>"/>
</jsp:include>
<%
if (searchLine != null) {
%>
- <jsp:include page="search2.jsp" flush="true">
+ <jsp:include page="bookmarkSearch.jsp" flush="true">
<jsp:param name="bookmarkActions" value="<%=tokenActions%>" />
<jsp:param name="bookmarkActions" value="<%=bookmarkActions%>" />
<jsp:param name="bowUrl" value="<%=url%>"/>
@@ -35,12 +34,12 @@
<jsp:param name="bookmarkId" value="<%=formBookmarkId%>"/>
<jsp:param name="tags" value="<%=formTags%>"/>
<jsp:param name="alias" value="<%=formAlias%>"/>
- <jsp:param name="button" value="<%=formButton%>"/>
<jsp:param name="action" value="<%=formAction%>"/>
</jsp:include>
<% } else {
%>
- <jsp:include page="home.jsp" flush="true">
+
+ <jsp:include page="bookmarkHome.jsp" flush="true">
<jsp:param name="bookmarkActions" value="<%=tokenActions%>" />
<jsp:param name="bookmarkActions" value="<%=bookmarkActions%>" />
<jsp:param name="bowUrl" value="<%=url%>"/>
@@ -49,7 +48,6 @@
<jsp:param name="bookmarkId" value="<%=formBookmarkId%>"/>
<jsp:param name="tags" value="<%=formTags%>"/>
<jsp:param name="alias" value="<%=formAlias%>"/>
- <jsp:param name="button" value="<%=formButton%>"/>
<jsp:param name="action" value="<%=formAction%>"/>
</jsp:include>
<% }
Modified: trunk/src/main/webapp/openSearchResult.jsp
===================================================================
--- trunk/src/main/webapp/openSearchResult.jsp 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/webapp/openSearchResult.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -24,83 +24,72 @@
<jsp:param name="bowUrl" value="<%=url%>"/>
</jsp:include>
<body>
- <h1 class="result">Results</h1>
+ <div id="mainbodyback" class="clearfix">
+ <div id="mainbody">
- <% if (bookmarkActions != null) {
- List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
- if (!bookmarkList.isEmpty()) {
- %>
- <table class="result">
- <tr class="result">
- <th class="result">
- Date
- <a style="text-decoration:none" href="bow?action=orderAscOS&type=date&searchLine=<%=searchLine%>" >
- <IMG style="border:none" SRC="img/asc.png" ALT="order ASC" TITLE="Asc" />
- </a>
- <a style="text-decoration:none" href="bow?action=orderDescOS&type=date&searchLine=<%=searchLine%>">
- <IMG style="border:none" SRC="img/desc.png" ALT="order DESC" TITLE="Desc" />
- </a>
- </th>
- <th class="result">
- Name
- <a style="text-decoration:none" href="bow?action=orderAscOS&type=name&searchLine=<%=searchLine%>">
- <IMG style="border:none" SRC="img/asc.png" ALT="order ASC" TITLE="Asc" />
- </a>
- <a style="text-decoration:none" href="bow?action=orderDescOS&type=name&searchLine=<%=searchLine%>">
- <IMG style="border:none" SRC="img/desc.png" ALT="order DESC" TITLE="Desc" />
- </a>
- </th>
- <th class="result">Tags</th>
- <th class="result">
- Click
- <a style="text-decoration:none" href="bow?action=orderAscOS&type=click&searchLine=<%=searchLine%>">
- <IMG style="border:none" SRC="img/asc.png" ALT="order ASC" TITLE="Asc" />
- </a>
- <a style="text-decoration:none" href="bow?action=orderDescOS&type=click&searchLine=<%=searchLine%>">
- <IMG style="border:none" SRC="img/desc.png" ALT="order DESC" TITLE="Desc" />
- </a>
- </th>
- </tr>
- <%
- SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
- for (Bookmark bookmark : bookmarkList) {
- %>
- <tr class="result">
- <td class="result">
- <%=sdf.format(bookmark.getDate())%>
- </td>
- <td class="result">
- <a href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
- </td>
- <td class="result">
- <%
- Set<String> tagList = bookmark.getTags();
- if (tagList != null && !tagList.isEmpty()) {
- for (String tag : tagList) {
- %>
- <%=tag%>
- <%
- }
- %>
- </td>
- <%
- }
- %>
- <td class="result">
- <%=bookmark.getClick()%>
- </td>
- </tr>
- <%
- }
- %>
- </table>
- <%
- } else {
- %>
- <h2 class="result">No Bookmarks found</h2>
- <% }
- }
- %>
+ <div id="content">
+ <div class="menu clearfix"><p>Result</p>
+ <form method="POST" action="bow?action=orderOS&searchLine=<%=searchLine%>">
+ <label>Order By :</label>
+ <select name="type">
+ <option value="ascName">Asc Name</option>
+ <option value="descName">Desc Name</option>
+ <option value="ascClick">Asc Click</option>
+ <option value="descClick">Desc Click</option>
+ <option value="ascDate">Asc Date</option>
+ <option value="descDate">Desc Date</option>
+ </select>
+ <button type="submit">OK</button>
+ </form>
+ </div>
+ <div id="contenu">
+ <%
+ List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
+ if (!bookmarkList.isEmpty()) {
+ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
+ for (Bookmark bookmark : bookmarkList) {
+ String link = bookmark.getLink();
+ link = link.replace("'", "\\'");
+ %>
+ <body>
+ <div class="bookmark">
+ <div class="bookmarkhead clearfix">
+ <a href="<%=url + bookmark.getAlias()%>" title="<%=url + bookmark.getAlias()%>" target="_blank">
+ <%=bookmark.getAlias()%>
+ </a>
+ <span> (<%=sdf.format(bookmark.getDate())%>)</span>
+ </div>
+ <div class="bookmarkcontenu clearfix">
+ <div class="screenshot"></div>
+ <div class="description">
+ <h3>Description :</h3>
+ <p><a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a></p>
+ <p class="tags"><strong>Tags :</strong>
+ <%
+ Set<String> tagList = bookmark.getTags();
+ if (tagList != null && !tagList.isEmpty()) {
+ for (String tag : tagList) {
+ %>
+ <%=tag%>
+ <%
+ }
+ }
+ %>
+ </p>
+ </div>
+ <div class="click"><%=bookmark.getClick()%></div>
+ </div>
+ </div>
+ <%
+ }
+ } else {
+ %>
+ <h2>No Bookmarks</h2>
+ <%}%>
+ </div>
+ </div>
+ </div>
+ </div>
<jsp:include page="footer.jsp" flush="true" >
<jsp:param name="bowUrl" value="<%=url%>" />
<jsp:param name="version" value="<%=version%>" />
Added: trunk/src/main/webapp/preference.jsp
===================================================================
--- trunk/src/main/webapp/preference.jsp (rev 0)
+++ trunk/src/main/webapp/preference.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -0,0 +1,34 @@
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="org.chorem.bow.Preference" %>
+<%
+ String error = (String) request.getAttribute("msgError");
+ String url = (String) request.getAttribute("bowUrl");
+ String version = (String) request.getAttribute("version");
+ Preference preference = (Preference) request.getAttribute("preference");
+ User user = session.getAttribute("user");
+%>
+
+<html>
+ <jsp:include page="header.jsp" flush="true">
+ <jsp:param name="bowUrl" value="<%=url%>"/>
+ </jsp:include>
+ <body>
+ <h1 class="login">Login</h1>
+ <form method="POST" action="bow?action=login">
+ email <input type="text" name="email" size="20">
+ <br />
+ password <input type=password name="password" size="20">
+ <br />
+ <input type="submit" value="login">
+ </form>
+ <a href="bow?action=registration">register</a>
+ <br />
+ <%if (error != null) {%>
+ <font color="red"><%=error%></font>
+ <%}%>
+ <jsp:include page="footer.jsp" flush="true" >
+ <jsp:param name="bowUrl" value="<%=url%>" />
+ <jsp:param name="version" value="<%=version%>" />
+ </jsp:include>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/src/main/webapp/preferences.jsp
===================================================================
--- trunk/src/main/webapp/preferences.jsp (rev 0)
+++ trunk/src/main/webapp/preferences.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -0,0 +1,82 @@
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+
+<%@page import="org.chorem.bow.Preference" %>
+<%@page import="org.chorem.bow.User" %>
+
+<%
+ User user = (User) session.getAttribute("user");
+ Preference preference = (Preference) session.getAttribute("preference");
+ if (user != null && preference != null) {
+ String url = (String) request.getAttribute("bowUrl");
+ String version = (String) request.getAttribute("version");
+ String check = preference.getColors();
+ if (check == null) {
+ preference.setColors("");
+ }
+ check = preference.getSearchEngineUrlResults();
+ if (check == null) {
+ preference.setSearchEngineUrlResults("");
+ }
+ check = preference.getSearchEngineUrlSuggestions();
+ if (check == null) {
+ preference.setSearchEngineUrlSuggestions("");
+ }
+%>
+
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta name="description" content="Bookmark On the Web" />
+ <title>Bow</title>
+ <link rel="stylesheet" type="text/css" href="./css/connexion.css" />
+ </head>
+
+ <body>
+ <div id="headback">
+ <div id="head">
+ <div id="headleft">
+ <a class="logo" href="bow">bow</a>
+ </div>
+ </div>
+ </div>
+ <div id="mainbodyback">
+ <div id="mainbody">
+
+ <div id="content">
+
+ <form method="POST" action="bow?action=changePreferences">
+
+ <h1>User Informations</h1>
+ <p>Email :</p>
+ <input type="text" name="email" value="<%=user.getEmail()%>"/>
+ <p>Password :</p>
+ <input type=password name="password"/>
+
+ <br/>
+
+ <h1>Site look</h1>
+ <p>Site color</p>
+ <input type="text" name="colors" value="<%=preference.getColors()%>"/>
+ <p>Tags number displays in the tag cloud</p>
+ <input type="text" name="tags" value="<%=preference.getTags()%>"/>
+ <p>Bookmarks number diplays in the home page</p>
+ <input type="text" name="bookmarks" value="<%=preference.getBookmarks()%>"/>
+ <p>Search Engine URL Suggestions</p>
+ <input type="text" name="searchEngineUrlSuggestions" value="<%=preference.getSearchEngineUrlSuggestions()%>"/>
+ <p>Search Engine URL Results</p>
+ <input type="text" name="searchEngineUrlResults" value="<%=preference.getSearchEngineUrlResults()%>"/>
+
+ <button type="submit">Change</button>
+ </form>
+ <a href="bow?action=home">Return to the home page</a>
+ </div>
+
+ </div>
+ <jsp:include page="footer.jsp" flush="true" >
+ <jsp:param name="bowUrl" value="<%=url%>" />
+ <jsp:param name="version" value="<%=version%>" />
+ </jsp:include>
+ </div>
+ </body>
+</html>
+<%}%>
\ No newline at end of file
Modified: trunk/src/main/webapp/register.jsp
===================================================================
--- trunk/src/main/webapp/register.jsp 2010-06-04 13:37:29 UTC (rev 67)
+++ trunk/src/main/webapp/register.jsp 2010-06-08 15:07:02 UTC (rev 68)
@@ -4,28 +4,49 @@
String url = (String) request.getAttribute("bowUrl");
String version = (String) request.getAttribute("version");
%>
+
<html>
- <jsp:include page="header.jsp" flush="true">
- <jsp:param name="bowUrl" value="<%=url%>"/>
- </jsp:include>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta name="description" content="Bookmark On the Web" />
+ <title>Bow</title>
+ <link rel="stylesheet" type="text/css" href="./css/connexion.css" />
+ </head>
<body>
- <h1 class="login">Register</h1>
+ <div id="headback">
+ <div id="head">
+ <div id="headleft">
+ <a class="logo" href="bow">bow</a>
+ </div>
+ </div>
+ </div>
+ <div id="mainbodyback">
+ <div id="mainbody">
- <form method="POST" action="bow?action=register">
- email <input type="text" name="email" size="20">
- <br />
- password <input type=password name="password" size="20">
- <br />
- <input type="submit" value="Register">
- </form>
- <a href="bow">Return to the login page</a>
- <br />
- <%if (error != null && error.isEmpty() == false) {%>
- <font color="red"><%=error%></font>
- <%}%>
- <jsp:include page="footer.jsp" flush="true" >
- <jsp:param name="bowUrl" value="<%=url%>" />
- <jsp:param name="version" value="<%=version%>" />
- </jsp:include>
+ <div id="content">
+
+ <div id="contenu">
+ <h1>Register</h1>
+ <form method="POST" action="bow?action=register" >
+ <p>Email :</p>
+ <input type="text" name="email" />
+ <p>Password :</p>
+ <input type=password name="password" />
+ <button>Register</button>
+ </form>
+ <a href="bow">Return to the login page</a>
+ </div>
+ <br />
+ <%if (error != null) {%>
+ <font color="red"><%=error%></font>
+ <%}%>
+ </div>
+
+ </div>
+ <jsp:include page="footer.jsp" flush="true" >
+ <jsp:param name="bowUrl" value="<%=url%>" />
+ <jsp:param name="version" value="<%=version%>" />
+ </jsp:include>
+ </div>
</body>
</html>
\ No newline at end of file
Modified: trunk/src/main/xmi/bow.zargo
===================================================================
(Binary files differ)
1
0
04 Jun '10
Author: bbrossaud
Date: 2010-06-04 15:37:29 +0200 (Fri, 04 Jun 2010)
New Revision: 67
Url: http://chorem.org/repositories/revision/bow/67
Log:
addition edition in javascript or not
Modified:
trunk/src/main/java/org/chorem/bow/BowProxy.java
trunk/src/main/java/org/chorem/bow/ControllerServlet.java
trunk/src/main/webapp/header.jsp
trunk/src/main/webapp/home.jsp
trunk/src/main/webapp/main.jsp
trunk/src/main/webapp/search2.jsp
Modified: trunk/src/main/java/org/chorem/bow/BowProxy.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowProxy.java 2010-06-03 16:03:39 UTC (rev 66)
+++ trunk/src/main/java/org/chorem/bow/BowProxy.java 2010-06-04 13:37:29 UTC (rev 67)
@@ -23,6 +23,7 @@
import org.nuiton.wikitty.WikittyProxy;
import org.nuiton.wikitty.WikittyService;
import org.nuiton.wikitty.WikittyServiceCached;
+import org.nuiton.wikitty.WikittyServiceNotifier;
import org.nuiton.wikitty.jdbc.WikittyServiceJDBC;
/**
@@ -51,6 +52,8 @@
protected BowProxy(BowConfig config) {
WikittyService ws = new WikittyServiceJDBC(config.getFlatOptions());
+ // fix me 04/06/2009
+ ws = new WikittyServiceNotifier(ws);
ws = new WikittyServiceCached(ws);
setWikittyService(ws);
}
Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-03 16:03:39 UTC (rev 66)
+++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-04 13:37:29 UTC (rev 67)
@@ -400,19 +400,27 @@
*/
protected void actionEditBookmark(HttpServletRequest request, HttpServletResponse response, User user)
throws IOException, ServletException {
- String tags = request.getParameter("tags");
- String name = request.getParameter("name");
String bookmarkId = request.getParameter("bookmarkId");
if (bookmarkId != null && !bookmarkId.isEmpty()) {
WikittyProxy proxy = BowProxy.getInstance();
Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId);
if (bookmark != null) {
- BookmarkActions.updateBookmarkName(bookmark, name);
- BookmarkActions.addTagsToBookmark(tags, bookmark);
- proxy.store(bookmark);
+ request.setAttribute("link", bookmark.getLink());
+ request.setAttribute("name", bookmark.getDescription());
+ request.setAttribute("alias", bookmark.getAlias());
+ request.setAttribute("tags", BookmarkActions.getBookmarkTagsString(bookmark));
+ request.setAttribute("button", "Modify");
+ request.setAttribute("action", "bow?action=modifyBookmark");
+ request.setAttribute("bookmarkId", bookmarkId);
}
}
- redirectToTheGoodPage(request, response);
+ String searchLine = request.getParameter("searchLine");
+ if (searchLine == null) {
+ actionHome(request, user);
+ } else {
+ actionSearch(request, user);
+ }
+ request.getRequestDispatcher("main.jsp").forward(request, response);
}
/* @param request servlet request
@@ -493,7 +501,7 @@
redirectToTheGoodPage(request, response);
}
- protected void actionModifyBookmark(HttpServletRequest request, HttpServletResponse response, User user)
+ protected void actionModifyBookmark(HttpServletRequest request, HttpServletResponse response, User user)
throws IOException {
String link = request.getParameter("url"); // url of the website
String name = request.getParameter("name"); // website name
Modified: trunk/src/main/webapp/header.jsp
===================================================================
--- trunk/src/main/webapp/header.jsp 2010-06-03 16:03:39 UTC (rev 66)
+++ trunk/src/main/webapp/header.jsp 2010-06-04 13:37:29 UTC (rev 67)
@@ -11,15 +11,39 @@
<link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="<%=url%>bow?action=permanentXml" />
<script type="text/javascript">
<!--
- function modify(name, alias, tags, url, action) {
+ function modify(name, alias, tags, link, action, id) {
var form = document.getElementById("bookmarkForm");
- form.elements["url"].value = url;
+ form.elements["url"].value = link;
form.elements["name"].value = name;
form.elements["tags"].value = tags;
form.elements["alias"].value = alias;
form.elements["submit"].value = 'Modif';
form.action = action;
+ var del = null;
+ var count = 0;
+ for ((del = document.getElementById(id + count)); del != null; del = document.getElementById(id + count)) {
+ del.style.display = 'inline';
+ ++count;
+ }
+ return false;
}
+
+ function modifyLast(name, alias, tags, link, action, id) {
+ var form = document.getElementById("bookmarkForm");
+ form.elements["url"].value = link;
+ form.elements["name"].value = name;
+ form.elements["tags"].value = tags;
+ form.elements["alias"].value = alias;
+ form.elements["submit"].value = 'Modif';
+ form.action = action;
+ var del = null;
+ var count = 0;
+ for ((del = document.getElementById(count + id)); del != null; del = document.getElementById(count + id)) {
+ del.style.display = 'inline';
+ ++count;
+ }
+ return false;
+ }
//-->
</script>
</head>
\ No newline at end of file
Modified: trunk/src/main/webapp/home.jsp
===================================================================
--- trunk/src/main/webapp/home.jsp 2010-06-03 16:03:39 UTC (rev 66)
+++ trunk/src/main/webapp/home.jsp 2010-06-04 13:37:29 UTC (rev 67)
@@ -16,6 +16,33 @@
String temporaryToken = tokenActions.getTemporaryToken();
String permanentToken = tokenActions.getPermanentToken();
String url = (String) request.getAttribute("bowUrl");
+
+ String formLink = (String) request.getAttribute("link");
+ String formName = (String) request.getAttribute("name");
+ String formBookmarkId = (String) request.getAttribute("bookmarkId");
+ String formTags = (String) request.getAttribute("tags");
+ String formAlias = (String) request.getAttribute("alias");
+ String formButton = (String) request.getAttribute("button");
+ String formAction = (String) request.getAttribute("action");
+
+ if (formLink == null) {
+ formLink = "URL";
+ }
+ if (formName == null) {
+ formName = "name";
+ }
+ if (formTags == null) {
+ formTags = "tag1 tag2...";
+ }
+ if (formAlias == null) {
+ formAlias = "alias";
+ }
+ if (formButton == null) {
+ formButton = "Add";
+ }
+ if (formAction == null) {
+ formAction = "bow?action=addUrl";
+ }
%>
<body>
<div id="table">
@@ -32,6 +59,8 @@
<%
for (Bookmark bookmark : bookmarkList) {
+ String link = bookmark.getLink();
+ link = link.replace("'", "\\'");
%>
<table class="result">
<tr class="result">
@@ -44,7 +73,9 @@
</div>
<div style="float: right">
- <input type="image" src="img/edit.png" title="Edit" onclick="modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=bookmark.getLink()%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>')"/>
+ <a style="border:none;text-decoration: none" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');">
+ <IMG style="border:none;" src="img/edit.png" title="Edit" ALT="Edit Bookmark" />
+ </a>
<a style="border:none;text-decoration: none" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
<IMG style="border:none;" SRC="img/remove.png" ALT="Remove bookmark" TITLE="Remove" />
</a>
@@ -69,21 +100,29 @@
<br />
tags :
<%
- Set<String> tagList = bookmark.getTags();
- if (tagList != null && !tagList.isEmpty()) {
- for (String tag : tagList) {
+ Set<String> tagList = bookmark.getTags();
+ if (tagList != null && !tagList.isEmpty()) {
+ int count = 0;
+ for (String tag : tagList) {
+ if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) {
%>
- <a id="delete" style="display:none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <a id="<%=bookmark.getWikittyId() + count%>" style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
<IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
</a>
+ <%} else {%>
+ <a id="<%=bookmark.getWikittyId() + count%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <%}%>
<a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
<%
- }
+ ++count;
+ }
%>
</div>
</td>
<%
- }
+ }
%>
</tr>
<br />
@@ -103,6 +142,8 @@
<h2 class="result">The last addition bookmarks</h2>
<%
for (Bookmark bookmark : lastBookmarks) {
+ String link = bookmark.getLink();
+ link = link.replace("'", "\\'");
%>
<table class="result">
<tr class="result">
@@ -115,7 +156,9 @@
</div>
<div style="float: right">
- <input type="image" src="img/edit.png" title="Edit" onclick="modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=bookmark.getLink()%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>')"/>
+ <a style="border:none;text-decoration: none" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>" onclick="return modifyLast('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');">
+ <IMG style="border:none;" src="img/edit.png" title="Edit" ALT="Edit Bookmark" />
+ </a>
<a style="border:none;text-decoration: none" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
<IMG style="border:none;" SRC="img/remove.png" ALT="Remove bookmark" TITLE="Remove" />
</a>
@@ -142,14 +185,22 @@
<%
Set<String> tagList = bookmark.getTags();
if (tagList != null && !tagList.isEmpty()) {
+ int count = 0;
for (String tag : tagList) {
+ if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) {
%>
- <a id="delete" style="display:none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <a id="<%=count + bookmark.getWikittyId()%>" style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
<IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
</a>
+ <%} else {%>
+ <a id="<%=count + bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <%}%>
<a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
<%
- }
+ ++count;
+ }
%>
</div>
</td>
@@ -179,15 +230,15 @@
</ul>
</div>
<div class="menu">
- <form id="bookmarkForm" method="POST" action="bow?action=addUrl">
+ <form id="bookmarkForm" method="POST" action="<%=formAction%>">
URL<br />
- <input type="text" name="url" size="20" value="URL" /><br />
+ <input type="text" name="url" size="20" value="<%=formLink%>" /><br />
Name<br />
- <input type="text" name="name" size="20" value="name" /><br />
+ <input type="text" name="name" size="20" value="<%=formName%>" /><br />
Tags<br />
- <input type="text" name="tags" size="20" value="tag1 tag2..." /><br />
- Alias<br /><input type="text" name="alias" size="20" value="alias" /><br />
- <input type="submit" name="submit" value="add" />
+ <input type="text" name="tags" size="20" value="<%=formTags%>" /><br />
+ Alias<br /><input type="text" name="alias" size="20" value="<%=formAlias%>" /><br />
+ <input type="submit" name="submit" value="<%=formButton%>" />
</form>
</div>
Modified: trunk/src/main/webapp/main.jsp
===================================================================
--- trunk/src/main/webapp/main.jsp 2010-06-03 16:03:39 UTC (rev 66)
+++ trunk/src/main/webapp/main.jsp 2010-06-04 13:37:29 UTC (rev 67)
@@ -9,6 +9,14 @@
String searchLine = bookmarkActions.getSearchLine();
String url = (String) request.getAttribute("bowUrl");
String version = (String) request.getAttribute("version");
+
+ String formLink = (String) request.getAttribute("link");
+ String formName = (String) request.getAttribute("name");
+ String formBookmarkId = (String) request.getAttribute("bookmarkId");
+ String formTags = (String) request.getAttribute("tags");
+ String formAlias = (String) request.getAttribute("alias");
+ String formButton = (String) request.getAttribute("button");
+ String formAction = (String) request.getAttribute("action");
%>
<html>
@@ -22,6 +30,13 @@
<jsp:param name="bookmarkActions" value="<%=tokenActions%>" />
<jsp:param name="bookmarkActions" value="<%=bookmarkActions%>" />
<jsp:param name="bowUrl" value="<%=url%>"/>
+ <jsp:param name="link" value="<%=formLink%>"/>
+ <jsp:param name="name" value="<%=formName%>"/>
+ <jsp:param name="bookmarkId" value="<%=formBookmarkId%>"/>
+ <jsp:param name="tags" value="<%=formTags%>"/>
+ <jsp:param name="alias" value="<%=formAlias%>"/>
+ <jsp:param name="button" value="<%=formButton%>"/>
+ <jsp:param name="action" value="<%=formAction%>"/>
</jsp:include>
<% } else {
%>
@@ -29,6 +44,13 @@
<jsp:param name="bookmarkActions" value="<%=tokenActions%>" />
<jsp:param name="bookmarkActions" value="<%=bookmarkActions%>" />
<jsp:param name="bowUrl" value="<%=url%>"/>
+ <jsp:param name="link" value="<%=formLink%>"/>
+ <jsp:param name="name" value="<%=formName%>"/>
+ <jsp:param name="bookmarkId" value="<%=formBookmarkId%>"/>
+ <jsp:param name="tags" value="<%=formTags%>"/>
+ <jsp:param name="alias" value="<%=formAlias%>"/>
+ <jsp:param name="button" value="<%=formButton%>"/>
+ <jsp:param name="action" value="<%=formAction%>"/>
</jsp:include>
<% }
%>
Modified: trunk/src/main/webapp/search2.jsp
===================================================================
--- trunk/src/main/webapp/search2.jsp 2010-06-03 16:03:39 UTC (rev 66)
+++ trunk/src/main/webapp/search2.jsp 2010-06-04 13:37:29 UTC (rev 67)
@@ -18,6 +18,33 @@
String searchLine = bookmarkActions.getSearchLine();
String fullText = bookmarkActions.getFullTextLine();
String url = (String) request.getAttribute("bowUrl");
+
+ String formLink = (String) request.getAttribute("link");
+ String formName = (String) request.getAttribute("name");
+ String formBookmarkId = (String) request.getAttribute("bookmarkId");
+ String formTags = (String) request.getAttribute("tags");
+ String formAlias = (String) request.getAttribute("alias");
+ String formButton = (String) request.getAttribute("button");
+ String formAction = (String) request.getAttribute("action");
+
+ if (formLink == null) {
+ formLink = "URL";
+ }
+ if (formName == null) {
+ formName = "name";
+ }
+ if (formTags == null) {
+ formTags = "tag1 tag2...";
+ }
+ if (formAlias == null) {
+ formAlias = "alias";
+ }
+ if (formButton == null) {
+ formButton = "Add";
+ }
+ if (formAction == null) {
+ formAction = "bow?action=addUrl";
+ }
%>
<body>
@@ -55,6 +82,8 @@
if (!bookmarkList.isEmpty()) {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
for (Bookmark bookmark : bookmarkList) {
+ String link = bookmark.getLink();
+ link = link.replace("'", "\\'");
%>
<table class="result">
<tr class="result">
@@ -67,7 +96,9 @@
</div>
<div style="float: right">
- <input type="image" src="img/edit.png" title="Edit" onclick="modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=bookmark.getLink()%>', 'bow?action=modifyBookmark&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>&bookmarkId=<%=bookmark.getWikittyId()%>')"/>
+ <a style="border:none;text-decoration: none" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');">
+ <IMG style="border:none;" src="img/edit.png" title="Edit" ALT="Edit Bookmark" />
+ </a>
<a style="border:none;text-decoration: none" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
<IMG style="border:none;" SRC="img/remove.png" ALT="Remove bookmark" TITLE="Remove" />
</a>
@@ -94,13 +125,23 @@
<%
Set<String> tagList = bookmark.getTags();
if (tagList != null && !tagList.isEmpty()) {
+ int count = 0;
for (String tag : tagList) {
+ if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) {
%>
- <a id="delete" style="display:none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <a id="<%=bookmark.getWikittyId() + count%>" style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" >
<IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
</a>
- <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
+ <%} else {%>
+ <a id="<%=bookmark.getWikittyId() + count%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" >
+ <IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
<%}%>
+ <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none;"><%=tag%></a>
+ <%
+ ++count;
+ }
+ %>
</div>
</td>
<%
@@ -129,16 +170,16 @@
</ul>
</div>
<div class="menu">
- <form id="bookmarkForm" method="POST" action="bow?action=addUrl&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <form id="bookmarkForm" method="POST" action="<%=formAction%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
URL<br />
- <input type="text" name="url" size="20" value="URL" /><br />
+ <input type="text" name="url" size="20" value="<%=formLink%>" /><br />
Name<br />
- <input type="text" name="name" size="20" value="name" /><br />
+ <input type="text" name="name" size="20" value="<%=formName%>" /><br />
Tags<br />
- <input type="text" name="tags" size="20" value="tag1 tag2..." /><br />
+ <input type="text" name="tags" size="20" value="<%=formTags%>" /><br />
Alias<br />
- <input type="text" name="alias" size="20" value="alias" /><br />
- <input type="submit" name="submit" value="add" />
+ <input type="text" name="alias" size="20" value="<%=formAlias%>" /><br />
+ <input type="submit" name="submit" value="<%=formButton%>" />
</form>
</div>
1
0
r66 - in trunk/src/main: java/org/chorem/bow webapp webapp/css
by bbrossaud@users.chorem.org 03 Jun '10
by bbrossaud@users.chorem.org 03 Jun '10
03 Jun '10
Author: bbrossaud
Date: 2010-06-03 18:03:39 +0200 (Thu, 03 Jun 2010)
New Revision: 66
Url: http://chorem.org/repositories/revision/bow/66
Log:
new design with javascript
Added:
trunk/src/main/webapp/search2.jsp
Modified:
trunk/src/main/java/org/chorem/bow/BookmarkActions.java
trunk/src/main/java/org/chorem/bow/ControllerServlet.java
trunk/src/main/webapp/css/styles.css
trunk/src/main/webapp/header.jsp
trunk/src/main/webapp/home.jsp
trunk/src/main/webapp/main.jsp
trunk/src/main/webapp/search.jsp
Modified: trunk/src/main/java/org/chorem/bow/BookmarkActions.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BookmarkActions.java 2010-06-03 08:18:34 UTC (rev 65)
+++ trunk/src/main/java/org/chorem/bow/BookmarkActions.java 2010-06-03 16:03:39 UTC (rev 66)
@@ -37,7 +37,7 @@
String link = getUrlFromHtml(html);
String tags = getTagsFromHtml(html);
Date date = getDateFromHtml(html);
- Bookmark bookmark = createBookmark(link, name, tags, user, date);
+ Bookmark bookmark = createBookmark(link, name, tags, user, null, date);
return bookmark;
}
@@ -90,9 +90,9 @@
return export;
}
- /* @param html String html
- *
- */
+ /* @param html String html
+ *
+ */
public static String getUrlFromHtml(String html) {
String url = "";
if (html != null) {
@@ -184,7 +184,7 @@
}
}
- public static Bookmark createBookmark(String url, String name, String tags, User user, Date date) {
+ public static Bookmark createBookmark(String url, String name, String tags, User user, String alias, Date date) {
Bookmark bookmark = (Bookmark) new BookmarkImpl();
if (name != null) {
name = name.trim();
@@ -212,7 +212,12 @@
date = new Date();
}
bookmark.setDate(date); // set the date
- bookmark.setAlias("");
+ if (alias != null) {
+ alias = alias.trim();
+ bookmark.setAlias(alias);
+ } else {
+ bookmark.setAlias("");
+ }
return bookmark;
}
@@ -223,6 +228,33 @@
}
}
+ public static void updateBookmark(Bookmark bookmark, String name, String link, String str, String alias) {
+ if (name != null) {
+ name = name.trim();
+ bookmark.setDescription(name);
+ }
+ if (link != null) {
+ link = link.trim();
+ bookmark.setLink(link);
+ }
+ if (str != null) {
+ bookmark.clearTags();
+ if (!str.isEmpty()) {
+ str = str.trim();
+ String[] tags = str.split("\\s+");
+ for (int i = 0; i < tags.length; i++) {
+ if (bookmark.getTags() == null || !bookmark.getTags().contains(tags[i])) {
+ bookmark.addTags(tags[i]);
+ }
+ }
+ }
+ }
+ if (alias != null) {
+ alias = alias.trim();
+ bookmark.setAlias(alias);
+ }
+ }
+
public static String getBookmarkTagsString(Bookmark bookmark) {
if (bookmark != null) {
Set<String> tags = bookmark.getTags();
Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-03 08:18:34 UTC (rev 65)
+++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-03 16:03:39 UTC (rev 66)
@@ -118,6 +118,11 @@
log.debug("Going to actionAddUrl");
}
this.actionAddUrl(request, response, user);
+ } else if (action.equals("modifyBookmark") && user != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Going to actionModif");
+ }
+ this.actionModifyBookmark(request, response, user);
} else if (action.equals("importBookmarks") && user != null) {
if (log.isDebugEnabled()) {
log.debug("Going to actionImportBookmarks");
@@ -488,6 +493,22 @@
redirectToTheGoodPage(request, response);
}
+ protected void actionModifyBookmark(HttpServletRequest request, HttpServletResponse response, User user)
+ throws IOException {
+ String link = request.getParameter("url"); // url of the website
+ String name = request.getParameter("name"); // website name
+ String alias = request.getParameter("alias");
+ String tags = request.getParameter("tags");
+ String id = request.getParameter("bookmarkId");
+ WikittyProxy proxy = BowProxy.getInstance();
+ Bookmark bookmark = proxy.restore(Bookmark.class, id);
+ if (bookmark != null) {
+ BookmarkActions.updateBookmark(bookmark, name, link, tags, alias);
+ proxy.store(bookmark);
+ }
+ redirectToTheGoodPage(request, response);
+ }
+
/* @param request servlet request
* @param response servlet response
* @param user User user
@@ -503,10 +524,11 @@
protected void addUrl(HttpServletRequest request, User user) {
String link = request.getParameter("url"); // url of the website
String name = request.getParameter("name"); // website name
+ String alias = request.getParameter("alias");
Bookmark bookmark = null;
if (name != null) {
String tags = request.getParameter("tags"); // tags
- bookmark = BookmarkActions.createBookmark(link, name, tags, user, null);
+ bookmark = BookmarkActions.createBookmark(link, name, tags, user, alias, null);
} else { // this part is for the bookmark addition by script
String nameAndTags = request.getParameter("nameAndTags");
bookmark = BookmarkActions.createBookmark(link, nameAndTags, user);
Modified: trunk/src/main/webapp/css/styles.css
===================================================================
--- trunk/src/main/webapp/css/styles.css 2010-06-03 08:18:34 UTC (rev 65)
+++ trunk/src/main/webapp/css/styles.css 2010-06-03 16:03:39 UTC (rev 66)
@@ -45,7 +45,7 @@
font-family:monospace;
border:1px solid #6495ed;
padding:5px;
- text-align:center;
+ /*text-align:center;*/
}
caption {
font-family:sans-serif;
@@ -164,3 +164,12 @@
background:#A9BCE1 none repeat scroll 0 0;
color:#FFFFFF;
}
+
+.test {
+ text-align: center;
+ float: right;
+ position: relative;
+ bottom: 1%;
+ right: 0px;
+ width: 4em;
+}
\ No newline at end of file
Modified: trunk/src/main/webapp/header.jsp
===================================================================
--- trunk/src/main/webapp/header.jsp 2010-06-03 08:18:34 UTC (rev 65)
+++ trunk/src/main/webapp/header.jsp 2010-06-03 16:03:39 UTC (rev 66)
@@ -9,4 +9,17 @@
<link rel="stylesheet" type="text/css" href="./css/styles.css" />
<link rel="search" type="application/opensearchdescription+xml" title="bowTemporarySearchEngine" href="<%=url%>bow?action=temporaryXml" />
<link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="<%=url%>bow?action=permanentXml" />
+ <script type="text/javascript">
+ <!--
+ function modify(name, alias, tags, url, action) {
+ var form = document.getElementById("bookmarkForm");
+ form.elements["url"].value = url;
+ form.elements["name"].value = name;
+ form.elements["tags"].value = tags;
+ form.elements["alias"].value = alias;
+ form.elements["submit"].value = 'Modif';
+ form.action = action;
+ }
+ //-->
+ </script>
</head>
\ No newline at end of file
Modified: trunk/src/main/webapp/home.jsp
===================================================================
--- trunk/src/main/webapp/home.jsp 2010-06-03 08:18:34 UTC (rev 65)
+++ trunk/src/main/webapp/home.jsp 2010-06-03 16:03:39 UTC (rev 66)
@@ -24,177 +24,150 @@
Home
</h1>
<%
- if (bookmarkActions != null) {
- List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
- if (!bookmarkList.isEmpty()) {
+ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
+ List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
+ if (!bookmarkList.isEmpty()) {
%>
<h2 class="result">The most used bookmarks</h2>
+
+ <%
+ for (Bookmark bookmark : bookmarkList) {
+ %>
<table class="result">
<tr class="result">
- <th class ="result remove">
- remove
+ <th>
+
+ <div style="float: left">
+ <input type="image" src="img/img.png" title="bookmark" />
+ <%=bookmark.getAlias()%>
+ (<%=sdf.format(bookmark.getDate())%>)
+ </div>
+
+ <div style="float: right">
+ <input type="image" src="img/edit.png" title="Edit" onclick="modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=bookmark.getLink()%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>')"/>
+ <a style="border:none;text-decoration: none" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
+ <IMG style="border:none;" SRC="img/remove.png" ALT="Remove bookmark" TITLE="Remove" />
+ </a>
+ </div>
+
</th>
- <th class="result date">
- Date
- </th>
- <th class="result name">
- Name
- </th>
- <th class ="result tags">
- Tags
- </th>
- <th class=" result click">
- Click
- </th>
</tr>
- <%
- SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
- for (Bookmark bookmark : bookmarkList) {
- %>
- <tr class="result">
+
+ <tr>
<td class="result">
- <a style="border:none;" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
- <IMG style="border:none;" SRC="img/remove.png" ALT="Remove bookmark" TITLE="Remove" />
- </a>
- </td>
- <td class="result">
- <%=sdf.format(bookmark.getDate())%>
- </td>
- <%
- String alias = bookmark.getAlias();
- if (alias != null && !alias.isEmpty()) {
- alias = url + "alias/" + alias;
- }
- %>
- <td class="result" style="text-align: left">
- <a title ="<%=alias%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
- <form method="POST" action="bow?action=addAlias&bookmarkId=<%=bookmark.getWikittyId()%>" style="display: inline">
- <input type="text" name="alias" size="10" value="<%=bookmark.getAlias()%>" />
- <input style="display: inline;" type="submit" value="Add alias" />
- </form>
- <form method="POST" action="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
- <input type="text" name="name" size="35" value="<%=bookmark.getDescription()%>" />
- <input type="image" src="img/edit.png" title="Edit"/>
- </form>
- </td>
- <td class="result" style="text-align: left">
- <%
- 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%>">
- <IMG style="border:none" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ <div class="test">
+ Clicks:
+ <br />
+ <%=bookmark.getClick()%>
+ </div>
+ <div style="float: left; margin: 5px;">
+ <input type="image" src="img/img.png" title="bookmark" />
+ </div>
+
+ <div style="float: left;margin: 5px">
+ <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
+ <br />
+ tags :
+ <%
+ Set<String> tagList = bookmark.getTags();
+ if (tagList != null && !tagList.isEmpty()) {
+ for (String tag : tagList) {
+ %>
+ <a id="delete" style="display:none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
</a>
- <a href="bow?action=search&addTag=<%=tag%>" style="text-decoration: none"><%=tag%></a>
+ <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
+ <%
+ }
+ %>
</div>
- <%
- }
- }
- %>
- <form method="POST" action="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
- <input type="text" name="tags" size="35" value="<%=BookmarkActions.getBookmarkTagsString(bookmark)%>" />
- <input type="image" src="img/edit.png" title="Edit"/>
- </form>
</td>
- <td class="result">
- <%=bookmark.getClick()%>
- </td>
+ <%
+ }
+ %>
</tr>
- <%
- }
- %>
+ <br />
</table>
+
<%
- List<Bookmark> lastBookmarks = bookmarkActions.getLastBookmarks();
- if (!lastBookmarks.isEmpty()) {
+ }
+ } else {
%>
+ <h2 class="result">No Bookmarks</h2>
+ <% }
+ %>
+ <%
+ List<Bookmark> lastBookmarks = bookmarkActions.getLastBookmarks();
+ if (!lastBookmarks.isEmpty()) {
+ %>
<h2 class="result">The last addition bookmarks</h2>
+ <%
+ for (Bookmark bookmark : lastBookmarks) {
+ %>
<table class="result">
<tr class="result">
- <th class ="result remove">
- remove
+ <th>
+
+ <div style="float: left">
+ <input type="image" src="img/img.png" title="bookmark" />
+ <%=bookmark.getAlias()%>
+ (<%=sdf.format(bookmark.getDate())%>)
+ </div>
+
+ <div style="float: right">
+ <input type="image" src="img/edit.png" title="Edit" onclick="modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=bookmark.getLink()%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>')"/>
+ <a style="border:none;text-decoration: none" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
+ <IMG style="border:none;" SRC="img/remove.png" ALT="Remove bookmark" TITLE="Remove" />
+ </a>
+ </div>
+
</th>
- <th class="result date">
- Date
- </th>
- <th class="result name">
- Name
- </th>
- <th class ="result tags">
- Tags
- </th>
- <th class=" result click">
- Click
- </th>
</tr>
- <%
- for (Bookmark bookmark : lastBookmarks) {
- %>
- <tr class="result">
+
+ <tr>
<td class="result">
- <a style="border:none;" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
- <IMG style="border:none;" SRC="img/remove.png" ALT="Remove bookmark" TITLE="Remove" />
- </a>
- </td>
- <td class="result">
- <%=sdf.format(bookmark.getDate())%>
- </td>
- <%
- String alias = bookmark.getAlias();
- if (alias != null && !alias.isEmpty()) {
- alias = url + "alias/" + alias;
- }
- %>
- <td class="result" style="text-align: left">
- <a title ="<%=alias%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
- <form method="POST" action="bow?action=addAlias&bookmarkId=<%=bookmark.getWikittyId()%>" style="display: inline">
- <input type="text" name="alias" size="10" value="<%=bookmark.getAlias()%>" />
- <input style="display: inline;" type="submit" value="Add alias" />
- </form>
- <form method="POST" action="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
- <input type="text" name="name" size="35" value="<%=bookmark.getDescription()%>" />
- <input type="image" src="img/edit.png" title="Edit"/>
- </form>
- </td>
- <td class="result" style="text-align: left">
- <%
- 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%>">
+ <div class="test">
+ Clicks:
+ <br />
+ <%=bookmark.getClick()%>
+ </div>
+ <div style="float: left; margin: 5px;">
+ <input type="image" src="img/img.png" title="bookmark" />
+ </div>
+
+ <div style="float: left;margin: 5px">
+ <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
+ <br />
+ tags :
+ <%
+ Set<String> tagList = bookmark.getTags();
+ if (tagList != null && !tagList.isEmpty()) {
+ for (String tag : tagList) {
+ %>
+ <a id="delete" style="display:none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
<IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
</a>
- <a href="bow?action=search&addTag=<%=tag%>" style="text-decoration: none"><%=tag%></a>
- </div>
- <%
+ <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
+ <%
}
- }
- %>
- <form method="POST" action="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
- <input type="text" name="tags" size="35" value="<%=BookmarkActions.getBookmarkTagsString(bookmark)%>" />
- <input style="display: inline" type="image" src="img/edit.png" title="Edit"/>
- </form>
+ %>
+ </div>
</td>
- <td class="result">
- <%=bookmark.getClick()%>
- </td>
- </tr>
- <%
+ <%
}
- %>
+ %>
+ </tr>
+ <br />
</table>
+
<%
- }
- } else {
+ }
+ } else {
%>
<h2 class="result">No Bookmarks</h2>
- <% }
- }
+ <% }
%>
+
</div>
<div id="menu">
<div class="menu">
@@ -206,20 +179,22 @@
</ul>
</div>
<div class="menu">
- <form method="POST" action="bow?action=addUrl">
+ <form id="bookmarkForm" method="POST" action="bow?action=addUrl">
URL<br />
<input type="text" name="url" size="20" value="URL" /><br />
Name<br />
<input type="text" name="name" size="20" value="name" /><br />
Tags<br />
<input type="text" name="tags" size="20" value="tag1 tag2..." /><br />
- <input type="submit" value="add" />
+ Alias<br /><input type="text" name="alias" size="20" value="alias" /><br />
+ <input type="submit" name="submit" value="add" />
</form>
</div>
<div class="menu">
<div class="tagCloud">
- <% if (bookmarkActions != null) {
+ <% if (bookmarkActions
+ != null) {
List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud();
for (FacetTopic tag : tagCloud) {
int value = tag.getCount();
Modified: trunk/src/main/webapp/main.jsp
===================================================================
--- trunk/src/main/webapp/main.jsp 2010-06-03 08:18:34 UTC (rev 65)
+++ trunk/src/main/webapp/main.jsp 2010-06-03 16:03:39 UTC (rev 66)
@@ -18,7 +18,7 @@
<%
if (searchLine != null) {
%>
- <jsp:include page="search.jsp" flush="true">
+ <jsp:include page="search2.jsp" flush="true">
<jsp:param name="bookmarkActions" value="<%=tokenActions%>" />
<jsp:param name="bookmarkActions" value="<%=bookmarkActions%>" />
<jsp:param name="bowUrl" value="<%=url%>"/>
Modified: trunk/src/main/webapp/search.jsp
===================================================================
--- trunk/src/main/webapp/search.jsp 2010-06-03 08:18:34 UTC (rev 65)
+++ trunk/src/main/webapp/search.jsp 2010-06-03 16:03:39 UTC (rev 66)
@@ -18,7 +18,6 @@
String searchLine = bookmarkActions.getSearchLine();
String fullText = bookmarkActions.getFullTextLine();
String url = (String) request.getAttribute("bowUrl");
- String version = (String) request.getAttribute("version");
%>
<body>
@@ -149,7 +148,7 @@
<input type="text" name="name" size="20" value="name" /><br />
Tags<br />
<input type="text" name="tags" size="20" value="tag1 tag2..." /><br />
- <input type="submit" value="add" />
+ <input name="submit" type="submit" value="add" />
</form>
</div>
Added: trunk/src/main/webapp/search2.jsp
===================================================================
--- trunk/src/main/webapp/search2.jsp (rev 0)
+++ trunk/src/main/webapp/search2.jsp 2010-06-03 16:03:39 UTC (rev 66)
@@ -0,0 +1,183 @@
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="org.chorem.bow.Bookmark" %>
+<%@page import="org.chorem.bow.BookmarkActions" %>
+<%@page import="java.text.SimpleDateFormat" %>
+<%@page import="java.util.Iterator" %>
+<%@page import="java.util.Set" %>
+<%@page import="java.util.ArrayList" %>
+<%@page import="java.util.List" %>
+<%@page import="org.chorem.bow.TokenActions" %>
+<%@page import="org.nuiton.wikitty.FacetTopic" %>
+
+<%
+ TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
+ BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
+ if (tokenActions != null && bookmarkActions != null) {
+ String temporaryToken = tokenActions.getTemporaryToken();
+ String permanentToken = tokenActions.getPermanentToken();
+ String searchLine = bookmarkActions.getSearchLine();
+ String fullText = bookmarkActions.getFullTextLine();
+ String url = (String) request.getAttribute("bowUrl");
+%>
+
+<body>
+ <div id="table">
+ <h1 class="result">
+ <a style="float: left;font-size: 12px; margin-left: 10px;" href="<%=url%>bow?action=home">home</a>
+ My Bookmarks
+ </h1>
+ <div style="text-align: center">
+ Date
+ <a style="text-decoration:none" href="bow?action=orderAsc&type=date&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" >
+ <IMG style="border:none" SRC="img/asc.png" ALT="order ASC" TITLE="Asc" />
+ </a>
+ <a style="text-decoration:none" href="bow?action=orderDesc&type=date&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <IMG style="border:none" SRC="img/desc.png" ALT="order DESC" TITLE="Desc" />
+ </a>
+ Name
+ <a style="text-decoration:none" href="bow?action=orderAsc&type=name&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <IMG style="border:none" SRC="img/asc.png" ALT="order ASC" TITLE="Asc" />
+ </a>
+ <a style="text-decoration:none" href="bow?action=orderDesc&type=name&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <IMG style="border:none" SRC="img/desc.png" ALT="order DESC" TITLE="Desc" />
+ </a>
+ Click
+ <a style="text-decoration:none" href="bow?action=orderAsc&type=click&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <IMG style="border:none" SRC="img/asc.png" ALT="order ASC" TITLE="Asc" />
+ </a>
+ <a style="text-decoration:none" href="bow?action=orderDesc&type=click&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <IMG style="border:none" SRC="img/desc.png" ALT="order DESC" TITLE="Desc" />
+ </a>
+ </div>
+ <br />
+ <%
+ List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
+ if (!bookmarkList.isEmpty()) {
+ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
+ for (Bookmark bookmark : bookmarkList) {
+ %>
+ <table class="result">
+ <tr class="result">
+ <th>
+
+ <div style="float: left">
+ <input type="image" src="img/img.png" title="bookmark" />
+ <%=bookmark.getAlias()%>
+ (<%=sdf.format(bookmark.getDate())%>)
+ </div>
+
+ <div style="float: right">
+ <input type="image" src="img/edit.png" title="Edit" onclick="modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=bookmark.getLink()%>', 'bow?action=modifyBookmark&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>&bookmarkId=<%=bookmark.getWikittyId()%>')"/>
+ <a style="border:none;text-decoration: none" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ <IMG style="border:none;" SRC="img/remove.png" ALT="Remove bookmark" TITLE="Remove" />
+ </a>
+ </div>
+
+ </th>
+ </tr>
+
+ <tr>
+ <td class="result">
+ <div class="test">
+ Clicks:
+ <br />
+ <%=bookmark.getClick()%>
+ </div>
+ <div style="float: left; margin: 5px;">
+ <input type="image" src="img/img.png" title="bookmark" />
+ </div>
+
+ <div style="float: left;margin: 5px">
+ <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
+ <br />
+ tags :
+ <%
+ Set<String> tagList = bookmark.getTags();
+ if (tagList != null && !tagList.isEmpty()) {
+ for (String tag : tagList) {
+ %>
+ <a id="delete" style="display:none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" >
+ <IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
+ </a>
+ <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
+ <%}%>
+ </div>
+ </td>
+ <%
+ }
+ %>
+ </tr>
+ </table>
+ <br />
+ <%
+ }
+ } else {
+ %>
+ <h2 class="result">No Bookmarks</h2>
+ <% }
+ %>
+ </div>
+
+ <div id="menu">
+ <div class="menu">
+ <ul id="meta">
+ <li><a href="bow?action=logout">Logout</a></li>
+ <li><a href="bow?action=home">Home</a></li>
+ <li><a href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');var%20link='<%=url%>bow?action=addUrl&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);void(0);">Temporary token</a></li>
+ <li><a href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');var%20link='<%=url%>bow?action=addUrl&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);void(0);">Current permanent token</a></li>
+ <li><a href="bow?action=generateToken&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">Regenerate permanent token</a></li>
+ </ul>
+ </div>
+ <div class="menu">
+ <form id="bookmarkForm" method="POST" action="bow?action=addUrl&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
+ URL<br />
+ <input type="text" name="url" size="20" value="URL" /><br />
+ Name<br />
+ <input type="text" name="name" size="20" value="name" /><br />
+ Tags<br />
+ <input type="text" name="tags" size="20" value="tag1 tag2..." /><br />
+ Alias<br />
+ <input type="text" name="alias" size="20" value="alias" /><br />
+ <input type="submit" name="submit" value="add" />
+ </form>
+ </div>
+
+ <div class="menu">
+ <div class="tagCloud">
+ <% if (bookmarkActions != null) {
+ List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud();
+ for (FacetTopic tag : tagCloud) {
+ int value = tag.getCount();
+ String tagName = tag.getTopicName();
+ int font = bookmarkActions.getFont(value);
+ %>
+ <a href="bow?action=search&addTag=<%=tagName%>&searchLine=<%=searchLine%>" title="<%=value%> results" class="tag" style="font-size: <%=font%>px;"><%=tagName%></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%>" />
+ <input style="float: left" type="submit" value="Find" />
+ </form>
+ </div>
+ <div class="menu">
+ <form method="POST" action="bow?action=fullText" style="text-align: center;">
+ Full text research
+ <input style="float: left" type="text" name="fullTextLine" size="15" value="<%=bookmarkActions.getFullTextLine()%>" />
+ <input style="float: left;" type="submit" value="Find" />
+ </form>
+ </div>
+ <div class="menu">
+ <form method="post" action="bow?action=importBookmarks&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" enctype="multipart/form-data">
+ Import Bookmarks
+ <input type="file" name="upfile" />
+ <input type="submit" value="Import"/>
+ </form>
+ <br />
+ <a href="bow?action=exportBookmarks&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">Export bookmarks</a>
+ </div>
+ </div>
+ </div>
+</body>
+<%}%>
\ No newline at end of file
1
0
03 Jun '10
Author: bbrossaud
Date: 2010-06-03 10:18:34 +0200 (Thu, 03 Jun 2010)
New Revision: 65
Url: http://chorem.org/repositories/revision/bow/65
Log:
tags clickable and password md5 encoding
Modified:
trunk/src/main/java/org/chorem/bow/BookmarkActions.java
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/BookmarkActions.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BookmarkActions.java 2010-06-02 16:53:58 UTC (rev 64)
+++ trunk/src/main/java/org/chorem/bow/BookmarkActions.java 2010-06-03 08:18:34 UTC (rev 65)
@@ -28,6 +28,11 @@
protected int tmax = -1;
protected int tmin = -1;
+ /* @param html String html
+ * @param name String name
+ * @param user User user
+ * @return Bookmark the bookmark filled
+ */
public static Bookmark createBookmarkFromHtml(String html, String name, User user) {
String link = getUrlFromHtml(html);
String tags = getTagsFromHtml(html);
@@ -36,6 +41,9 @@
return bookmark;
}
+ /* @param html String html
+ * @return Date from the html
+ */
public static Date getDateFromHtml(String html) {
Date date = null;
if (html != null) {
@@ -44,7 +52,7 @@
if (m.find()) {
String str = m.group(1);
if (str != null && !str.isEmpty()) {
- long time = Long.valueOf(str) * 1000;
+ long time = Long.valueOf(str) * 1000; // the date in ms
date = new Date(time);
}
}
@@ -52,6 +60,9 @@
return date;
}
+ /* @param bookmarks List<Bookmarks> bookmarks
+ * @return String the html file
+ */
public static String getExportHtmlBookmark(List<Bookmark> bookmarks) {
String export = "";
export = "<!DOCTYPE NETSCAPE-Bookmark-file-1>\n"
@@ -79,6 +90,9 @@
return export;
}
+ /* @param html String html
+ *
+ */
public static String getUrlFromHtml(String html) {
String url = "";
if (html != null) {
Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-02 16:53:58 UTC (rev 64)
+++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-03 08:18:34 UTC (rev 65)
@@ -32,6 +32,7 @@
import org.htmlparser.util.ParserException;
import org.htmlparser.util.SimpleNodeIterator;
import org.nuiton.util.ArgumentsParserException;
+import org.nuiton.util.StringUtil;
import org.nuiton.wikitty.Criteria;
import org.nuiton.wikitty.FacetTopic;
import org.nuiton.wikitty.PagedResult;
@@ -632,6 +633,7 @@
throws IOException, ServletException, NoSuchAlgorithmException {
String email = request.getParameter("email");
String password = request.getParameter("password");
+ password = StringUtil.encodeMD5(password);
if (this.checkRegister(email, password)) { // check if all is well
String error = "Email and password must be correctly filled";
request.setAttribute("msgError", error);
@@ -639,8 +641,8 @@
} else {
WikittyProxy proxy = BowProxy.getInstance();
UserImpl newUser = new UserImpl();
- newUser.setPassword(request.getParameter("password"));
- newUser.setEmail(request.getParameter("email"));
+ newUser.setPassword(password);
+ newUser.setEmail(email);
User login = proxy.store((User) newUser); // store the new user
if (login == null) {
request.getRequestDispatcher("error.jsp").forward(request, response);
@@ -663,8 +665,8 @@
throws IOException, ServletException, NoSuchAlgorithmException {
String email = request.getParameter("email");
String password = request.getParameter("password");
+ password = StringUtil.encodeMD5(password);
User login = this.checkLogin(email, password); // check if the user exists
-
if (login != null) {
session.setAttribute("user", login);
initializeToken(session, login);
Modified: trunk/src/main/webapp/home.jsp
===================================================================
--- trunk/src/main/webapp/home.jsp 2010-06-02 16:53:58 UTC (rev 64)
+++ trunk/src/main/webapp/home.jsp 2010-06-03 08:18:34 UTC (rev 65)
@@ -87,7 +87,7 @@
<a style="text-decoration:none" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>">
<IMG style="border:none" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
</a>
- <%=tag%>
+ <a href="bow?action=search&addTag=<%=tag%>" style="text-decoration: none"><%=tag%></a>
</div>
<%
}
@@ -142,10 +142,10 @@
<%=sdf.format(bookmark.getDate())%>
</td>
<%
- String alias = bookmark.getAlias();
- if (alias != null && !alias.isEmpty()) {
- alias = url + "alias/" + alias;
- }
+ String alias = bookmark.getAlias();
+ if (alias != null && !alias.isEmpty()) {
+ alias = url + "alias/" + alias;
+ }
%>
<td class="result" style="text-align: left">
<a title ="<%=alias%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a>
@@ -160,19 +160,19 @@
</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%>">
<IMG style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
</a>
- <%=tag%>
+ <a href="bow?action=search&addTag=<%=tag%>" style="text-decoration: none"><%=tag%></a>
</div>
<%
+ }
}
- }
%>
<form method="POST" action="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>">
<input type="text" name="tags" size="35" value="<%=BookmarkActions.getBookmarkTagsString(bookmark)%>" />
Modified: trunk/src/main/webapp/search.jsp
===================================================================
--- trunk/src/main/webapp/search.jsp 2010-06-02 16:53:58 UTC (rev 64)
+++ trunk/src/main/webapp/search.jsp 2010-06-03 08:18:34 UTC (rev 65)
@@ -104,7 +104,7 @@
<a style="text-decoration:none" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">
<IMG style="border:none" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" />
</a>
- <%=tag%>
+ <a href="bow?action=search&addTag=<%=tag%>&searchLine=<%=searchLine%>" style="text-decoration: none"><%=tag%></a>
</div>
<%
}
1
0
Author: bpoussin
Date: 2010-06-02 18:53:58 +0200 (Wed, 02 Jun 2010)
New Revision: 64
Url: http://chorem.org/repositories/revision/bow/64
Log:
suppression de la dependance multi-storage qui ne sert a rien
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-06-02 16:42:56 UTC (rev 63)
+++ trunk/pom.xml 2010-06-02 16:53:58 UTC (rev 64)
@@ -60,12 +60,6 @@
</dependency>
<dependency>
- <groupId>org.nuiton.wikitty</groupId>
- <artifactId>wikitty-multistorage-impl</artifactId>
- <version>${wikitty.version}</version>
- </dependency>
-
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.11</version>
1
0
Author: bpoussin
Date: 2010-06-02 18:42:56 +0200 (Wed, 02 Jun 2010)
New Revision: 63
Url: http://chorem.org/repositories/revision/bow/63
Log:
pouvoir voir l'exception dans les logs, c'est tout de meme beaucoup plus facile pour comprendre les erreurs :(
Modified:
trunk/src/main/java/org/chorem/bow/ControllerServlet.java
Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-02 15:55:32 UTC (rev 62)
+++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-02 16:42:56 UTC (rev 63)
@@ -224,6 +224,7 @@
request.getRequestDispatcher("login.jsp").forward(request, response);
}
} catch (Exception eee) {
+ log.error("Can't do action", eee);
request.getRequestDispatcher("error.jsp").forward(request, response);
}
}
1
0
02 Jun '10
Author: bbrossaud
Date: 2010-06-02 17:55:32 +0200 (Wed, 02 Jun 2010)
New Revision: 62
Url: http://chorem.org/repositories/revision/bow/62
Log:
modified varaible name
Modified:
trunk/src/main/java/org/chorem/bow/ControllerServlet.java
trunk/src/main/webapp/permanentXml.jsp
Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-02 15:51:02 UTC (rev 61)
+++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-02 15:55:32 UTC (rev 62)
@@ -262,7 +262,7 @@
protected void actionOpenSearchSuggestion(HttpServletRequest request, HttpServletResponse response, User user)
throws IOException, ServletException {
if (user != null) {
- String search = request.getParameter("search");
+ String search = request.getParameter("searchLine");
if (search != null) {
OpenSearchActions openSearchActions = new OpenSearchActions();
WikittyProxy proxy = BowProxy.getInstance();
Modified: trunk/src/main/webapp/permanentXml.jsp
===================================================================
--- trunk/src/main/webapp/permanentXml.jsp 2010-06-02 15:51:02 UTC (rev 61)
+++ trunk/src/main/webapp/permanentXml.jsp 2010-06-02 15:55:32 UTC (rev 62)
@@ -19,6 +19,6 @@
<InputEncoding>inputEncoding</InputEncoding>
<Image width="16" height="16" type="image/ico"><%=url%>img/bow.gif</Image>
<Url type="text/html" method="GET" template="<%=url%>bow?action=openSearchResult&token=<%=token%>&searchLine={searchTerms}" />
- <Url type="application/x-suggestions+json" method="GET" template="<%=url%>bow?action=openSearchSuggestion&token=<%=token%>&search={searchTerms}" />
+ <Url type="application/x-suggestions+json" method="GET" template="<%=url%>bow?action=openSearchSuggestion&token=<%=token%>&searchLine={searchTerms}" />
<moz:SearchForm><%=url%>bow</moz:SearchForm>
</OpenSearchDescription>
\ No newline at end of file
1
0
Author: bbrossaud
Date: 2010-06-02 17:51:02 +0200 (Wed, 02 Jun 2010)
New Revision: 61
Url: http://chorem.org/repositories/revision/bow/61
Log:
added footer in openSearchResult.jsp
Modified:
trunk/src/main/webapp/openSearchResult.jsp
Modified: trunk/src/main/webapp/openSearchResult.jsp
===================================================================
--- trunk/src/main/webapp/openSearchResult.jsp 2010-06-02 15:17:28 UTC (rev 60)
+++ trunk/src/main/webapp/openSearchResult.jsp 2010-06-02 15:51:02 UTC (rev 61)
@@ -1,10 +1,8 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="org.chorem.bow.Bookmark" %>
<%@page import="org.chorem.bow.BookmarkActions" %>
-<%@page import="java.util.HashMap" %>
<%@page import="java.text.SimpleDateFormat" %>
<%@page import="java.util.Iterator" %>
-<%@page import="java.util.Map" %>
<%@page import="java.util.Set" %>
<%@page import="java.util.ArrayList" %>
<%@page import="java.util.List" %>
@@ -12,11 +10,13 @@
<%
BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
- String searchLine = "";
if (bookmarkActions != null) {
- searchLine = bookmarkActions.getSearchLine();
- }
- String url = (String) request.getAttribute("bowUrl");
+ String searchLine = "";
+ if (bookmarkActions != null) {
+ searchLine = bookmarkActions.getSearchLine();
+ }
+ String version = (String) request.getAttribute("version");
+ String url = (String) request.getAttribute("bowUrl");
%>
<html>
@@ -27,8 +27,8 @@
<h1 class="result">Results</h1>
<% if (bookmarkActions != null) {
- List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
- if (!bookmarkList.isEmpty()) {
+ List<Bookmark> bookmarkList = bookmarkActions.getBookmarks();
+ if (!bookmarkList.isEmpty()) {
%>
<table class="result">
<tr class="result">
@@ -99,16 +99,12 @@
%>
<h2 class="result">No Bookmarks found</h2>
<% }
- }
+ }
%>
- <div class="Index" id="footer">
- <a shape="rect" href="<%=url%>">bow</a>
- <a shape="rect" href="http://www.chorem.org/projects/list_files/bow"></a> -
- <a shape="rect" href="http://www.gnu.org/licenses/agpl.html">Licence AGPL</a> -
- <span title="Copyright">©2009-2010</span>
- <a shape="rect" href="http://www.codelutin.com">Code Lutin</a> -
- <a shape="rect" href="http://www.chorem.org/projects/bow/issues">Rapport de bug</a> -
- <a shape="rect" href="http://list.chorem.org/cgi-bin/mailman/listinfo/bow-users">Support utilisateur</a>
- </div>
+ <jsp:include page="footer.jsp" flush="true" >
+ <jsp:param name="bowUrl" value="<%=url%>" />
+ <jsp:param name="version" value="<%=version%>" />
+ </jsp:include>
</body>
-</html>
\ No newline at end of file
+</html>
+<%}%>
\ No newline at end of file
1
0
Author: bbrossaud
Date: 2010-06-02 17:17:28 +0200 (Wed, 02 Jun 2010)
New Revision: 60
Url: http://chorem.org/repositories/revision/bow/60
Log:
remove bug from suggestion.jsp
Modified:
trunk/src/main/webapp/suggestions.jsp
Modified: trunk/src/main/webapp/suggestions.jsp
===================================================================
--- trunk/src/main/webapp/suggestions.jsp 2010-06-02 15:11:39 UTC (rev 59)
+++ trunk/src/main/webapp/suggestions.jsp 2010-06-02 15:17:28 UTC (rev 60)
@@ -1,6 +1,5 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="org.chorem.bow.OpenSearchActions" %>
-<%@page import="org.chorem.bow.Suggestion" %>
<%@page import="java.util.List" %>
<%@page import="java.util.Iterator" %>
<%@page import="org.nuiton.wikitty.FacetTopic" %>
1
0
02 Jun '10
Author: bbrossaud
Date: 2010-06-02 17:11:39 +0200 (Wed, 02 Jun 2010)
New Revision: 59
Url: http://chorem.org/repositories/revision/bow/59
Log:
use facet for the opensearch suggestions
Removed:
trunk/src/main/java/org/chorem/bow/Model.java
trunk/src/main/java/org/chorem/bow/Suggestion.java
Modified:
trunk/src/main/java/org/chorem/bow/ControllerServlet.java
trunk/src/main/java/org/chorem/bow/OpenSearchActions.java
trunk/src/main/java/org/chorem/bow/SuggestionsComparator.java
trunk/src/main/webapp/openSearchResult.jsp
trunk/src/main/webapp/suggestions.jsp
Modified: trunk/src/main/java/org/chorem/bow/ControllerServlet.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-02 14:14:19 UTC (rev 58)
+++ trunk/src/main/java/org/chorem/bow/ControllerServlet.java 2010-06-02 15:11:39 UTC (rev 59)
@@ -276,12 +276,16 @@
List<String> cpy = new ArrayList<String>(searchLine);
cpy.remove(cpy.size() - 1);
criteria = Search.query().eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).
- eq(Bookmark.FQ_FIELD_TAGS, cpy).criteria();
+ eq(Bookmark.FQ_FIELD_TAGS, cpy).criteria().addFacetField(Bookmark.FQ_FIELD_TAGS);
} else {
- criteria = Search.query().eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).criteria();
+ criteria = Search.query().eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).
+ criteria().addFacetField(Bookmark.FQ_FIELD_TAGS);
}
- List<Bookmark> bookList = proxy.findAllByCriteria(Bookmark.class, criteria).getAll();
+ PagedResult result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ List<Bookmark> bookList = result.getAll();
+ List<FacetTopic> topics = result.getTopic(Bookmark.FQ_FIELD_TAGS);
openSearchActions.setBookmarkList(bookList);
+ openSearchActions.setSuggestionList(topics);
openSearchActions.findSuggestions(searchLine);
request.setAttribute("openSearchAction", openSearchActions);
}
Deleted: trunk/src/main/java/org/chorem/bow/Model.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/Model.java 2010-06-02 14:14:19 UTC (rev 58)
+++ trunk/src/main/java/org/chorem/bow/Model.java 2010-06-02 15:11:39 UTC (rev 59)
@@ -1,53 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.chorem.bow;
-
-import java.util.Properties;
-import org.nuiton.wikitty.WikittyExtensionStorage;
-import org.nuiton.wikitty.WikittyProxy;
-import org.nuiton.wikitty.WikittyService;
-import org.nuiton.wikitty.WikittyStorage;
-import org.nuiton.wikitty.jdbc.WikittyExtensionStorageJDBC;
-import org.nuiton.wikitty.jdbc.WikittyStorageJDBC;
-import org.nuiton.wikitty.multistorage.MultiStorageConfiguration;
-import org.nuiton.wikitty.multistorage.MultiStorageConfiguration.BasicConfiguration;
-import org.nuiton.wikitty.multistorage.WikittyServiceMultiStorage;
-
-/**
- *
- * @author bbrossaud
- */
-public class Model {
-
- protected WikittyProxy proxy = null;
-
- Model() {
- System.setProperty("solr.data.dir", System.getProperty("user.home") + "/.bow/solr");
- this.init();
- }
-
- public void init() {
- MultiStorageConfiguration config = new BasicConfiguration();
- Model.configureJDBC(config);
-
- WikittyService jdbcStorage = new WikittyServiceMultiStorage(config);
- proxy = new WikittyProxy();
- proxy.setWikittyService(jdbcStorage);
- }
-
- static void configureJDBC(MultiStorageConfiguration configuration) {
- Properties properties = new Properties();
-
- WikittyExtensionStorage extensionStorage = new WikittyExtensionStorageJDBC(properties);
- WikittyStorage wikittyStorage = new WikittyStorageJDBC(extensionStorage, properties);
-
- configuration.addExtensionStorage(extensionStorage, true);
- configuration.addWikittyStorage(wikittyStorage, true);
- }
-
- public WikittyProxy getProxy() {
- return proxy;
- }
-}
Modified: trunk/src/main/java/org/chorem/bow/OpenSearchActions.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/OpenSearchActions.java 2010-06-02 14:14:19 UTC (rev 58)
+++ trunk/src/main/java/org/chorem/bow/OpenSearchActions.java 2010-06-02 15:11:39 UTC (rev 59)
@@ -6,12 +6,11 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
+import org.nuiton.wikitty.FacetTopic;
/**
*
@@ -20,50 +19,38 @@
public class OpenSearchActions {
protected List<Bookmark> bookmarkList = new ArrayList<Bookmark>();
- protected List<Suggestion> suggestions = new ArrayList<Suggestion>();
+ protected List<FacetTopic> suggestions = new ArrayList<FacetTopic>();
protected String[] search = null;
public void findSuggestions(List<String> searchLine) {
int size = searchLine.size();
search = searchLine.toArray(new String[size]);
- fieldSuggestionList(search[size - 1], searchLine);
- }
-
- protected void fieldSuggestionList(String word, List<String> searchLine) {
- if (bookmarkList != null) {
- Map<String, Integer> map = new HashMap<String, Integer>();
- List<Bookmark> save = new ArrayList<Bookmark>(bookmarkList);
- for (Bookmark bookmark : save) {
- Set<String> tagList = bookmark.getTags();
- boolean contain = false;
- if (tagList != null) {
- for (String tag : tagList) {
- if (tag.indexOf(word) == 0 && !searchLine.contains(tag)) {
- contain = true;
- if (map.containsKey(tag)) {
- Integer count = map.get(tag);
- ++count;
- map.put(tag, count);
- } else {
- map.put(tag, 1);
- }
- }
- }
+ String word = search[size - 1];
+ List<FacetTopic> save = new ArrayList<FacetTopic>(suggestions);
+ for (FacetTopic topic : save) {
+ String tag = topic.getTopicName();
+ if (tag != null) {
+ if (tag.indexOf(word) != 0 || searchLine.contains(tag)) {
+ suggestions.remove(topic);
}
- if (contain == false) {
- bookmarkList.remove(bookmark);
+ }
+ }
+ List<Bookmark> cpy = new ArrayList<Bookmark>(bookmarkList);
+ for (Bookmark bookmark : cpy) {
+ Set<String> tags = bookmark.getTags();
+ boolean delete = true;
+ for (FacetTopic topic : suggestions) {
+ String name = topic.getTopicName();
+ if (tags != null && tags.contains(name)) {
+ delete = false;
+ break;
}
}
- Set<String> keys = map.keySet();
- for (String key : keys) {
- Suggestion newSuggestion = new Suggestion();
- newSuggestion.setName(key);
- newSuggestion.setNb(map.get(key));
- suggestions.add(newSuggestion);
+ if (delete == true) {
+ bookmarkList.remove(bookmark);
}
-
- Collections.sort(suggestions, new SuggestionsComparator());
}
+ Collections.sort(suggestions, new SuggestionsComparator());
}
protected boolean bookmarkHasTag(Bookmark bookmark, String tag) {
@@ -97,14 +84,14 @@
public String getJsonSuggestions() {
String str = "[";
String srch = "";
- Iterator<Suggestion> it = suggestions.iterator();
+ Iterator<FacetTopic> it = suggestions.iterator();
if (search.length > 1) {
srch = StringUtils.join(search, ' ', 0, (search.length - 1));
srch += " ";
}
while (it.hasNext()) {
- Suggestion su = it.next();
- str += "\"" + srch + su.getName() + "\"";
+ FacetTopic su = it.next();
+ str += "\"" + srch + su.getTopicName() + "\"";
if (it.hasNext()) {
str += ",";
}
@@ -120,10 +107,10 @@
public String getJsonDescription() {
String str = "[";
- Iterator<Suggestion> it = suggestions.iterator();
+ Iterator<FacetTopic> it = suggestions.iterator();
while (it.hasNext()) {
- Suggestion su = it.next();
- str += "\"" + su.getNb() + " results\"";
+ FacetTopic su = it.next();
+ str += "\"" + su.getCount() + " results\"";
if (it.hasNext()) {
str += ",";
}
@@ -136,8 +123,10 @@
search = tab;
}
- public void setSuggestionList(List<Suggestion> list) {
- suggestions = list;
+ public void setSuggestionList(List<FacetTopic> list) {
+ if (list != null) {
+ suggestions = new ArrayList<FacetTopic>(list);
+ }
}
public List<Bookmark> getBookmarkList() {
@@ -148,7 +137,7 @@
return search;
}
- public List<Suggestion> getSuggestionList() {
+ public List<FacetTopic> getSuggestionList() {
return suggestions;
}
}
Deleted: trunk/src/main/java/org/chorem/bow/Suggestion.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/Suggestion.java 2010-06-02 14:14:19 UTC (rev 58)
+++ trunk/src/main/java/org/chorem/bow/Suggestion.java 2010-06-02 15:11:39 UTC (rev 59)
@@ -1,35 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.chorem.bow;
-
-/**
- *
- * @author bbrossaud
- */
-public class Suggestion {
- int nb = 0;
- String name = "";
-
- public void increment() {
- nb++;
- }
-
- public void setNb(int value) {
- nb = value;
- }
-
- public void setName(String str) {
- name = str;
- }
-
- public int getNb() {
- return nb;
- }
-
- public String getName() {
- return name;
- }
-}
Modified: trunk/src/main/java/org/chorem/bow/SuggestionsComparator.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/SuggestionsComparator.java 2010-06-02 14:14:19 UTC (rev 58)
+++ trunk/src/main/java/org/chorem/bow/SuggestionsComparator.java 2010-06-02 15:11:39 UTC (rev 59)
@@ -2,23 +2,25 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
-
package org.chorem.bow;
import java.util.Comparator;
+import org.nuiton.wikitty.FacetTopic;
/**
*
* @author bbrossaud
*/
-public class SuggestionsComparator implements Comparator<Suggestion> {
+public class SuggestionsComparator implements Comparator<FacetTopic> {
@Override
- public int compare(Suggestion o1, Suggestion o2) {
- if (o1.getNb() < o2.getNb())
+ public int compare(FacetTopic o1, FacetTopic o2) {
+ if (o1.getCount() < o2.getCount()) {
return 1;
- if (o1.getNb() > o2.getNb())
+ }
+ if (o1.getCount() > o2.getCount()) {
return -1;
+ }
return 0;
}
}
Modified: trunk/src/main/webapp/openSearchResult.jsp
===================================================================
--- trunk/src/main/webapp/openSearchResult.jsp 2010-06-02 14:14:19 UTC (rev 58)
+++ trunk/src/main/webapp/openSearchResult.jsp 2010-06-02 15:11:39 UTC (rev 59)
@@ -16,11 +16,11 @@
if (bookmarkActions != null) {
searchLine = bookmarkActions.getSearchLine();
}
- String url = (String) request.getAttribute("bowUrl");
+ String url = (String) request.getAttribute("bowUrl");
%>
<html>
- <jsp:include page="header.jsp" flush="true">
+ <jsp:include page="header.jsp" flush="true">
<jsp:param name="bowUrl" value="<%=url%>"/>
</jsp:include>
<body>
@@ -80,7 +80,7 @@
%>
<%=tag%>
<%
- }
+ }
%>
</td>
<%
Modified: trunk/src/main/webapp/suggestions.jsp
===================================================================
--- trunk/src/main/webapp/suggestions.jsp 2010-06-02 14:14:19 UTC (rev 58)
+++ trunk/src/main/webapp/suggestions.jsp 2010-06-02 15:11:39 UTC (rev 59)
@@ -3,6 +3,7 @@
<%@page import="org.chorem.bow.Suggestion" %>
<%@page import="java.util.List" %>
<%@page import="java.util.Iterator" %>
+<%@page import="org.nuiton.wikitty.FacetTopic" %>
<%
@@ -10,7 +11,7 @@
if (osa != null) {
String[] word = osa.getSearch();
if (word != null) {
- List<Suggestion> suggestions = osa.getSuggestionList();
+ List<FacetTopic> suggestions = osa.getSuggestionList();
if (suggestions != null) {
%>
<%=osa.getJsonResult()%>
1
0