Author: vbriand Date: 2010-12-31 16:48:49 +0100 (Fri, 31 Dec 2010) New Revision: 155 Url: http://chorem.org/repositories/revision/bow/155 Log: Utilisation du plugin i18n mais tout n'est pas encore traduit et les cl?\195?\169s ne sont pas toutes dans un format valide. Added: trunk/src/main/i18n/ trunk/src/main/i18n/jsp.rules trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java trunk/src/main/resources/i18n/ trunk/src/main/resources/i18n/bow_en_GB.properties trunk/src/main/resources/i18n/bow_fr_FR.properties trunk/src/main/resources/org/chorem/bow/action/ForgotPasswordAction-validation.xml trunk/src/main/webapp/jsp/admin.jsp trunk/src/main/webapp/jsp/error.jsp trunk/src/main/webapp/jsp/inc/bookmarkTop.jsp trunk/src/main/webapp/jsp/permanentXml.jsp trunk/src/main/webapp/jsp/search.jsp trunk/src/main/webapp/jsp/suggestions.jsp trunk/src/main/webapp/jsp/temporaryXml.jsp Removed: trunk/src/main/resources/org/chorem/bow/action/HomeAction.properties trunk/src/main/resources/org/chorem/bow/action/HomeAction_fr.properties trunk/src/main/resources/org/chorem/bow/action/LoginAction.properties trunk/src/main/resources/org/chorem/bow/action/LoginAction_fr.properties trunk/src/main/resources/org/chorem/bow/action/RegisterAction.properties trunk/src/main/resources/org/chorem/bow/action/RegisterAction_fr.properties trunk/src/main/resources/org/chorem/bow/action/package.properties trunk/src/main/resources/org/chorem/bow/action/package_fr.properties trunk/src/main/webapp/admin.jsp trunk/src/main/webapp/bookmark.jsp trunk/src/main/webapp/bookmarkTop.jsp trunk/src/main/webapp/error.jsp trunk/src/main/webapp/errorFrame.jsp trunk/src/main/webapp/footer.jsp trunk/src/main/webapp/forgotPassword.jsp trunk/src/main/webapp/header.jsp trunk/src/main/webapp/home.jsp trunk/src/main/webapp/jsp/index.jsp trunk/src/main/webapp/login.jsp trunk/src/main/webapp/permanentXml.jsp trunk/src/main/webapp/preferences.jsp trunk/src/main/webapp/register.jsp trunk/src/main/webapp/search.jsp trunk/src/main/webapp/suggestions.jsp trunk/src/main/webapp/temporaryXml.jsp Modified: trunk/pom.xml trunk/src/main/java/org/chorem/bow/BowInit.java trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java trunk/src/main/java/org/chorem/bow/action/AddClickAction.java trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java trunk/src/main/java/org/chorem/bow/action/HomeAction.java trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java trunk/src/main/java/org/chorem/bow/action/LocaleAction.java trunk/src/main/java/org/chorem/bow/action/LoginAction.java trunk/src/main/java/org/chorem/bow/action/LogoutAction.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/OpenSearchSuggestionAction.java trunk/src/main/java/org/chorem/bow/action/OrderAction.java trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java trunk/src/main/java/org/chorem/bow/action/RegisterAction.java trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java trunk/src/main/java/org/chorem/bow/action/SearchAction.java trunk/src/main/resources/org/chorem/bow/action/LoginAction-validation.xml trunk/src/main/resources/org/chorem/bow/action/RegisterAction-validation.xml trunk/src/main/resources/struts.properties trunk/src/main/webapp/WEB-INF/decorators.xml trunk/src/main/webapp/jsp/forgotPassword.jsp trunk/src/main/webapp/jsp/home.jsp trunk/src/main/webapp/jsp/inc/bookmark.jsp trunk/src/main/webapp/jsp/inc/errorFrame.jsp trunk/src/main/webapp/jsp/inc/rightMenu.jsp trunk/src/main/webapp/jsp/inc/tagsCloud.jsp trunk/src/main/webapp/jsp/login.jsp trunk/src/main/webapp/jsp/preferences.jsp trunk/src/main/webapp/jsp/register.jsp Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/pom.xml 2010-12-31 15:48:49 UTC (rev 155) @@ -176,7 +176,11 @@ <slf4jVersion>1.6.1</slf4jVersion> <struts2.version>2.1.8.1</struts2.version> - <locales>en</locales> + <i18n.bundles>fr_FR,en_GB</i18n.bundles> + <i18n.silent>true</i18n.silent> + <i18n.bundleOutputName>bow-i18n</i18n.bundleOutputName> + <i18n.bundleOutputDir>${basedir}/target/generated-sources/resources</i18n.bundleOutputDir> + <i18n.addBundleOuputDirParent>false</i18n.addBundleOuputDirParent> <!-- license to use --> <license.licenseName>agpl_v3</license.licenseName> @@ -243,6 +247,42 @@ </dependency> </dependencies> </plugin> + + <plugin> + <groupId>org.nuiton.i18n</groupId> + <artifactId>maven-i18n-plugin</artifactId> + <executions> + <execution> + <id>scan-java-sources</id> + <goals> + <goal>parserJava</goal> + </goals> + </execution> + <execution> + <id>scan-jsp-sources</id> + <goals> + <goal>parserJsp</goal> + </goals> + <configuration> + <userRulesFiles> + <file>${basedir}/src/main/i18n/jsp.rules</file> + </userRulesFiles> + <namespaces> + <s>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd</s> + <sx>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd</sx> + <jsp>http://java.sun.com/JSP/Page</jsp> + </namespaces> + </configuration> + </execution> + <execution> + <id>gen-and-make-bundle</id> + <goals> + <goal>gen</goal> + <goal>bundle</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build> </project> Added: trunk/src/main/i18n/jsp.rules =================================================================== --- trunk/src/main/i18n/jsp.rules (rev 0) +++ trunk/src/main/i18n/jsp.rules 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,9 @@ +# Règles i18n pour les jsp + +//s:text/@name +//s:submit/@key +//s:textfield/@key +//s:password/@key +//s:file/@key + +//sx:datetimepicker/@key Modified: trunk/src/main/java/org/chorem/bow/BowInit.java =================================================================== --- trunk/src/main/java/org/chorem/bow/BowInit.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/BowInit.java 2010-12-31 15:48:49 UTC (rev 155) @@ -34,6 +34,7 @@ Criteria criteria = Search.query().eq(Token.FQ_FIELD_EMAIL, login.getEmail()).criteria(); Token token = proxy.findByCriteria(Token.class, criteria); TokenActions tokenActions = new TokenActions(); + if (token == null) { token = new TokenImpl(); String newToken = tokenActions.generateToken(); Modified: trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -8,9 +8,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class AddAliasAction extends ActionSupport { +public class AddAliasAction extends BowBaseAction { private static final long serialVersionUID = 2565840071468031758L; protected String alias; protected String bookmarkId; @@ -43,7 +41,6 @@ this.bookmarkId = bookmarkId; } - @Override public String execute() { if (alias != null && !alias.isEmpty()) { WikittyProxy proxy = BowProxy.getInstance(); Modified: trunk/src/main/java/org/chorem/bow/action/AddClickAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/AddClickAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/AddClickAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -4,9 +4,7 @@ import org.chorem.bow.BowProxy; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; - -public class AddClickAction extends ActionSupport { +public class AddClickAction extends BowBaseAction { private static final long serialVersionUID = 8579081104294143087L; protected String bookmarkId; @@ -23,7 +21,6 @@ this.bookmarkId = bookmarkId; } - @Override public String execute() { if (bookmarkId != null && !bookmarkId.isEmpty()) { WikittyProxy proxy = BowProxy.getInstance(); Modified: trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -11,9 +11,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class AddUrlAction extends ActionSupport implements SessionAware { +public class AddUrlAction extends BowBaseAction implements SessionAware { private static final long serialVersionUID = 3389170166034184139L; protected String link; protected String name; @@ -97,7 +95,6 @@ this.session = session; } - @Override public String execute() { WikittyProxy proxy = BowProxy.getInstance(); Bookmark bookmark = null; Added: trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java (rev 0) +++ trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,79 @@ +package org.chorem.bow.action; + +import com.opensymphony.xwork2.ActionSupport; +import com.opensymphony.xwork2.util.ValueStack; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +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); + + @Override + public String getText(String aTextName) { + String value = super.getText(aTextName); + return getSafeText(aTextName, value); + } + + @Override + public String getText(String aTextName, String defaultValue) { + String value = super.getText(aTextName, defaultValue); + return getSafeText(aTextName, value); + } + + @Override + public String getText(String aTextName, String defaultValue, String obj) { + String value = super.getText(aTextName, defaultValue, obj); + return getSafeText(aTextName, value); + } + + @Override + public String getText(String aTextName, List<Object> args) { + String value = super.getText(aTextName, args); + return getSafeText(aTextName, value); + } + + @Override + public String getText(String key, String[] args) { + String value = super.getText(key, args); + return getSafeText(key, value); + } + + @Override + public String getText(String aTextName, String defaultValue, List<Object> args) { + String value = super.getText(aTextName, defaultValue, args); + return getSafeText(aTextName, value); + } + + @Override + public String getText(String key, String defaultValue, String[] args) { + String value = super.getText(key, defaultValue, args); + return getSafeText(key, value); + } + + @Override + public String getText(String key, String defaultValue, List<Object> args, ValueStack stack) { + String value = super.getText(key, defaultValue, args, stack); + return getSafeText(key, value); + } + + @Override + public String getText(String key, String defaultValue, String[] args, ValueStack stack) { + String value = super.getText(key, defaultValue, args, stack); + return getSafeText(key, value); + } + + protected String getSafeText(String key, String value) { + if (StringUtils.isEmpty(value)) { + if (log.isWarnEnabled()) { + log.warn("Key [" + key + "] is not translated"); + } + return UNTRANSLATED_MARKER + key + UNTRANSLATED_MARKER; + } + return value; + } +} \ No newline at end of file Property changes on: trunk/src/main/java/org/chorem/bow/action/BowBaseAction.java ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -10,9 +10,7 @@ import org.nuiton.util.StringUtil; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; - -public class ChangePreferencesAction extends ActionSupport implements SessionAware { +public class ChangePreferencesAction extends BowBaseAction implements SessionAware { private static final long serialVersionUID = -1923646256914239581L; protected String colors; protected String tagsNb; @@ -187,7 +185,6 @@ return newUser; } - @Override public String execute() { WikittyProxy proxy = BowProxy.getInstance(); Preference preference = changePreference(); Modified: trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -14,9 +14,7 @@ import org.nuiton.wikitty.search.Element; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class DeleteImportAction extends ActionSupport implements SessionAware { +public class DeleteImportAction extends BowBaseAction implements SessionAware { private static final long serialVersionUID = 8714394293884265516L; protected String date; protected Map<String, Object> session; @@ -39,7 +37,6 @@ this.session = session; } - @Override public String execute() { if (date != null) { WikittyProxy proxy = BowProxy.getInstance(); Modified: trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -13,9 +13,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class DeleteSearchResultsAction extends ActionSupport implements SessionAware { +public class DeleteSearchResultsAction extends BowBaseAction implements SessionAware { private static final long serialVersionUID = -3903724044644625507L; protected String searchLine; protected String fullTextLine; @@ -54,7 +52,6 @@ this.session = session; } - @Override public String execute() { if (searchLine != null && fullTextLine != null) { WikittyProxy proxy = BowProxy.getInstance(); Modified: trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -4,9 +4,7 @@ import org.chorem.bow.BowProxy; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; - -public class DeleteTagAction extends ActionSupport { +public class DeleteTagAction extends BowBaseAction { private static final long serialVersionUID = -6174966873862161966L; protected String bookmarkId; protected String deleteTag; @@ -36,7 +34,6 @@ this.deleteTag = deleteTag; } - @Override public String execute() { if (deleteTag != null && bookmarkId != null) { if (!bookmarkId.isEmpty()) { Modified: trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -16,9 +16,7 @@ import org.chorem.bow.User; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; - -public class EditBookmarkAction extends ActionSupport implements SessionAware, ServletRequestAware { +public class EditBookmarkAction extends BowBaseAction implements SessionAware, ServletRequestAware { private static final long serialVersionUID = 2706590901233864637L; protected String bookmarkId; protected String searchLine; @@ -63,7 +61,6 @@ this.request = request; } - @Override public String execute() { if (bookmarkId != null && !bookmarkId.isEmpty()) { WikittyProxy proxy = BowProxy.getInstance(); @@ -74,7 +71,7 @@ request.setAttribute("name", bookmark.getDescription()); request.setAttribute("alias", bookmark.getAlias()); request.setAttribute("tags", BookmarkActions.getBookmarkTagsString(bookmark)); - request.setAttribute("action", "bow?action=modifyBookmark"); + request.setAttribute("action", "bow/modifyBookmark.action"); request.setAttribute("bookmarkId", bookmarkId); } } Modified: trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -17,9 +17,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class ExportBookmarksAction extends ActionSupport implements SessionAware, ServletResponseAware { +public class ExportBookmarksAction extends BowBaseAction implements SessionAware, ServletResponseAware { private static final long serialVersionUID = 45880214686011946L; protected Map<String, Object> session; protected HttpServletResponse response; @@ -34,7 +32,6 @@ this.response = response; } - @Override public String execute() { WikittyProxy proxy = BowProxy.getInstance(); Criteria criteria = Search.query().eq(Bookmark.FQ_FIELD_EMAIL, ((User)session.get("user")).getEmail()).criteria(); Modified: trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -14,9 +14,9 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; +import static org.nuiton.i18n.I18n.n_; -public class ForgotPasswordAction extends ActionSupport{ +public class ForgotPasswordAction extends BowBaseAction { private static final long serialVersionUID = -8207951465957204954L; protected String email; @@ -43,7 +43,7 @@ } return false; } - + public String execute() { if (email != null) { email = email.trim(); @@ -63,9 +63,9 @@ } String mailContent; - mailContent = getText("mailHi") + "\n\n" + getText("mailPwd") + password + "\n\n" + getText("mailEmail") + email + "\n\n"; + mailContent = getText(n_("bow.register.mailHi")) + "\n\n" + getText(n_("bow.register.mailPwd")) + password + "\n\n" + getText(n_("bow.register.mailEmail")) + email + "\n\n"; try { - BowMail.sendMail(email, getText("mailSubject"), mailContent); //TODO: modifier les noms et peut-être la manière de faire car c'est pas très beau + BowMail.sendMail(email, getText(n_("bow.register.mailSubject")), mailContent); //TODO: modifier les noms et peut-être la manière de faire car c'est pas très beau } catch (AddressException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -77,7 +77,7 @@ proxy.store(user); return SUCCESS; } else { - addFieldError("email", getText("emailDoesntExist")); + addFieldError("email", getText(n_("bow.forgotPassword.emailDoesntExist"))); } } } Modified: trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -13,9 +13,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class GenerateTokenAction extends ActionSupport implements SessionAware { +public class GenerateTokenAction extends BowBaseAction implements SessionAware { private static final long serialVersionUID = 1141019772989666309L; protected Map<String, Object> session; @@ -24,7 +22,6 @@ this.session = session; } - @Override public String execute() { WikittyProxy proxy = BowProxy.getInstance(); User user = (User)session.get("user"); Modified: trunk/src/main/java/org/chorem/bow/action/HomeAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/HomeAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/HomeAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -15,9 +15,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class HomeAction extends ActionSupport implements SessionAware, ServletRequestAware { +public class HomeAction extends BowBaseAction implements SessionAware, ServletRequestAware { private static final long serialVersionUID = -3735250067223062719L; protected String token; protected Map<String, Object> session; @@ -60,7 +58,6 @@ return null; } - @Override 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 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -29,9 +29,9 @@ import org.htmlparser.util.SimpleNodeIterator; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; +import static org.nuiton.i18n.I18n.n_; -public class ImportBookmarksAction extends ActionSupport implements SessionAware, ServletRequestAware { +public class ImportBookmarksAction extends BowBaseAction implements SessionAware, ServletRequestAware { private static final long serialVersionUID = -5962680416570797028L; protected Map<String, Object> session; protected HttpServletRequest request; @@ -105,7 +105,6 @@ } } - @Override public String execute() { // Check that we have a file upload request boolean isMultipart = ServletFileUpload.isMultipartContent(request); @@ -143,11 +142,10 @@ return SUCCESS; } catch (ParserException e) { - request.setAttribute("errorMsgUser", "Bad bookmarks file format, expected Netscape-like bookmarks file"); + request.setAttribute("errorMsgUser", getText(n_("bow.bookmark.badFileFormat"))); request.setAttribute("errorMsgTech", e.getMessage()); - String searchLine = request.getParameter("searchLine"); - if (searchLine == null) { + if (request.getParameter("searchLine") == null) { BowInit.initHomePage(request, user); return "home"; } else { Modified: trunk/src/main/java/org/chorem/bow/action/LocaleAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/LocaleAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/LocaleAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -1,8 +1,6 @@ package org.chorem.bow.action; -import com.opensymphony.xwork2.ActionSupport; - -public class LocaleAction extends ActionSupport { +public class LocaleAction extends BowBaseAction { private static final long serialVersionUID = 9124549040894568467L; public String execute() { Modified: trunk/src/main/java/org/chorem/bow/action/LoginAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/LoginAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/LoginAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -39,9 +39,9 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; +import static org.nuiton.i18n.I18n.n_; -public class LoginAction extends ActionSupport implements SessionAware, ServletRequestAware { +public class LoginAction extends BowBaseAction implements SessionAware, ServletRequestAware { private static final long serialVersionUID = 6891064800288772246L; protected String email; protected String password; @@ -91,7 +91,7 @@ User user = proxy.findByCriteria(User.class, criteria); if (user == null) { - addActionError(getText("authenticationFailure")); + addActionError(getText(n_("bow.login.authenticationFailure"))); } return user; } @@ -99,13 +99,14 @@ return null; } - @Override 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/java/org/chorem/bow/action/LogoutAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/LogoutAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/LogoutAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -5,9 +5,7 @@ import org.apache.struts2.dispatcher.SessionMap; import org.apache.struts2.interceptor.SessionAware; -import com.opensymphony.xwork2.ActionSupport; - -public class LogoutAction extends ActionSupport implements SessionAware { +public class LogoutAction extends BowBaseAction implements SessionAware { private static final long serialVersionUID = 4806944250461551896L; protected Map<String, Object> session; Modified: trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -7,9 +7,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class ModifyBookmarkAction extends ActionSupport { +public class ModifyBookmarkAction extends BowBaseAction { private static final long serialVersionUID = 8197008295267924063L; protected String url; protected String name; @@ -87,7 +85,6 @@ this.bookmarkId = bookmarkId; } - @Override public String execute() { WikittyProxy proxy = BowProxy.getInstance(); Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId); Modified: trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -22,9 +22,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class OpenSearchResultAction extends ActionSupport implements SessionAware, ServletRequestAware, ServletResponseAware { +public class OpenSearchResultAction extends BowBaseAction implements SessionAware, ServletRequestAware, ServletResponseAware { private static final long serialVersionUID = -1691325797986483856L; protected String searchLine; protected String token; @@ -76,7 +74,6 @@ } //TODO : gérer toutes les redirections comme il faut avec Struts2 - @Override public String execute() { User user = (User)session.get("user"); Modified: trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -19,9 +19,7 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; - -public class OpenSearchSuggestionAction extends ActionSupport implements SessionAware, ServletRequestAware { +public class OpenSearchSuggestionAction extends BowBaseAction implements SessionAware, ServletRequestAware { private static final long serialVersionUID = 3973618635494129146L; protected Map<String, Object> session; protected String searchLine; @@ -51,7 +49,6 @@ this.request = request; } - @Override public String execute() { User user = (User)session.get("user"); Modified: trunk/src/main/java/org/chorem/bow/action/OrderAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/OrderAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/OrderAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -15,9 +15,7 @@ import org.nuiton.wikitty.PagedResult; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; - -public class OrderAction extends ActionSupport implements SessionAware, ServletRequestAware { +public class OrderAction extends BowBaseAction implements SessionAware, ServletRequestAware { private static final long serialVersionUID = 203690999710176818L; protected Map<String, Object> session; protected String type; @@ -62,7 +60,6 @@ this.request = request; } - @Override public String execute() { Criteria baseCriteria = BowBookmark.getBookmarkListCriteriaByUser((User)session.get("user"), searchLine); Modified: trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -6,9 +6,7 @@ import org.chorem.bow.BowProxy; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; - -public class ReIndexationAction extends ActionSupport implements SessionAware { +public class ReIndexationAction extends BowBaseAction implements SessionAware { private static final long serialVersionUID = 6226574522402739559L; protected Map<String, Object> session; @@ -17,7 +15,6 @@ this.session = session; } - @Override public String execute() { if ((Boolean)session.get("admin")) { //If is admin WikittyProxy proxy = BowProxy.getInstance(); Modified: trunk/src/main/java/org/chorem/bow/action/RegisterAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/RegisterAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/RegisterAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -18,9 +18,9 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.search.Search; -import com.opensymphony.xwork2.ActionSupport; +import static org.nuiton.i18n.I18n.n_; -public class RegisterAction extends ActionSupport implements SessionAware, ServletRequestAware { +public class RegisterAction extends BowBaseAction implements SessionAware, ServletRequestAware { private static final long serialVersionUID = 2204772861770399542L; protected String email; protected String password; @@ -90,7 +90,7 @@ return false; } //FIXME : message d'erreur mais return true ??? - addFieldError("email", getText("emailAldyUsed")); + addFieldError("email", getText(n_("bow.register.emailAldyUsed"))); return true; } } @@ -98,13 +98,13 @@ //request.setAttribute("errorMsgUser", "Email and password must be correctly filled"); return true; } - + public String execute() { if (email != null) { email = email.trim(); if (password != null) { if (!password.equals(repeatPassword)) { - addActionError(getText("pwdDontMatch")); + addActionError(getText(n_("bow.register.pwdDontMatch"))); return INPUT; } String md5 = StringUtil.encodeMD5(password); @@ -126,8 +126,8 @@ try { String mailContent; - mailContent = getText("mailHi") + "\n\n" + getText("mailPwd") + password + "\n\n" + getText("mailEmail") + email + "\n\n"; - BowMail.sendMail(email, getText("mailSubject"), mailContent); //TODO: modifier les noms et peut-être la manière de faire car c'est pas très beau + mailContent = getText(n_("bow.register.mailHi")) + "\n\n" + getText(n_("bow.register.mailPwd")) + password + "\n\n" + getText(n_("bow.register.mailEmail")) + email + "\n\n"; + BowMail.sendMail(email, getText(n_("bow.register.mailSubject")), mailContent); //TODO: modifier les noms et peut-être la manière de faire car c'est pas très beau } catch (AddressException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -138,7 +138,7 @@ return SUCCESS; } else { - addFieldError("email", getText("invalidLogin")); + addFieldError("email", getText(n_("bow.register.invalidLogin"))); } } } Modified: trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -4,9 +4,7 @@ import org.chorem.bow.BowProxy; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; - -public class RemoveBookmarkAction extends ActionSupport { +public class RemoveBookmarkAction extends BowBaseAction { private static final long serialVersionUID = 820566716695285561L; protected String bookmarkId; @@ -24,7 +22,6 @@ this.bookmarkId = bookmarkId; } - @Override public String execute() { if (bookmarkId != null && !bookmarkId.isEmpty()) { try { Modified: trunk/src/main/java/org/chorem/bow/action/SearchAction.java =================================================================== --- trunk/src/main/java/org/chorem/bow/action/SearchAction.java 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/java/org/chorem/bow/action/SearchAction.java 2010-12-31 15:48:49 UTC (rev 155) @@ -18,9 +18,7 @@ import org.nuiton.wikitty.PagedResult; import org.nuiton.wikitty.WikittyProxy; -import com.opensymphony.xwork2.ActionSupport; - -public class SearchAction extends ActionSupport implements SessionAware, ServletRequestAware { +public class SearchAction extends BowBaseAction implements SessionAware, ServletRequestAware { private static final long serialVersionUID = -2161661766242362907L; protected Map<String, Object> session; protected String searchLine; @@ -80,7 +78,6 @@ this.request = request; } - @Override public String execute() { User user = (User)session.get("user"); @@ -107,10 +104,12 @@ } 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); //Selects all bookmarks by user - BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, searchLine); - request.setAttribute("bookmarkActions", bookmarkActions); + if (criteria != null) { + criteria = criteria.addSortDescending(Bookmark.FQ_FIELD_CLICK); + PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria); //Selects all bookmarks by user + BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, searchLine); + request.setAttribute("bookmarkActions", bookmarkActions); + } } return SUCCESS; } Added: trunk/src/main/resources/i18n/bow_en_GB.properties =================================================================== --- trunk/src/main/resources/i18n/bow_en_GB.properties (rev 0) +++ trunk/src/main/resources/i18n/bow_en_GB.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,48 @@ +bookmarksHomePage= +bow.action.locale.english=English +bow.action.locale.french=French +bow.bookmark.badFileFormat= +bow.config.alias.url.description= +bow.config.application.version.description= +bow.config.bow.addressFrom.description= +bow.config.bow.admins.description= +bow.config.bow.smtpServer.description= +bow.config.bow.url.description= +bow.config.configFileName.description= +bow.config.data.dir.description= +bow.config.search.engine.description= +bow.config.servlet.bow.description= +bow.forgotPassword.emailDoesntExist= +bow.forgotpwd.submit=Send +bow.forgotpwd.title=Forgot your password? +bow.home.title= +bow.label.locale.english= +bow.label.locale.french= +bow.login.authenticationFailure= +bow.login.email=Email +bow.login.email.required=Email is required +bow.login.email.wrongformat=Your email address isn''t valid +bow.login.password=Password +bow.login.password.required=Password is required +bow.login.repeatPassword=Repeat your password +bow.login.repeatPassword.required=Please repeat your password +bow.login.submit=Login +bow.login.title=Login +bow.register.emailAldyUsed=This email address is already used +bow.register.invalidLogin= +bow.register.mailEmail= +bow.register.mailHi= +bow.register.mailPwd= +bow.register.mailSubject= +bow.register.pwdDontMatch=Passwords don't match +bow.register.submit=Register +bow.register.title=Register +bow.requiredstring=${getText(fieldKey)} is required +colors= +confirmNewPassword= +currentPassword= +email= +newPassword= +searchEngineUrlResults= +searchEngineUrlSuggestions= +tagsNb= Property changes on: trunk/src/main/resources/i18n/bow_en_GB.properties ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/src/main/resources/i18n/bow_fr_FR.properties =================================================================== --- trunk/src/main/resources/i18n/bow_fr_FR.properties (rev 0) +++ trunk/src/main/resources/i18n/bow_fr_FR.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,48 @@ +bookmarksHomePage= +bow.action.locale.english=Anglais +bow.action.locale.french=Fran\u00E7ais +bow.bookmark.badFileFormat= +bow.config.alias.url.description= +bow.config.application.version.description= +bow.config.bow.addressFrom.description= +bow.config.bow.admins.description= +bow.config.bow.smtpServer.description= +bow.config.bow.url.description= +bow.config.configFileName.description= +bow.config.data.dir.description= +bow.config.search.engine.description= +bow.config.servlet.bow.description= +bow.forgotPassword.emailDoesntExist= +bow.forgotpwd.submit=Envoyer +bow.forgotpwd.title=Vous avez oubli\u00E9 votre mot de passe ? +bow.home.title= +bow.label.locale.english= +bow.label.locale.french= +bow.login.authenticationFailure= +bow.login.email=Email +bow.login.email.required=Veuillez entrer votre adresse email +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.required=Veuillez retaper votre mot de passe +bow.login.submit=Connexion +bow.login.title=Connexion +bow.register.emailAldyUsed=Cette adresse email est d\u00E9j\u00E0 utilis\u00E9e +bow.register.invalidLogin= +bow.register.mailEmail= +bow.register.mailHi= +bow.register.mailPwd= +bow.register.mailSubject= +bow.register.pwdDontMatch=Les mots de passe sont diff\u00E9erents +bow.register.submit=S''enregistrer +bow.register.title=S''enregistrer +bow.requiredstring=${getText(fieldKey)} est obligatoire +colors= +confirmNewPassword= +currentPassword= +email= +newPassword= +searchEngineUrlResults= +searchEngineUrlSuggestions= +tagsNb= Property changes on: trunk/src/main/resources/i18n/bow_fr_FR.properties ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/src/main/resources/org/chorem/bow/action/ForgotPasswordAction-validation.xml =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/ForgotPasswordAction-validation.xml (rev 0) +++ trunk/src/main/resources/org/chorem/bow/action/ForgotPasswordAction-validation.xml 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,14 @@ +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> + +<validators> + <field name="email"> + <field-validator type="requiredstring"> + <message key="bow.login.email.required" /> + </field-validator> + <field-validator type="email"> + <message key="bow.login.email.wrongformat" /> + </field-validator> + </field> +</validators> Property changes on: trunk/src/main/resources/org/chorem/bow/action/ForgotPasswordAction-validation.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: trunk/src/main/resources/org/chorem/bow/action/HomeAction.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/HomeAction.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/HomeAction.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +0,0 @@ -mostUsedBookmarks = The most used bookmarks -noBookmarks = No bookmarks -latestBookmarks = The latest added bookmarks \ No newline at end of file Deleted: trunk/src/main/resources/org/chorem/bow/action/HomeAction_fr.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/HomeAction_fr.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/HomeAction_fr.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +0,0 @@ -mostUsedBookmarks = Les marque-pages les plus utilisés -noBookmarks = Aucun marque-pages -latestBookmarks = Les derniers marque-pages ajoutés \ No newline at end of file Modified: trunk/src/main/resources/org/chorem/bow/action/LoginAction-validation.xml =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/LoginAction-validation.xml 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/LoginAction-validation.xml 2010-12-31 15:48:49 UTC (rev 155) @@ -5,15 +5,15 @@ <validators> <field name="email"> <field-validator type="requiredstring"> - <message key="requiredstring" /> + <message key="bow.login.email.required" /> </field-validator> <field-validator type="email"> - <message key="wrongformat" /> + <message key="bow.login.email.wrongformat" /> </field-validator> </field> <field name="password"> <field-validator type="requiredstring"> - <message key="requiredstring" /> + <message key="bow.login.password.required" /> </field-validator> </field> </validators> Deleted: trunk/src/main/resources/org/chorem/bow/action/LoginAction.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/LoginAction.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/LoginAction.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,4 +0,0 @@ -login = Login -register = Register -forgotpwd = Forgot your password ? -authenticationFailure = Unknown email or incorrect password Deleted: trunk/src/main/resources/org/chorem/bow/action/LoginAction_fr.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/LoginAction_fr.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/LoginAction_fr.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,4 +0,0 @@ -login = Connexion -register = S'enregistrer -forgotpwd = Vous avez oublie votre mot de passe ? -authenticationFailure = Email inconnu ou mot de passe incorrect Modified: trunk/src/main/resources/org/chorem/bow/action/RegisterAction-validation.xml =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/RegisterAction-validation.xml 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/RegisterAction-validation.xml 2010-12-31 15:48:49 UTC (rev 155) @@ -5,20 +5,25 @@ <validators> <field name="email"> <field-validator type="requiredstring"> - <message key="requiredstring" /> + <message key="bow.login.email.required" /> </field-validator> <field-validator type="email"> - <message key="wrongformat" /> + <message key="bow.login.email.wrongformat" /> </field-validator> </field> <field name="password"> <field-validator type="requiredstring"> - <message key="requiredstring" /> + <message key="bow.login.password.required" /> </field-validator> </field> <field name="repeatPassword"> <field-validator type="requiredstring"> - <message key="requiredstring" /> + <message key="bow.login.repeatPassword.required" /> </field-validator> </field> + + <validator type="expression"> + <param name="expression">password.equals(repeatPassword)</param> + <message key="bow.register.pwdDontMatch" /> + </validator> </validators> Deleted: trunk/src/main/resources/org/chorem/bow/action/RegisterAction.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/RegisterAction.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/RegisterAction.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,10 +0,0 @@ -repeatPassword = Retype your password -pwdDontMatch = Passwords don't match -emailAldyUsed = This email address is already used -invalidLogin = Invalid login, please choose another one -mailSubject = [Bow] New password -mailHi = Hi, -mailPwd = Your password : -mailEmail = Your email : -register = Register -loginPage = Login page \ No newline at end of file Deleted: trunk/src/main/resources/org/chorem/bow/action/RegisterAction_fr.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/RegisterAction_fr.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/RegisterAction_fr.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,10 +0,0 @@ -repeatPassword = Retapez votre mot de passe -pwdDontMatch = Les mot de passe ne sont pas identiques -emailAldyUsed = Cette adresse email est déjà utilisée -invalidLogin = Login incorrect, merci d'en choisir un nouveau -mailSubject = [Bow] Nouveau mot de passe -mailHi = Bonjour, -mailPwd = Votre mot de passe : -mailEmail = Votre email : -register = S'enregistrer -loginPage = Connexion Deleted: trunk/src/main/resources/org/chorem/bow/action/package.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/package.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/package.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,5 +0,0 @@ -requiredstring = ${getText(fieldName)} is required -wrongformat = ${getText(fieldName)} is not in correct format -password = Password -email = Email -logout = Logout \ No newline at end of file Deleted: trunk/src/main/resources/org/chorem/bow/action/package_fr.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/package_fr.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/org/chorem/bow/action/package_fr.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,5 +0,0 @@ -requiredstring = ${getText(fieldName)} doit etre renseigne -wrongformat = ${getText(fieldName)} a un format incorrect -password = Mot de passe -email = Email -logout = Deconnexion \ No newline at end of file Modified: trunk/src/main/resources/struts.properties =================================================================== --- trunk/src/main/resources/struts.properties 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/resources/struts.properties 2010-12-31 15:48:49 UTC (rev 155) @@ -1,8 +1,4 @@ - - -# struts.configuration=org.apache.struts2.config.DefaultConfiguration - -# struts.locale=en_US +struts.locale=fr_FR struts.i18n.encoding=UTF-8 struts.objectFactory = spring @@ -11,9 +7,6 @@ struts.objectFactory.spring.useClassCache = true -#struts.objectTypeDeterminer = tiger -#struts.objectTypeDeterminer = notiger - # struts.multipart.parser=cos # struts.multipart.parser=pell struts.multipart.parser=jakarta @@ -33,9 +26,9 @@ struts.tag.altSyntax=true -struts.devMode = false +struts.devMode=true -struts.i18n.reload=false +struts.i18n.reload=true struts.ui.theme=xhtml struts.ui.templateDir=template @@ -44,15 +37,10 @@ struts.configuration.xml.reload=false -# struts.velocity.configfile = velocity.properties - -# struts.velocity.contexts = - struts.url.http.port = 80 struts.url.https.port = 443 -# struts.custom.i18n.resources=testmessages,testmessages2 -struts.custom.i18n.resources=globalmessages +struts.custom.i18n.resources=bow-i18n struts.dispatcher.parametersWorkaround = false @@ -61,4 +49,3 @@ struts.freemarker.wrapper.altMap=true struts.xslt.nocache=false - Modified: trunk/src/main/webapp/WEB-INF/decorators.xml =================================================================== --- trunk/src/main/webapp/WEB-INF/decorators.xml 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/WEB-INF/decorators.xml 2010-12-31 15:48:49 UTC (rev 155) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <decorators defaultdir="/WEB-INF/decorators"> <!-- Any urls that are excluded will never be decorated by Sitemesh --> @@ -9,6 +9,7 @@ <pattern>/images/*</pattern> <pattern>/dojo/*</pattern> <pattern>/struts/*</pattern> + <pattern>/jsp/inc/*</pattern> <pattern>index.jsp</pattern> </excludes> Deleted: trunk/src/main/webapp/admin.jsp =================================================================== --- trunk/src/main/webapp/admin.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/admin.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,65 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@page import="org.chorem.bow.Preference" %> -<%@page import="org.chorem.bow.User" %> -<%@page import="org.chorem.bow.TokenActions" %> -<% -User user = (User) session.getAttribute("user"); -Preference preference = (Preference) session.getAttribute("preference"); -TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); -Boolean admin = (Boolean) session.getAttribute("admin"); -if (user != null && preference != null && tokenActions != null && admin) { -// String url = (String) request.getAttribute("bowUrl"); -// String version = (String) request.getAttribute("version"); -// String permanentToken = tokenActions.getPermanentToken(); - String check = preference.getColors(); - if (check == null) { - preference.setColors(""); - } - check = preference.getSearchEngineUrlResults(); - if (check == null) { - preference.setSearchEngineUrlResults(""); - } - check = preference.getSearchEngineUrlSuggestions(); - if (check == null) { - preference.setSearchEngineUrlSuggestions(""); - } - %> - <jsp:include page="header.jsp" flush="true"> - <jsp:param name="cssFile" value="connexion.css" /> - </jsp:include> - <div id="main"> - <jsp:include page="errorFrame.jsp" flush="true" /> - <div id="content"> - <div id="formFrame"> - <h1>Admin panel</h1> - <br /><br /> - <a href="bow?action=reIndexation">All data re-indexation</a> - <a href="bow?action=home" id="homePage">Return to the home page</a> - </div> - </div> - </div> - <jsp:include page="footer.jsp" flush="true" /> -<% } %> Deleted: trunk/src/main/webapp/bookmark.jsp =================================================================== --- trunk/src/main/webapp/bookmark.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/bookmark.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,94 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@page import="org.chorem.bow.BowConfig" %> -<%@page import="org.chorem.bow.Bookmark" %> -<%@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 url = (String) request.getAttribute("bowUrl"); -String aliasUrl = BowConfig.getInstance().getServletAliasUrl(); -String search = ""; -String searchLine = request.getParameter("searchLine"); -if (searchLine != null) { - search += "&searchLine=" + searchLine; -} -String fullTextLine = request.getParameter("fullTextLine"); -if (fullTextLine != null) { - search += "&fullTextLine=" + fullTextLine; -} -if (url != null && bookmark != null && sdf != null && bookmarkActions != null) { - String formBookmarkId = (String) request.getAttribute("formBookmarkId"); - String link = bookmark.getLink(); - link = link.replace("'", "\\'"); -%> -<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()%> - </a> - <p class="date"> (<%=sdf.format(bookmark.getDate())%>)</p> - <a class="edit" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>', '<%=bookmark.getWikittyId()%>');"></a> - <a class="supprim" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>"></a> - </div> - <div class="bookmarkcontenu"> - <div class="screenshot"></div> - <div class="click"><%=bookmark.getClick()%></div> - <div class="description"> - <h3>Description :</h3> - <p> - <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" onclick="window.open(this.href); return false;"><%=bookmark.getDescription()%></a> - </p> - <p class="tags"> - <strong>Tags :</strong> - <% - Set<String> tagList = bookmark.getTags(); - if (tagList != null && !tagList.isEmpty()) { - for (String tag : tagList) { - if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) { - %> - <a style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%><%=search%>"> - <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" /> - </a> - <% - } else { - %> - <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%><%=search%>"> - <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" /> - </a> - <% } %> - <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a> - <% - } - } - %> - </p> - </div> - </div> -</div> -<% } %> Deleted: trunk/src/main/webapp/bookmarkTop.jsp =================================================================== --- trunk/src/main/webapp/bookmarkTop.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/bookmarkTop.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,105 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@page import="org.chorem.bow.BookmarkActions" %> -<%@page import="java.text.SimpleDateFormat" %> -<%@page import="java.util.Iterator" %> -<%@page import="java.util.Set" %> -<%@page import="java.util.ArrayList" %> -<%@page import="java.util.List" %> -<%@page import="org.chorem.bow.TokenActions" %> -<%@page import="org.nuiton.wikitty.FacetTopic" %> -<%@page import="org.chorem.bow.Bookmark" %> -<%@page import="org.chorem.bow.Preference" %> -<% -TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); -BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); -Boolean admin = (Boolean) session.getAttribute("admin"); -if (admin == null) -{ - admin = false; -} - -if (tokenActions != null && bookmarkActions != null) -{ - String temporaryToken = tokenActions.getTemporaryToken(); - String permanentToken = tokenActions.getPermanentToken(); - String url = (String) request.getAttribute("bowUrl"); - int nbTags = 100; - Preference preference = (Preference) session.getAttribute("preference"); -} - -int tags = preference.getTags(); -if (preference != null && tags > 0) -{ - nbTags = tags; -} - -request.setAttribute("nbTags", nbTags); -String formLink = (String) request.getAttribute("link"); -String formName = (String) request.getAttribute("name"); -String formTags = (String) request.getAttribute("tagsNb"); -String formAlias = (String) request.getAttribute("alias"); -String formAction = (String) request.getAttribute("action"); - -if (formLink == null) -{ - formLink = "URL"; -} - -if (formName == null) -{ - formName = "name"; -} - -if (formTags == null) -{ - formTags = "tag1 tag2..."; -} - -if (formAlias == null) -{ - formAlias = "alias"; -} - -if (formAction == null) -{ - formAction = "bow?action=addUrl"; -} - -if (tokenActions != null && bookmarkActions != null) -{ - if (searchLine != null) - { - String searchLine = bookmarkActions.getSearchLine(); - String fullText = bookmarkActions.getFullTextLine(); - } - else - { - if (preference != null && preference.getBookmarks() > 0) - { - nbBookmarks = preference.getBookmarks(); - } - } -%> Deleted: trunk/src/main/webapp/error.jsp =================================================================== --- trunk/src/main/webapp/error.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/error.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,35 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page import="org.chorem.bow.TokenActions" %> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%-- - String techError = (String) request.getAttribute("errorMsgTech"); ---%> -<jsp:include page="header.jsp" flush="true"> - <jsp:param name="cssFile" value="connexion.css" /> -</jsp:include> -<div id="main"> - <jsp:include page="errorFrame.jsp" flush="true" /> -</div> -<jsp:include page="footer.jsp" flush="true" /> Deleted: trunk/src/main/webapp/errorFrame.jsp =================================================================== --- trunk/src/main/webapp/errorFrame.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/errorFrame.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,35 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<% -String userError = (String) request.getAttribute("errorMsgUser"); -String techError = (String) request.getAttribute("errorMsgTech"); - -if (userError != null) { -%> - <div class="menu clearfix"> - <h2>Error</h2> - </div> - <pre class="error"><%=userError%><% if (techError != null) { %><br /><br />Detailed error :<br /><%=techError%><% } %></pre> -<% } %> Deleted: trunk/src/main/webapp/footer.jsp =================================================================== --- trunk/src/main/webapp/footer.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/footer.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,43 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> - <%@page contentType="text/html" pageEncoding="UTF-8"%> - <% - String url = (String) request.getAttribute("bowUrl"); - String version = (String) request.getAttribute("version"); - %> - </div> - </div> - <div id="footer"> - <p> - <a shape="rect" href="<%=url%>">bow</a> - <a shape="rect" href="http://www.chorem.org/projects/list_files/bow"><%=version%></a> - - <a shape="rect" href="http://www.gnu.org/licenses/agpl.html">Licence AGPL</a> - - <span title="Copyright">©2010</span> - <a shape="rect" href="http://www.codelutin.com">Code Lutin</a> - - <a shape="rect" href="http://www.chorem.org/projects/bow/issues">Rapport de bug</a> - - <a shape="rect" href="http://list.chorem.org/cgi-bin/mailman/listinfo/bow-users">Support utilisateur</a> - </p> - </div> - </body> -</html> Deleted: trunk/src/main/webapp/forgotPassword.jsp =================================================================== --- trunk/src/main/webapp/forgotPassword.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/forgotPassword.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,46 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<jsp:include page="header.jsp" flush="true"> - <jsp:param name="cssFile" value="connexion.css" /> -</jsp:include> -<div id="main"> - <jsp:include page="errorFrame.jsp" flush="true" /> - <div id="content"> - <div id="formFrame"> - <h1>Forgot Your Password?</h1> - <form method="post" action="bow?action=sendPassword"> - <p> - <label for="email">Email :</label> - <br /> - <br /> - <input type="text" name="email" id="email" /> - <input type="submit" value="Submit" /> - </p> - </form> - <a href="bow" class="register">Login page</a> - </div> - </div> -</div> -<jsp:include page="footer.jsp" flush="true" /> Deleted: trunk/src/main/webapp/header.jsp =================================================================== --- trunk/src/main/webapp/header.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/header.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,87 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page import="org.chorem.bow.TokenActions" %> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<% - String url = (String) request.getAttribute("bowUrl"); - TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); - String css = (String) request.getParameter("cssFile"); -%> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> - <meta name="description" content="Bookmarks On the Web" /> - <title>Bow</title> - <link rel="icon" type="image/png" href="img/favicon.png" /> - <link rel="search" type="application/opensearchdescription+xml" title="bowTemporarySearchEngine" href="<%=url%>?action=temporaryXml" /> - <link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="<%=url%>?action=permanentXml" /> - <link rel="stylesheet" type="text/css" href="./css/global.css" /> - <% - if (css != null) { - %> - <link rel="stylesheet" type="text/css" href="./css/<%=css%>" /> - <% } %> - <script type="text/javascript"> - <!-- - function modify(name, alias, tags, link, action, id) { - var form = document.getElementById("bookmarkForm"); - form.elements["url"].value = link; - form.elements["name"].value = name; - form.elements["tags"].value = tags; - form.elements["alias"].value = alias; - form.action = action; - var tab = document.getElementsByName(id); - for (var count = 0; count < tab.length; ++count) { - tab[count].style.display = 'inline'; - } - return false; - } - - function deleteConfirmation(goTo, bookmarksNb, importDate) { - var confMsg = "Do you really want to delete "; - - if (bookmarksNb > 1) { - confMsg += "these " + bookmarksNb + " bookmarks"; - } else { - confMsg += "this bookmark"; - } - - if (importDate !== undefined) - confMsg += " imported the " + importDate + "?"; - else - confMsg += "?"; - if (confirm(confMsg)) { - window.location = goTo; - } - } - //--> - </script> -</head> -<body> -<div id="wrap"> - <div id="page"> - <div id="header"> - <a class="logo" href="<%=url%><% if (tokenActions != null) { %>?action=home&token=<%=tokenActions.getPermanentToken()%><% } %>">bow</a> - </div> Deleted: trunk/src/main/webapp/home.jsp =================================================================== --- trunk/src/main/webapp/home.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/home.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,101 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@page import="org.chorem.bow.BookmarkActions" %> -<%@page import="org.chorem.bow.TokenActions" %> -<%@page import="org.chorem.bow.Bookmark" %> -<%@page import="org.chorem.bow.Preference" %> -<%@page import="java.util.List" %> -<%@page import="java.text.SimpleDateFormat" %> -<% -TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); -BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); -Preference preference = (Preference) session.getAttribute("preference"); - -if (tokenActions != null && bookmarkActions != null) { - %> - <jsp:include page="header.jsp" flush="true"> - <jsp:param name="cssFile" value="bookmark.css" /> - </jsp:include> - <div id="main"> - <jsp:include page="errorFrame.jsp" flush="true" /> - <div class="menu clearfix"> - <h2>The most used bookmarks</h2> - </div> - <div class="content"> - <% - int nbBookmarks = 10; - if (preference != null) { - if (preference.getBookmarks() > 0) - nbBookmarks = preference.getBookmarks(); - } - SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - List<Bookmark> bookmarkList = bookmarkActions.getBookmarks(); - if (!bookmarkList.isEmpty()) { - int count = 0; - for (Bookmark bookmark : bookmarkList) { - request.setAttribute("bookmark", bookmark); - request.setAttribute("sdf", sdf); - %> - <jsp:include page="bookmark.jsp" flush="true" /> - <% - ++count; - if (count >= nbBookmarks) { - break; - } - } - } - else { %> - <p class="nobookmarks">No Bookmarks</p> - <% } %> - </div> - - <div class="menu clearfix"> - <h2>The latest added bookmarks</h2> - </div> - <div class="content"> - <% - List<Bookmark> lastBookmarks = bookmarkActions.getLastBookmarks(); - if (!lastBookmarks.isEmpty()) { - int count = 0; - for (Bookmark bookmark : lastBookmarks) { - request.setAttribute("bookmark", bookmark); - request.setAttribute("sdf", sdf); - %> - <jsp:include page="bookmark.jsp" flush="true" /> - <% - ++count; - if (count >= nbBookmarks) { - break; - } - } - } - else { %> - <p class="nobookmarks">No Bookmarks</p> - <% } %> - </div> - </div> - <jsp:include page="rightMenu.jsp" flush="true" /> - <jsp:include page="footer.jsp" flush="true" /> -<% } %> Added: trunk/src/main/webapp/jsp/admin.jsp =================================================================== --- trunk/src/main/webapp/jsp/admin.jsp (rev 0) +++ trunk/src/main/webapp/jsp/admin.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + bow + + $Id: admin.jsp 144 2010-12-23 10:24:48Z bpoussin $ + $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/admin.jsp $ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + 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.Preference" %> +<%@page import="org.chorem.bow.User" %> +<%@page import="org.chorem.bow.TokenActions" %> +<% +User user = (User) session.getAttribute("user"); +Preference preference = (Preference) session.getAttribute("preference"); +TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); +Boolean admin = (Boolean) session.getAttribute("admin"); +if (user != null && preference != null && tokenActions != null && admin) { +// String url = (String) request.getAttribute("bowUrl"); +// String version = (String) request.getAttribute("version"); +// String permanentToken = tokenActions.getPermanentToken(); + String check = preference.getColors(); + if (check == null) { + preference.setColors(""); + } + check = preference.getSearchEngineUrlResults(); + if (check == null) { + preference.setSearchEngineUrlResults(""); + } + check = preference.getSearchEngineUrlSuggestions(); + if (check == null) { + preference.setSearchEngineUrlSuggestions(""); + } + %> + <html 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"> + <head> + <s:url id="css" value="/css/bookmark.css" /> + <link href="${css}" rel="stylesheet" type="text/css" /> + <s:head /> + </head> + <body> + <div id="content"> + <div id="formFrame"> + <h1>Admin panel</h1> + <br /><br /> + <a href="/bow/reIndexation.action">All data re-indexation</a> + <a href="/bow/home.action" id="homePage">Return to the home page</a> + </div> + </div> + </body> + </html> +<% } %> Property changes on: trunk/src/main/webapp/jsp/admin.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain Copied: trunk/src/main/webapp/jsp/error.jsp (from rev 154, trunk/src/main/webapp/error.jsp) =================================================================== --- trunk/src/main/webapp/jsp/error.jsp (rev 0) +++ trunk/src/main/webapp/jsp/error.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + bow + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + 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.TokenActions" %> +<%-- + String techError = (String) request.getAttribute("errorMsgTech"); +--%> +<html 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"> + <head> + <s:url id="css" value="/css/connexion.css" /> + <link href="${css}" rel="stylesheet" type="text/css" /> + <s:head /> + </head> + <body> + <div id="main"> + <jsp:include page="errorFrame.jsp" flush="true" /> + </div> + </body> +</html> + Property changes on: trunk/src/main/webapp/jsp/error.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/src/main/webapp/jsp/forgotPassword.jsp =================================================================== --- trunk/src/main/webapp/jsp/forgotPassword.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/forgotPassword.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L bow @@ -23,22 +24,27 @@ --> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags" %> -<html> +<html 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"> <head> - <link href="<s:url value='/css/connexion.css'/>" rel="stylesheet" type="text/css" /> + <title><s:text name="bow.forgotpwd.title" /></title> + <s:url id="css" value="/css/connexion.css" /> + <link href="${css}" rel="stylesheet" type="text/css" /> <s:head /> </head> <body> <div id="content"> <div id="formFrame"> - <h1><s:property value="%{getText('forgotPwd')}" /></h1> - <s:form action="/bow/forgotPassword.action"> + <h1><s:text name="bow.forgotpwd.title" /></h1> + <s:form action="forgotPassword"> <p> - <s:textfield key="email" name="email" label="%{getText('email')}" /> - <s:submit value="%{getText('submit')}" /> + <s:textfield key="bow.login.email" name="email" /> + <s:submit key="bow.forgotpwd.submit" /> </p> </s:form> - <a href="<%= request.getContextPath() %>" class="register"><s:property value="%{getText('loginPage')}" /></a> + <s:a action="login_input"><s:text name="bow.login.title" /></s:a> </div> </div> </body> Modified: trunk/src/main/webapp/jsp/home.jsp =================================================================== --- trunk/src/main/webapp/jsp/home.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/home.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L bow @@ -36,9 +37,14 @@ if (tokenActions != null && bookmarkActions != null) { %> - <html> + <html 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"> <head> - <link href="<s:url value='/css/bookmark.css'/>" rel="stylesheet" type="text/css" /> + <title><s:text name="bow.home.title" /></title> + <s:url id="css" value="/css/bookmark.css" /> + <link href="${css}" rel="stylesheet" type="text/css" /> <s:head /> </head> <body> Modified: trunk/src/main/webapp/jsp/inc/bookmark.jsp =================================================================== --- trunk/src/main/webapp/jsp/inc/bookmark.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/inc/bookmark.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L bow Copied: trunk/src/main/webapp/jsp/inc/bookmarkTop.jsp (from rev 154, trunk/src/main/webapp/bookmarkTop.jsp) =================================================================== --- trunk/src/main/webapp/jsp/inc/bookmarkTop.jsp (rev 0) +++ trunk/src/main/webapp/jsp/inc/bookmarkTop.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + #%L + bow + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="org.chorem.bow.BookmarkActions" %> +<%@page import="java.text.SimpleDateFormat" %> +<%@page import="java.util.Iterator" %> +<%@page import="java.util.Set" %> +<%@page import="java.util.ArrayList" %> +<%@page import="java.util.List" %> +<%@page import="org.chorem.bow.TokenActions" %> +<%@page import="org.nuiton.wikitty.FacetTopic" %> +<%@page import="org.chorem.bow.Bookmark" %> +<%@page import="org.chorem.bow.Preference" %> +<% +TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); +BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); +Boolean admin = (Boolean) session.getAttribute("admin"); +if (admin == null) +{ + admin = false; +} + +if (tokenActions != null && bookmarkActions != null) +{ + String temporaryToken = tokenActions.getTemporaryToken(); + String permanentToken = tokenActions.getPermanentToken(); + String url = (String) request.getAttribute("bowUrl"); + int nbTags = 100; + Preference preference = (Preference) session.getAttribute("preference"); +} + +int tags = preference.getTags(); +if (preference != null && tags > 0) +{ + nbTags = tags; +} + +request.setAttribute("nbTags", nbTags); +String formLink = (String) request.getAttribute("link"); +String formName = (String) request.getAttribute("name"); +String formTags = (String) request.getAttribute("tagsNb"); +String formAlias = (String) request.getAttribute("alias"); +String formAction = (String) request.getAttribute("action"); + +if (formLink == null) +{ + formLink = "URL"; +} + +if (formName == null) +{ + formName = "name"; +} + +if (formTags == null) +{ + formTags = "tag1 tag2..."; +} + +if (formAlias == null) +{ + formAlias = "alias"; +} + +if (formAction == null) +{ + formAction = "bow?action=addUrl"; +} + +if (tokenActions != null && bookmarkActions != null) +{ + if (searchLine != null) + { + String searchLine = bookmarkActions.getSearchLine(); + String fullText = bookmarkActions.getFullTextLine(); + } + else + { + if (preference != null && preference.getBookmarks() > 0) + { + nbBookmarks = preference.getBookmarks(); + } + } +%> Property changes on: trunk/src/main/webapp/jsp/inc/bookmarkTop.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/src/main/webapp/jsp/inc/errorFrame.jsp =================================================================== --- trunk/src/main/webapp/jsp/inc/errorFrame.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/inc/errorFrame.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <% String userError = (String) request.getAttribute("errorMsgUser"); String techError = (String) request.getAttribute("errorMsgTech"); Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp =================================================================== --- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" ?> <!-- #%L bow @@ -76,7 +77,10 @@ if (formAction == null) formAction = "/bow/addUrl.action"; %> -<div id="logout"> +<div id="logout" 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="/bow/logout.action"> <div class="input"> <s:submit value="%{getText('logout')}" /> Modified: trunk/src/main/webapp/jsp/inc/tagsCloud.jsp =================================================================== --- trunk/src/main/webapp/jsp/inc/tagsCloud.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/inc/tagsCloud.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -25,8 +25,8 @@ <%@page import="java.util.List" %> <%@page import="org.nuiton.wikitty.FacetTopic" %> <% -BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); -int nbTags = (Integer) request.getAttribute("nbTags"); +BookmarkActions bookmarkActions = (BookmarkActions)request.getAttribute("bookmarkActions"); +int nbTags = (Integer)request.getAttribute("nbTags"); String search = ""; String searchLine = request.getParameter("searchLine"); if (searchLine != null) { @@ -40,7 +40,7 @@ String tagName = tag.getTopicName(); int font = bookmarkActions.getFont(value); %> - <a href="bow?action=search&addTag=<%=tagName%><%=search%>" title="<%=value%> result<%=(value != 1 ? "s" : "")%>" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a> + <a href="/bow/search.action&addTag=<%=tagName%><%=search%>" title="<%=value%> result<%=(value != 1 ? "s" : "")%>" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a> <% ++count; if (count >= nbTags) { Deleted: trunk/src/main/webapp/jsp/index.jsp =================================================================== --- trunk/src/main/webapp/jsp/index.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/index.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,20 +0,0 @@ -<!DOCTYPE html PUBLIC - "-//W3C//DTD XHTML 1.1 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<%@taglib prefix="s" uri="/struts-tags" %> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> - <head> - <title>Index</title> - <s:head /> - </head> - <body> - <s:form action="helloWorld"> - <s:textfield label="What is your name?" name="name" /> - <s:textfield label="What is the date?" name="dateNow" /> - <s:submit /> - </s:form> - </body> -</html> - Modified: trunk/src/main/webapp/jsp/login.jsp =================================================================== --- trunk/src/main/webapp/jsp/login.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/login.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,35 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags"%> -<html> +<html 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"> <head> - <link href="<s:url value='/css/connexion.css'/>" rel="stylesheet" type="text/css" /> + <title><s:text name="bow.login.title" /></title> + <s:url id="css" value="/css/connexion.css" /> + <link href="${css}" rel="stylesheet" type="text/css" /> <s:head /> </head> <body> <div id="content"> <div id="formFrame"> - <h1><s:property value="%{getText('login')}" /></h1> - <s:form action="/bow/login.action"> + <h1><s:text name="bow.login.title" /></h1> + <s:form action="login"> <p> - <s:textfield key="email" name="email" label="%{getText('email')}" /> - <br /><br /> - <s:password key="password" name="password" label="%{getText('password')}" /> - <br /><br /> - <s:submit value="%{getText('login')}" /> + <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</s:param> + <s:param name="request_locale" >en_GB</s:param> </s:url> <s:url id="localeFR" action="login_input"> - <s:param name="request_locale" >fr</s:param> + <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 /> - <a href="<%= request.getContextPath() %>/register_input.action" id="register"><s:property value="%{getText('register')}" /></a> - <a href="<%= request.getContextPath() %>/forgotPassword.action" id="forgotPwd"><s:property value="%{getText('forgotpwd')}" /></a> + + <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> </body> Copied: trunk/src/main/webapp/jsp/permanentXml.jsp (from rev 154, trunk/src/main/webapp/permanentXml.jsp) =================================================================== --- trunk/src/main/webapp/jsp/permanentXml.jsp (rev 0) +++ trunk/src/main/webapp/jsp/permanentXml.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,47 @@ +<!-- + #%L + bow + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page contentType="text/xml" pageEncoding="UTF-8"%> +<%@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); +%> + +<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" + xmlns:moz="http://www.mozilla.org/2006/browser/search/"> + <ShortName>bowPermanentSearchEngine</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> +</OpenSearchDescription> Property changes on: trunk/src/main/webapp/jsp/permanentXml.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/src/main/webapp/jsp/preferences.jsp =================================================================== --- trunk/src/main/webapp/jsp/preferences.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/preferences.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L bow @@ -65,9 +66,13 @@ preference.setSearchEngineUrlSuggestions(""); } %> - <html> + <html 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"> <head> - <link href="<s:url value='/css/bookmark.css'/>" rel="stylesheet" type="text/css" /> + <s:url value="/css/bookmark.css" /> + <link href="${css}" rel="stylesheet" type="text/css" /> <s:head /> </head> <body> Modified: trunk/src/main/webapp/jsp/register.jsp =================================================================== --- trunk/src/main/webapp/jsp/register.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/jsp/register.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L bow @@ -23,24 +24,29 @@ --> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags" %> -<html> +<html 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"> <head> - <link href="<s:url value='/css/connexion.css'/>" rel="stylesheet" type="text/css" /> + <title><s:text name="bow.register.title" /></title> + <s:url id="css" value="/css/connexion.css" /> + <link href="${css}" rel="stylesheet" type="text/css" /> <s:head /> </head> <body> <div id="content"> <div id="formFrame"> - <h1><s:property value="%{getText('register')}" /></h1> - <s:form action="/bow/register.action"> + <h1><s:text name="bow.register.title" /></h1> + <s:form action="register"> <p> - <s:textfield key="email" name="email" label="%{getText('email')}" /> - <s:password key="password" name="password" label="%{getText('password')}" /> - <s:password key="repeatPassword" name="repeatPassword" label="%{getText('repeatPassword')}" /> - <s:submit value="%{getText('register')}" /> + <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:submit key="bow.register.submit" /> </p> </s:form> - <a href="<%= request.getContextPath() %>" id="register"><s:property value="%{getText('loginPage')}" /></a> + <s:a action="login_input"><s:text name="bow.login.title" /></s:a> </div> </div> </body> Added: trunk/src/main/webapp/jsp/search.jsp =================================================================== --- trunk/src/main/webapp/jsp/search.jsp (rev 0) +++ trunk/src/main/webapp/jsp/search.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,92 @@ +<!-- + #%L + bow + + $Id: search.jsp 144 2010-12-23 10:24:48Z bpoussin $ + $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/search.jsp $ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="org.chorem.bow.BookmarkActions" %> +<%@page import="org.chorem.bow.TokenActions" %> +<%@page import="org.chorem.bow.Bookmark" %> +<%@page import="org.chorem.bow.Preference" %> +<%@page import="java.text.SimpleDateFormat" %> +<%@page import="java.util.List" %> +<% +TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); +BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); +//Preference preference = (Preference) session.getAttribute("preference"); +String searchLine = bookmarkActions.getSearchLine(); +String fullText = bookmarkActions.getFullTextLine(); + +if (tokenActions != null && bookmarkActions != null) { + %> + <jsp:include page="header.jsp" flush="true"> + <jsp:param name="cssFile" value="bookmark.css" /> + </jsp:include> + <div id="main"> + <jsp:include page="errorFrame.jsp" flush="true" /> + <div class="menu clearfix"> + <h2>Search</h2> + <form method="post" action="bow?action=order&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>"> + <p> + <label for="type">Order By :</label> + <select id="type" name="type"> + <option value="ascName">Asc Name</option> + <option value="descName">Desc Name</option> + <option value="ascClick">Asc Click</option> + <option value="descClick">Desc Click</option> + <option value="ascDate">Asc Date</option> + <option value="descDate">Desc Date</option> + </select> + <input type="submit" value="OK" /> + <% + List<Bookmark> bookmarkList = bookmarkActions.getBookmarks(); + int bookmarksNb = bookmarkList.size(); + + if (bookmarksNb > 0) { + %> + <a id="deleteSearchResultsButton" href="" onclick="deleteConfirmation('bow?action=deleteSearchResults&searchLine=<%= searchLine %>&fullTextLine=<%= fullText %>', <%=bookmarksNb%>); return(false);"></a> + <% } %> + </p> + </form> + </div> + <div class="content"> + <% + if (!bookmarkList.isEmpty()) { + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + for (Bookmark bookmark : bookmarkList) { + request.setAttribute("bookmark", bookmark); + request.setAttribute("sdf", sdf); + %> + <jsp:include page="bookmark.jsp" flush="true"> + <jsp:param name="searchLine" value="<%=searchLine%>" /> + <jsp:param name="fullTextLine" value="<%=fullText%>" /> + </jsp:include> + <% + } + } + else { %> + <p class="nobookmarks">No Bookmarks</p> + <% } %> + </div> + </div> + <jsp:include page="rightMenu.jsp" flush="true" /> + <jsp:include page="footer.jsp" flush="true" /> +<% } %> Property changes on: trunk/src/main/webapp/jsp/search.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain Copied: trunk/src/main/webapp/jsp/suggestions.jsp (from rev 154, trunk/src/main/webapp/suggestions.jsp) =================================================================== --- trunk/src/main/webapp/jsp/suggestions.jsp (rev 0) +++ trunk/src/main/webapp/jsp/suggestions.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,44 @@ +<!-- + #%L + bow + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="org.chorem.bow.OpenSearchActions" %> +<%@page import="java.util.List" %> +<%@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) { +%> +<%=osa.getJsonResult()%> +<% + } + } + } +%> Property changes on: trunk/src/main/webapp/jsp/suggestions.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Copied: trunk/src/main/webapp/jsp/temporaryXml.jsp (from rev 154, trunk/src/main/webapp/temporaryXml.jsp) =================================================================== --- trunk/src/main/webapp/jsp/temporaryXml.jsp (rev 0) +++ trunk/src/main/webapp/jsp/temporaryXml.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -0,0 +1,47 @@ +<!-- + #%L + bow + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page contentType="text/xml" pageEncoding="UTF-8"%> +<%@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); +%> + +<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" + xmlns:moz="http://www.mozilla.org/2006/browser/search/"> + <ShortName>bowTemporarySearchEngine</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> +</OpenSearchDescription> Property changes on: trunk/src/main/webapp/jsp/temporaryXml.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Deleted: trunk/src/main/webapp/login.jsp =================================================================== --- trunk/src/main/webapp/login.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/login.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,51 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<jsp:include page="header.jsp" flush="true"> - <jsp:param name="cssFile" value="connexion.css" /> -</jsp:include> -<div id="main"> - <jsp:include page="errorFrame.jsp" flush="true" /> - <div id="content"> - <div id="formFrame"> - <h1>Login</h1> - <form method="post" action="bow?action=login"> - <div> - <label for="email">Email :</label> - <input type="text" name="email" id="email" /> - </div> - <div> - <label for="password">Password :</label> - <input type="password" name="password" id="password" /> - </div> - <div> - <input type="submit" value="Login" /> - </div> - </form> - <a href="bow?action=registration" id="register">Register</a> - <a href="bow?action=forgotPassword" id="forgotPwd">Forgot Your Password?</a> - </div> - </div> -</div> -<jsp:include page="footer.jsp" flush="true" /> Deleted: trunk/src/main/webapp/permanentXml.jsp =================================================================== --- trunk/src/main/webapp/permanentXml.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/permanentXml.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,47 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/xml" pageEncoding="UTF-8"%> -<%@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); -%> - -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" - xmlns:moz="http://www.mozilla.org/2006/browser/search/"> - <ShortName>bowPermanentSearchEngine</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> -</OpenSearchDescription> Deleted: trunk/src/main/webapp/preferences.jsp =================================================================== --- trunk/src/main/webapp/preferences.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/preferences.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,148 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@page import="org.chorem.bow.Preference"%> -<%@page import="org.chorem.bow.User"%> -<%@page import="org.chorem.bow.TokenActions"%> -<%@page import="org.chorem.bow.BookmarkActions"%> -<%@page import="org.chorem.bow.Bookmark" %> -<%@page import="org.chorem.bow.Import" %> -<%@page import="org.nuiton.wikitty.FacetTopic" %> -<%@page import="java.util.List" %> -<%@page import="java.util.Date" %> -<% -User user = (User) session.getAttribute("user"); -Preference preference = (Preference) session.getAttribute("preference"); -TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); -//Boolean admin = (Boolean) session.getAttribute("admin"); -//if (admin == null) { -// admin = false; -//} -int nbTags = 100; - -if (user != null && preference != null && tokenActions != null){ - int tags = preference.getTags(); - if (tags > 0) { - nbTags = tags; - } - request.setAttribute("nbTags", nbTags); -// String url = (String) request.getAttribute("bowUrl"); -// String version = (String) request.getAttribute("version"); -// String temporaryToken = tokenActions.getTemporaryToken(); -// String permanentToken = tokenActions.getPermanentToken(); - String check = preference.getColors(); - if (check == null) { - preference.setColors(""); - } - check = preference.getSearchEngineUrlResults(); - if (check == null) { - preference.setSearchEngineUrlResults(""); - } - check = preference.getSearchEngineUrlSuggestions(); - if (check == null) { - preference.setSearchEngineUrlSuggestions(""); - } - %> - <jsp:include page="header.jsp" flush="true"> - <jsp:param name="cssFile" value="bookmark.css" /> - </jsp:include> - <div id="main"> - <jsp:include page="errorFrame.jsp" flush="true" /> - <div id="content"> - <div class="menu clearfix"> - <h2>Preferences</h2> - </div> - <form method="post" action="bow?action=changePreferences"> - <div class="formFrame"> - <h3>User information</h3> - <p> - <label for="email">Email :</label><br /> - <input type="text" name="email" id="email" value="<%=user.getEmail()%>" /><br /><br /> - <label for="password">Current password :</label><br /> - <input type="password" id="password" name="currentPassword" /><br /><br /> - <label for="newPassword">New password :</label><br /> - <input type="password" id="newPassword" name="newPassword" /><br /><br /> - <label for="confirmNewPassword">Confirm new password :</label><br /> - <input type="password" id="confirmNewPassword" name="confirmNewPassword" /> - <a href="bow?action=generateToken" id="regenPermToken">Regenerate permanent token</a> - </p> - </div> - <div class="formFrame"> - <h3>Site look</h3> - <p> - <label for="colors">Site color</label><br /> - <input type="text" name="colors" id="colors" value="<%=preference.getColors()%>" /><br /> - <label for="tagsNb">Number of tags displayed in the tag cloud</label><br /> - <input type="text" name="tagsNb" id="tagsNb" value="<%=nbTags%>" /><br /> - <label for="bookmarks">Number of bookmarks displayed on the home page</label><br /> - <input type="text" name="bookmarks" id="bookmarks" value="<%=preference.getBookmarks()%>"/><br /> - <label for="searchEngineUrlSuggestions">Search Engine URL Suggestions</label><br /> - <input type="text" name="searchEngineUrlSuggestions" id="searchEngineUrlSuggestions" value="<%=preference.getSearchEngineUrlSuggestions()%>"/><br /> - <label for="searchEngineUrlResults">Search Engine URL Results ({searchTerms} will be replaced by your text)</label><br /> - <input type="text" name="searchEngineUrlResults" id="searchEngineUrlResults" value="<%=preference.getSearchEngineUrlResults()%>"/><br /> - <input type="submit" value="Change" /> - <br /><br /> - <a href="bow?action=home" id="homePage">Return to the home page</a> - </p> - </div> - </form> - <div class="menu clearfix"> - <h2>Imported bookmarks</h2> - </div> - <% - List<FacetTopic> bookmarkImportList = (List<FacetTopic>)request.getAttribute("bookmarksImportDate"); - if (bookmarkImportList != null) { - if (bookmarkImportList.size() > 0) { - String bgColors[] = {"Pink", "White"}; - int i = 0; - int colorsNb = bgColors.length; - - for (FacetTopic bookmarkImport : bookmarkImportList) { - String date = bookmarkImport.getTopicName(); - String dateSave = date; - - date = date.replaceAll("[^0-9:-]+", " ").trim(); - date = date.substring(0, date.lastIndexOf(' ')); - %> - <div class="deleteImport deleteImport<%=bgColors[i % colorsNb]%>"> - <span><%= date + " (" + bookmarkImport.getCount() + " bookmarks)" %></span> - <a class="deleteImportButton" href="" onclick="deleteConfirmation('bow?action=deleteImport&date=<%=dateSave%>',<%=bookmarkImport.getCount()%>,'<%=date%>'); return(false);"></a> - </div> - <% - i++; - } - } else { - %> - <div class="deleteImport deleteImportWhite"> - <span>No imported bookmarks</span> - </div> - <% - } - } - %> - </div> - </div> - <jsp:include page="rightMenu.jsp" flush="true" /> - <jsp:include page="footer.jsp" flush="true" /> -<% } %> Deleted: trunk/src/main/webapp/register.jsp =================================================================== --- trunk/src/main/webapp/register.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/register.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,54 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<jsp:include page="header.jsp" flush="true"> - <jsp:param name="cssFile" value="connexion.css" /> -</jsp:include> -<div id="main"> - <jsp:include page="errorFrame.jsp" flush="true" /> - <div id="content"> - <div id="formFrame"> - <h1>Register</h1> - <form method="post" action="bow?action=register"> - <div> - <label for="email">Email :</label> - <input type="text" name="email" id="email" /> - </div> - <div> - <label for="password">Password :</label> - <input type="password" name="password" id="password" /> - </div> - <div> - <label for="repeatPassword">Repeat the password :</label> - <input type="password" name="repeatPassword" id="repeatPassword" /> - </div> - <div> - <input type="submit" value="Register" /> - </div> - </form> - <a href="bow" id="register">Login page</a> - </div> - </div> -</div> -<jsp:include page="footer.jsp" flush="true" /> Deleted: trunk/src/main/webapp/search.jsp =================================================================== --- trunk/src/main/webapp/search.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/search.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,92 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@page import="org.chorem.bow.BookmarkActions" %> -<%@page import="org.chorem.bow.TokenActions" %> -<%@page import="org.chorem.bow.Bookmark" %> -<%@page import="org.chorem.bow.Preference" %> -<%@page import="java.text.SimpleDateFormat" %> -<%@page import="java.util.List" %> -<% -TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); -BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); -//Preference preference = (Preference) session.getAttribute("preference"); -String searchLine = bookmarkActions.getSearchLine(); -String fullText = bookmarkActions.getFullTextLine(); - -if (tokenActions != null && bookmarkActions != null) { - %> - <jsp:include page="header.jsp" flush="true"> - <jsp:param name="cssFile" value="bookmark.css" /> - </jsp:include> - <div id="main"> - <jsp:include page="errorFrame.jsp" flush="true" /> - <div class="menu clearfix"> - <h2>Search</h2> - <form method="post" action="bow?action=order&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>"> - <p> - <label for="type">Order By :</label> - <select id="type" name="type"> - <option value="ascName">Asc Name</option> - <option value="descName">Desc Name</option> - <option value="ascClick">Asc Click</option> - <option value="descClick">Desc Click</option> - <option value="ascDate">Asc Date</option> - <option value="descDate">Desc Date</option> - </select> - <input type="submit" value="OK" /> - <% - List<Bookmark> bookmarkList = bookmarkActions.getBookmarks(); - int bookmarksNb = bookmarkList.size(); - - if (bookmarksNb > 0) { - %> - <a id="deleteSearchResultsButton" href="" onclick="deleteConfirmation('bow?action=deleteSearchResults&searchLine=<%= searchLine %>&fullTextLine=<%= fullText %>', <%=bookmarksNb%>); return(false);"></a> - <% } %> - </p> - </form> - </div> - <div class="content"> - <% - if (!bookmarkList.isEmpty()) { - SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - for (Bookmark bookmark : bookmarkList) { - request.setAttribute("bookmark", bookmark); - request.setAttribute("sdf", sdf); - %> - <jsp:include page="bookmark.jsp" flush="true"> - <jsp:param name="searchLine" value="<%=searchLine%>" /> - <jsp:param name="fullTextLine" value="<%=fullText%>" /> - </jsp:include> - <% - } - } - else { %> - <p class="nobookmarks">No Bookmarks</p> - <% } %> - </div> - </div> - <jsp:include page="rightMenu.jsp" flush="true" /> - <jsp:include page="footer.jsp" flush="true" /> -<% } %> Deleted: trunk/src/main/webapp/suggestions.jsp =================================================================== --- trunk/src/main/webapp/suggestions.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/suggestions.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,44 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@page import="org.chorem.bow.OpenSearchActions" %> -<%@page import="java.util.List" %> -<%@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) { -%> -<%=osa.getJsonResult()%> -<% - } - } - } -%> Deleted: trunk/src/main/webapp/temporaryXml.jsp =================================================================== --- trunk/src/main/webapp/temporaryXml.jsp 2010-12-30 17:57:29 UTC (rev 154) +++ trunk/src/main/webapp/temporaryXml.jsp 2010-12-31 15:48:49 UTC (rev 155) @@ -1,47 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/xml" pageEncoding="UTF-8"%> -<%@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); -%> - -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" - xmlns:moz="http://www.mozilla.org/2006/browser/search/"> - <ShortName>bowTemporarySearchEngine</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> -</OpenSearchDescription>