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
January 2011
- 3 participants
- 23 discussions
r179 - in trunk/src/main: java/org/chorem/bow java/org/chorem/bow/action resources resources/i18n webapp/WEB-INF/decorators webapp/jsp webapp/jsp/inc webapp/template/xhtml
by vbriand@users.chorem.org 28 Jan '11
by vbriand@users.chorem.org 28 Jan '11
28 Jan '11
Author: vbriand
Date: 2011-01-28 18:28:36 +0100 (Fri, 28 Jan 2011)
New Revision: 179
Url: http://chorem.org/repositories/revision/bow/179
Log:
When an action (remove, import, modify a bookmark) is performed on the search page, the user is redirected to the search page instead of the home page. Transformed some code on jsp pages to its Struts2 equivalent. The search engines work again (when logged in for the moment). The <form>s all redirect to the correct url (/bow instead of /bow/bow).
Added:
trunk/src/main/java/org/chorem/bow/BowUtils.java
trunk/src/main/webapp/template/xhtml/file.ftl
Modified:
trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java
trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java
trunk/src/main/java/org/chorem/bow/action/FullTextSearchAction.java
trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java
trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java
trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java
trunk/src/main/java/org/chorem/bow/action/PreferencesAction.java
trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java
trunk/src/main/resources/i18n/bow_en_GB.properties
trunk/src/main/resources/i18n/bow_fr_FR.properties
trunk/src/main/resources/struts.xml
trunk/src/main/webapp/WEB-INF/decorators/main.jsp
trunk/src/main/webapp/jsp/inc/bookmark.jsp
trunk/src/main/webapp/jsp/inc/footer.jsp
trunk/src/main/webapp/jsp/inc/rightMenu.jsp
trunk/src/main/webapp/jsp/login.jsp
trunk/src/main/webapp/jsp/permanentXml.jsp
trunk/src/main/webapp/jsp/preferences.jsp
trunk/src/main/webapp/jsp/search.jsp
trunk/src/main/webapp/jsp/suggestions.jsp
trunk/src/main/webapp/jsp/temporaryXml.jsp
Added: trunk/src/main/java/org/chorem/bow/BowUtils.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowUtils.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/BowUtils.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -0,0 +1,66 @@
+package org.chorem.bow;
+
+import javax.servlet.http.HttpSession;
+
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
+public class BowUtils {
+ static public String redirectTo(String searchLine, String fullTextLine) {
+ if (!searchLine.equals("") || !fullTextLine.equals("")) {
+ return "search.action?searchLine=" + searchLine + "&fullTextLine=" + fullTextLine;
+ } else {
+ return "home.action";
+ }
+ }
+
+ /* @param token String token
+ * @param session HttpSession session
+ * @return User
+ * @description check if the token is valid and return the
+ * token owner
+ */
+ static public User checkToken(String token, HttpSession session) {
+ if (checkTemporaryToken(token, session)) {
+ return (User) session.getAttribute("user");
+ }
+ return checkPermanentToken(token);
+ }
+
+ /* @param token String which contains the MD5 encoding token
+ * @return null the token doesn't exist
+ * @return User the token owner
+ */
+ protected static User checkPermanentToken(String token) {
+ if (token != null) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = Search.query().eq(Token.FQ_FIELD_TOKEN, token).criteria();
+ Token DbToken = proxy.findByCriteria(Token.class, criteria);
+
+ if (DbToken != null) { // check if the token exists
+ String userEmail = DbToken.getEmail(); // the token owner user name (email)
+ criteria = Search.query().eq(User.FQ_FIELD_EMAIL, userEmail).criteria(); // retrieve user by token
+ return proxy.findByCriteria(User.class, criteria);
+ }
+ }
+ return null;
+ }
+
+ /* @param token String which contains the MD5 encoding token
+ * @return null the token doesn't exist
+ * @return User the token owner
+ */
+ protected static boolean checkTemporaryToken(String token, HttpSession session) {
+ TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
+ if (tokenActions != null) {
+ String temporaryToken = tokenActions.getTemporaryToken();
+ if (temporaryToken != null) {
+ if (temporaryToken.equals(token)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/BowUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -8,11 +8,10 @@
import java.util.List;
public class BowBaseAction extends ActionSupport {
-
private static final long serialVersionUID = 1L;
public static final String UNTRANSLATED_MARKER = "???";
- private static final Log log = LogFactory.getLog(BowBaseAction.class);
-
+ protected static final Log log = LogFactory.getLog(BowBaseAction.class);
+
@Override
public String getText(String aTextName) {
String value = super.getText(aTextName);
Modified: trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -20,6 +20,7 @@
private static final long serialVersionUID = 2706590901233864637L;
protected String bookmarkId;
protected String searchLine;
+ protected String fullTextLine;
protected Map<String, Object> session;
protected HttpServletRequest request;
@@ -51,6 +52,20 @@
this.searchLine = searchLine;
}
+ /**
+ * @return the fullTextLine
+ */
+ public String getFullTextLine() {
+ return fullTextLine;
+ }
+
+ /**
+ * @param fullTextLine the fullTextLine to set
+ */
+ public void setFullTextLine(String fullTextLine) {
+ this.fullTextLine = fullTextLine;
+ }
+
@Override
public void setSession(Map<String, Object> session) {
this.session = session;
@@ -71,7 +86,7 @@
request.setAttribute("name", bookmark.getDescription());
request.setAttribute("alias", bookmark.getAlias());
request.setAttribute("tags", BookmarkActions.getBookmarkTagsString(bookmark));
- request.setAttribute("formAction", "/bow/modifyBookmark.action?bookmarkId=" + bookmarkId);
+ request.setAttribute("formAction", "/bow/modifyBookmark.action?bookmarkId=" + bookmarkId + "&searchLine=" + searchLine + "&fullTextLine=" + fullTextLine);
}
}
if (searchLine == null) {
Modified: trunk/src/main/java/org/chorem/bow/action/FullTextSearchAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/FullTextSearchAction.java 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/java/org/chorem/bow/action/FullTextSearchAction.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -14,6 +14,8 @@
public class FullTextSearchAction extends BowBaseAction implements SessionAware, ServletRequestAware {
private static final long serialVersionUID = -7736099487284993426L;
protected Map<String, Object> session;
+ protected String searchLine;
+ protected String fullTextLine;
protected HttpServletRequest request;
@Override
@@ -26,6 +28,34 @@
this.session = session;
}
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ /**
+ * @return the fullTextLine
+ */
+ public String getFullTextLine() {
+ return fullTextLine;
+ }
+
+ /**
+ * @param fullTextLine the fullTextLine to set
+ */
+ public void setFullTextLine(String fullTextLine) {
+ this.fullTextLine = fullTextLine;
+ }
+
public String execute() {
User user = (User)session.get("user");
Modified: trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -18,6 +18,7 @@
import org.chorem.bow.BowInit;
import org.chorem.bow.BowProxy;
import org.chorem.bow.BowSearch;
+import org.chorem.bow.BowUtils;
import org.chorem.bow.Import;
import org.chorem.bow.User;
import org.htmlparser.Node;
@@ -34,6 +35,9 @@
protected File upfile;
protected String upfileContentType;
protected String upfileFileName;
+ protected String searchLine;
+ protected String fullTextLine;
+ protected String redirectTo;
protected Map<String, Object> session;
protected HttpServletRequest request;
@@ -79,6 +83,41 @@
this.upfileFileName = upfileFileName;
}
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ /**
+ * @return the fullTextLine
+ */
+ public String getFullTextLine() {
+ return fullTextLine;
+ }
+
+ /**
+ * @param fullTextLine the fullTextLine to set
+ */
+ public void setFullTextLine(String fullTextLine) {
+ this.fullTextLine = fullTextLine;
+ }
+
+ /**
+ * @return the redirectTo
+ */
+ public String getRedirectTo() {
+ return redirectTo;
+ }
+
@Override
public void setSession(Map<String, Object> session) {
this.session = session;
@@ -171,13 +210,28 @@
parseHtmlToBookmarks(list, user, bookmarks, new ArrayList<String>());
bookmarks = proxy.store(bookmarks);
createImportExtension(bookmarks);
- BowInit.initHomePage(request, user);
- return SUCCESS;
+ redirectTo = BowUtils.redirectTo(searchLine, fullTextLine);
+ if (searchLine == null || searchLine.isEmpty()) {
+ BowInit.initHomePage(request, user);
+ return SUCCESS;
+ } else {
+ try {
+ BowSearch.search(request, user);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ServletException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return SUCCESS;
+ }
} catch (ParserException e) {
request.setAttribute("errorMsgUser", getText(n_("bow.bookmark.badFileFormat")));
request.setAttribute("errorMsgTech", e.getMessage());
+ redirectTo = BowUtils.redirectTo(searchLine, fullTextLine);
- if (request.getParameter("searchLine") == null) {
+ if (searchLine == null || searchLine.isEmpty()) {
BowInit.initHomePage(request, user);
return SUCCESS;
} else {
@@ -190,7 +244,7 @@
// TODO Auto-generated catch block
e1.printStackTrace();
}
- return "search";
+ return SUCCESS;
}
}
} catch (IOException e2) {
Modified: trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -3,6 +3,7 @@
import org.chorem.bow.Bookmark;
import org.chorem.bow.BookmarkActions;
import org.chorem.bow.BowProxy;
+import org.chorem.bow.BowUtils;
import org.nuiton.wikitty.Criteria;
import org.nuiton.wikitty.WikittyProxy;
import org.nuiton.wikitty.search.Search;
@@ -14,6 +15,9 @@
protected String alias;
protected String tags;
protected String bookmarkId;
+ protected String searchLine;
+ protected String fullTextLine;
+ protected String redirectTo;
/**
* @return the link
@@ -85,6 +89,48 @@
this.bookmarkId = bookmarkId;
}
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ /**
+ * @return the fullTextLine
+ */
+ public String getFullTextLine() {
+ return fullTextLine;
+ }
+
+ /**
+ * @param fullTextLine the fullTextLine to set
+ */
+ public void setFullTextLine(String fullTextLine) {
+ this.fullTextLine = fullTextLine;
+ }
+
+ /**
+ * @return the redirectTo
+ */
+ public String getRedirectTo() {
+ return redirectTo;
+ }
+
+ /**
+ * @param redirectTo the redirectTo to set
+ */
+ public void setRedirectTo(String redirectTo) {
+ this.redirectTo = redirectTo;
+ }
+
public String execute() {
WikittyProxy proxy = BowProxy.getInstance();
Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId);
@@ -100,6 +146,8 @@
BookmarkActions.updateBookmark(bookmark, name, link, tags, alias);
proxy.store(bookmark);
}
+ System.out.println("{{{{{{{{{{{{{{{{{{"+searchLine+"}}}}}}}}}{{{{{{{"+fullTextLine);
+ redirectTo = BowUtils.redirectTo(searchLine, fullTextLine);
return SUCCESS;
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -15,6 +15,7 @@
import org.chorem.bow.BowConfig;
import org.chorem.bow.BowInit;
import org.chorem.bow.BowProxy;
+import org.chorem.bow.BowUtils;
import org.chorem.bow.Preference;
import org.chorem.bow.User;
import org.nuiton.wikitty.Criteria;
@@ -26,6 +27,7 @@
private static final long serialVersionUID = -1691325797986483856L;
protected String searchLine;
protected String token;
+ protected String redirectTo;
protected Map<String, Object> session;
protected HttpServletRequest request;
protected HttpServletResponse response;
@@ -58,6 +60,13 @@
this.token = token;
}
+ /**
+ * @return the redirectTo
+ */
+ public String getRedirectTo() {
+ return redirectTo;
+ }
+
@Override
public void setSession(Map<String, Object> session) {
this.session = session;
@@ -73,78 +82,77 @@
this.response = response;
}
- //TODO : gérer toutes les redirections comme il faut avec Struts2
public String execute() {
User user = (User)session.get("user");
- if (searchLine != null && searchLine.matches("^http://[^ ]*")) {
- //response.sendRedirect(searchLine);
- } else if (searchLine != null
- && (searchLine.startsWith(":") || searchLine.startsWith("t:")) ) {
- //On fait une recherche sur les tags
-
- int index = searchLine.indexOf(":");
- searchLine = searchLine.substring(index+1); //Suppresses first ":"
-
- session.put("user", user);
- try {
- BowInit.initializeToken(session, user);
- } catch (NoSuchAlgorithmException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- WikittyProxy proxy = BowProxy.getInstance();
- Criteria criteria = BowBookmark.getBookmarkListCriteriaByUser(user, searchLine);
- criteria = criteria.addSortDescending(Bookmark.FQ_FIELD_CLICK);
- PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria); //Retrieves bookmarks by search
- BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, searchLine);
- request.setAttribute("bookmarkActions", bookmarkActions);
- request.setAttribute("token", token);
- //request.getRequestDispatcher("search.jsp").forward(request, response);
- } else if (searchLine != null && searchLine.startsWith("f:")) {
- // recherche fulltext dans bow
- String fullText = searchLine.substring(2);
-
- session.put("user", user);
- try {
- BowInit.initializeToken(session, user);
- } catch (NoSuchAlgorithmException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- WikittyProxy proxy = BowProxy.getInstance();
- Criteria criteria;
- if (!fullText.isEmpty()) {
- criteria = Search.query().keyword(fullText).
- eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).criteria().
- addFacetField(Bookmark.FQ_FIELD_TAGS);
-
+ if (user != null) {
+ if (searchLine != null && searchLine.matches("^http://[^ ]*")) {
+ redirectTo = BowUtils.redirectTo(searchLine, null);
+ } else if (searchLine != null
+ && (searchLine.startsWith(":") || searchLine.startsWith("t:")) ) {
+ //On fait une recherche sur les tags
+
+ int index = searchLine.indexOf(":");
+ searchLine = searchLine.substring(index+1); //Suppresses first ":"
+
+ session.put("user", user);
+ try {
+ BowInit.initializeToken(session, user);
+ } catch (NoSuchAlgorithmException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = BowBookmark.getBookmarkListCriteriaByUser(user, searchLine);
+ criteria = criteria.addSortDescending(Bookmark.FQ_FIELD_CLICK);
+ PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria); //Retrieves bookmarks by search
+ BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, searchLine);
+ request.setAttribute("bookmarkActions", bookmarkActions);
+ request.setAttribute("token", token);
+ redirectTo = BowUtils.redirectTo(searchLine, null);
+ } else if (searchLine != null && searchLine.startsWith("f:")) {
+ // recherche fulltext dans bow
+ String fullText = searchLine.substring(2);
+
+ session.put("user", user);
+ try {
+ BowInit.initializeToken(session, user);
+ } catch (NoSuchAlgorithmException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria;
+ if (!fullText.isEmpty()) {
+ criteria = Search.query().keyword(fullText).
+ eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).criteria().
+ addFacetField(Bookmark.FQ_FIELD_TAGS);
+ } else {
+ criteria = BowBookmark.getBookmarkListCriteriaByUser(user, null);
+ }
+ PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, null);
+ request.setAttribute("bookmarkActions", bookmarkActions);
+ request.setAttribute("token", token);
+ redirectTo = BowUtils.redirectTo(searchLine, null);
+ } else if (searchLine != null && searchLine.startsWith("a:")) {
+ // on redirige vers l'alias demande
+ searchLine = searchLine.substring(2);
+ redirectTo = BowConfig.getInstance().getAliasUrl() + searchLine;
} else {
- criteria = BowBookmark.getBookmarkListCriteriaByUser(user, null);
+ // on fait une recherche sur le moteur de recherche configure
+ WikittyProxy proxy = BowProxy.getInstance();
+ Preference pref = proxy.restore(Preference.class, user.getWikittyId());
+
+ String searchEngineURL = pref.getSearchEngineUrlResults();
+ if (searchEngineURL == null || "".equals(searchEngineURL)) {
+ BowConfig config = BowConfig.getInstance();
+ searchEngineURL = config.getSearchEngine();
+ }
+ searchEngineURL = searchEngineURL.replace("{searchTerms}", searchLine);
+ searchEngineURL = response.encodeRedirectURL(searchEngineURL);
+ redirectTo = searchEngineURL;
}
- PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria);
- BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, null);
- request.setAttribute("bookmarkActions", bookmarkActions);
- request.setAttribute("token", token);
- //request.getRequestDispatcher("search.jsp").forward(request, response);
- } else if (searchLine != null && searchLine.startsWith("a:")) {
- // on redirige vers l'alias demande
- searchLine = searchLine.substring(2);
- //response.sendRedirect(BowConfig.getInstance().getAliasUrl() + searchLine);
- } else {
- // on fait une recherche sur le moteur de recherche configure
- WikittyProxy proxy = BowProxy.getInstance();
- Preference pref = proxy.restore(Preference.class, user.getWikittyId());
-
- String searchEngineURL = pref.getSearchEngineUrlResults();
- if (searchEngineURL == null || "".equals(searchEngineURL)) {
- BowConfig config = BowConfig.getInstance();
- searchEngineURL = config.getSearchEngine();
- }
- searchEngineURL = searchEngineURL.replace("{searchTerms}", searchLine);
- searchEngineURL = response.encodeRedirectURL(searchEngineURL);
-
- //response.sendRedirect(searchEngineURL);
}
return SUCCESS;
}
Modified: trunk/src/main/java/org/chorem/bow/action/PreferencesAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/PreferencesAction.java 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/java/org/chorem/bow/action/PreferencesAction.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -245,8 +245,9 @@
User newUser = proxy.restore(User.class, user.getWikittyId());
Criteria criteria = Search.query().eq(User.FQ_FIELD_EMAIL, email).criteria();
+ User find = proxy.findByCriteria(User.class, criteria);
- if (proxy.findByCriteria(User.class, criteria) == null) { //If this email address isn't already used by someone else
+ if (find == null || find.getEmail().equals(user.getEmail())) { //If this email address isn't already used by someone else
try {
newUser = changeUser(newUser);
} catch (NoSuchAlgorithmException e) {
Modified: trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java 2011-01-28 17:28:36 UTC (rev 179)
@@ -2,11 +2,15 @@
import org.chorem.bow.Bookmark;
import org.chorem.bow.BowProxy;
+import org.chorem.bow.BowUtils;
import org.nuiton.wikitty.WikittyProxy;
public class RemoveBookmarkAction extends BowBaseAction {
private static final long serialVersionUID = 820566716695285561L;
protected String bookmarkId;
+ protected String searchLine;
+ protected String fullTextLine;
+ protected String redirectTo;
/**
* @return the bookmarkId
@@ -22,6 +26,41 @@
this.bookmarkId = bookmarkId;
}
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ /**
+ * @return the fullTextLine
+ */
+ public String getFullTextLine() {
+ return fullTextLine;
+ }
+
+ /**
+ * @param fullTextLine the fullTextLine to set
+ */
+ public void setFullTextLine(String fullTextLine) {
+ this.fullTextLine = fullTextLine;
+ }
+
+ /**
+ * @return the redirectTo
+ */
+ public String getRedirectTo() {
+ return redirectTo;
+ }
+
public String execute() {
if (bookmarkId != null && !bookmarkId.isEmpty()) {
try {
@@ -31,12 +70,11 @@
if (bookmark != null) {
proxy.delete(bookmarkId);
}
- } catch (Exception eee) {
- //TODO: log
- //log.error("Can't do action", eee);
+ } catch (Exception e) {
+ log.error("Can't do action", e);
}
}
-// redirectToTheGoodPage(request, response);
+ redirectTo = BowUtils.redirectTo(searchLine, fullTextLine);
return SUCCESS;
}
}
\ No newline at end of file
Modified: trunk/src/main/resources/i18n/bow_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-28 17:28:36 UTC (rev 179)
@@ -14,6 +14,9 @@
bow.config.data.dir.description=
bow.config.search.engine.description=
bow.config.servlet.bow.description=
+bow.footer.bugreport=Bug report
+bow.footer.license=AGPL License
+bow.footer.userSupport=User support
bow.forgotPassword.emailDoesntExist=
bow.forgotpwd.submit=Send
bow.forgotpwd.title=Forgot your password?
@@ -22,7 +25,7 @@
bow.home.title=Home
bow.label.locale.english=
bow.label.locale.french=
-bow.login.authenticationFailure=
+bow.login.authenticationFailure=Either your email address doesn''t exist or your password is incorrect
bow.login.email=Email
bow.login.email.required=Email is required
bow.login.email.wrongformat=Your email address isn''t valid
@@ -41,7 +44,7 @@
bow.preferences.newPassword=New password
bow.preferences.noImportedBookmarks=No imported bookmarks
bow.preferences.regenPermToken=Regenerate permanent token
-bow.preferences.searchEngineUrlResults=Search Engine URL Results ({searchTerms} will be replaced by your text)
+bow.preferences.searchEngineUrlResults=Search Engine URL Results ('{'searchTerms'}' will be replaced by your text)
bow.preferences.searchEngineUrlSuggestions=Search Engine URL Suggestions
bow.preferences.siteLook=Site look
bow.preferences.submit=Change
@@ -58,14 +61,17 @@
bow.register.submit=Register
bow.register.title=Register
bow.requiredstring=${getText(fieldKey)} is required
+bow.rightMenu.admin=Admin
bow.rightMenu.bookmark.addModify=Add / Modify
bow.rightMenu.bookmark.alias=ALIAS
bow.rightMenu.bookmark.link=URL
bow.rightMenu.bookmark.name=DESC
bow.rightMenu.bookmark.permanentLink=Bookmark add link (permanent)
+bow.rightMenu.bookmark.permanentLinkDescription=Add this link to your favourites to bookmark others in the future. This link is always available\!
bow.rightMenu.bookmark.submit=Save
bow.rightMenu.bookmark.tags=TAGS
bow.rightMenu.bookmark.temporaryLink=Bookmark add link (session)
+bow.rightMenu.bookmark.temporaryLinkDescription=Add this link to your favourites to bookmark others in the future. This link is only available while you are connected on the site\!
bow.rightMenu.chromiumExtension=Chromium extension
bow.rightMenu.exportBookmarks=Export bookmarks
bow.rightMenu.extensions=Extensions
@@ -78,6 +84,12 @@
bow.rightMenu.search=Search
bow.rightMenu.token.permanent=Permanent token id
bow.rightMenu.token.temporary=Session token id
+bow.search.ascclick=Asc. clicks nb
+bow.search.ascdate=Asc. date
+bow.search.ascname=Asc. name
+bow.search.descclick=Desc. clicks nb
+bow.search.descdate=Desc. date
+bow.search.descname=Desc. name
bow.search.orderby=Order by
bow.search.submit=Search
bow.search.title=Search
Modified: trunk/src/main/resources/i18n/bow_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-28 17:28:36 UTC (rev 179)
@@ -14,6 +14,9 @@
bow.config.data.dir.description=
bow.config.search.engine.description=
bow.config.servlet.bow.description=
+bow.footer.bugreport=Rapport de bug
+bow.footer.license=Licence AGPL
+bow.footer.userSupport=Support utilisateur
bow.forgotPassword.emailDoesntExist=
bow.forgotpwd.submit=Envoyer
bow.forgotpwd.title=Vous avez oubli\u00E9 votre mot de passe ?
@@ -22,7 +25,7 @@
bow.home.title=Accueil
bow.label.locale.english=
bow.label.locale.french=
-bow.login.authenticationFailure=
+bow.login.authenticationFailure=Soit votre adresse email n''existe pas, soit votre vot de passe est eronn\u00E9
bow.login.email=Email
bow.login.email.required=Veuillez entrer votre adresse email
bow.login.email.wrongformat=Votre adresse email est invalide
@@ -41,13 +44,13 @@
bow.preferences.newPassword=Nouveau mot de passe
bow.preferences.noImportedBookmarks=Aucun marque-page import\u00E9
bow.preferences.regenPermToken=Reg\u00E9n\u00E9rer le token permanent
-bow.preferences.searchEngineUrlResults=
-bow.preferences.searchEngineUrlSuggestions=
-bow.preferences.siteLook=
+bow.preferences.searchEngineUrlResults=Search Engine URL Results ('{'searchTerms'}' sera remplac\u00E9 par votre recherche)
+bow.preferences.searchEngineUrlSuggestions=Search Engine URL Suggestions
+bow.preferences.siteLook=Pr\u00E9f\u00E9rences du site
bow.preferences.submit=Changer
-bow.preferences.tagsNb=
+bow.preferences.tagsNb=Nombre de tags affich\u00E9s sur le nuage de tags
bow.preferences.title=Pr\u00E9f\u00E9rences
-bow.preferences.userInfo=
+bow.preferences.userInfo=Informations utilisateur
bow.register.emailAldyUsed=Cette adresse email est d\u00E9j\u00E0 utilis\u00E9e
bow.register.invalidLogin=
bow.register.mailEmail=
@@ -58,14 +61,17 @@
bow.register.submit=S''enregistrer
bow.register.title=S''enregistrer
bow.requiredstring=${getText(fieldKey)} est obligatoire
+bow.rightMenu.admin=Admin
bow.rightMenu.bookmark.addModify=Ajouter / Modifier
bow.rightMenu.bookmark.alias=ALIAS
bow.rightMenu.bookmark.link=URL
bow.rightMenu.bookmark.name=DESC
bow.rightMenu.bookmark.permanentLink=Ajouter un bookmark (permanent)
+bow.rightMenu.bookmark.permanentLinkDescription=Ajoutez ce lien \u00E0 vos favoris pour pouvoir bookmarker vos liens dans le futur. Ce lien est toujours disponible \!
bow.rightMenu.bookmark.submit=Sauvegarder
bow.rightMenu.bookmark.tags=TAGS
bow.rightMenu.bookmark.temporaryLink=Ajouter un bookmark (session)
+bow.rightMenu.bookmark.temporaryLinkDescription=Ajoutez ce lien \u00E0 vos favoris pour pouvoir bookmarker vos liens dans le futur. Ce lien est seulement disponible tant que vous \u00EAtes connect\u00E9 sur le site \!
bow.rightMenu.chromiumExtension=Extension pour chromium
bow.rightMenu.exportBookmarks=Exporter les marque-pages
bow.rightMenu.extensions=Extensions
@@ -78,6 +84,12 @@
bow.rightMenu.search=Recherche
bow.rightMenu.token.permanent=Token permanent
bow.rightMenu.token.temporary=Token session
+bow.search.ascclick=Nb clics asc.
+bow.search.ascdate=Date asc.
+bow.search.ascname=Nom asc.
+bow.search.descclick=Nb clics desc.
+bow.search.descdate=Date desc.
+bow.search.descname=Nom desc.
bow.search.orderby=Trier par
bow.search.submit=Rechercher
bow.search.title=Recherche
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/resources/struts.xml 2011-01-28 17:28:36 UTC (rev 179)
@@ -6,6 +6,7 @@
<constant name="struts.devMode" value="true" />
<constant name="struts.ognl.allowStaticMethodAccess" value="true" />
+ <!-- <default-action-ref name="" />--><!-- TODO: action à lancer quand une action n'existe pas -->
<package name="myPackage" extends="struts-default">
<action name="register_*" method="{1}" class="org.chorem.bow.action.RegisterAction">
<result name="input">/jsp/register.jsp</result>
@@ -38,21 +39,16 @@
<package name="bookmark" extends="struts-default">
<action name="importBookmarks" class="org.chorem.bow.action.ImportBookmarksAction">
- <result name="search" type="redirectAction">search</result>
<result name="error" type="redirectAction">error</result>
- <result name="login" type="redirectAction">home</result>
- <result type="redirectAction">home</result>
+ <result name="login" type="redirectAction">login_input</result>
+ <result type="redirect">${redirectTo}</result>
</action>
- <action name="exportBookmarks" class="org.chorem.bow.action.ExportBookmarksAction">
- <result type="redirectAction">home</result>
- </action>
+ <action name="exportBookmarks" class="org.chorem.bow.action.ExportBookmarksAction" />
<action name="modifyBookmark" class="org.chorem.bow.action.ModifyBookmarkAction">
- <result name="search">/jsp/search.jsp</result>
- <result type="redirectAction">home</result>
+ <result type="redirect">${redirectTo}</result>
</action>
<action name="removeBookmark" class="org.chorem.bow.action.RemoveBookmarkAction">
- <result type="redirectAction">home</result>
- <result name="search">/jsp/search.jsp</result>
+ <result type="redirect">${redirectTo}</result>
</action>
<action name="editBookmark" class="org.chorem.bow.action.EditBookmarkAction">
<result name="home" type="redirectAction">home</result>
@@ -90,9 +86,10 @@
<action name="*Xml">
<result>/jsp/{1}Xml.jsp</result>
</action>
- <!-- Suggestion, Result -->
- <action name="openSearch*" method="{1}" class="org.chorem.bow.action.OpenSearchAction">
- <!-- TODO: changer pour rediriger selon la page sur laquelle on se trouvait (home, search, ...)-->
+ <action name="openSearchResult" class="org.chorem.bow.action.OpenSearchResultAction">
+ <result type="redirect">${redirectTo}</result>
+ </action>
+ <action name="openSearchSuggestion" class="org.chorem.bow.action.OpenSearchSuggestionAction">
<result>/jsp/suggestions.jsp</result>
</action>
<action name="preferences" class="org.chorem.bow.action.PreferencesAction">
@@ -106,7 +103,7 @@
<result>/jsp/admin.jsp</result>
</action>
<action name="deleteImport" class="org.chorem.bow.action.DeleteImportAction">
- <result>/jsp/preferences.jsp</result>
+ <result type="redirectAction">preferences</result>
</action>
<action name="reIndexation" class="org.chorem.bow.action.ReIndexationAction">
<result>/jsp/admin.jsp</result>
Modified: trunk/src/main/webapp/WEB-INF/decorators/main.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -1,10 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@page import="org.chorem.bow.BowUtils" %>
<%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %>
<%@taglib prefix="s" uri="/struts-tags" %>
+<%
+String token = request.getParameter("token");
+if (token != null && !token.isEmpty()) {
+ session.setAttribute("user", BowUtils.checkToken(token, session));
+}
+%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Bow : <decorator:title default="Bow" /></title>
@@ -15,8 +22,8 @@
<s:url id="permanentXml" action="permanentXml" />
<s:url id="favicon" value="/img/favicon.png" />
<link rel="icon" type="image/png" href="${favicon}" />
- <link rel="search" type="application/opensearchdescription+xml" title="bowTemporarySearchEngine" href="${temporaryXml}" />
- <link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="${permanentXml}" />
+ <link rel="search" type="application/opensearchdescription+xml" title="Bow (temporary)" href="${temporaryXml}" />
+ <link rel="search" type="application/opensearchdescription+xml" title="Bow (permanent)" href="${permanentXml}" />
<s:url id="globalCSS" value="/css/global.css" />
<link href="${globalCSS}" rel="stylesheet" type="text/css" media="all" />
<s:url id="bookmarkJS" value="/js/bookmark.js" />
Modified: trunk/src/main/webapp/jsp/inc/bookmark.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/bookmark.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/inc/bookmark.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -29,92 +29,73 @@
<%@page import="java.text.SimpleDateFormat" %>
<%@page import="org.chorem.bow.BookmarkActions" %>
<%@page import="java.util.Set" %>
-<%
-Bookmark bookmark = (Bookmark) request.getAttribute("bookmark");
-BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
-SimpleDateFormat sdf = (SimpleDateFormat) request.getAttribute("sdf");
-String aliasUrl = BowConfig.getInstance().getServletAliasUrl();
-if (bookmark != null && sdf != null && bookmarkActions != null) {
- String formBookmarkId = (String) request.getAttribute("formBookmarkId");
- String link = bookmark.getLink();
- link = link.replace("'", "\\'");
- %>
- <s:set var="searchLine" value="%{#request.searchLine}" />
- <s:set var="fullTextLine" value="%{#request.fullTextLine}" />
- <s:set var="wikittyId" value="%{#request.bookmark.getWikittyId()}" />
- <s:set var="bookmarkLink" value="%{#request.bookmark.getLink()}" />
- <s:set var="bookmarkAlias" value="%{#request.bookmark.getAlias()}" />
- <s:set var="bookmarkDescription" value="%{#request.bookmark.getDescription()}" />
- <s:set var="bookmarkClicks" value="%{#request.bookmark.getClick()}" />
-
- <div class="bookmark">
- <div class="bookmarkhead">
- <a class="alias" href="<%=aliasUrl + bookmark.getAlias()%>" title="<%=bookmark.getLink()%>" onclick="window.open(this.href); return false;">
- <s:property value="%{#bookmarkAlias}" />
- </a>
- <p class="date"> (<%=sdf.format(bookmark.getDate())%>)</p>
- <s:url id="editBookmark" action="modifyBookmark" escapeAmp="false">
- <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
- <s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
- <s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
- </s:url>
- <s:a cssClass="edit" href="%{editBookmark}" onclick="return modify('%{#bookmarkDescription}', '%{#bookmarkAlias}', '%{@org.chorem.bow.BookmarkActions@getBookmarkTagsString(#request.bookmark)}', '%{#bookmarkLink}', '%{editBookmark}', '%{#wikittyId}');"></s:a>
- <s:url id="removeBookmark" action="removeBookmark" escapeAmp="false">
- <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
- <s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
- <s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
- </s:url>
- <s:a cssClass="supprim" href="%{removeBookmark}"></s:a>
- </div>
- <div class="bookmarkcontenu">
- <div class="screenshot"></div>
- <div class="click"><s:property value="%{#bookmarkClicks}" /></div>
- <div class="description">
- <h3><s:text name="bow.bookmark.description" /> :</h3>
- <p>
- <s:url id="addClick" action="addClick">
- <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
- </s:url>
- <s:a title="%{#bookmarkLink}" href="%{addClick}" onclick="window.open(this.href); return false;"><s:property value="%{#bookmarkDescription}" /></s:a>
- </p>
- <p class="tags">
- <strong><s:text name="bow.bookmark.tags" /> :</strong>
- <%
- Set<String> tagList = bookmark.getTags();
-
- if (tagList != null && !tagList.isEmpty()) {
- for (String tag : tagList) {
- %>
- <s:url id="deleteTag" action="deleteTag" escapeAmp="false">
- <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
- <s:param name="deleteTag"><%=tag%></s:param>
- <s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
- <s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
- </s:url>
- <%
- if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) {
- %>
- <s:a cssStyle="text-decoration: none;" href="%{deleteTag}">
- <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" />
- </s:a>
- <%
- } else {
- %>
- <a name="<s:property value='%{#wikittyId}' />" style="display:none; text-decoration: none;" href="<s:property value='%{#deleteTag}' />">
- <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" />
- </a>
- <% } %>
- <s:url id="search" action="search">
- <s:param name="searchLine"><%=tag%></s:param>
- </s:url>
- <s:a href="%{search}" cssStyle="text-decoration: none"><%=tag%></s:a>
- <%
- }
- }
- %>
- </p>
- </div>
- </div>
- </div>
- <% } %>
+<s:set var="searchLine" value="%{#request.searchLine}" />
+<s:set var="fullTextLine" value="%{#request.fullTextLine}" />
+<s:set var="wikittyId" value="%{#request.bookmark.getWikittyId()}" />
+<s:set var="bookmarkLink" value="%{#request.bookmark.getLink()}" />
+<s:set var="bookmarkAlias" value="%{#request.bookmark.getAlias()}" />
+<s:set var="bookmarkDescription" value="%{#request.bookmark.getDescription()}" />
+<s:set var="bookmarkClicks" value="%{#request.bookmark.getClick()}" />
+<s:set var="formBookmarkId" value="%{#request.formBookmarkId}" />
+<s:set var="aliasUrl" value="%{@org.chorem.bow.BowConfig@getInstance().getServletAliasUrl() + #bookmarkAlias}" />
+<s:set var="date" value="%{#request.sdf.format(#request.bookmark.getDate())}" />
+
+<div class="bookmark">
+ <div class="bookmarkhead">
+ <s:a cssClass="alias" href="%{#aliasUrl}" title="%{#bookmarkLink}" onclick="window.open(this.href); return false;">
+ <s:property value="%{#bookmarkAlias}" />
+ </s:a>
+ <p class="date">(<s:property value="%{date}" />)</p>
+ <s:url id="editBookmark" action="modifyBookmark" escapeAmp="false">
+ <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
+ <s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
+ <s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
+ </s:url>
+ <s:a cssClass="edit" href="%{editBookmark}" onclick="return modify('%{#bookmarkDescription}', '%{#bookmarkAlias}', '%{@org.chorem.bow.BookmarkActions@getBookmarkTagsString(#request.bookmark)}', '%{#bookmarkLink}', '%{editBookmark}', '%{#wikittyId}');"></s:a>
+ <s:url id="removeBookmark" action="removeBookmark" escapeAmp="false">
+ <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
+ <s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
+ <s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
+ </s:url>
+ <s:a cssClass="supprim" href="%{removeBookmark}"></s:a>
+ </div>
+ <div class="bookmarkcontenu">
+ <div class="screenshot"></div>
+ <div class="click"><s:property value="%{#bookmarkClicks}" /></div>
+ <div class="description">
+ <h3><s:text name="bow.bookmark.description" /> :</h3>
+ <p>
+ <s:url id="addClick" action="addClick">
+ <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
+ </s:url>
+ <s:a title="%{#bookmarkLink}" href="%{addClick}" onclick="window.open(this.href); return false;"><s:property value="%{#bookmarkDescription}" /></s:a>
+ </p>
+ <p class="tags">
+ <strong><s:text name="bow.bookmark.tags" /> :</strong>
+ <s:iterator value="#request.bookmark.tags">
+ <s:url id="deleteTag" action="deleteTag" escapeAmp="false">
+ <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
+ <s:param name="deleteTag"><s:property /></s:param>
+ <s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
+ <s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
+ </s:url>
+ <s:if test="%{formBookmarkId != null && formBookmarkId.equals(wikittyId)}">
+ <s:a cssStyle="text-decoration:none;" href="%{deleteTag}">
+ <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" />
+ </s:a>
+ </s:if>
+ <s:else>
+ <a name="<s:property value='%{#wikittyId}' />" style="display:none; text-decoration: none;" href="<s:property value='%{#deleteTag}' />">
+ <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" />
+ </a>
+ </s:else>
+ <s:url id="search" action="search">
+ <s:param name="searchLine"><s:property /></s:param>
+ </s:url>
+ <s:a href="%{search}" cssStyle="text-decoration:none"><s:property /></s:a>
+ </s:iterator>
+ </p>
+ </div>
+ </div>
+</div>
Modified: trunk/src/main/webapp/jsp/inc/footer.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/footer.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/inc/footer.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -5,11 +5,11 @@
<p>
<a shape="rect" href="">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> -
+ <a shape="rect" href="http://www.gnu.org/licenses/agpl.html"><s:text name="bow.footer.license" /></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> -
+ <a shape="rect" href="http://www.chorem.org/projects/bow/issues"><s:text name="bow.footer.bugreport" /></a> -
+ <a shape="rect" href="http://list.chorem.org/cgi-bin/mailman/listinfo/bow-users"><s:text name="bow.footer.userSupport" /></a> -
<s:url id="localeEN">
<s:param name="request_locale">en_GB</s:param>
</s:url>
Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -32,10 +32,6 @@
<%
TokenActions tokenActions = (TokenActions)session.getAttribute("tokenActions");
BookmarkActions bookmarkActions = (BookmarkActions)request.getAttribute("bookmarkActions");
-Boolean admin = (Boolean)session.getAttribute("admin");
-if (admin == null) {
- admin = false;
-}
int nbTags = 100;
Preference preference = (Preference)session.getAttribute("preference");
@@ -45,21 +41,18 @@
nbTags = tags;
}
request.setAttribute("nbTags", nbTags);
-String searchLine = null;
-String fullText = null;
-if (bookmarkActions != null){
- searchLine = bookmarkActions.getSearchLine();
- fullText = bookmarkActions.getFullTextLine();
-}
if ((String)request.getAttribute("formAction") == null)
- request.setAttribute("formAction", "/addUrl.action");
+ request.setAttribute("formAction", "addUrl");
%>
+<s:set var="searchLine" value="%{request.bookmarkActions.searchLine}" />
+<s:set var="fullTextLine" value="%{request.bookmarkActions.fullTextLine}" />
+
<div id="logoutDiv" xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <s:form action="logout" theme="simple">
+ <s:form action="logout">
<div class="input">
<s:submit key="bow.rightMenu.logout" />
</div>
@@ -69,9 +62,9 @@
<div id="side">
<div id="colonneD">
<ul class="droite">
- <% if (admin) { %>
- <li><s:a action="admin"><s:text name="bow.rightMenu.admin" /></s:a></li>
- <% } %>
+ <s:if test="%{#session.admin == true}">
+ <li><s:a action="admin"><s:text name="bow.rightMenu.admin" /></s:a></li>
+ </s:if>
<li><s:a action="preferences"><s:text name="bow.preferences.title" /></s:a></li>
<li><s:a title="%{getText('bow.rightMenu.bookmark.temporaryLinkDescription')}" 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='%{#session.bowUrl}addUrl.action?token=%{#session.tokenActions.getTemporaryToken()}&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:text name="bow.rightMenu.bookmark.temporaryLink" /></s:a></li>
<li><s:a title="%{getText('bow.rightMenu.bookmark.permanentLinkDescription')}" 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='%{#session.bowUrl}addUrl.action?token=%{#session.tokenActions.getPermanentToken()}&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:text name="bow.rightMenu.bookmark.permanentLink" /></s:a></li>
@@ -95,19 +88,20 @@
</s:form>
</div>
<div id="nuage">
- <% if (searchLine != null) { %>
+ <s:if test="%{searchLine != null}">
<jsp:include page="tagsCloud.jsp" flush="true">
- <jsp:param name="searchLine" value="<%=searchLine%>" />
+ <jsp:param name="searchLine" value="%{searchLine}" />
</jsp:include>
- <% } else { %>
+ </s:if>
+ <s:else>
<jsp:include page="tagsCloud.jsp" flush="true" />
- <% } %>
+ </s:else>
</div>
<div class="recherche">
<s:form action="search">
<div class="input">
<s:textfield key="bow.rightMenu.search" name="searchLine" labelSeparator="" />
- <s:submit key="bow.rightMenu.find.submit" theme="simple" />
+ <s:submit key="bow.rightMenu.find.submit" />
</div>
</s:form>
</div>
@@ -115,16 +109,17 @@
<s:form action="fullText">
<div class="input">
<s:textfield key="bow.rightMenu.fullTextSearch" name="fullTextLine" labelSeparator="" />
- <s:submit key="bow.rightMenu.find.submit" theme="simple" />
+ <s:submit key="bow.rightMenu.find.submit" />
</div>
</s:form>
</div>
<div id="import">
<s:form action="importBookmarks" method="post" enctype="multipart/form-data">
<div class="input">
- <label for="fileImport"><s:text name="bow.rightMenu.importBookmarks" /></label>
- <input type="file" size="15%" id="upfile" name="upfile" /><br />
- <s:submit key="bow.rightMenu.import.submit" theme="simple" />
+ <s:file size="15%" name="upfile" key="bow.rightMenu.importBookmarks" labelSeparator="" />
+ <s:hidden name="searchLine" value="%{searchLine}" />
+ <s:hidden name="fullTextLine" value="%{fullTextLine}" />
+ <s:submit key="bow.rightMenu.import.submit" />
</div>
</s:form>
<s:a action="exportBookmarks"><s:text name="bow.rightMenu.exportBookmarks" /></s:a>
Modified: trunk/src/main/webapp/jsp/login.jsp
===================================================================
--- trunk/src/main/webapp/jsp/login.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/login.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -16,6 +16,7 @@
<div id="content">
<div id="formFrame">
<h1><s:text name="bow.login.title" /></h1>
+ <s:actionerror />
<s:form action="login">
<p>
<s:textfield key="bow.login.email" name="email" labelposition="top" labelSeparator=" :" /><br /><br />
Modified: trunk/src/main/webapp/jsp/permanentXml.jsp
===================================================================
--- trunk/src/main/webapp/jsp/permanentXml.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/permanentXml.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -25,23 +25,23 @@
<%@page import="org.chorem.bow.TokenActions" %>
<%
- TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
- String token = "";
- if (tokenActions != null) {
- token = tokenActions.getPermanentToken();
- }
- String url = request.getRequestURL().toString();
- int index = url.indexOf("permanentXml.jsp");
- url = url.substring(0, index);
+TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
+String token = "";
+if (tokenActions != null) {
+ token = tokenActions.getPermanentToken();
+}
+String url = request.getRequestURL().toString();
+int index = url.indexOf("permanentXml.jsp");
+url = url.substring(0, index - 4);
%>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
- <ShortName>bowPermanentSearchEngine</ShortName>
+ <ShortName>Bow (permanent)</ShortName>
<Description>bookmarkSearch</Description>
<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%>&searchLine={searchTerms}" />
- <moz:SearchForm><%=url%>bow</moz:SearchForm>
+ <Url type="text/html" method="GET" template="<%=url%>openSearchResult.action?token=<%=token%>&searchLine={searchTerms}" />
+ <Url type="application/x-suggestions+json" method="GET" template="<%=url%>openSearchSuggestion.action?token=<%=token%>&searchLine={searchTerms}" />
+ <moz:SearchForm><%=url%></moz:SearchForm>
</OpenSearchDescription>
Modified: trunk/src/main/webapp/jsp/preferences.jsp
===================================================================
--- trunk/src/main/webapp/jsp/preferences.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/preferences.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -43,11 +43,8 @@
<div class="menu clearfix">
<h2><s:text name="bow.preferences.title" /></h2>
</div>
- <s:url id="changePreferences" action="preferences">
- <s:param name="update">1</s:param>
- </s:url>
<s:actionerror />
- <s:form action="%{changePreferences}">
+ <s:form action="preferences">
<div class="formFrame">
<h3><s:text name="bow.preferences.userInfo" /></h3>
<p>
@@ -67,6 +64,7 @@
<s:textfield key="bow.preferences.bookmarksHomePage" name="bookmarksHomePage" labelposition="top" /><br />
<s:textfield key="bow.preferences.searchEngineUrlSuggestions" name="searchEngineUrlSuggestions" labelposition="top" /><br />
<s:textfield key="bow.preferences.searchEngineUrlResults" name="searchEngineUrlResults" labelposition="top" /><br />
+ <s:hidden name="update" value="1" />
<s:submit key="bow.preferences.submit" />
<br /><br />
<s:url id="home" action="home" />
@@ -98,7 +96,7 @@
<s:url id="deleteImport" action="deleteImport">
<s:param name="date"><%=dateSave%></s:param>
</s:url>
- <s:a cssClass="deleteImportButton" href="" onclick="deleteConfirmation('%{deleteImport}','%{#bookmarkImport!getCount}','<%=date%>'); return(false);"></s:a>
+ <a class="deleteImportButton" href="" onclick="deleteConfirmation('<s:property value="%{deleteImport}" />','<%=bookmarkImport.getCount()%>','<%=date%>'); return(false);"></a>
</div>
<%
i++;
Modified: trunk/src/main/webapp/jsp/search.jsp
===================================================================
--- trunk/src/main/webapp/jsp/search.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/search.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -52,11 +52,7 @@
<body>
<div class="menu clearfix">
<h2><s:text name="bow.search.title" /></h2>
- <s:url id="order" action="order" escapeAmp="false">
- <s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
- <s:param name="fullTextLine"><s:property value="%{#fullText}" /></s:param>
- </s:url>
- <s:form action="%{order}">
+ <s:form action="order">
<p>
<label for="type"><s:text name="bow.search.orderby" /></label>
<select id="type" name="type">
@@ -76,6 +72,8 @@
</s:url>
<s:a id="deleteSearchResultsButton" href="" onclick="deleteConfirmation('%{deleteSearchResults}', %{#bookmarksToDelete}); return(false);"></s:a>
</s:if>
+ <s:hidden name="searchLine" value="%{#searchLine}" />
+ <s:hidden name="fullTextLine" value="%{#fullText}" />
</p>
</s:form>
</div>
Modified: trunk/src/main/webapp/jsp/suggestions.jsp
===================================================================
--- trunk/src/main/webapp/jsp/suggestions.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/suggestions.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -27,18 +27,17 @@
<%@page import="java.util.Iterator" %>
<%@page import="org.nuiton.wikitty.FacetTopic" %>
-
<%
- OpenSearchActions osa = (OpenSearchActions) request.getAttribute("openSearchAction");
- if (osa != null) {
- String[] word = osa.getSearch();
- if (word != null) {
- List<FacetTopic> suggestions = osa.getSuggestionList();
- if (suggestions != null) {
+OpenSearchActions osa = (OpenSearchActions) request.getAttribute("openSearchAction");
+if (osa != null) {
+ String[] word = osa.getSearch();
+ if (word != null) {
+ List<FacetTopic> suggestions = osa.getSuggestionList();
+ if (suggestions != null) {
+ %>
+ <%=osa.getJsonResult()%>
+ <%
+ }
+ }
+}
%>
-<%=osa.getJsonResult()%>
-<%
- }
- }
- }
-%>
Modified: trunk/src/main/webapp/jsp/temporaryXml.jsp
===================================================================
--- trunk/src/main/webapp/jsp/temporaryXml.jsp 2011-01-27 15:51:12 UTC (rev 178)
+++ trunk/src/main/webapp/jsp/temporaryXml.jsp 2011-01-28 17:28:36 UTC (rev 179)
@@ -25,23 +25,23 @@
<%@page import="org.chorem.bow.TokenActions" %>
<%
- TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
- String token = "";
- if (tokenActions != null) {
- token = tokenActions.getTemporaryToken();
- }
- String url = request.getRequestURL().toString();
- int index = url.indexOf("temporaryXml.jsp");
- url = url.substring(0, index);
+TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
+String token = "";
+if (tokenActions != null) {
+ token = tokenActions.getTemporaryToken();
+}
+String url = request.getRequestURL().toString();
+int index = url.indexOf("temporaryXml.jsp");
+url = url.substring(0, index - 4);
%>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
- <ShortName>bowTemporarySearchEngine</ShortName>
+ <ShortName>Bow (temporary)</ShortName>
<Description>bookmarkSearch</Description>
<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}" />
- <moz:SearchForm><%=url%>bow</moz:SearchForm>
+ <Url type="text/html" method="GET" template="<%=url%>openSearchResult.action?token=<%=token%>&searchLine={searchTerms}" />
+ <Url type="application/x-suggestions+json" method="GET" template="<%=url%>openSearchSuggestion.action?token=<%=token%>&search={searchTerms}" />
+ <moz:SearchForm><%=url%></moz:SearchForm>
</OpenSearchDescription>
Added: trunk/src/main/webapp/template/xhtml/file.ftl
===================================================================
--- trunk/src/main/webapp/template/xhtml/file.ftl (rev 0)
+++ trunk/src/main/webapp/template/xhtml/file.ftl 2011-01-28 17:28:36 UTC (rev 179)
@@ -0,0 +1,24 @@
+<#--
+/*
+ * $Id: file.ftl 590812 2007-10-31 20:32:54Z apetrelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#include "/${parameters.templateDir}/xhtml/controlheader-core.ftl" />
+<#include "/${parameters.templateDir}/simple/file.ftl" />
1
0
r178 - in trunk/src/main: java/org/chorem/bow java/org/chorem/bow/action webapp webapp/WEB-INF/decorators webapp/css webapp/jsp webapp/jsp/inc webapp/template webapp/template/xhtml
by vbriand@users.chorem.org 27 Jan '11
by vbriand@users.chorem.org 27 Jan '11
27 Jan '11
Author: vbriand
Date: 2011-01-27 16:51:12 +0100 (Thu, 27 Jan 2011)
New Revision: 178
Url: http://chorem.org/repositories/revision/bow/178
Log:
Overloaded the default template of Struts2 ("xhtml") in order to remove the generated "<table>"s
Added:
trunk/src/main/webapp/template/
trunk/src/main/webapp/template/xhtml/
trunk/src/main/webapp/template/xhtml/controlheader-core.ftl
trunk/src/main/webapp/template/xhtml/form-close.ftl
trunk/src/main/webapp/template/xhtml/form.ftl
trunk/src/main/webapp/template/xhtml/password.ftl
trunk/src/main/webapp/template/xhtml/submit-close.ftl
trunk/src/main/webapp/template/xhtml/submit.ftl
trunk/src/main/webapp/template/xhtml/text.ftl
Modified:
trunk/src/main/java/org/chorem/bow/
trunk/src/main/java/org/chorem/bow/action/LoginAction.java
trunk/src/main/webapp/WEB-INF/decorators/main.jsp
trunk/src/main/webapp/css/bookmark.css
trunk/src/main/webapp/css/connexion.css
trunk/src/main/webapp/css/global.css
trunk/src/main/webapp/jsp/inc/rightMenu.jsp
trunk/src/main/webapp/jsp/login.jsp
trunk/src/main/webapp/jsp/preferences.jsp
Property changes on: trunk/src/main/java/org/chorem/bow
___________________________________________________________________
Added: svn:ignore
+ .ControllerServlet.java
Modified: trunk/src/main/java/org/chorem/bow/action/LoginAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/LoginAction.java 2011-01-27 09:31:16 UTC (rev 177)
+++ trunk/src/main/java/org/chorem/bow/action/LoginAction.java 2011-01-27 15:51:12 UTC (rev 178)
@@ -90,15 +90,15 @@
}
return null;
}
-
+
public String execute() {
if (email != null) {
email = email.trim();
-
+
if (password != null) {
String md5 = StringUtil.encodeMD5(password);
User user;
-
+
try {
user = checkLogin(email, md5);
} catch (NoSuchAlgorithmException e) {
Modified: trunk/src/main/webapp/WEB-INF/decorators/main.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-27 09:31:16 UTC (rev 177)
+++ trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-27 15:51:12 UTC (rev 178)
@@ -8,6 +8,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Bow : <decorator:title default="Bow" /></title>
+ <decorator:head />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="Bookmarks on the web" />
<s:url id="temporaryXml" action="temporaryXml" />
@@ -20,7 +21,6 @@
<link href="${globalCSS}" rel="stylesheet" type="text/css" media="all" />
<s:url id="bookmarkJS" value="/js/bookmark.js" />
<script type="text/javascript" src="${bookmarkJS}"></script>
- <decorator:head />
</head>
<body id="page-home">
<div id="wrap">
Modified: trunk/src/main/webapp/css/bookmark.css
===================================================================
--- trunk/src/main/webapp/css/bookmark.css 2011-01-27 09:31:16 UTC (rev 177)
+++ trunk/src/main/webapp/css/bookmark.css 2011-01-27 15:51:12 UTC (rev 178)
@@ -488,10 +488,4 @@
#bookmarkForm label{
margin-top:12px;
font-style:normal;
-}
-
-#bookmarkForm input[type="text"]{
- width:100%;
- margin-top:10px;
- margin-left:10px;
}
\ No newline at end of file
Modified: trunk/src/main/webapp/css/connexion.css
===================================================================
--- trunk/src/main/webapp/css/connexion.css 2011-01-27 09:31:16 UTC (rev 177)
+++ trunk/src/main/webapp/css/connexion.css 2011-01-27 15:51:12 UTC (rev 178)
@@ -52,7 +52,7 @@
margin-top: 25px;
}
-#page {
+#page{
width:100%;
margin:0 auto;
clear:both;
@@ -78,12 +78,12 @@
color:#804561;
width:225px;
position:relative;
- margin:15px 15px -20px 0px;
+ margin:15px 15px 10px 0px;
}
-#formFrame form table td label{
+#formFrame form p{
color:#804561;
- font-size:16px;
+ font-size:14px;
font-weight:bold;
padding:10px 0;
}
@@ -137,9 +137,9 @@
}
#forgotPassword{
- margin-top:50px;
+ margin-top:30px;
}
#register{
- margin-top:35px;
+ margin-top:20px;
}
\ No newline at end of file
Modified: trunk/src/main/webapp/css/global.css
===================================================================
--- trunk/src/main/webapp/css/global.css 2011-01-27 09:31:16 UTC (rev 177)
+++ trunk/src/main/webapp/css/global.css 2011-01-27 15:51:12 UTC (rev 178)
@@ -108,3 +108,9 @@
text-align:center;
line-height:50px;
}
+
+.errorMessage{
+ font-weight:normal;
+ font-size:12px;
+ color:red;
+}
\ No newline at end of file
Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-27 09:31:16 UTC (rev 177)
+++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-27 15:51:12 UTC (rev 178)
@@ -87,10 +87,10 @@
<div id="add" class="clearfix">
<h2><s:text name="bow.rightMenu.bookmark.addModify" /></h2>
<s:form id="bookmarkForm" action="%{#request.formAction}">
- <s:textfield key="bow.rightMenu.bookmark.link" name="link" value="%{#request.link}" labelSeparator="" />
- <s:textfield key="bow.rightMenu.bookmark.alias" name="alias" value="%{#request.alias}" labelSeparator="" />
- <s:textfield key="bow.rightMenu.bookmark.name" name="name" value="%{#request.name}" labelSeparator="" />
- <s:textfield key="bow.rightMenu.bookmark.tags" name="tags" value="%{#request.tags}" labelSeparator="" />
+ <s:textfield key="bow.rightMenu.bookmark.link" name="link" value="%{#request.link}" labelSeparator="" /><br />
+ <s:textfield key="bow.rightMenu.bookmark.alias" name="alias" value="%{#request.alias}" labelSeparator="" /><br />
+ <s:textfield key="bow.rightMenu.bookmark.name" name="name" value="%{#request.name}" labelSeparator="" /><br />
+ <s:textfield key="bow.rightMenu.bookmark.tags" name="tags" value="%{#request.tags}" labelSeparator="" /><br /><br />
<s:submit key="bow.rightMenu.bookmark.submit" />
</s:form>
</div>
@@ -106,8 +106,7 @@
<div class="recherche">
<s:form action="search">
<div class="input">
- <label for="searchLine"><s:text name="bow.rightMenu.search" /></label>
- <input type="text" name="searchLine" id="searchLine" />
+ <s:textfield key="bow.rightMenu.search" name="searchLine" labelSeparator="" />
<s:submit key="bow.rightMenu.find.submit" theme="simple" />
</div>
</s:form>
@@ -115,8 +114,7 @@
<div class="recherche">
<s:form action="fullText">
<div class="input">
- <label for="fullTextLine"><s:text name="bow.rightMenu.fullTextSearch" /></label>
- <input type="text" name="fullTextLine" id="fullTextLine" />
+ <s:textfield key="bow.rightMenu.fullTextSearch" name="fullTextLine" labelSeparator="" />
<s:submit key="bow.rightMenu.find.submit" theme="simple" />
</div>
</s:form>
Modified: trunk/src/main/webapp/jsp/login.jsp
===================================================================
--- trunk/src/main/webapp/jsp/login.jsp 2011-01-27 09:31:16 UTC (rev 177)
+++ trunk/src/main/webapp/jsp/login.jsp 2011-01-27 15:51:12 UTC (rev 178)
@@ -17,9 +17,11 @@
<div id="formFrame">
<h1><s:text name="bow.login.title" /></h1>
<s:form action="login">
+ <p>
<s:textfield key="bow.login.email" name="email" labelposition="top" labelSeparator=" :" /><br /><br />
<s:password key="bow.login.password" name="password" labelposition="top" labelSeparator=" :" /><br /><br />
<s:submit key="bow.login.submit" />
+ </p>
</s:form>
<s:a action="register_input" id="registerLink"><s:text name="bow.register.title" /></s:a><br />
<s:a action="forgotPassword_input" id="forgotPwd"><s:text name="bow.forgotpwd.title" /></s:a>
Modified: trunk/src/main/webapp/jsp/preferences.jsp
===================================================================
--- trunk/src/main/webapp/jsp/preferences.jsp 2011-01-27 09:31:16 UTC (rev 177)
+++ trunk/src/main/webapp/jsp/preferences.jsp 2011-01-27 15:51:12 UTC (rev 178)
@@ -51,22 +51,22 @@
<div class="formFrame">
<h3><s:text name="bow.preferences.userInfo" /></h3>
<p>
- <s:textfield key="bow.login.email" name="email" cssStyle="margin-bottom: 2px" /><br /><br />
- <s:password key="bow.preferences.currentPassword" name="currentPassword" />
- <s:password key="bow.preferences.newPassword" name="newPassword" />
- <s:password key="bow.preferences.confirmNewPassword" name="confirmNewPassword" />
- <s:url id="generateToken" action="generateToken" />
- <s:a href="%{generateToken}" id="regenPermToken"><s:text name="bow.preferences.regenPermToken" /></s:a>
+ <s:textfield key="bow.login.email" name="email" labelposition="top" /><br />
+ <s:password key="bow.preferences.currentPassword" name="currentPassword" labelposition="top" /><br />
+ <s:password key="bow.preferences.newPassword" name="newPassword" labelposition="top" /><br />
+ <s:password key="bow.preferences.confirmNewPassword" name="confirmNewPassword" labelposition="top" /><br />
+ <s:url id="regenPermToken" action="regenPermToken" />
+ <s:a href="%{regenPermToken}" id="regenPermToken"><s:text name="bow.preferences.regenPermToken" /></s:a>
</p>
</div>
<div class="formFrame">
<h3><s:text name="bow.preferences.siteLook" /></h3>
<p>
- <s:textfield key="bow.preferences.colors" name="colors" /><br />
- <s:textfield key="bow.preferences.tagsNb" name="tagsNb" /><br />
- <s:textfield key="bow.preferences.bookmarksHomePage" name="bookmarksHomePage" /><br />
- <s:textfield key="bow.preferences.searchEngineUrlSuggestions" name="searchEngineUrlSuggestions" /><br />
- <s:textfield key="bow.preferences.searchEngineUrlResults" name="searchEngineUrlResults" />
+ <s:textfield key="bow.preferences.colors" name="colors" labelposition="top" /><br />
+ <s:textfield key="bow.preferences.tagsNb" name="tagsNb" labelposition="top" /><br />
+ <s:textfield key="bow.preferences.bookmarksHomePage" name="bookmarksHomePage" labelposition="top" /><br />
+ <s:textfield key="bow.preferences.searchEngineUrlSuggestions" name="searchEngineUrlSuggestions" labelposition="top" /><br />
+ <s:textfield key="bow.preferences.searchEngineUrlResults" name="searchEngineUrlResults" labelposition="top" /><br />
<s:submit key="bow.preferences.submit" />
<br /><br />
<s:url id="home" action="home" />
Added: trunk/src/main/webapp/template/xhtml/controlheader-core.ftl
===================================================================
--- trunk/src/main/webapp/template/xhtml/controlheader-core.ftl (rev 0)
+++ trunk/src/main/webapp/template/xhtml/controlheader-core.ftl 2011-01-27 15:51:12 UTC (rev 178)
@@ -0,0 +1,66 @@
+<#--
+/*
+ * $Id: controlheader-core.ftl 720258 2008-11-24 19:05:16Z musachy $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#--
+ Only show message if errors are available.
+ This will be done if ActionSupport is used.
+-->
+<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
+<#if hasFieldErrors>
+<#list fieldErrors[parameters.name] as error>
+
+ <span class="errorMessage">${error?html}</span><#t/>
+ <#if parameters.labelposition?default("") == 'top'>
+ <br />
+ </#if>
+
+</#list>
+</#if>
+<#--
+ if the label position is top,
+ then give the label it's own row in the table
+-->
+<#if parameters.label??>
+ <label <#t/>
+<#if parameters.id??>
+ for="${parameters.id?html}" <#t/>
+</#if>
+<#if hasFieldErrors>
+ class="errorLabel"<#t/>
+<#else>
+ class="label"<#t/>
+</#if>
+ ><#t/>
+<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'>
+ <span class="required">*</span><#t/>
+</#if>
+${parameters.label?html}<#t/>
+<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'>
+ <span class="required">*</span><#t/>
+</#if>
+${parameters.labelseparator?default(":")?html}<#t/>
+<#include "/${parameters.templateDir}/xhtml/tooltip.ftl" />
+</label><#t/>
+</#if>
+<#if parameters.labelposition?default("") == 'top'>
+ <br />
+</#if>
\ No newline at end of file
Added: trunk/src/main/webapp/template/xhtml/form-close.ftl
===================================================================
--- trunk/src/main/webapp/template/xhtml/form-close.ftl (rev 0)
+++ trunk/src/main/webapp/template/xhtml/form-close.ftl 2011-01-27 15:51:12 UTC (rev 178)
@@ -0,0 +1,34 @@
+<#--
+/*
+ * $Id: form-close.ftl 590812 2007-10-31 20:32:54Z apetrelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#include "/${parameters.templateDir}/simple/form-close.ftl" />
+<#include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" />
+<#if parameters.focusElement?if_exists != "">
+<script type="text/javascript">
+ StrutsUtils.addOnLoad(function() {
+ var element = document.getElementById("${parameters.focusElement?html}");
+ if(element) {
+ element.focus();
+ }
+ });
+</script>
+</#if>
Added: trunk/src/main/webapp/template/xhtml/form.ftl
===================================================================
--- trunk/src/main/webapp/template/xhtml/form.ftl (rev 0)
+++ trunk/src/main/webapp/template/xhtml/form.ftl 2011-01-27 15:51:12 UTC (rev 178)
@@ -0,0 +1,32 @@
+<#--
+/*
+ * $Id: form.ftl 720258 2008-11-24 19:05:16Z musachy $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#include "/${parameters.templateDir}/xhtml/form-validate.ftl" />
+<#include "/${parameters.templateDir}/simple/form-common.ftl" />
+<#if (parameters.validate?default(false))>
+ onreset="${parameters.onreset?default('clearErrorMessages(this);clearErrorLabels(this);')}"
+<#else>
+ <#if parameters.onreset??>
+ onreset="${parameters.onreset?html}"
+ </#if>
+</#if>
+>
Added: trunk/src/main/webapp/template/xhtml/password.ftl
===================================================================
--- trunk/src/main/webapp/template/xhtml/password.ftl (rev 0)
+++ trunk/src/main/webapp/template/xhtml/password.ftl 2011-01-27 15:51:12 UTC (rev 178)
@@ -0,0 +1,24 @@
+<#--
+/*
+ * $Id: password.ftl 590812 2007-10-31 20:32:54Z apetrelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#include "/${parameters.templateDir}/xhtml/controlheader-core.ftl" />
+<#include "/${parameters.templateDir}/simple/password.ftl" />
Added: trunk/src/main/webapp/template/xhtml/submit-close.ftl
===================================================================
--- trunk/src/main/webapp/template/xhtml/submit-close.ftl (rev 0)
+++ trunk/src/main/webapp/template/xhtml/submit-close.ftl 2011-01-27 15:51:12 UTC (rev 178)
@@ -0,0 +1 @@
+<#include "/${parameters.templateDir}/simple/submit-close.ftl" />
Added: trunk/src/main/webapp/template/xhtml/submit.ftl
===================================================================
--- trunk/src/main/webapp/template/xhtml/submit.ftl (rev 0)
+++ trunk/src/main/webapp/template/xhtml/submit.ftl 2011-01-27 15:51:12 UTC (rev 178)
@@ -0,0 +1,23 @@
+<#--
+/*
+ * $Id: submit.ftl 720258 2008-11-24 19:05:16Z musachy $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#include "/${parameters.templateDir}/simple/submit.ftl" />
Added: trunk/src/main/webapp/template/xhtml/text.ftl
===================================================================
--- trunk/src/main/webapp/template/xhtml/text.ftl (rev 0)
+++ trunk/src/main/webapp/template/xhtml/text.ftl 2011-01-27 15:51:12 UTC (rev 178)
@@ -0,0 +1,24 @@
+<#--
+/*
+ * $Id: text.ftl 590812 2007-10-31 20:32:54Z apetrelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#include "/${parameters.templateDir}/xhtml/controlheader-core.ftl" />
+<#include "/${parameters.templateDir}/simple/text.ftl" />
1
0
Author: tchemit
Date: 2011-01-27 10:31:16 +0100 (Thu, 27 Jan 2011)
New Revision: 177
Url: http://chorem.org/repositories/revision/bow/177
Log:
Update mavenpom4redmine to 2.4.3.
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-01-21 17:08:05 UTC (rev 176)
+++ trunk/pom.xml 2011-01-27 09:31:16 UTC (rev 177)
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -12,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>2.4.1</version>
+ <version>2.4.3</version>
</parent>
<groupId>org.chorem</groupId>
1
0
Author: vbriand
Date: 2011-01-21 18:08:05 +0100 (Fri, 21 Jan 2011)
New Revision: 176
Url: http://chorem.org/repositories/revision/bow/176
Log:
Fixed the design on the home page
Modified:
trunk/src/main/webapp/css/bookmark.css
trunk/src/main/webapp/css/connexion.css
trunk/src/main/webapp/jsp/inc/rightMenu.jsp
Modified: trunk/src/main/webapp/css/bookmark.css
===================================================================
--- trunk/src/main/webapp/css/bookmark.css 2011-01-21 14:54:13 UTC (rev 175)
+++ trunk/src/main/webapp/css/bookmark.css 2011-01-21 17:08:05 UTC (rev 176)
@@ -197,7 +197,7 @@
padding-left: 5px;
}
-#logout{
+#logoutDiv{
float:right;
position:relative;
right:67%;
@@ -206,7 +206,7 @@
height:100px;
}
-#logout a.help{
+#logoutDiv a.help{
background:transparent url('/bow/img/aide.jpg') no-repeat scroll 0 0;
display:block;
height:34px;
@@ -217,7 +217,7 @@
float:left;
}
-#logout form input{
+#logoutDiv form input{
background:transparent url('/bow/img/fondbouton.jpg') repeat-x scroll 0 0;
border:medium none;
color:#9C7186;
@@ -280,7 +280,9 @@
}
#colonneD #extensions .extensionIcon {
- float: left;
+ float:left;
+ border:0 none;
+ margin-right:10px;
}
#colonneD #extensions .extensionName {
@@ -472,3 +474,24 @@
margin-left:25px;
margin-right:11px;
}
+
+.input label{
+ color:#9edcf8;
+ font-size:20px;
+ font-weight:normal;
+ font-style:normal;
+ float:left;
+ margin-bottom:20px;
+ width:100%;
+}
+
+#bookmarkForm label{
+ margin-top:12px;
+ font-style:normal;
+}
+
+#bookmarkForm input[type="text"]{
+ width:100%;
+ margin-top:10px;
+ margin-left:10px;
+}
\ No newline at end of file
Modified: trunk/src/main/webapp/css/connexion.css
===================================================================
--- trunk/src/main/webapp/css/connexion.css 2011-01-21 14:54:13 UTC (rev 175)
+++ trunk/src/main/webapp/css/connexion.css 2011-01-21 17:08:05 UTC (rev 176)
@@ -142,4 +142,4 @@
#register{
margin-top:35px;
-}
+}
\ No newline at end of file
Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-21 14:54:13 UTC (rev 175)
+++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-21 17:08:05 UTC (rev 176)
@@ -53,14 +53,16 @@
}
if ((String)request.getAttribute("formAction") == null)
- request.setAttribute("formAction", "/bow/addUrl.action");
+ request.setAttribute("formAction", "/addUrl.action");
%>
-<div id="logout" xmlns="http://www.w3.org/1999/xhtml"
+<div id="logoutDiv" xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <s:form action="logout">
- <s:submit key="bow.rightMenu.logout" />
+ <s:form action="logout" theme="simple">
+ <div class="input">
+ <s:submit key="bow.rightMenu.logout" />
+ </div>
</s:form>
<a href="http://maven-site.chorem.org/bow/" class="help" onclick="window.open(this.href); return false;"><s:text name="bow.rightMenu.help" /></a>
</div>
@@ -85,10 +87,10 @@
<div id="add" class="clearfix">
<h2><s:text name="bow.rightMenu.bookmark.addModify" /></h2>
<s:form id="bookmarkForm" action="%{#request.formAction}">
- <s:textfield key="bow.rightMenu.bookmark.link" name="link" value="%{#request.link}" />
- <s:textfield key="bow.rightMenu.bookmark.alias" name="alias" value="%{#request.alias}" />
- <s:textfield key="bow.rightMenu.bookmark.name" name="name" value="%{#request.name}" />
- <s:textfield key="bow.rightMenu.bookmark.tags" name="tags" value="%{#request.tags}" />
+ <s:textfield key="bow.rightMenu.bookmark.link" name="link" value="%{#request.link}" labelSeparator="" />
+ <s:textfield key="bow.rightMenu.bookmark.alias" name="alias" value="%{#request.alias}" labelSeparator="" />
+ <s:textfield key="bow.rightMenu.bookmark.name" name="name" value="%{#request.name}" labelSeparator="" />
+ <s:textfield key="bow.rightMenu.bookmark.tags" name="tags" value="%{#request.tags}" labelSeparator="" />
<s:submit key="bow.rightMenu.bookmark.submit" />
</s:form>
</div>
@@ -102,24 +104,30 @@
<% } %>
</div>
<div class="recherche">
- <h2><s:text name="bow.rightMenu.search" /></h2>
<s:form action="search">
- <s:textfield name="searchLine" />
- <s:submit key="bow.rightMenu.find.submit" />
+ <div class="input">
+ <label for="searchLine"><s:text name="bow.rightMenu.search" /></label>
+ <input type="text" name="searchLine" id="searchLine" />
+ <s:submit key="bow.rightMenu.find.submit" theme="simple" />
+ </div>
</s:form>
</div>
<div class="recherche">
- <h2><s:text name="bow.rightMenu.fullTextSearch" /></h2>
<s:form action="fullText">
- <s:textfield name="fullTextLine" />
- <s:submit key="bow.rightMenu.find.submit" />
+ <div class="input">
+ <label for="fullTextLine"><s:text name="bow.rightMenu.fullTextSearch" /></label>
+ <input type="text" name="fullTextLine" id="fullTextLine" />
+ <s:submit key="bow.rightMenu.find.submit" theme="simple" />
+ </div>
</s:form>
</div>
<div id="import">
- <h2><s:text name="bow.rightMenu.importBookmarks" /></h2>
<s:form action="importBookmarks" method="post" enctype="multipart/form-data">
- <s:file name="upfile" size="15%" /><br />
- <s:submit key="bow.rightMenu.import.submit" />
+ <div class="input">
+ <label for="fileImport"><s:text name="bow.rightMenu.importBookmarks" /></label>
+ <input type="file" size="15%" id="upfile" name="upfile" /><br />
+ <s:submit key="bow.rightMenu.import.submit" theme="simple" />
+ </div>
</s:form>
<s:a action="exportBookmarks"><s:text name="bow.rightMenu.exportBookmarks" /></s:a>
</div>
1
0
r175 - in trunk/src/main: resources/i18n webapp/css webapp/jsp
by vbriand@users.chorem.org 21 Jan '11
by vbriand@users.chorem.org 21 Jan '11
21 Jan '11
Author: vbriand
Date: 2011-01-21 15:54:13 +0100 (Fri, 21 Jan 2011)
New Revision: 175
Url: http://chorem.org/repositories/revision/bow/175
Log:
Fixed the design on the login, forgotPassword and register pages which was broken because Struts2 generates ugly "<table>"s everywhere
Modified:
trunk/src/main/resources/i18n/bow_fr_FR.properties
trunk/src/main/webapp/css/connexion.css
trunk/src/main/webapp/jsp/forgotPassword.jsp
trunk/src/main/webapp/jsp/login.jsp
trunk/src/main/webapp/jsp/register.jsp
Modified: trunk/src/main/resources/i18n/bow_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-21 11:22:45 UTC (rev 174)
+++ trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-21 14:54:13 UTC (rev 175)
@@ -28,7 +28,7 @@
bow.login.email.wrongformat=Votre adresse email est invalide
bow.login.password=Mot de passe
bow.login.password.required=Veuillez entrer votre mot de passe
-bow.login.repeatPassword=Retapez votre mot de passe
+bow.login.repeatPassword=Confirmation
bow.login.repeatPassword.required=Veuillez retaper votre mot de passe
bow.login.submit=Connexion
bow.login.title=Connexion
Modified: trunk/src/main/webapp/css/connexion.css
===================================================================
--- trunk/src/main/webapp/css/connexion.css 2011-01-21 11:22:45 UTC (rev 174)
+++ trunk/src/main/webapp/css/connexion.css 2011-01-21 14:54:13 UTC (rev 175)
@@ -78,10 +78,10 @@
color:#804561;
width:225px;
position:relative;
- margin:15px auto;
+ margin:15px 15px -20px 0px;
}
-#formFrame form p{
+#formFrame form table td label{
color:#804561;
font-size:16px;
font-weight:bold;
@@ -101,7 +101,7 @@
font-size: 12px;
}
-#formFrame #register{
+#formFrame #registerLink, #formFrame #loginLink{
bottom:50px;
font-size:14px;
}
@@ -117,7 +117,7 @@
font-size: 10px;
}
-input[type="submit"] {
+input[type="submit"]{
float:right;
margin-top:20px;
background:url('/bow/img/fdboutonV.jpg') repeat-x;
@@ -127,5 +127,19 @@
font-weight:bold;
border:none;
width:auto;
- padding: 2px;
+ padding:2px;
}
+
+#formFrame input[type="submit"]{
+ position:absolute;
+ bottom:40px;
+ right:30px;
+}
+
+#forgotPassword{
+ margin-top:50px;
+}
+
+#register{
+ margin-top:35px;
+}
Modified: trunk/src/main/webapp/jsp/forgotPassword.jsp
===================================================================
--- trunk/src/main/webapp/jsp/forgotPassword.jsp 2011-01-21 11:22:45 UTC (rev 174)
+++ trunk/src/main/webapp/jsp/forgotPassword.jsp 2011-01-21 14:54:13 UTC (rev 175)
@@ -40,11 +40,11 @@
<h1><s:text name="bow.forgotpwd.title" /></h1>
<s:form action="forgotPassword">
<p>
- <s:textfield key="bow.login.email" name="email" />
+ <s:textfield key="bow.login.email" name="email" labelposition="top" labelSeparator=" :" />
<s:submit key="bow.forgotpwd.submit" />
</p>
</s:form>
- <s:a action="login_input"><s:text name="bow.login.title" /></s:a>
+ <s:a action="login_input" id="loginLink"><s:text name="bow.login.title" /></s:a>
</div>
</div>
</body>
Modified: trunk/src/main/webapp/jsp/login.jsp
===================================================================
--- trunk/src/main/webapp/jsp/login.jsp 2011-01-21 11:22:45 UTC (rev 174)
+++ trunk/src/main/webapp/jsp/login.jsp 2011-01-21 14:54:13 UTC (rev 175)
@@ -13,25 +13,17 @@
<s:head />
</head>
<body>
- <div id="content">
- <div id="formFrame">
- <h1><s:text name="bow.login.title" /></h1>
- <s:form action="login">
- <p>
- <!-- <label for="login_email" class="label"><s:text name="bow.login.email" /> :</label>
- <input type="text" name="email" value="" id="login_email" /><br /><br />
- <label for="login_password" class="label"><s:text name="bow.login.password" /> :</label>
- <input type="password" name="password" id="login_password" /></td>
- <s:submit key="bow.login.submit" /> -->
-
- <s:textfield key="bow.login.email" name="email" /><br /><br />
- <s:password key="bow.login.password" name="password" /><br /><br />
- <s:submit key="bow.login.submit" />
- </p>
- </s:form>
- <s:a action="register_input"><s:text name="bow.register.title" /></s:a><br />
- <s:a action="forgotPassword_input"><s:text name="bow.forgotpwd.title" /></s:a>
- </div>
- </div>
+ <div id="content">
+ <div id="formFrame">
+ <h1><s:text name="bow.login.title" /></h1>
+ <s:form action="login">
+ <s:textfield key="bow.login.email" name="email" labelposition="top" labelSeparator=" :" /><br /><br />
+ <s:password key="bow.login.password" name="password" labelposition="top" labelSeparator=" :" /><br /><br />
+ <s:submit key="bow.login.submit" />
+ </s:form>
+ <s:a action="register_input" id="registerLink"><s:text name="bow.register.title" /></s:a><br />
+ <s:a action="forgotPassword_input" id="forgotPwd"><s:text name="bow.forgotpwd.title" /></s:a>
+ </div>
+ </div>
</body>
</html>
Modified: trunk/src/main/webapp/jsp/register.jsp
===================================================================
--- trunk/src/main/webapp/jsp/register.jsp 2011-01-21 11:22:45 UTC (rev 174)
+++ trunk/src/main/webapp/jsp/register.jsp 2011-01-21 14:54:13 UTC (rev 175)
@@ -40,13 +40,13 @@
<h1><s:text name="bow.register.title" /></h1>
<s:form action="register">
<p>
- <s:textfield key="bow.login.email" name="email" />
- <s:password key="bow.login.password" name="password" />
- <s:password key="bow.login.repeatPassword" name="repeatPassword" />
+ <s:textfield key="bow.login.email" name="email" labelposition="top" labelSeparator=" :" />
+ <s:password key="bow.login.password" name="password" labelposition="top" labelSeparator=" :" />
+ <s:password key="bow.login.repeatPassword" name="repeatPassword" labelposition="top" labelSeparator=" :" />
<s:submit key="bow.register.submit" />
</p>
</s:form>
- <s:a action="login_input"><s:text name="bow.login.title" /></s:a>
+ <s:a action="login_input" id="loginLink"><s:text name="bow.login.title" /></s:a>
</div>
</div>
</body>
1
0
r174 - in trunk/src/main: java/org/chorem/bow java/org/chorem/bow/action resources resources/i18n webapp/WEB-INF/decorators webapp/css webapp/jsp webapp/jsp/inc
by vbriand@users.chorem.org 21 Jan '11
by vbriand@users.chorem.org 21 Jan '11
21 Jan '11
Author: vbriand
Date: 2011-01-21 12:22:45 +0100 (Fri, 21 Jan 2011)
New Revision: 174
Url: http://chorem.org/repositories/revision/bow/174
Log:
We can't change our email address to the address of someone else anymore
Modified:
trunk/src/main/java/org/chorem/bow/BowInit.java
trunk/src/main/java/org/chorem/bow/action/PreferencesAction.java
trunk/src/main/resources/i18n/bow_en_GB.properties
trunk/src/main/resources/i18n/bow_fr_FR.properties
trunk/src/main/resources/struts.xml
trunk/src/main/webapp/WEB-INF/decorators/main.jsp
trunk/src/main/webapp/css/bookmark.css
trunk/src/main/webapp/css/connexion.css
trunk/src/main/webapp/jsp/inc/footer.jsp
trunk/src/main/webapp/jsp/inc/header.jsp
trunk/src/main/webapp/jsp/inc/rightMenu.jsp
trunk/src/main/webapp/jsp/login.jsp
trunk/src/main/webapp/jsp/preferences.jsp
Modified: trunk/src/main/java/org/chorem/bow/BowInit.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowInit.java 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/java/org/chorem/bow/BowInit.java 2011-01-21 11:22:45 UTC (rev 174)
@@ -64,6 +64,7 @@
static public void initHomePage(HttpServletRequest request, User user) {
WikittyProxy proxy = BowProxy.getInstance();
Criteria criteria = BowBookmark.getBookmarkListCriteriaByUser(user, null);
+
if (criteria != null) {
Criteria sortCriteria = criteria.addSortDescending(Bookmark.FQ_FIELD_CLICK);
PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, sortCriteria); //Selects all bookmarks by user
Modified: trunk/src/main/java/org/chorem/bow/action/PreferencesAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/PreferencesAction.java 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/java/org/chorem/bow/action/PreferencesAction.java 2011-01-21 11:22:45 UTC (rev 174)
@@ -13,8 +13,10 @@
import org.chorem.bow.Preference;
import org.chorem.bow.User;
import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.Criteria;
import org.nuiton.wikitty.FacetTopic;
import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
public class PreferencesAction extends BowBaseAction implements SessionAware, ServletRequestAware {
private static final long serialVersionUID = -58341106356599721L;
@@ -236,26 +238,32 @@
if (user != null) {
setBookmarksImportDate(BowBookmark.getBookmarksByImportDate(request, user));
- if (update != null) {
+ if (update != null) { //If the user submitted the form
WikittyProxy proxy = BowProxy.getInstance();
Preference preference = changePreference();
proxy.store(preference);
- User newUser = proxy.restore(User.class, (user).getWikittyId());
+ User newUser = proxy.restore(User.class, user.getWikittyId());
+ Criteria criteria = Search.query().eq(User.FQ_FIELD_EMAIL, email).criteria();
- try {
- newUser = changeUser(newUser);
- } catch (NoSuchAlgorithmException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ if (proxy.findByCriteria(User.class, criteria) == null) { //If this email address isn't already used by someone else
+ try {
+ newUser = changeUser(newUser);
+ } catch (NoSuchAlgorithmException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ newUser = proxy.store(newUser);
+ session.put("user", newUser);
+
+ preference = proxy.restore(Preference.class, newUser.getWikittyId());
+ session.put("preference", preference);
+ return "update";
}
- newUser = proxy.store(newUser);
- session.put("user", newUser);
-
- preference = proxy.restore(Preference.class, newUser.getWikittyId());
- session.put("preference", preference);
- return "update";
- } else {
+ setEmail(user.getEmail());
+ addActionError(getText("bow.preferences.emailAldyExists"));
+ return ERROR;
+ } else { //If the user didn't submit the form, the fields are filled with the current preferences values
Preference preference = (Preference)session.get("preference");
setEmail(user.getEmail());
Modified: trunk/src/main/resources/i18n/bow_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-21 11:22:45 UTC (rev 174)
@@ -32,21 +32,22 @@
bow.login.repeatPassword.required=Please repeat your password
bow.login.submit=Login
bow.login.title=Login
-bow.preferences.bookmarksHomePage=
-bow.preferences.colors=
-bow.preferences.confirmNewPassword=
-bow.preferences.currentPassword=
-bow.preferences.importedBookmarks=
-bow.preferences.newPassword=
-bow.preferences.noImportedBookmarks=
-bow.preferences.regenPermToken=
-bow.preferences.searchEngineUrlResults=
-bow.preferences.searchEngineUrlSuggestions=
-bow.preferences.siteLook=
-bow.preferences.submit=
-bow.preferences.tagsNb=
+bow.preferences.bookmarksHomePage=Number of bookmarks displayed on the home page
+bow.preferences.colors=Site color
+bow.preferences.confirmNewPassword=Confirm new password
+bow.preferences.currentPassword=Current password
+bow.preferences.emailAldyExists=This email address is already linked with another account
+bow.preferences.importedBookmarks=Imported bookmarks
+bow.preferences.newPassword=New password
+bow.preferences.noImportedBookmarks=No imported bookmarks
+bow.preferences.regenPermToken=Regenerate permanent token
+bow.preferences.searchEngineUrlResults=Search Engine URL Results ({searchTerms} will be replaced by your text)
+bow.preferences.searchEngineUrlSuggestions=Search Engine URL Suggestions
+bow.preferences.siteLook=Site look
+bow.preferences.submit=Change
+bow.preferences.tagsNb=Number of tags displayed in the tag cloud
bow.preferences.title=Preferences
-bow.preferences.userInfo=
+bow.preferences.userInfo=User information
bow.register.emailAldyUsed=This email address is already used
bow.register.invalidLogin=
bow.register.mailEmail=
@@ -70,10 +71,13 @@
bow.rightMenu.extensions=Extensions
bow.rightMenu.find.submit=Find
bow.rightMenu.fullTextSearch=Full text search
+bow.rightMenu.help=Help
bow.rightMenu.import.submit=Import
bow.rightMenu.importBookmarks=Import bookmarks
bow.rightMenu.logout=Logout
bow.rightMenu.search=Search
bow.rightMenu.token.permanent=Permanent token id
bow.rightMenu.token.temporary=Session token id
+bow.search.orderby=Order by
+bow.search.submit=Search
bow.search.title=Search
Modified: trunk/src/main/resources/i18n/bow_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-21 11:22:45 UTC (rev 174)
@@ -32,18 +32,19 @@
bow.login.repeatPassword.required=Veuillez retaper votre mot de passe
bow.login.submit=Connexion
bow.login.title=Connexion
-bow.preferences.bookmarksHomePage=
-bow.preferences.colors=
-bow.preferences.confirmNewPassword=
-bow.preferences.currentPassword=
-bow.preferences.importedBookmarks=
-bow.preferences.newPassword=
-bow.preferences.noImportedBookmarks=
-bow.preferences.regenPermToken=
+bow.preferences.bookmarksHomePage=Nombre de marque-pages affich\u00E9s
+bow.preferences.colors=Couleur du site
+bow.preferences.confirmNewPassword=Confirmez votre mot de passe
+bow.preferences.currentPassword=Mot de passe actuel
+bow.preferences.emailAldyExists=Cette addresse email est d\u00E9j\u00E0 utilis\u00E9e par un autre compte
+bow.preferences.importedBookmarks=Marque-pages import\u00E9s
+bow.preferences.newPassword=Nouveau mot de passe
+bow.preferences.noImportedBookmarks=Aucun marque-page import\u00E9
+bow.preferences.regenPermToken=Reg\u00E9n\u00E9rer le token permanent
bow.preferences.searchEngineUrlResults=
bow.preferences.searchEngineUrlSuggestions=
bow.preferences.siteLook=
-bow.preferences.submit=
+bow.preferences.submit=Changer
bow.preferences.tagsNb=
bow.preferences.title=Pr\u00E9f\u00E9rences
bow.preferences.userInfo=
@@ -70,10 +71,13 @@
bow.rightMenu.extensions=Extensions
bow.rightMenu.find.submit=Rechercher
bow.rightMenu.fullTextSearch=Recherche full text
+bow.rightMenu.help=Aide
bow.rightMenu.import.submit=Importer
bow.rightMenu.importBookmarks=Importer des marque-pages
bow.rightMenu.logout=D\u00E9connexion
bow.rightMenu.search=Recherche
bow.rightMenu.token.permanent=Token permanent
bow.rightMenu.token.temporary=Token session
+bow.search.orderby=Trier par
+bow.search.submit=Rechercher
bow.search.title=Recherche
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/resources/struts.xml 2011-01-21 11:22:45 UTC (rev 174)
@@ -98,6 +98,7 @@
<action name="preferences" class="org.chorem.bow.action.PreferencesAction">
<result name="login" type="redirectAction">login_input</result>
<result name="update" type="redirectAction">preferences</result>
+ <result name="error">/jsp/preferences.jsp</result>
<result>/jsp/preferences.jsp</result>
</action>
<action name="admin">
Modified: trunk/src/main/webapp/WEB-INF/decorators/main.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-21 11:22:45 UTC (rev 174)
@@ -12,6 +12,8 @@
<meta name="description" content="Bookmarks on the web" />
<s:url id="temporaryXml" action="temporaryXml" />
<s:url id="permanentXml" action="permanentXml" />
+ <s:url id="favicon" value="/img/favicon.png" />
+ <link rel="icon" type="image/png" href="${favicon}" />
<link rel="search" type="application/opensearchdescription+xml" title="bowTemporarySearchEngine" href="${temporaryXml}" />
<link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="${permanentXml}" />
<s:url id="globalCSS" value="/css/global.css" />
Modified: trunk/src/main/webapp/css/bookmark.css
===================================================================
--- trunk/src/main/webapp/css/bookmark.css 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/webapp/css/bookmark.css 2011-01-21 11:22:45 UTC (rev 174)
@@ -393,8 +393,8 @@
padding:15px 0;
}
-.formFrame p input[type="text"],
-.formFrame p input[type="password"]{
+.formFrame p input[type="text"], td input[type="text"],
+.formFrame p input[type="password"], td input[type="password"]{
width:225px;
}
@@ -427,7 +427,7 @@
font-size:10px;
}
-.formFrame p input{
+.formFrame p input, td input{
margin-bottom:2px;
}
Modified: trunk/src/main/webapp/css/connexion.css
===================================================================
--- trunk/src/main/webapp/css/connexion.css 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/webapp/css/connexion.css 2011-01-21 11:22:45 UTC (rev 174)
@@ -81,7 +81,7 @@
margin:15px auto;
}
-#formFrame form div{
+#formFrame form p{
color:#804561;
font-size:16px;
font-weight:bold;
Modified: trunk/src/main/webapp/jsp/inc/footer.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/footer.jsp 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/webapp/jsp/inc/footer.jsp 2011-01-21 11:22:45 UTC (rev 174)
@@ -1,3 +1,6 @@
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@taglib prefix="s" uri="/struts-tags" %>
+
<div id="footer">
<p>
<a shape="rect" href="">bow</a>
@@ -6,6 +9,14 @@
<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>
+ <a shape="rect" href="http://list.chorem.org/cgi-bin/mailman/listinfo/bow-users">Support utilisateur</a> -
+ <s:url id="localeEN">
+ <s:param name="request_locale">en_GB</s:param>
+ </s:url>
+ <s:url id="localeFR">
+ <s:param name="request_locale">fr_FR</s:param>
+ </s:url>
+ <s:a href="%{localeEN}"><s:text name="bow.action.locale.english" /></s:a> -
+ <s:a href="%{localeFR}"><s:text name="bow.action.locale.french" /></s:a>
</p>
</div>
\ No newline at end of file
Modified: trunk/src/main/webapp/jsp/inc/header.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/header.jsp 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/webapp/jsp/inc/header.jsp 2011-01-21 11:22:45 UTC (rev 174)
@@ -1,4 +1,10 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@taglib prefix="s" uri="/struts-tags"%>
<div id="header">
- <a class="logo" href="/bow/">bow</a>
+ <s:if test="#session.user">
+ <a class="logo" href="<s:property value='%{#session.bowUrl}' />home.action?token=<s:property value='%{#session.tokenActions.getPermanentToken()}' />">bow</a>
+ </s:if>
+ <s:else>
+ <a class="logo" href="">bow</a>
+ </s:else>
</div>
\ No newline at end of file
Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-21 11:22:45 UTC (rev 174)
@@ -25,13 +25,7 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@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.BowConfig" %>
<%@page import="org.chorem.bow.Preference" %>
@@ -43,9 +37,6 @@
admin = false;
}
-String temporaryToken = tokenActions.getTemporaryToken();
-String permanentToken = tokenActions.getPermanentToken();
-
int nbTags = 100;
Preference preference = (Preference)session.getAttribute("preference");
if (preference != null) {
@@ -61,23 +52,8 @@
fullText = bookmarkActions.getFullTextLine();
}
-String formLink = (String)request.getAttribute("link");
-String formName = (String)request.getAttribute("name");
-String formTags = (String)request.getAttribute("tags");
-String formAlias = (String)request.getAttribute("alias");
-String formAction = (String)request.getAttribute("formAction");
-
-if (formLink == null)
- formLink = "URL";
-if (formName == null)
- formName = "name";
-if (formTags == null)
- formTags = "tag1 tag2...";
-if (formAlias == null)
- formAlias = "alias";
-if (formAction == null)
+if ((String)request.getAttribute("formAction") == null)
request.setAttribute("formAction", "/bow/addUrl.action");
- //formAction = "/bow/addUrl.action";
%>
<div id="logout" xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
@@ -135,17 +111,13 @@
<div class="recherche">
<h2><s:text name="bow.rightMenu.fullTextSearch" /></h2>
<s:form action="fullText">
- <% if (fullText != null) { %>
- <s:textfield name="fullTextLine" value="" /> <!-- <%=fullText%> -->
- <% } else { %>
- <s:textfield name="fullTextLine" />
- <% } %>
+ <s:textfield name="fullTextLine" />
<s:submit key="bow.rightMenu.find.submit" />
</s:form>
</div>
<div id="import">
<h2><s:text name="bow.rightMenu.importBookmarks" /></h2>
- <s:form action="importBookmarks" enctype="multipart/form-data">
+ <s:form action="importBookmarks" method="post" enctype="multipart/form-data">
<s:file name="upfile" size="15%" /><br />
<s:submit key="bow.rightMenu.import.submit" />
</s:form>
Modified: trunk/src/main/webapp/jsp/login.jsp
===================================================================
--- trunk/src/main/webapp/jsp/login.jsp 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/webapp/jsp/login.jsp 2011-01-21 11:22:45 UTC (rev 174)
@@ -17,22 +17,18 @@
<div id="formFrame">
<h1><s:text name="bow.login.title" /></h1>
<s:form action="login">
- <p>
+ <p>
+ <!-- <label for="login_email" class="label"><s:text name="bow.login.email" /> :</label>
+ <input type="text" name="email" value="" id="login_email" /><br /><br />
+ <label for="login_password" class="label"><s:text name="bow.login.password" /> :</label>
+ <input type="password" name="password" id="login_password" /></td>
+ <s:submit key="bow.login.submit" /> -->
+
<s:textfield key="bow.login.email" name="email" /><br /><br />
<s:password key="bow.login.password" name="password" /><br /><br />
<s:submit key="bow.login.submit" />
</p>
</s:form>
- <s:url id="localeEN" action="login_input">
- <s:param name="request_locale">en_GB</s:param>
- </s:url>
- <s:url id="localeFR" action="login_input">
- <s:param name="request_locale">fr_FR</s:param>
- </s:url>
-
- <s:a href="%{localeEN}">English</s:a><br />
- <s:a href="%{localeFR}">French</s:a><br />
-
<s:a action="register_input"><s:text name="bow.register.title" /></s:a><br />
<s:a action="forgotPassword_input"><s:text name="bow.forgotpwd.title" /></s:a>
</div>
Modified: trunk/src/main/webapp/jsp/preferences.jsp
===================================================================
--- trunk/src/main/webapp/jsp/preferences.jsp 2011-01-14 14:25:43 UTC (rev 173)
+++ trunk/src/main/webapp/jsp/preferences.jsp 2011-01-21 11:22:45 UTC (rev 174)
@@ -46,11 +46,12 @@
<s:url id="changePreferences" action="preferences">
<s:param name="update">1</s:param>
</s:url>
+ <s:actionerror />
<s:form action="%{changePreferences}">
<div class="formFrame">
<h3><s:text name="bow.preferences.userInfo" /></h3>
<p>
- <s:textfield key="bow.login.email" name="email" /><br /><br />
+ <s:textfield key="bow.login.email" name="email" cssStyle="margin-bottom: 2px" /><br /><br />
<s:password key="bow.preferences.currentPassword" name="currentPassword" />
<s:password key="bow.preferences.newPassword" name="newPassword" />
<s:password key="bow.preferences.confirmNewPassword" name="confirmNewPassword" />
1
0
14 Jan '11
Author: vbriand
Date: 2011-01-14 15:25:43 +0100 (Fri, 14 Jan 2011)
New Revision: 173
Url: http://chorem.org/repositories/revision/bow/173
Log:
Fixed the major design issue when logged in
Modified:
trunk/src/main/webapp/WEB-INF/decorators/main.jsp
trunk/src/main/webapp/jsp/home.jsp
trunk/src/main/webapp/jsp/preferences.jsp
trunk/src/main/webapp/jsp/search.jsp
Modified: trunk/src/main/webapp/WEB-INF/decorators/main.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-14 13:24:54 UTC (rev 172)
+++ trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2011-01-14 14:25:43 UTC (rev 173)
@@ -23,11 +23,14 @@
<body id="page-home">
<div id="wrap">
<div id="page">
- <%@include file="/jsp/inc/header.jsp" %>
+ <%@include file="/jsp/inc/header.jsp" %>
<div id="main">
- <%@include file="/jsp/inc/errorFrame.jsp" %>
- <decorator:body />
- </div>
+ <%@include file="/jsp/inc/errorFrame.jsp" %>
+ <decorator:body />
+ </div>
+ <s:if test="#session.user">
+ <jsp:include page="/jsp/inc/rightMenu.jsp" />
+ </s:if>
</div>
</div>
<%@include file="/jsp/inc/footer.jsp" %>
Modified: trunk/src/main/webapp/jsp/home.jsp
===================================================================
--- trunk/src/main/webapp/jsp/home.jsp 2011-01-14 13:24:54 UTC (rev 172)
+++ trunk/src/main/webapp/jsp/home.jsp 2011-01-14 14:25:43 UTC (rev 173)
@@ -104,7 +104,6 @@
<p class="nobookmarks"><s:text name="bow.bookmarks.noBookmarks" /></p>
<% } %>
</div>
- <jsp:include page="inc/rightMenu.jsp" />
</body>
</html>
<% } %>
Modified: trunk/src/main/webapp/jsp/preferences.jsp
===================================================================
--- trunk/src/main/webapp/jsp/preferences.jsp 2011-01-14 13:24:54 UTC (rev 172)
+++ trunk/src/main/webapp/jsp/preferences.jsp 2011-01-14 14:25:43 UTC (rev 173)
@@ -39,7 +39,6 @@
<s:head />
</head>
<body>
- <s:property value="#session.put" />
<div id="content">
<div class="menu clearfix">
<h2><s:text name="bow.preferences.title" /></h2>
@@ -113,6 +112,5 @@
}
%>
</div>
- <jsp:include page="inc/rightMenu.jsp" flush="true" />
</body>
</html>
\ No newline at end of file
Modified: trunk/src/main/webapp/jsp/search.jsp
===================================================================
--- trunk/src/main/webapp/jsp/search.jsp 2011-01-14 13:24:54 UTC (rev 172)
+++ trunk/src/main/webapp/jsp/search.jsp 2011-01-14 14:25:43 UTC (rev 173)
@@ -50,7 +50,6 @@
<s:head />
</head>
<body>
- <div id="content">
<div class="menu clearfix">
<h2><s:text name="bow.search.title" /></h2>
<s:url id="order" action="order" escapeAmp="false">
@@ -101,7 +100,6 @@
<p class="nobookmarks"><s:text name="bow.bookmarks.noBookmarks" /></p>
<% } %>
</div>
- <jsp:include page="inc/rightMenu.jsp" />
</body>
</html>
<% } %>
1
0
r172 - in trunk/src/main: java/org/chorem/bow/action resources resources/i18n webapp/jsp/inc
by vbriand@users.chorem.org 14 Jan '11
by vbriand@users.chorem.org 14 Jan '11
14 Jan '11
Author: vbriand
Date: 2011-01-14 14:24:54 +0100 (Fri, 14 Jan 2011)
New Revision: 172
Url: http://chorem.org/repositories/revision/bow/172
Log:
Fixed all bugs when editing a bookmark
Modified:
trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java
trunk/src/main/resources/i18n/bow_en_GB.properties
trunk/src/main/resources/i18n/bow_fr_FR.properties
trunk/src/main/resources/struts.xml
trunk/src/main/webapp/jsp/inc/bookmark.jsp
trunk/src/main/webapp/jsp/inc/rightMenu.jsp
Modified: trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2011-01-13 18:04:39 UTC (rev 171)
+++ trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2011-01-14 13:24:54 UTC (rev 172)
@@ -9,24 +9,24 @@
public class ModifyBookmarkAction extends BowBaseAction {
private static final long serialVersionUID = 8197008295267924063L;
- protected String url;
+ protected String link;
protected String name;
protected String alias;
protected String tags;
protected String bookmarkId;
/**
- * @return the url
+ * @return the link
*/
- public String getUrl() {
- return url;
+ public String getLink() {
+ return link;
}
/**
- * @param url the url to set
+ * @param url the linkto set
*/
- public void setUrl(String url) {
- this.url = url;
+ public void setLink(String link) {
+ this.link = link;
}
/**
@@ -97,7 +97,7 @@
alias = bookmark.getAlias();
}
}
- BookmarkActions.updateBookmark(bookmark, name, url, tags, alias);
+ BookmarkActions.updateBookmark(bookmark, name, link, tags, alias);
proxy.store(bookmark);
}
return SUCCESS;
Modified: trunk/src/main/resources/i18n/bow_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-13 18:04:39 UTC (rev 171)
+++ trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-14 13:24:54 UTC (rev 172)
@@ -1,6 +1,8 @@
bow.action.locale.english=English
bow.action.locale.french=French
bow.bookmark.badFileFormat=
+bow.bookmark.description=Description
+bow.bookmark.tags=Tags
bow.bookmarks.noBookmarks=No bookmarks
bow.config.alias.url.description=
bow.config.application.version.description=
@@ -70,6 +72,7 @@
bow.rightMenu.fullTextSearch=Full text search
bow.rightMenu.import.submit=Import
bow.rightMenu.importBookmarks=Import bookmarks
+bow.rightMenu.logout=Logout
bow.rightMenu.search=Search
bow.rightMenu.token.permanent=Permanent token id
bow.rightMenu.token.temporary=Session token id
Modified: trunk/src/main/resources/i18n/bow_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-13 18:04:39 UTC (rev 171)
+++ trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-14 13:24:54 UTC (rev 172)
@@ -1,6 +1,8 @@
bow.action.locale.english=Anglais
bow.action.locale.french=Fran\u00E7ais
bow.bookmark.badFileFormat=
+bow.bookmark.description=Description
+bow.bookmark.tags=Tags
bow.bookmarks.noBookmarks=Pas de marque-page
bow.config.alias.url.description=
bow.config.application.version.description=
@@ -70,6 +72,7 @@
bow.rightMenu.fullTextSearch=Recherche full text
bow.rightMenu.import.submit=Importer
bow.rightMenu.importBookmarks=Importer des marque-pages
+bow.rightMenu.logout=D\u00E9connexion
bow.rightMenu.search=Recherche
bow.rightMenu.token.permanent=Token permanent
bow.rightMenu.token.temporary=Token session
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2011-01-13 18:04:39 UTC (rev 171)
+++ trunk/src/main/resources/struts.xml 2011-01-14 13:24:54 UTC (rev 172)
@@ -4,6 +4,7 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
+ <constant name="struts.ognl.allowStaticMethodAccess" value="true" />
<package name="myPackage" extends="struts-default">
<action name="register_*" method="{1}" class="org.chorem.bow.action.RegisterAction">
Modified: trunk/src/main/webapp/jsp/inc/bookmark.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/bookmark.jsp 2011-01-13 18:04:39 UTC (rev 171)
+++ trunk/src/main/webapp/jsp/inc/bookmark.jsp 2011-01-14 13:24:54 UTC (rev 172)
@@ -43,11 +43,15 @@
<s:set var="searchLine" value="%{#request.searchLine}" />
<s:set var="fullTextLine" value="%{#request.fullTextLine}" />
<s:set var="wikittyId" value="%{#request.bookmark.getWikittyId()}" />
+ <s:set var="bookmarkLink" value="%{#request.bookmark.getLink()}" />
+ <s:set var="bookmarkAlias" value="%{#request.bookmark.getAlias()}" />
+ <s:set var="bookmarkDescription" value="%{#request.bookmark.getDescription()}" />
+ <s:set var="bookmarkClicks" value="%{#request.bookmark.getClick()}" />
<div class="bookmark">
<div class="bookmarkhead">
<a class="alias" href="<%=aliasUrl + bookmark.getAlias()%>" title="<%=bookmark.getLink()%>" onclick="window.open(this.href); return false;">
- <%=bookmark.getAlias()%>
+ <s:property value="%{#bookmarkAlias}" />
</a>
<p class="date"> (<%=sdf.format(bookmark.getDate())%>)</p>
<s:url id="editBookmark" action="modifyBookmark" escapeAmp="false">
@@ -55,7 +59,7 @@
<s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
<s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
</s:url>
- <s:a cssClass="edit" href="%{editBookmark}" onclick="return modify('%{#request.bookmark.getDescription()}', '%{#request.bookmark.getAlias()}', '%{#request.bookmark.getTags()}', '%{#request.bookmark.getLink()}', '%{editBookmark}', '%{#wikittyId}');"></s:a>
+ <s:a cssClass="edit" href="%{editBookmark}" onclick="return modify('%{#bookmarkDescription}', '%{#bookmarkAlias}', '%{@org.chorem.bow.BookmarkActions@getBookmarkTagsString(#request.bookmark)}', '%{#bookmarkLink}', '%{editBookmark}', '%{#wikittyId}');"></s:a>
<s:url id="removeBookmark" action="removeBookmark" escapeAmp="false">
<s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
<s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
@@ -65,17 +69,17 @@
</div>
<div class="bookmarkcontenu">
<div class="screenshot"></div>
- <div class="click"><%=bookmark.getClick()%></div>
+ <div class="click"><s:property value="%{#bookmarkClicks}" /></div>
<div class="description">
- <h3>Description :</h3>
+ <h3><s:text name="bow.bookmark.description" /> :</h3>
<p>
<s:url id="addClick" action="addClick">
- <s:param name="bookmarkId"><%=bookmark.getWikittyId()%></s:param>
+ <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
</s:url>
- <s:a title="%{#request.bookmark.getLink()}" href="%{addClick}" onclick="window.open(this.href); return false;"><%=bookmark.getDescription()%></s:a>
+ <s:a title="%{#bookmarkLink}" href="%{addClick}" onclick="window.open(this.href); return false;"><s:property value="%{#bookmarkDescription}" /></s:a>
</p>
<p class="tags">
- <strong>Tags :</strong>
+ <strong><s:text name="bow.bookmark.tags" /> :</strong>
<%
Set<String> tagList = bookmark.getTags();
Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-13 18:04:39 UTC (rev 171)
+++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-14 13:24:54 UTC (rev 172)
@@ -65,7 +65,7 @@
String formName = (String)request.getAttribute("name");
String formTags = (String)request.getAttribute("tags");
String formAlias = (String)request.getAttribute("alias");
-String formAction = (String)request.getAttribute("formAction"); //TODO : modifier le nom action en formAction parce que sinon ça fait tout péter
+String formAction = (String)request.getAttribute("formAction");
if (formLink == null)
formLink = "URL";
@@ -84,7 +84,7 @@
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<s:form action="logout">
- <s:submit name="bow.rightMenu.logout" />
+ <s:submit key="bow.rightMenu.logout" />
</s:form>
<a href="http://maven-site.chorem.org/bow/" class="help" onclick="window.open(this.href); return false;"><s:text name="bow.rightMenu.help" /></a>
</div>
@@ -109,7 +109,7 @@
<div id="add" class="clearfix">
<h2><s:text name="bow.rightMenu.bookmark.addModify" /></h2>
<s:form id="bookmarkForm" action="%{#request.formAction}">
- <s:textfield key="bow.rightMenu.bookmark.link" name="link" value="%{#request.link}" />
+ <s:textfield key="bow.rightMenu.bookmark.link" name="link" value="%{#request.link}" />
<s:textfield key="bow.rightMenu.bookmark.alias" name="alias" value="%{#request.alias}" />
<s:textfield key="bow.rightMenu.bookmark.name" name="name" value="%{#request.name}" />
<s:textfield key="bow.rightMenu.bookmark.tags" name="tags" value="%{#request.tags}" />
1
0
r171 - in trunk/src/main: resources resources/i18n webapp/jsp/inc
by vbriand@users.chorem.org 13 Jan '11
by vbriand@users.chorem.org 13 Jan '11
13 Jan '11
Author: vbriand
Date: 2011-01-13 19:04:39 +0100 (Thu, 13 Jan 2011)
New Revision: 171
Url: http://chorem.org/repositories/revision/bow/171
Log:
The tags can now be removed
Modified:
trunk/src/main/resources/i18n/bow_en_GB.properties
trunk/src/main/resources/i18n/bow_fr_FR.properties
trunk/src/main/resources/struts.xml
trunk/src/main/webapp/jsp/inc/bookmark.jsp
trunk/src/main/webapp/jsp/inc/tagsCloud.jsp
Modified: trunk/src/main/resources/i18n/bow_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-13 15:11:42 UTC (rev 170)
+++ trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-13 18:04:39 UTC (rev 171)
@@ -60,6 +60,7 @@
bow.rightMenu.bookmark.link=URL
bow.rightMenu.bookmark.name=DESC
bow.rightMenu.bookmark.permanentLink=Bookmark add link (permanent)
+bow.rightMenu.bookmark.submit=Save
bow.rightMenu.bookmark.tags=TAGS
bow.rightMenu.bookmark.temporaryLink=Bookmark add link (session)
bow.rightMenu.chromiumExtension=Chromium extension
@@ -72,3 +73,4 @@
bow.rightMenu.search=Search
bow.rightMenu.token.permanent=Permanent token id
bow.rightMenu.token.temporary=Session token id
+bow.search.title=Search
Modified: trunk/src/main/resources/i18n/bow_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-13 15:11:42 UTC (rev 170)
+++ trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-13 18:04:39 UTC (rev 171)
@@ -60,6 +60,7 @@
bow.rightMenu.bookmark.link=URL
bow.rightMenu.bookmark.name=DESC
bow.rightMenu.bookmark.permanentLink=Ajouter un bookmark (permanent)
+bow.rightMenu.bookmark.submit=Sauvegarder
bow.rightMenu.bookmark.tags=TAGS
bow.rightMenu.bookmark.temporaryLink=Ajouter un bookmark (session)
bow.rightMenu.chromiumExtension=Extension pour chromium
@@ -72,3 +73,4 @@
bow.rightMenu.search=Recherche
bow.rightMenu.token.permanent=Token permanent
bow.rightMenu.token.temporary=Token session
+bow.search.title=Recherche
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2011-01-13 15:11:42 UTC (rev 170)
+++ trunk/src/main/resources/struts.xml 2011-01-13 18:04:39 UTC (rev 171)
@@ -31,7 +31,7 @@
</action>
<action name="addUrl" class="org.chorem.bow.action.AddUrlAction">
<result type="redirectAction">home</result>
- <!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
+ <!-- TODO: changer pour rediriger selon la page sur laquelle on se trouvait (home, search, ...)-->
</action>
</package>
@@ -71,10 +71,11 @@
<result type="redirectAction">preferences</result>
</action>
<action name="deleteTag" class="org.chorem.bow.action.DeleteTagAction">
- <!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
+ <!-- TODO: changer pour rediriger selon la page sur laquelle on se trouvait (home, search, ...)-->
+ <result type="redirectAction">home</result>
</action>
<action name="addAlias" class="org.chorem.bow.action.AddAliasAction">
- <!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
+ <!-- TODO: changer pour rediriger selon la page sur laquelle on se trouvait (home, search, ...)-->
<result type="redirectAction">home</result>
</action>
<action name="order" class="org.chorem.bow.action.OrderAction">
@@ -90,7 +91,7 @@
</action>
<!-- Suggestion, Result -->
<action name="openSearch*" method="{1}" class="org.chorem.bow.action.OpenSearchAction">
- <!-- Plein de types de redirections différentes, et un .forward(..., ...); que je ne sais pas comment changer -->
+ <!-- TODO: changer pour rediriger selon la page sur laquelle on se trouvait (home, search, ...)-->
<result>/jsp/suggestions.jsp</result>
</action>
<action name="preferences" class="org.chorem.bow.action.PreferencesAction">
Modified: trunk/src/main/webapp/jsp/inc/bookmark.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/bookmark.jsp 2011-01-13 15:11:42 UTC (rev 170)
+++ trunk/src/main/webapp/jsp/inc/bookmark.jsp 2011-01-13 18:04:39 UTC (rev 171)
@@ -42,6 +42,7 @@
%>
<s:set var="searchLine" value="%{#request.searchLine}" />
<s:set var="fullTextLine" value="%{#request.fullTextLine}" />
+ <s:set var="wikittyId" value="%{#request.bookmark.getWikittyId()}" />
<div class="bookmark">
<div class="bookmarkhead">
@@ -50,13 +51,13 @@
</a>
<p class="date"> (<%=sdf.format(bookmark.getDate())%>)</p>
<s:url id="editBookmark" action="modifyBookmark" escapeAmp="false">
- <s:param name="bookmarkId"><s:property value="%{#request.bookmark.getWikittyId()}" /></s:param>
+ <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
<s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
<s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
</s:url>
- <s:a cssClass="edit" href="%{editBookmark}" onclick="return modify('%{#request.bookmark.getDescription()}', '%{#request.bookmark.getAlias()}', '%{#request.bookmark.getTags()}', '%{#request.bookmark.getLink()}', '%{editBookmark}', '%{#request.bookmark.getWikittyId()}');"></s:a>
+ <s:a cssClass="edit" href="%{editBookmark}" onclick="return modify('%{#request.bookmark.getDescription()}', '%{#request.bookmark.getAlias()}', '%{#request.bookmark.getTags()}', '%{#request.bookmark.getLink()}', '%{editBookmark}', '%{#wikittyId}');"></s:a>
<s:url id="removeBookmark" action="removeBookmark" escapeAmp="false">
- <s:param name="bookmarkId"><s:property value="%{#request.bookmark.getWikittyId()}" /></s:param>
+ <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
<s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
<s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
</s:url>
@@ -71,8 +72,7 @@
<s:url id="addClick" action="addClick">
<s:param name="bookmarkId"><%=bookmark.getWikittyId()%></s:param>
</s:url>
- <s:a title="" href="%{addClick}" onclick="window.open(this.href); return false;"><%=bookmark.getDescription()%></s:a>
- <!-- <%=bookmark.getLink()%>-->
+ <s:a title="%{#request.bookmark.getLink()}" href="%{addClick}" onclick="window.open(this.href); return false;"><%=bookmark.getDescription()%></s:a>
</p>
<p class="tags">
<strong>Tags :</strong>
@@ -82,8 +82,8 @@
if (tagList != null && !tagList.isEmpty()) {
for (String tag : tagList) {
%>
- <s:url id="deleteTag" action="deleteTag">
- <s:param name="bookmarkId"><s:property value="%{#request.bookmark.getWikittyId()}" /></s:param>
+ <s:url id="deleteTag" action="deleteTag" escapeAmp="false">
+ <s:param name="bookmarkId"><s:property value="%{#wikittyId}" /></s:param>
<s:param name="deleteTag"><%=tag%></s:param>
<s:param name="searchLine"><s:property value="%{#searchLine}" /></s:param>
<s:param name="fullTextLine"><s:property value="%{#fullTextLine}" /></s:param>
@@ -97,10 +97,9 @@
<%
} else {
%>
- <!-- <%=bookmark.getWikittyId()%> -->
- <s:a name="" cssStyle="display:none; text-decoration: none;" href="%{deleteTag}">
- <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" />
- </s:a>
+ <a name="<s:property value='%{#wikittyId}' />" style="display:none; text-decoration: none;" href="<s:property value='%{#deleteTag}' />">
+ <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" />
+ </a>
<% } %>
<s:url id="search" action="search">
<s:param name="searchLine"><%=tag%></s:param>
Modified: trunk/src/main/webapp/jsp/inc/tagsCloud.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/tagsCloud.jsp 2011-01-13 15:11:42 UTC (rev 170)
+++ trunk/src/main/webapp/jsp/inc/tagsCloud.jsp 2011-01-13 18:04:39 UTC (rev 171)
@@ -21,6 +21,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
#L%
-->
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@taglib prefix="s" uri="/struts-tags" %>
<%@page import="org.chorem.bow.BookmarkActions" %>
<%@page import="java.util.List" %>
<%@page import="org.nuiton.wikitty.FacetTopic" %>
@@ -40,7 +42,12 @@
String tagName = tag.getTopicName();
int font = bookmarkActions.getFont(value);
%>
- <a href="/bow/search.action&addTag=<%=tagName%><%=search%>" title="<%=value%> result<%=(value != 1 ? "s" : "")%>" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a>
+ <s:url id="search" action="search" escapeAmp="false">
+ <s:param name="addTag"><%=tagName%></s:param>
+ <s:param name="searchLine"><s:property value="%{#request.searchLine}" /></s:param>
+ </s:url>
+ <!-- title="??value?? result??(value != 1 ? \"s\" : \"\")??" style="font-size: ??font??px;"-->
+ <s:a href="%{#search}" class="tag"><%=tagName%></s:a>
<%
++count;
if (count >= nbTags) {
1
0
r170 - in trunk/src/main: java/org/chorem/bow java/org/chorem/bow/action resources/i18n webapp/jsp/inc
by vbriand@users.chorem.org 13 Jan '11
by vbriand@users.chorem.org 13 Jan '11
13 Jan '11
Author: vbriand
Date: 2011-01-13 16:11:42 +0100 (Thu, 13 Jan 2011)
New Revision: 170
Url: http://chorem.org/repositories/revision/bow/170
Log:
Fixed the links to add bookmarks. Added some translations. Fixed various bugs.
Modified:
trunk/src/main/java/org/chorem/bow/BowInit.java
trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java
trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java
trunk/src/main/resources/i18n/bow_en_GB.properties
trunk/src/main/resources/i18n/bow_fr_FR.properties
trunk/src/main/webapp/jsp/inc/bookmark.jsp
trunk/src/main/webapp/jsp/inc/rightMenu.jsp
Modified: trunk/src/main/java/org/chorem/bow/BowInit.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowInit.java 2011-01-13 10:58:47 UTC (rev 169)
+++ trunk/src/main/java/org/chorem/bow/BowInit.java 2011-01-13 15:11:42 UTC (rev 170)
@@ -51,8 +51,12 @@
static public void initSession(Map<String, Object> session, User user) throws NoSuchAlgorithmException {
WikittyProxy proxy = BowProxy.getInstance();
Preference preference = proxy.restore(Preference.class, user.getWikittyId());
+ BowConfig config = BowConfig.getInstance();
+
session.put("user", user);
session.put("preference", preference);
+ session.put("version", config.getVersion());
+ session.put("bowUrl", config.getBowUrl());
initializeToken(session, user);
checkAdmin(session, user.getEmail());
}
Modified: trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java 2011-01-13 10:58:47 UTC (rev 169)
+++ trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java 2011-01-13 15:11:42 UTC (rev 170)
@@ -12,7 +12,7 @@
private static final long serialVersionUID = 1L;
public static final String UNTRANSLATED_MARKER = "???";
private static final Log log = LogFactory.getLog(BowBaseAction.class);
-
+
@Override
public String getText(String aTextName) {
String value = super.getText(aTextName);
Modified: trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java 2011-01-13 10:58:47 UTC (rev 169)
+++ trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java 2011-01-13 15:11:42 UTC (rev 170)
@@ -152,51 +152,54 @@
User user = (User)session.get("user");
if (user != null) {
- try {
- List<?> lines;
+ if (upfile != null) {
+ try {
+ List<?> lines;
- lines = FileUtils.readLines(upfile);
- String content = "";
-
- for (Object line : lines) {
- content += (String)line;
- }
- WikittyProxy proxy = BowProxy.getInstance();
-
- try {
- Parser parser = new Parser(content);
- NodeList list = parser.parse(null);
- List<Bookmark> bookmarks = new ArrayList<Bookmark>();
- parseHtmlToBookmarks(list, user, bookmarks, new ArrayList<String>());
- bookmarks = proxy.store(bookmarks);
- createImportExtension(bookmarks);
- BowInit.initHomePage(request, user);
- return SUCCESS;
- } catch (ParserException e) {
- request.setAttribute("errorMsgUser", getText(n_("bow.bookmark.badFileFormat")));
- request.setAttribute("errorMsgTech", e.getMessage());
-
- if (request.getParameter("searchLine") == null) {
+ lines = FileUtils.readLines(upfile);
+ String content = "";
+
+ for (Object line : lines) {
+ content += (String)line;
+ }
+ WikittyProxy proxy = BowProxy.getInstance();
+
+ try {
+ Parser parser = new Parser(content);
+ NodeList list = parser.parse(null);
+ List<Bookmark> bookmarks = new ArrayList<Bookmark>();
+ parseHtmlToBookmarks(list, user, bookmarks, new ArrayList<String>());
+ bookmarks = proxy.store(bookmarks);
+ createImportExtension(bookmarks);
BowInit.initHomePage(request, user);
return SUCCESS;
- } else {
- try {
- BowSearch.search(request, user);
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- } catch (ServletException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return "search";
- }
+ } catch (ParserException e) {
+ request.setAttribute("errorMsgUser", getText(n_("bow.bookmark.badFileFormat")));
+ request.setAttribute("errorMsgTech", e.getMessage());
+
+ if (request.getParameter("searchLine") == null) {
+ BowInit.initHomePage(request, user);
+ return SUCCESS;
+ } else {
+ try {
+ BowSearch.search(request, user);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ServletException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return "search";
+ }
+ }
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
}
- } catch (IOException e2) {
- // TODO Auto-generated catch block
- e2.printStackTrace();
+ return ERROR;
}
- return ERROR;
+ return SUCCESS;
}
return LOGIN;
}
Modified: trunk/src/main/resources/i18n/bow_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-13 10:58:47 UTC (rev 169)
+++ trunk/src/main/resources/i18n/bow_en_GB.properties 2011-01-13 15:11:42 UTC (rev 170)
@@ -1,7 +1,7 @@
bow.action.locale.english=English
bow.action.locale.french=French
bow.bookmark.badFileFormat=
-bow.bookmarks.noBookmarks=
+bow.bookmarks.noBookmarks=No bookmarks
bow.config.alias.url.description=
bow.config.application.version.description=
bow.config.bow.addressFrom.description=
@@ -15,10 +15,9 @@
bow.forgotPassword.emailDoesntExist=
bow.forgotpwd.submit=Send
bow.forgotpwd.title=Forgot your password?
-bow.home.latestBookmarks=
-bow.home.mostUsedBookmarks=
-bow.home.noBookmarks=
-bow.home.title=
+bow.home.latestBookmarks=The latest added bookmarks
+bow.home.mostUsedBookmarks=The most used bookmarks
+bow.home.title=Home
bow.label.locale.english=
bow.label.locale.french=
bow.login.authenticationFailure=
@@ -52,7 +51,24 @@
bow.register.mailHi=
bow.register.mailPwd=
bow.register.mailSubject=
-bow.register.pwdDontMatch=Passwords don't match
+bow.register.pwdDontMatch=Passwords don''t match
bow.register.submit=Register
bow.register.title=Register
bow.requiredstring=${getText(fieldKey)} is required
+bow.rightMenu.bookmark.addModify=Add / Modify
+bow.rightMenu.bookmark.alias=ALIAS
+bow.rightMenu.bookmark.link=URL
+bow.rightMenu.bookmark.name=DESC
+bow.rightMenu.bookmark.permanentLink=Bookmark add link (permanent)
+bow.rightMenu.bookmark.tags=TAGS
+bow.rightMenu.bookmark.temporaryLink=Bookmark add link (session)
+bow.rightMenu.chromiumExtension=Chromium extension
+bow.rightMenu.exportBookmarks=Export bookmarks
+bow.rightMenu.extensions=Extensions
+bow.rightMenu.find.submit=Find
+bow.rightMenu.fullTextSearch=Full text search
+bow.rightMenu.import.submit=Import
+bow.rightMenu.importBookmarks=Import bookmarks
+bow.rightMenu.search=Search
+bow.rightMenu.token.permanent=Permanent token id
+bow.rightMenu.token.temporary=Session token id
Modified: trunk/src/main/resources/i18n/bow_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-13 10:58:47 UTC (rev 169)
+++ trunk/src/main/resources/i18n/bow_fr_FR.properties 2011-01-13 15:11:42 UTC (rev 170)
@@ -1,7 +1,7 @@
bow.action.locale.english=Anglais
bow.action.locale.french=Fran\u00E7ais
bow.bookmark.badFileFormat=
-bow.bookmarks.noBookmarks=
+bow.bookmarks.noBookmarks=Pas de marque-page
bow.config.alias.url.description=
bow.config.application.version.description=
bow.config.bow.addressFrom.description=
@@ -15,10 +15,9 @@
bow.forgotPassword.emailDoesntExist=
bow.forgotpwd.submit=Envoyer
bow.forgotpwd.title=Vous avez oubli\u00E9 votre mot de passe ?
-bow.home.latestBookmarks=
-bow.home.mostUsedBookmarks=
-bow.home.noBookmarks=
-bow.home.title=
+bow.home.latestBookmarks=Les derniers marque-pages ajout\u00E9s
+bow.home.mostUsedBookmarks=Les marque-pages les plus utilis\u00E9s
+bow.home.title=Accueil
bow.label.locale.english=
bow.label.locale.french=
bow.login.authenticationFailure=
@@ -56,3 +55,20 @@
bow.register.submit=S''enregistrer
bow.register.title=S''enregistrer
bow.requiredstring=${getText(fieldKey)} est obligatoire
+bow.rightMenu.bookmark.addModify=Ajouter / Modifier
+bow.rightMenu.bookmark.alias=ALIAS
+bow.rightMenu.bookmark.link=URL
+bow.rightMenu.bookmark.name=DESC
+bow.rightMenu.bookmark.permanentLink=Ajouter un bookmark (permanent)
+bow.rightMenu.bookmark.tags=TAGS
+bow.rightMenu.bookmark.temporaryLink=Ajouter un bookmark (session)
+bow.rightMenu.chromiumExtension=Extension pour chromium
+bow.rightMenu.exportBookmarks=Exporter les marque-pages
+bow.rightMenu.extensions=Extensions
+bow.rightMenu.find.submit=Rechercher
+bow.rightMenu.fullTextSearch=Recherche full text
+bow.rightMenu.import.submit=Importer
+bow.rightMenu.importBookmarks=Importer des marque-pages
+bow.rightMenu.search=Recherche
+bow.rightMenu.token.permanent=Token permanent
+bow.rightMenu.token.temporary=Token session
Modified: trunk/src/main/webapp/jsp/inc/bookmark.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/bookmark.jsp 2011-01-13 10:58:47 UTC (rev 169)
+++ trunk/src/main/webapp/jsp/inc/bookmark.jsp 2011-01-13 15:11:42 UTC (rev 170)
@@ -33,10 +33,9 @@
Bookmark bookmark = (Bookmark) request.getAttribute("bookmark");
BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
SimpleDateFormat sdf = (SimpleDateFormat) request.getAttribute("sdf");
-String url = (String) request.getAttribute("bowUrl");
String aliasUrl = BowConfig.getInstance().getServletAliasUrl();
-url = "toto"; //TODO: à changer
-if (url != null && bookmark != null && sdf != null && bookmarkActions != null) {
+
+if (bookmark != null && sdf != null && bookmarkActions != null) {
String formBookmarkId = (String) request.getAttribute("formBookmarkId");
String link = bookmark.getLink();
link = link.replace("'", "\\'");
Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-13 10:58:47 UTC (rev 169)
+++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2011-01-13 15:11:42 UTC (rev 170)
@@ -33,6 +33,7 @@
<%@page import="org.chorem.bow.TokenActions" %>
<%@page import="org.nuiton.wikitty.FacetTopic" %>
<%@page import="org.chorem.bow.Bookmark" %>
+<%@page import="org.chorem.bow.BowConfig" %>
<%@page import="org.chorem.bow.Preference" %>
<%
TokenActions tokenActions = (TokenActions)session.getAttribute("tokenActions");
@@ -44,7 +45,7 @@
String temporaryToken = tokenActions.getTemporaryToken();
String permanentToken = tokenActions.getPermanentToken();
-String url = (String) request.getAttribute("bowUrl");
+
int nbTags = 100;
Preference preference = (Preference)session.getAttribute("preference");
if (preference != null) {
@@ -94,15 +95,15 @@
<li><s:a action="admin"><s:text name="bow.rightMenu.admin" /></s:a></li>
<% } %>
<li><s:a action="preferences"><s:text name="bow.preferences.title" /></s:a></li>
- <li><s:a title="%{getText('bow.rightMenu.bookmark.temporaryLinkDescription')}" 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%>/addUrl.action&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);"><s:text name="bow.rightMenu.bookmark.temporaryLink" /></s:a></li>
- <li><s:a title="%{getText('bow.rightMenu.bookmark.permanentLinkDescription')}" 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%>/addUrl.action&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);"><s:text name="bow.rightMenu.bookmark.permanentLink" /></s:a></li>
+ <li><s:a title="%{getText('bow.rightMenu.bookmark.temporaryLinkDescription')}" 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='%{#session.bowUrl}addUrl.action?token=%{#session.tokenActions.getTemporaryToken()}&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:text name="bow.rightMenu.bookmark.temporaryLink" /></s:a></li>
+ <li><s:a title="%{getText('bow.rightMenu.bookmark.permanentLinkDescription')}" 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='%{#session.bowUrl}addUrl.action?token=%{#session.tokenActions.getPermanentToken()}&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:text name="bow.rightMenu.bookmark.permanentLink" /></s:a></li>
</ul>
<div id="extensions">
<h2><s:text name="bow.rightMenu.extensions" /></h2>
<ul class="droite">
- <li><a href="extensions/bow4chromium.crx"><img src="img/chromium.png" alt="Chromium" class="extensionIcon" />Extension pour Chromium</a></li>
- <li><strong><s:text name="bow.rightMenu.token.permanent" /></strong><%=permanentToken%></li>
- <li><strong><s:text name="bow.rightMenu.token.temporary" /></strong><%=temporaryToken%></li>
+ <li><a href="extensions/bow4chromium.crx"><img src="img/chromium.png" alt="Chromium" class="extensionIcon" /><s:text name="bow.rightMenu.chromiumExtension" /></a></li>
+ <li><strong><s:text name="bow.rightMenu.token.permanent" /> :</strong><br /><s:property value="%{#session.tokenActions.getPermanentToken()}" /></li>
+ <li><strong><s:text name="bow.rightMenu.token.temporary" /> :</strong><br /><s:property value="%{#session.tokenActions.getTemporaryToken()}" /></li>
</ul>
</div>
<div id="add" class="clearfix">
@@ -127,7 +128,7 @@
<div class="recherche">
<h2><s:text name="bow.rightMenu.search" /></h2>
<s:form action="search">
- <s:textfield key="bow.rightMenu.find.searchLine" name="searchLine" />
+ <s:textfield name="searchLine" />
<s:submit key="bow.rightMenu.find.submit" />
</s:form>
</div>
@@ -135,17 +136,17 @@
<h2><s:text name="bow.rightMenu.fullTextSearch" /></h2>
<s:form action="fullText">
<% if (fullText != null) { %>
- <s:textfield key="bow.rightMenu.search.fullTextLine" name="fullTextLine" value="" /> <!-- <%=fullText%> -->
+ <s:textfield name="fullTextLine" value="" /> <!-- <%=fullText%> -->
<% } else { %>
- <s:textfield key="bow.rightMenu.search.fullTextLine" name="fullTextLine" />
+ <s:textfield name="fullTextLine" />
<% } %>
- <s:submit key="bow.rightMenu.find" />
+ <s:submit key="bow.rightMenu.find.submit" />
</s:form>
</div>
<div id="import">
<h2><s:text name="bow.rightMenu.importBookmarks" /></h2>
<s:form action="importBookmarks" enctype="multipart/form-data">
- <s:file name="upfile" size="15%" key="bow.rightMenu.import.file" /><br />
+ <s:file name="upfile" size="15%" /><br />
<s:submit key="bow.rightMenu.import.submit" />
</s:form>
<s:a action="exportBookmarks"><s:text name="bow.rightMenu.exportBookmarks" /></s:a>
1
0