Bow-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
December 2010
- 4 participants
- 28 discussions
r156 - in trunk/src/main/webapp: WEB-INF/decorators jsp jsp/inc
by vbriand@users.chorem.org 31 Dec '10
by vbriand@users.chorem.org 31 Dec '10
31 Dec '10
Author: vbriand
Date: 2010-12-31 17:27:15 +0100 (Fri, 31 Dec 2010)
New Revision: 156
Url: http://chorem.org/repositories/revision/bow/156
Log:
Nouvelles modifications pour i18n
Modified:
trunk/src/main/webapp/WEB-INF/decorators/main.jsp
trunk/src/main/webapp/jsp/home.jsp
trunk/src/main/webapp/jsp/inc/rightMenu.jsp
Modified: trunk/src/main/webapp/WEB-INF/decorators/main.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2010-12-31 15:48:49 UTC (rev 155)
+++ trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2010-12-31 16:27:15 UTC (rev 156)
@@ -7,13 +7,17 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title><decorator:title default="Bow" /></title>
+ <title>Bow : <decorator:title default="Bow" /></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="Bookmarks on the web" />
- <link rel="search" type="application/opensearchdescription+xml" title="bowTemporarySearchEngine" href="?action=temporaryXml" />
- <link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="?action=permanentXml" />
- <link href="<s:url value='/css/global.css'/>" rel="stylesheet" type="text/css" media="all" />
- <script type="text/javascript" src="<s:url value='/js/bookmark.js' />"></script>
+ <s:url id="temporaryXml" action="temporaryXml" />
+ <s:url id="permanentXml" action="permanentXml" />
+ <link rel="search" type="application/opensearchdescription+xml" title="bowTemporarySearchEngine" href="${temporaryXml}" />
+ <link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="${permanentXml}" />
+ <s:url id="globalCSS" value="/css/global.css" />
+ <link href="${globalCSS}" rel="stylesheet" type="text/css" media="all" />
+ <s:url id="bookmarkJS" value="/js/bookmark.js" />
+ <script type="text/javascript" src="${bookmarkJS}"></script>
<decorator:head />
</head>
<body id="page-home">
Modified: trunk/src/main/webapp/jsp/home.jsp
===================================================================
--- trunk/src/main/webapp/jsp/home.jsp 2010-12-31 15:48:49 UTC (rev 155)
+++ trunk/src/main/webapp/jsp/home.jsp 2010-12-31 16:27:15 UTC (rev 156)
@@ -49,7 +49,7 @@
</head>
<body>
<div class="menu clearfix">
- <h2><s:property value="%{getText('mostUsedBookmarks')}" /></h2>
+ <h2><s:text name="bow.home.mostUsedBookmarks" /></h2>
</div>
<div class="content">
<%
@@ -75,12 +75,12 @@
}
}
else { %>
- <p class="nobookmarks"><s:property value="%{getText('noBookmarks')}" /></p><s:set var="formAction" value="%{formAction}" />
+ <p class="nobookmarks"><s:text name="bow.home.noBookmarks" /></p>
<% } %>
</div>
<div class="menu clearfix">
- <h2><s:property value="%{getText('latestBookmarks')}" /></h2>
+ <h2><s:text name="bow.home.latestBookmarks" /></h2>
</div>
<div class="content">
<%
@@ -101,7 +101,7 @@
}
}
else { %>
- <p class="nobookmarks"><s:property value="%{getText('noBookmarks')}" /></p>
+ <p class="nobookmarks"><s:text name="bow.home.noBookmarks" /></p>
<% } %>
</div>
<jsp:include page="/jsp/inc/rightMenu.jsp" />
Modified: trunk/src/main/webapp/jsp/inc/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2010-12-31 15:48:49 UTC (rev 155)
+++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2010-12-31 16:27:15 UTC (rev 156)
@@ -81,39 +81,39 @@
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">
+ <s:form action="logout">
<div class="input">
- <s:submit value="%{getText('logout')}" />
+ <s:submit name="bow.rightMenu.logout" />
</div>
</s:form>
- <a href="http://maven-site.chorem.org/bow/" class="help" target="_blank"><s:property value="%{getText('help')}" /></a>
+ <a href="http://maven-site.chorem.org/bow/" class="help" target="_blank"><s:text name="bow.rightMenu.help" /></a>
</div>
<div id="side">
<div id="colonneD">
<ul class="droite">
<% if (admin) { %>
- <li><a href="/bow/admin.action"><s:property value="%{getText('admin')}" /></a></li>
+ <li><s:a action="admin"><s:text name="bow.rightMenu.admin" /></s:a></li>
<% } %>
- <li><a href="/bow/preferences.action"><s:property value="%{getText('preferences')}" /></a></li>
- <li><a title="%{getText('temporaryLinkDescription')}" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>/addUrl.action&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:property value="%{getText('temporaryLink')}" /></a></li>
- <li><a title="%{getText('permanentLinkDescription')}" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>/addUrl.action&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:property value="%{getText('permanentLink')}" /></a></li>
+ <li><s:a action="preferences"><s:text name="bow.preferences.title" /></s:a></li>
+ <li><a title="%{getText('temporaryLinkDescription')}" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>/addUrl.action&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:text name="bow.rightMenu.bookmark.temporaryLink" /></a></li>
+ <li><a title="%{getText('permanentLinkDescription')}" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>/addUrl.action&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:text name="bow.rightMenu.bookmark.permanentLink" /></a></li>
</ul>
<div id="extensions">
- <h2><s:property value="%{getText('extensions')}" /></h2>
+ <h2><s:text name="bow.rightMenu.extensions" /></h2>
<ul class="droite">
<li><a href="extensions/bow4chromium.crx"><img src="img/chromium.png" class="extensionIcon" /><div class="extensionName">Extension pour Chromium</div></a></li>
- <li><strong><s:property value="%{getText('permanentTokenId')}" /></strong> <%= permanentToken %></li>
- <li><strong><s:property value="%{getText('sessionTokenId')}" /></strong> <%= temporaryToken %></li>
+ <li><strong><s:text name="bow.rightMenu.token.permanent" /></strong> <%= permanentToken %></li>
+ <li><strong><s:text name="bow.rightMenu.token.temporary" /></strong> <%= temporaryToken %></li>
</ul>
</div>
<div id="add" class="clearfix">
- <h2><s:property value="%{getText('addModify')}" /></h2>
- <s:form id="bookmarkForm" action="/bow/addUrl.action">
- <div class="input"><s:textfield key="link" name="link" label="%{getText('link')}" /></div><!-- <%=formLink%> -->
- <div class="input"><s:textfield key="alias" name="alias" label="%{getText('alias')}" value="" /></div><!-- <%=formAlias%> -->
- <div class="input"><s:textfield key="name" name="name" label="%{getText('name')}" value="" /></div><!-- <%=formName%> -->
- <div class="input"><s:textfield key="tags" name="tags" label="%{getText('tags')}" value="" /></div><!-- <%=formTags%> -->
- <div class="input"><s:submit value="%{getText('save')}" /></div>
+ <h2><s:text name="bow.rightMenu.bookmark.addModify" /></h2>
+ <s:form id="bookmarkForm" action="addUrl">
+ <div class="input"><s:textfield key="bow.rightMenu.bookmark.link" name="link" /></div><!-- <%=formLink%> -->
+ <div class="input"><s:textfield key="bow.rightMenu.bookmark.alias" name="alias" /></div><!-- <%=formAlias%> -->
+ <div class="input"><s:textfield key="bow.rightMenu.bookmark.name" name="name" /></div><!-- <%=formName%> -->
+ <div class="input"><s:textfield key="bow.rightMenu.bookmark.tags" name="tags" /></div><!-- <%=formTags%> -->
+ <div class="input"><s:submit key="bow.rightMenu.bookmark.submit" /></div>
</s:form>
</div>
<div id="nuage">
@@ -126,36 +126,36 @@
<% } %>
</div>
<div class="recherche">
- <h2><label for="searchLine"><s:property value="%{getText('search')}" /></label></h2>
- <s:form action="/bow/search.action">
+ <h2><label for="searchLine"><s:text name="bow.rightMenu.search" /></label></h2>
+ <s:form action="search">
<div class="input">
- <s:textfield key="searchLine" name="searchLine" />
- <s:submit value="%{getText('find')}" />
+ <s:textfield key="bow.rightMenu.find.searchLine" name="searchLine" />
+ <s:submit key="bow.rightMenu.find.submit" />
</div>
</s:form>
</div>
<div class="recherche">
- <h2><label for="fullTextLine"><s:property value="%{getText('fullTextSearch')}" /></label></h2>
- <s:form action="/bow/fullText.action">
+ <h2><label for="fullTextLine"><s:text name="bow.rightMenu.fullTextSearch}" /></label></h2>
+ <s:form action="fullText">
<div class="input">
<% if (fullText != null) { %>
- <s:textfield key="fullTextLine" name="fullTextLine" value="" /> <!-- <%=fullText%> -->
+ <s:textfield key="bow.rightMenu.search.fullTextLine" name="fullTextLine" value="" /> <!-- <%=fullText%> -->
<% } else { %>
- <s:textfield key="fullTextLine" name="fullTextLine" />
+ <s:textfield key="bow.rightMenu.search.fullTextLine" name="fullTextLine" />
<% } %>
- <s:submit value="%{getText('find')}" />
+ <s:submit key="bow.rightMenu.find" />
</div>
</s:form>
</div>
<div id="import">
- <h2><s:property value="%{getText('importBookmarks')}" /></h2>
- <s:form action="/bow/importBookmarks.action" enctype="multipart/form-data">
+ <h2><s:text name="bow.rightMenu.importBookmarks" /></h2>
+ <s:form action="importBookmarks" enctype="multipart/form-data">
<div class="input">
- <s:file name="upfile" size="15%" label="%{getText('file')}" /><br />
- <s:submit value="%{getText('import')}" />
+ <s:file name="upfile" size="15%" key="bow.rightMenu.import.file" /><br />
+ <s:submit key="bow.rightMenu.import.submit" />
</div>
</s:form>
- <a href="/bow/exportBookmarks.action"><s:property value="%{getText('exportBookmarks')}" /></a>
+ <s:a action="exportBookmarks"><s:text name="bow.rightMenu.exportBookmarks" /></s:a>
</div>
<div class="colonnebas">
<img src="img/piedmenu.jpg" width="401" height="77" alt="Pied de menu" />
1
0
r155 - in trunk: . src/main src/main/i18n src/main/java/org/chorem/bow src/main/java/org/chorem/bow/action src/main/resources src/main/resources/i18n src/main/resources/org/chorem/bow/action src/main/webapp src/main/webapp/WEB-INF src/main/webapp/jsp src/main/webapp/jsp/inc
by vbriand@users.chorem.org 31 Dec '10
by vbriand@users.chorem.org 31 Dec '10
31 Dec '10
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>
1
0
r154 - in trunk/src/main: resources resources/org/chorem/bow/action webapp webapp/jsp webapp/jsp/inc
by vbriand@users.chorem.org 30 Dec '10
by vbriand@users.chorem.org 30 Dec '10
30 Dec '10
Author: vbriand
Date: 2010-12-30 18:57:29 +0100 (Thu, 30 Dec 2010)
New Revision: 154
Url: http://chorem.org/repositories/revision/bow/154
Log:
L'ajout manuel de bookmark commence ?\195?\160 marchouiller mais pas encore l'affichage
Added:
trunk/src/main/webapp/jsp/inc/bookmark.jsp
trunk/src/main/webapp/jsp/inc/rightMenu.jsp
trunk/src/main/webapp/jsp/inc/tagsCloud.jsp
trunk/src/main/webapp/jsp/preferences.jsp
Removed:
trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties
trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties
trunk/src/main/webapp/rightMenu.jsp
trunk/src/main/webapp/tagsCloud.jsp
Modified:
trunk/src/main/resources/struts.xml
trunk/src/main/webapp/jsp/home.jsp
trunk/src/main/webapp/jsp/login.jsp
Deleted: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties 2010-12-30 14:45:38 UTC (rev 153)
+++ trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties 2010-12-30 17:57:29 UTC (rev 154)
@@ -1,5 +0,0 @@
-url = URL
-alias = ALIAS
-name = DESC
-tags = TAGS
-save = Save
\ No newline at end of file
Deleted: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties 2010-12-30 14:45:38 UTC (rev 153)
+++ trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties 2010-12-30 17:57:29 UTC (rev 154)
@@ -1,5 +0,0 @@
-url = URL
-alias = ALIAS
-name = DESC
-tags = TAGS
-save = Sauvegarder
\ No newline at end of file
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2010-12-30 14:45:38 UTC (rev 153)
+++ trunk/src/main/resources/struts.xml 2010-12-30 17:57:29 UTC (rev 154)
@@ -30,6 +30,7 @@
<result>/jsp/home.jsp</result>
</action>
<action name="addUrl" class="org.chorem.bow.action.AddUrlAction">
+ <result type="redirect">/home.action</result>
<!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
</action>
</package>
Modified: trunk/src/main/webapp/jsp/home.jsp
===================================================================
--- trunk/src/main/webapp/jsp/home.jsp 2010-12-30 14:45:38 UTC (rev 153)
+++ trunk/src/main/webapp/jsp/home.jsp 2010-12-30 17:57:29 UTC (rev 154)
@@ -60,7 +60,7 @@
request.setAttribute("bookmark", bookmark);
request.setAttribute("sdf", sdf);
%>
- <jsp:include page="/bookmark.jsp" flush="true" />
+ <jsp:include page="/jsp/inc/bookmark.jsp" flush="true" />
<%
++count;
if (count >= nbBookmarks) {
@@ -69,7 +69,7 @@
}
}
else { %>
- <p class="nobookmarks"><s:property value="%{getText('noBookmarks')}" /></p>
+ <p class="nobookmarks"><s:property value="%{getText('noBookmarks')}" /></p><s:set var="formAction" value="%{formAction}" />
<% } %>
</div>
@@ -86,7 +86,7 @@
request.setAttribute("bookmark", bookmark);
request.setAttribute("sdf", sdf);
%>
- <jsp:include page="/bookmark.jsp" flush="true" />
+ <jsp:include page="/jsp/inc/bookmark.jsp" flush="true" />
<%
++count;
if (count >= nbBookmarks) {
@@ -97,8 +97,8 @@
else { %>
<p class="nobookmarks"><s:property value="%{getText('noBookmarks')}" /></p>
<% } %>
- </div>
- <jsp:include page="/rightMenu.jsp" />
- </body>
-</html>
+ </div>
+ <jsp:include page="/jsp/inc/rightMenu.jsp" />
+ </body>
+ </html>
<% } %>
Added: trunk/src/main/webapp/jsp/inc/bookmark.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/bookmark.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/inc/bookmark.jsp 2010-12-30 17:57:29 UTC (rev 154)
@@ -0,0 +1,94 @@
+<!--
+ #%L
+ bow
+
+ $Id: bookmark.jsp 150 2010-12-23 14:19:56Z vbriand $
+ $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/bookmark.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"%>
+<%@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/editBookmark.action&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow/modifyBookmark.action&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>', '<%=bookmark.getWikittyId()%>');"></a>
+ <a class="supprim" href="/bow/removeBookmark.action&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/addClick.action&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/deleteTag.action&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/deleteTag.action&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%><%=search%>">
+ <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" />
+ </a>
+ <% } %>
+ <a href="/bow/search.action&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a>
+ <%
+ }
+ }
+ %>
+ </p>
+ </div>
+ </div>
+</div>
+<% } %>
Property changes on: trunk/src/main/webapp/jsp/inc/bookmark.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/src/main/webapp/jsp/inc/rightMenu.jsp (from rev 152, trunk/src/main/webapp/rightMenu.jsp)
===================================================================
--- trunk/src/main/webapp/jsp/inc/rightMenu.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2010-12-30 17:57:29 UTC (rev 154)
@@ -0,0 +1,160 @@
+<!--
+ #%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.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;
+}
+
+String temporaryToken = tokenActions.getTemporaryToken();
+String permanentToken = tokenActions.getPermanentToken();
+String url = (String) request.getAttribute("bowUrl");
+int nbTags = 100;
+Preference preference = (Preference)session.getAttribute("preference");
+if (preference != null) {
+ int tags = preference.getTags();
+ if (tags > 0)
+ nbTags = tags;
+}
+request.setAttribute("nbTags", nbTags);
+String searchLine = null;
+String fullText = null;
+if (bookmarkActions != null){
+ searchLine = bookmarkActions.getSearchLine();
+ fullText = bookmarkActions.getFullTextLine();
+}
+
+String formLink = (String)request.getAttribute("link");
+String formName = (String)request.getAttribute("name");
+String formTags = (String)request.getAttribute("tags");
+String formAlias = (String)request.getAttribute("alias");
+String formAction = (String)request.getAttribute("formAction"); //TODO : modifier le nom action en formAction parce que sinon ça fait tout péter
+
+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/addUrl.action";
+%>
+<div id="logout">
+ <s:form action="/bow/logout.action">
+ <div class="input">
+ <s:submit value="%{getText('logout')}" />
+ </div>
+ </s:form>
+ <a href="http://maven-site.chorem.org/bow/" class="help" target="_blank"><s:property value="%{getText('help')}" /></a>
+</div>
+<div id="side">
+ <div id="colonneD">
+ <ul class="droite">
+ <% if (admin) { %>
+ <li><a href="/bow/admin.action"><s:property value="%{getText('admin')}" /></a></li>
+ <% } %>
+ <li><a href="/bow/preferences.action"><s:property value="%{getText('preferences')}" /></a></li>
+ <li><a title="%{getText('temporaryLinkDescription')}" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>/addUrl.action&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:property value="%{getText('temporaryLink')}" /></a></li>
+ <li><a title="%{getText('permanentLinkDescription')}" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>/addUrl.action&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:property value="%{getText('permanentLink')}" /></a></li>
+ </ul>
+ <div id="extensions">
+ <h2><s:property value="%{getText('extensions')}" /></h2>
+ <ul class="droite">
+ <li><a href="extensions/bow4chromium.crx"><img src="img/chromium.png" class="extensionIcon" /><div class="extensionName">Extension pour Chromium</div></a></li>
+ <li><strong><s:property value="%{getText('permanentTokenId')}" /></strong> <%= permanentToken %></li>
+ <li><strong><s:property value="%{getText('sessionTokenId')}" /></strong> <%= temporaryToken %></li>
+ </ul>
+ </div>
+ <div id="add" class="clearfix">
+ <h2><s:property value="%{getText('addModify')}" /></h2>
+ <s:form id="bookmarkForm" action="/bow/addUrl.action">
+ <div class="input"><s:textfield key="link" name="link" label="%{getText('link')}" /></div><!-- <%=formLink%> -->
+ <div class="input"><s:textfield key="alias" name="alias" label="%{getText('alias')}" value="" /></div><!-- <%=formAlias%> -->
+ <div class="input"><s:textfield key="name" name="name" label="%{getText('name')}" value="" /></div><!-- <%=formName%> -->
+ <div class="input"><s:textfield key="tags" name="tags" label="%{getText('tags')}" value="" /></div><!-- <%=formTags%> -->
+ <div class="input"><s:submit value="%{getText('save')}" /></div>
+ </s:form>
+ </div>
+ <div id="nuage">
+ <% if (searchLine != null) { %>
+ <jsp:include page="tagsCloud.jsp" flush="true">
+ <jsp:param name="searchLine" value="<%=searchLine%>" />
+ </jsp:include>
+ <% } else { %>
+ <jsp:include page="tagsCloud.jsp" flush="true" />
+ <% } %>
+ </div>
+ <div class="recherche">
+ <h2><label for="searchLine"><s:property value="%{getText('search')}" /></label></h2>
+ <s:form action="/bow/search.action">
+ <div class="input">
+ <s:textfield key="searchLine" name="searchLine" />
+ <s:submit value="%{getText('find')}" />
+ </div>
+ </s:form>
+ </div>
+ <div class="recherche">
+ <h2><label for="fullTextLine"><s:property value="%{getText('fullTextSearch')}" /></label></h2>
+ <s:form action="/bow/fullText.action">
+ <div class="input">
+ <% if (fullText != null) { %>
+ <s:textfield key="fullTextLine" name="fullTextLine" value="" /> <!-- <%=fullText%> -->
+ <% } else { %>
+ <s:textfield key="fullTextLine" name="fullTextLine" />
+ <% } %>
+ <s:submit value="%{getText('find')}" />
+ </div>
+ </s:form>
+ </div>
+ <div id="import">
+ <h2><s:property value="%{getText('importBookmarks')}" /></h2>
+ <s:form action="/bow/importBookmarks.action" enctype="multipart/form-data">
+ <div class="input">
+ <s:file name="upfile" size="15%" label="%{getText('file')}" /><br />
+ <s:submit value="%{getText('import')}" />
+ </div>
+ </s:form>
+ <a href="/bow/exportBookmarks.action"><s:property value="%{getText('exportBookmarks')}" /></a>
+ </div>
+ <div class="colonnebas">
+ <img src="img/piedmenu.jpg" width="401" height="77" alt="Pied de menu" />
+ </div>
+ </div>
+</div>
Property changes on: trunk/src/main/webapp/jsp/inc/rightMenu.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Copied: trunk/src/main/webapp/jsp/inc/tagsCloud.jsp (from rev 152, trunk/src/main/webapp/tagsCloud.jsp)
===================================================================
--- trunk/src/main/webapp/jsp/inc/tagsCloud.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/inc/tagsCloud.jsp 2010-12-30 17:57:29 UTC (rev 154)
@@ -0,0 +1,51 @@
+<!--
+ #%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.BookmarkActions" %>
+<%@page import="java.util.List" %>
+<%@page import="org.nuiton.wikitty.FacetTopic" %>
+<%
+BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
+int nbTags = (Integer) request.getAttribute("nbTags");
+String search = "";
+String searchLine = request.getParameter("searchLine");
+if (searchLine != null) {
+ search += "&searchLine=" + searchLine;
+}
+if (bookmarkActions != null) {
+ List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud();
+ int count = 0;
+ for (FacetTopic tag : tagCloud) {
+ int value = tag.getCount();
+ String tagName = tag.getTopicName();
+ int font = bookmarkActions.getFont(value);
+ %>
+ <a href="bow?action=search&addTag=<%=tagName%><%=search%>" title="<%=value%> result<%=(value != 1 ? "s" : "")%>" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a>
+ <%
+ ++count;
+ if (count >= nbTags) {
+ break;
+ }
+ }
+}
+%>
Property changes on: trunk/src/main/webapp/jsp/inc/tagsCloud.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/src/main/webapp/jsp/login.jsp
===================================================================
--- trunk/src/main/webapp/jsp/login.jsp 2010-12-30 14:45:38 UTC (rev 153)
+++ trunk/src/main/webapp/jsp/login.jsp 2010-12-30 17:57:29 UTC (rev 154)
@@ -19,10 +19,10 @@
<s:submit value="%{getText('login')}" />
</p>
</s:form>
- <s:url id="localeEN" action="login">
+ <s:url id="localeEN" action="login_input">
<s:param name="request_locale" >en</s:param>
</s:url>
- <s:url id="localeFR" action="login">
+ <s:url id="localeFR" action="login_input">
<s:param name="request_locale" >fr</s:param>
</s:url>
Added: trunk/src/main/webapp/jsp/preferences.jsp
===================================================================
--- trunk/src/main/webapp/jsp/preferences.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/preferences.jsp 2010-12-30 17:57:29 UTC (rev 154)
@@ -0,0 +1,141 @@
+<!--
+ #%L
+ bow
+
+ $Id: preferences.jsp 144 2010-12-23 10:24:48Z bpoussin $
+ $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/preferences.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"%>
+<%@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("");
+ }
+ %>
+ <html>
+ <head>
+ <link href="<s:url value='/css/bookmark.css'/>" rel="stylesheet" type="text/css" />
+ <s:head />
+ </head>
+ <body>
+ <div id="content">
+ <div class="menu clearfix">
+ <h2><s:property value="%{getText('preferences')}" /></h2>
+ </div>
+ <s:form action="/bow/changePreferences.action">
+ <div class="formFrame">
+ <h3><s:property value="%{getText('userInfo')}" /></h3>
+ <p>
+ <s:textfield key="email" name="email" label="%{getText('email')}" /><br /><br /><!-- value="<%=user.getEmail()%>" -->
+ <s:password key="currentPassword" name="currentPassword" label="%{getText('currentPassword')}" />
+ <s:password key="newPassword" name="newPassword" label="%{getText('newPassword')}" />
+ <s:password key="confirmNewPassword" name="confirmNewPassword" label="%{getText('confirmNewPassword')}" />
+ <a href="/bow/generateToken.action" id="regenPermToken"><s:property value="%{getText('regenPermToken')}" /></a>
+ </p>
+ </div>
+ <div class="formFrame">
+ <h3><s:property value="%{getText('siteLook')}" /></h3>
+ <p>
+ <s:textfield key="colors" name="colors" label="%{getText('siteColor')}" /><br /> <!-- value="<%=preference.getColors()%>" -->
+ <s:textfield key="tagsNb" name="tagsNb" label="%{getText('tagsNb')}" /><br />
+ <s:textfield key="bookmarksHomePage" name="bookmarksHomePage" label="%{getText('bookmarksHomePage')}" /><br />
+ <s:textfield key="searchEngineUrlSuggestions" name="searchEngineUrlSuggestions" label="%{getText('searchEngineUrlSuggestions')}" /><br />
+ <s:textfield key="searchEngineUrlResults" name="searchEngineUrlResults" label="%{getText('searchEngineUrlResults')}" />
+ <s:submit value="%{getText('changePreferences')}" />
+ <br /><br />
+ <a href="/bow/home.action" id="homePage"><s:property value="%{getText('homePage')}" /></a>
+ </p>
+ </div>
+ </s:form>
+ <div class="menu clearfix">
+ <h2><s:property value="%{getText('importedBookmarks')}" /></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/deleteImport.action&date=<%=dateSave%>',<%=bookmarkImport.getCount()%>,'<%=date%>'); return(false);"></a>
+ </div>
+ <%
+ i++;
+ }
+ } else {
+ %>
+ <div class="deleteImport deleteImportWhite">
+ <span><s:property value="%{getText('noImportedBookmarks')}" /></span>
+ </div>
+ <%
+ }
+ }
+ %>
+ </div>
+ <jsp:include page="/jsp/inc/rightMenu.jsp" flush="true" />
+ </body>
+ </html>
+<% } %>
\ No newline at end of file
Property changes on: trunk/src/main/webapp/jsp/preferences.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/src/main/webapp/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/rightMenu.jsp 2010-12-30 14:45:38 UTC (rev 153)
+++ trunk/src/main/webapp/rightMenu.jsp 2010-12-30 17:57:29 UTC (rev 154)
@@ -1,159 +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" %>
-<%@taglib prefix="s" uri="/struts-tags" %>
-<%@page import="org.chorem.bow.BookmarkActions" %>
-<%@page import="java.text.SimpleDateFormat" %>
-<%@page import="java.util.Iterator" %>
-<%@page import="java.util.Set" %>
-<%@page import="java.util.ArrayList" %>
-<%@page import="java.util.List" %>
-<%@page import="org.chorem.bow.TokenActions" %>
-<%@page import="org.nuiton.wikitty.FacetTopic" %>
-<%@page import="org.chorem.bow.Bookmark" %>
-<%@page import="org.chorem.bow.Preference" %>
-<%
-TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions");
-BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
-Boolean admin = (Boolean) session.getAttribute("admin");
-if (admin == null) {
- admin = false;
-}
-
-String temporaryToken = tokenActions.getTemporaryToken();
-String permanentToken = tokenActions.getPermanentToken();
-String url = (String) request.getAttribute("bowUrl");
-int nbTags = 100;
-Preference preference = (Preference) session.getAttribute("preference");
-if (preference != null) {
- int tags = preference.getTags();
- if (tags > 0)
- nbTags = tags;
-}
-request.setAttribute("nbTags", nbTags);
-String searchLine = null;
-String fullText = null;
-if (bookmarkActions != null){
- searchLine = bookmarkActions.getSearchLine();
- fullText = bookmarkActions.getFullTextLine();
-}
-
-String formLink = (String)request.getAttribute("link");
-String formName = (String)request.getAttribute("name");
-String formTags = (String)request.getAttribute("tags");
-String formAlias = (String)request.getAttribute("alias");
-String formAction = (String)request.getAttribute("formAction"); //TODO : modifier le nom action en formAction parce que sinon ça fait tout péter
-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";
-%>
-<div id="logout">
- <s:form action="/bow/logout.action">
- <div class="input">
- <s:submit value="%{getText('logout')}" />
- </div>
- </s:form>
- <a href="http://maven-site.chorem.org/bow/" class="help" target="_blank">Aide</a>
-</div>
-<div id="side">
- <div id="colonneD">
- <ul class="droite">
- <% if (admin) { %>
- <li><a href="bow?action=admin">Admin</a></li>
- <% } %>
- <li><a href="bow?action=preferences">Preferences</a></li>
- <li><a title="Add this link to your favourites to bookmark others in the future. This link is just available while you are connected on the site!" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>?action=addUrl&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);">Bookmark add link (session)</a></li>
- <li><a title="Add this link to your favourites to bookmark others in the future. This link is always available!" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>?action=addUrl&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);">Bookmark add link (permanent)</a></li>
- </ul>
- <div id="extensions">
- <h2>Extensions</h2>
- <ul class="droite">
- <li><a href="extensions/bow4chromium.crx"><img src="img/chromium.png" class="extensionIcon" /><div class="extensionName">Extension pour Chromium</div></a></li>
- <li><strong>Permanent token id:</strong> <%= permanentToken %></li>
- <li><strong>Session token id:</strong> <%= temporaryToken %></li>
- </ul>
- </div>
- <div id="add" class="clearfix">
- <h2>Add / Modify</h2>
- <s:form id="bookmarkForm" action=""> <!-- <%=formAction%> -->
- <div class="input"><s:textfield key="url" name="url" label="%{getText('url')}" value="" /></div><!-- <%=formLink%> -->
- <div class="input"><s:textfield key="alias" name="alias" label="%{getText('alias')}" value="" /></div><!-- <%=formAlias%> -->
- <div class="input"><s:textfield key="name" name="name" label="%{getText('name')}" value="" /></div><!-- <%=formName%> -->
- <div class="input"><s:textfield key="tags" name="tags" label="%{getText('tags')}" value="" /></div><!-- <%=formTags%> -->
- <div class="input"><s:submit value="%{getText('save')}" /></div>
- </s:form>
- </div>
- <div id="nuage">
- <% if (searchLine != null) { %>
- <jsp:include page="tagsCloud.jsp" flush="true">
- <jsp:param name="searchLine" value="<%=searchLine%>" />
- </jsp:include>
- <% } else { %>
- <jsp:include page="tagsCloud.jsp" flush="true" />
- <% } %>
- </div>
- <div class="recherche">
- <h2><label for="searchLine"><s:property value="%{getText('search')}" /></label></h2>
- <s:form action="/bow/search.action">
- <div class="input">
- <s:textfield key="searchLine" name="searchLine" />
- <s:submit value="%{getText('find')}" />
- </div>
- </s:form>
- </div>
- <div class="recherche">
- <h2><label for="fullTextLine"><s:property value="%{getText('fullTextSearch')}" /></label></h2>
- <s:form action="/bow/fullText.action">
- <div class="input">
- <% if (fullText != null) { %>
- <s:textfield key="fullTextLine" name="fullTextLine" value="" /> <!-- <%=fullText%> -->
- <% } else { %>
- <s:textfield key="fullTextLine" name="fullTextLine" />
- <% } %>
- <s:submit value="%{getText('find')}" />
- </div>
- </s:form>
- </div>
- <div id="import">
- <h2><s:property value="%{getText('importBookmarks')}" /></h2>
- <s:form action="/bow/importBookmarks.action" enctype="multipart/form-data">
- <div class="input">
- <s:file name="upfile" size="15%" label="%{getText('file')}" /><br />
- <s:submit value="%{'import'}" />
- </div>
- </s:form>
- <a href="/bow/exportBookmarks.action"><s:property value="%{getText('exportBookmarks')}" /></a>
- </div>
- <div class="colonnebas">
- <img src="img/piedmenu.jpg" width="401" height="77" alt="Pied de menu" />
- </div>
- </div>
-</div>
Deleted: trunk/src/main/webapp/tagsCloud.jsp
===================================================================
--- trunk/src/main/webapp/tagsCloud.jsp 2010-12-30 14:45:38 UTC (rev 153)
+++ trunk/src/main/webapp/tagsCloud.jsp 2010-12-30 17:57:29 UTC (rev 154)
@@ -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 import="org.chorem.bow.BookmarkActions" %>
-<%@page import="java.util.List" %>
-<%@page import="org.nuiton.wikitty.FacetTopic" %>
-<%
-BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions");
-int nbTags = (Integer) request.getAttribute("nbTags");
-String search = "";
-String searchLine = request.getParameter("searchLine");
-if (searchLine != null) {
- search += "&searchLine=" + searchLine;
-}
-if (bookmarkActions != null) {
- List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud();
- int count = 0;
- for (FacetTopic tag : tagCloud) {
- int value = tag.getCount();
- String tagName = tag.getTopicName();
- int font = bookmarkActions.getFont(value);
- %>
- <a href="bow?action=search&addTag=<%=tagName%><%=search%>" title="<%=value%> result<%=(value != 1 ? "s" : "")%>" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a>
- <%
- ++count;
- if (count >= nbTags) {
- break;
- }
- }
-}
-%>
1
0
r153 - in trunk/src/main: java/org/chorem/bow java/org/chorem/bow/action resources webapp/jsp
by vbriand@users.chorem.org 30 Dec '10
by vbriand@users.chorem.org 30 Dec '10
30 Dec '10
Author: vbriand
Date: 2010-12-30 15:45:38 +0100 (Thu, 30 Dec 2010)
New Revision: 153
Url: http://chorem.org/repositories/revision/bow/153
Log:
Toutes les actions de ControllerServlet ont ?\195?\169t?\195?\169 d?\195?\169plac?\195?\169es vers des classes d'action mais il reste encore quelques d?\195?\169tails du ControllerServlet ?\195?\160 impl?\195?\169menter en Struts2. Les classes d'action ne sont par contre pas du tout finalis?\195?\169es, que ce soit au niveau de la gestion d'erreurs, des commentaires, du logging ou des redirections (et du fonctionnement...).
Added:
trunk/src/main/java/org/chorem/bow/BowMail.java
trunk/src/main/java/org/chorem/bow/BowSearch.java
trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java
trunk/src/main/webapp/jsp/forgotPassword.jsp
Removed:
trunk/src/main/java/org/chorem/bow/action/RightMenuAction.java
trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java
Modified:
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/GenerateTokenAction.java
trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java
trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java
trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java
trunk/src/main/java/org/chorem/bow/action/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/struts.xml
trunk/src/main/webapp/jsp/login.jsp
trunk/src/main/webapp/jsp/register.jsp
Added: trunk/src/main/java/org/chorem/bow/BowMail.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowMail.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/BowMail.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -0,0 +1,31 @@
+package org.chorem.bow;
+
+import java.util.Properties;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+public class BowMail {
+ static public void sendMail(String sendToEmail, String mailSubject, String mailContent) throws AddressException, MessagingException {
+ BowConfig config = BowConfig.getInstance();
+ String smtpServer = config.getSmtpServer();
+ Properties properties = new Properties();
+ properties.put("mail.smtp.host", smtpServer);
+
+ Session session = Session.getDefaultInstance(properties, null);
+ session.setDebug(true);
+
+ Message msg = new MimeMessage(session);
+
+ msg.addRecipient(Message.RecipientType.TO, new InternetAddress(sendToEmail));
+ msg.setFrom(new InternetAddress(config.getAddressFrom()));
+ msg.setSubject(mailSubject);
+ msg.setContent(mailContent, "text/plain");
+ Transport.send(msg);
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/BowMail.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/BowSearch.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowSearch.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/BowSearch.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -0,0 +1,66 @@
+package org.chorem.bow;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.PagedResult;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
+public class BowSearch {
+ static public void search(HttpServletRequest request, User user)
+ throws IOException, ServletException {
+ String searchLine = request.getParameter("searchLine");
+
+ if (searchLine == null) {
+ searchLine = "";
+ }
+ String fulltext = request.getParameter("fullTextLine");
+
+ if (fulltext != null && !fulltext.isEmpty() && searchLine.isEmpty()) {
+ fullText(request, user);
+ } else {
+ String tag = request.getParameter("addTag");
+
+ if (tag != null && !tag.isEmpty()) {
+ if (searchLine.isEmpty()) {
+ searchLine = tag;
+ } else {
+ searchLine += " " + tag;
+ }
+ }
+ 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);
+ }
+ }
+
+ static public void fullText(HttpServletRequest request, User user) throws IOException, ServletException {
+ String fullText = request.getParameter("fullTextLine");
+
+ if (fullText == null || fullText.isEmpty()) {
+ search(request, user);
+ } else {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria;
+
+ if (!fullText.isEmpty()) {
+ criteria = Search.query().keyword(fullText).
+ eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).criteria().
+ addFacetField(Bookmark.FQ_FIELD_TAGS);
+
+ } else {
+ criteria = BowBookmark.getBookmarkListCriteriaByUser(user, null);
+ }
+ PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, null);
+ request.setAttribute("bookmarkActions", bookmarkActions);
+ }
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/BowSearch.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,64 @@
package org.chorem.bow.action;
+import java.util.List;
+
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BowProxy;
+import org.nuiton.wikitty.Criteria;
+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 ActionSupport {
private static final long serialVersionUID = 2565840071468031758L;
+ protected String alias;
+ protected String bookmarkId;
-}
+ /**
+ * @return the alias
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * @param alias the alias to set
+ */
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ /**
+ * @return the bookmarkId
+ */
+ public String getBookmarkId() {
+ return bookmarkId;
+ }
+
+ /**
+ * @param bookmarkId the bookmarkId to set
+ */
+ public void setBookmarkId(String bookmarkId) {
+ this.bookmarkId = bookmarkId;
+ }
+
+ @Override
+ public String execute() {
+ if (alias != null && !alias.isEmpty()) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = Search.query().eq(Bookmark.FQ_FIELD_ALIAS, alias).criteria();
+ List<Bookmark> bookmarks = proxy.findAllByCriteria(Bookmark.class, criteria).getAll();
+ if (bookmarks == null || bookmarks.isEmpty()) {
+ if (bookmarkId != null && !bookmarkId.isEmpty()) {
+ Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId);
+ if (bookmark != null) {
+ bookmark.setAlias(alias);
+ proxy.store(bookmark);
+ }
+ }
+ }
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/AddClickAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/AddClickAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/AddClickAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,39 @@
package org.chorem.bow.action;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BowProxy;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class AddClickAction extends ActionSupport{
+public class AddClickAction extends ActionSupport {
private static final long serialVersionUID = 8579081104294143087L;
+ protected String bookmarkId;
-}
+ /**
+ * @return the bookmarkId
+ */
+ public String getBookmarkId() {
+ return bookmarkId;
+ }
+ /**
+ * @param bookmarkId the bookmarkId to set
+ */
+ public void setBookmarkId(String bookmarkId) {
+ this.bookmarkId = bookmarkId;
+ }
+
+ @Override
+ public String execute() {
+ if (bookmarkId != null && !bookmarkId.isEmpty()) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId);
+ if (bookmark != null) {
+ bookmark.setClick(bookmark.getClick() + 1);
+ proxy.store(bookmark);
+ return SUCCESS;
+ }
+ }
+ return ERROR;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,124 @@
package org.chorem.bow.action;
+import java.util.Map;
+
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BookmarkActions;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
import com.opensymphony.xwork2.ActionSupport;
-public class AddUrlAction extends ActionSupport{
+public class AddUrlAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 3389170166034184139L;
+ protected String link;
+ protected String name;
+ protected String alias;
+ protected String tags;
+ protected String nameAndTags;
+ protected Map<String, Object> session;
+
+ /**
+ * @return the link
+ */
+ public String getLink() {
+ return link;
+ }
-}
+ /**
+ * @param link the link to set
+ */
+ public void setLink(String link) {
+ this.link = link;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the alias
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * @param alias the alias to set
+ */
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ /**
+ * @return the tags
+ */
+ public String getTags() {
+ return tags;
+ }
+
+ /**
+ * @param tags the tags to set
+ */
+ public void setTags(String tags) {
+ this.tags = tags;
+ }
+
+ /**
+ * @return the nameAndTags
+ */
+ public String getNameAndTags() {
+ return nameAndTags;
+ }
+
+ /**
+ * @param nameAndTags the nameAndTags to set
+ */
+ public void setNameAndTags(String nameAndTags) {
+ this.nameAndTags = nameAndTags;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public String execute() {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Bookmark bookmark = null;
+
+ if (name != null) {
+ if (alias != null && !alias.isEmpty()) {
+ Criteria criteria = Search.query().eq(Bookmark.FQ_FIELD_ALIAS, alias).criteria();
+
+ if (proxy.findByCriteria(Bookmark.class, criteria) != null) {
+ alias = "";
+ }
+ }
+ bookmark = BookmarkActions.createBookmark(link, name, tags, (User)session.get("user"), alias, null);
+ } else { //This part is for the bookmark addition by script
+ if (nameAndTags != null) {
+ bookmark = BookmarkActions.createBookmark(link, nameAndTags, (User)session.get("user"));
+ }
+ }
+ if (bookmark != null && !bookmark.getDescription().isEmpty() && !bookmark.getEmail().isEmpty()) {
+ proxy.store(bookmark); //Stores the bookmark if everything is ok
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,210 @@
package org.chorem.bow.action;
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.Preference;
+import org.chorem.bow.User;
+import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class ChangePreferencesAction extends ActionSupport{
+public class ChangePreferencesAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = -1923646256914239581L;
+ protected String colors;
+ protected String tagsNb;
+ protected String bookmarks;
+ protected String searchEngineUrlSuggestions;
+ protected String searchEngineUrlResults;
+ protected String email;
+ protected String newPassword;
+ protected String currentPassword;
+ protected String confirmNewPassword;
+ protected Map<String, Object> session;
-}
+ /**
+ * @return the colors
+ */
+ public String getColors() {
+ return colors;
+ }
+
+ /**
+ * @param colors the colors to set
+ */
+ public void setColors(String colors) {
+ this.colors = colors;
+ }
+
+ /**
+ * @return the tagsNb
+ */
+ public String getTagsNb() {
+ return tagsNb;
+ }
+
+ /**
+ * @param tagsNb the tagsNb to set
+ */
+ public void setTagsNb(String tagsNb) {
+ this.tagsNb = tagsNb;
+ }
+
+ /**
+ * @return the bookmarks
+ */
+ public String getBookmarks() {
+ return bookmarks;
+ }
+
+ /**
+ * @param bookmarks the bookmarks to set
+ */
+ public void setBookmarks(String bookmarks) {
+ this.bookmarks = bookmarks;
+ }
+
+ /**
+ * @return the searchEngineUrlSuggestions
+ */
+ public String getSearchEngineUrlSuggestions() {
+ return searchEngineUrlSuggestions;
+ }
+
+ /**
+ * @param searchEngineUrlSuggestions the searchEngineUrlSuggestions to set
+ */
+ public void setSearchEngineUrlSuggestions(String searchEngineUrlSuggestions) {
+ this.searchEngineUrlSuggestions = searchEngineUrlSuggestions;
+ }
+
+ /**
+ * @return the searchEngineUrlResults
+ */
+ public String getSearchEngineUrlResults() {
+ return searchEngineUrlResults;
+ }
+
+ /**
+ * @param searchEngineUrlResults the searchEngineUrlResults to set
+ */
+ public void setSearchEngineUrlResults(String searchEngineUrlResults) {
+ this.searchEngineUrlResults = searchEngineUrlResults;
+ }
+
+ /**
+ * @return the email
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * @param email the email to set
+ */
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ /**
+ * @return the newPassword
+ */
+ public String getNewPassword() {
+ return newPassword;
+ }
+
+ /**
+ * @param newPassword the newPassword to set
+ */
+ public void setNewPassword(String newPassword) {
+ this.newPassword = newPassword;
+ }
+
+ /**
+ * @return the currentPassword
+ */
+ public String getCurrentPassword() {
+ return currentPassword;
+ }
+
+ /**
+ * @param currentPassword the currentPassword to set
+ */
+ public void setCurrentPassword(String currentPassword) {
+ this.currentPassword = currentPassword;
+ }
+
+ /**
+ * @return the confirmNewPassword
+ */
+ public String getConfirmNewPassword() {
+ return confirmNewPassword;
+ }
+
+ /**
+ * @param confirmNewPassword the confirmNewPassword to set
+ */
+ public void setConfirmNewPassword(String confirmNewPassword) {
+ this.confirmNewPassword = confirmNewPassword;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ protected Preference changePreference() {
+ Preference preference = (Preference)session.get("preference");
+
+ preference.setColors(colors);
+ preference.setTags(Integer.valueOf(tagsNb));
+ preference.setBookmarks(Integer.valueOf(bookmarks));
+ preference.setSearchEngineUrlSuggestions(searchEngineUrlSuggestions);
+ preference.setSearchEngineUrlResults(searchEngineUrlResults);
+
+ return preference;
+ }
+
+ protected User changeUser(User newUser)
+ throws NoSuchAlgorithmException {
+ if (email != null && !email.isEmpty()) {
+ newUser.setEmail(email);
+ }
+ if (newPassword != null && confirmNewPassword != null && currentPassword != null) {
+ if (!newPassword.isEmpty() && !confirmNewPassword.isEmpty() && !currentPassword.isEmpty()) {
+ if (newPassword.equals(confirmNewPassword)) {
+ currentPassword = StringUtil.encodeMD5(currentPassword);
+ if (currentPassword.equals(newUser.getPassword())) {
+ String md5 = StringUtil.encodeMD5(newPassword);
+ newUser.setPassword(md5);
+ }
+ }
+ }
+ }
+ return newUser;
+ }
+
+ @Override
+ public String execute() {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Preference preference = changePreference();
+ proxy.store(preference);
+
+ User newUser = proxy.restore(User.class, ((User)session.get("user")).getWikittyId());
+ try {
+ newUser = changeUser(newUser);
+ } catch (NoSuchAlgorithmException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ newUser = proxy.store(newUser);
+ session.put("user", newUser);
+
+ preference = proxy.restore(Preference.class, newUser.getWikittyId());
+ session.put("preference", preference);
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,61 @@
package org.chorem.bow.action;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.Import;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Element;
+import org.nuiton.wikitty.search.Search;
+
import com.opensymphony.xwork2.ActionSupport;
-public class DeleteImportAction extends ActionSupport{
+public class DeleteImportAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 8714394293884265516L;
-
-}
+ protected String date;
+ protected Map<String, Object> session;
+
+ /**
+ * @return the date
+ */
+ public String getDate() {
+ return date;
+ }
+ /**
+ * @param date the date to set
+ */
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public String execute() {
+ if (date != null) {
+ WikittyProxy proxy = BowProxy.getInstance();
+
+ if (date.matches("[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{1,3}Z")) {
+ Criteria criteria = Search.query().eq(Element.ELT_EXTENSION, Import.EXT_IMPORT).eq(Bookmark.FQ_FIELD_EMAIL, ((User)session.get("user")).getEmail()).
+ eq(Import.FQ_FIELD_DATE, date).criteria();
+ List<Import> bookmarks = proxy.findAllByCriteria(Import.class, criteria).getAll();
+ List<String> ids = new ArrayList<String>();
+
+ for (Import bookmark : bookmarks) {
+ ids.add(bookmark.getWikittyId());
+ }
+ proxy.delete(ids);
+ }
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,81 @@
package org.chorem.bow.action;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BowBookmark;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
import com.opensymphony.xwork2.ActionSupport;
-public class DeleteSearchResultsAction extends ActionSupport{
+public class DeleteSearchResultsAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = -3903724044644625507L;
+ protected String searchLine;
+ protected String fullTextLine;
+ protected Map<String, Object> session;
-}
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ /**
+ * @return the fullTextLine
+ */
+ public String getFullTextLine() {
+ return fullTextLine;
+ }
+
+ /**
+ * @param fullTextLine the fullTextLine to set
+ */
+ public void setFullTextLine(String fullTextLine) {
+ this.fullTextLine = fullTextLine;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public String execute() {
+ if (searchLine != null && fullTextLine != null) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria;
+
+ if (fullTextLine.isEmpty()) {
+ criteria = BowBookmark.getBookmarkListCriteriaByUser((User)session.get("user"), searchLine);
+ } else {
+ criteria = Search.query().keyword(fullTextLine).eq(Bookmark.FQ_FIELD_EMAIL, ((User)session.get("user")).getEmail()).criteria().addFacetField(Bookmark.FQ_FIELD_TAGS);
+ }
+ List<Bookmark> bookmarks = proxy.findAllByCriteria(Bookmark.class, criteria).getAll();
+ List<String> ids = new ArrayList<String>();
+
+ for (Bookmark bookmark : bookmarks) {
+ if (searchLine.isEmpty() && bookmark.getTags() == null || !searchLine.isEmpty() ||
+ fullTextLine.isEmpty() && bookmark.getTags() == null || !fullTextLine.isEmpty()) {
+ ids.add(bookmark.getWikittyId());
+ }
+ }
+ proxy.delete(ids);
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,54 @@
package org.chorem.bow.action;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BowProxy;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class DeleteTagAction extends ActionSupport{
+public class DeleteTagAction extends ActionSupport {
private static final long serialVersionUID = -6174966873862161966L;
+ protected String bookmarkId;
+ protected String deleteTag;
-}
+ /**
+ * @return the bookmarkId
+ */
+ public String getBookmarkId() {
+ return bookmarkId;
+ }
+ /**
+ * @param bookmarkId the bookmarkId to set
+ */
+ public void setBookmarkId(String bookmarkId) {
+ this.bookmarkId = bookmarkId;
+ }
+ /**
+ * @return the deleteTag
+ */
+ public String getDeleteTag() {
+ return deleteTag;
+ }
+ /**
+ * @param deleteTag the deleteTag to set
+ */
+ public void setDeleteTag(String deleteTag) {
+ this.deleteTag = deleteTag;
+ }
+
+ @Override
+ public String execute() {
+ if (deleteTag != null && bookmarkId != null) {
+ if (!bookmarkId.isEmpty()) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId);
+
+ if (bookmark != null) {
+ bookmark.removeTags(deleteTag);
+ proxy.store(bookmark);
+ }
+ }
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,97 @@
package org.chorem.bow.action;
+import java.io.IOException;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BookmarkActions;
+import org.chorem.bow.BowInit;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.BowSearch;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class EditBookmarkAction extends ActionSupport{
+public class EditBookmarkAction extends ActionSupport implements SessionAware, ServletRequestAware {
private static final long serialVersionUID = 2706590901233864637L;
+ protected String bookmarkId;
+ protected String searchLine;
+ protected Map<String, Object> session;
+ protected HttpServletRequest request;
-}
+ /**
+ * @return the bookmarkId
+ */
+ public String getBookmarkId() {
+ return bookmarkId;
+ }
+
+ /**
+ * @param bookmarkId the bookmarkId to set
+ */
+ public void setBookmarkId(String bookmarkId) {
+ this.bookmarkId = bookmarkId;
+ }
+
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public String execute() {
+ if (bookmarkId != null && !bookmarkId.isEmpty()) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId);
+
+ if (bookmark != null) {
+ request.setAttribute("link", bookmark.getLink());
+ request.setAttribute("name", bookmark.getDescription());
+ request.setAttribute("alias", bookmark.getAlias());
+ request.setAttribute("tags", BookmarkActions.getBookmarkTagsString(bookmark));
+ request.setAttribute("action", "bow?action=modifyBookmark");
+ request.setAttribute("bookmarkId", bookmarkId);
+ }
+ }
+ if (searchLine == null) {
+ BowInit.initHomePage(request, (User)session.get("user"));
+ return NONE;
+ } else {
+ try {
+ BowSearch.search(request, (User)session.get("user"));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ServletException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return SUCCESS;
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,60 @@
package org.chorem.bow.action;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts2.interceptor.ServletResponseAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BookmarkActions;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
import com.opensymphony.xwork2.ActionSupport;
-public class ExportBookmarksAction extends ActionSupport{
+public class ExportBookmarksAction extends ActionSupport implements SessionAware, ServletResponseAware {
private static final long serialVersionUID = 45880214686011946L;
+ protected Map<String, Object> session;
+ protected HttpServletResponse response;
-}
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public void setServletResponse(HttpServletResponse response) {
+ 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();
+ List<Bookmark> bookmarks = proxy.findAllByCriteria(Bookmark.class, criteria).getAll();
+ String export = BookmarkActions.getExportHtmlBookmark(bookmarks);
+ byte[] buff = export.getBytes();
+ ServletOutputStream op;
+
+ try {
+ op = response.getOutputStream();
+ response.setContentType("application/octet-stream");
+ response.setHeader("Content-Disposition", "attachment; filename=\"bookmarks.html\"");
+ response.setContentLength(buff.length);
+ op.write(buff, 0, buff.length);
+ op.flush();
+ op.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java (from rev 152, trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java)
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -0,0 +1,86 @@
+package org.chorem.bow.action;
+
+import java.util.List;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.AddressException;
+
+import org.apache.commons.lang.RandomStringUtils;
+import org.chorem.bow.BowMail;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.User;
+import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class ForgotPasswordAction extends ActionSupport{
+ private static final long serialVersionUID = -8207951465957204954L;
+ protected String email;
+
+ /**
+ * @return the email
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * @param email the email to set
+ */
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ protected boolean passwordExists(String password) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = Search.query().eq(User.FQ_FIELD_PASSWORD, password).criteria();
+ List<User> users = proxy.findAllByCriteria(User.class, criteria).getAll();
+ if (users != null && users.size() > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ public String execute() {
+ if (email != null) {
+ email = email.trim();
+ if (!email.isEmpty()) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = Search.query().eq(User.FQ_FIELD_EMAIL, email).criteria();
+ User user = proxy.findByCriteria(User.class, criteria);
+ if (user != null) {
+ boolean bool = true;
+ String password = "";
+ String md5 = "";
+
+ while (bool) {
+ password = RandomStringUtils.randomAlphanumeric(20);
+ md5 = StringUtil.encodeMD5(password);
+ bool = passwordExists(md5);
+ }
+ String mailContent;
+
+ mailContent = getText("mailHi") + "\n\n" + getText("mailPwd") + password + "\n\n" + getText("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
+ } catch (AddressException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (MessagingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ user.setPassword(md5);
+ proxy.store(user);
+ return SUCCESS;
+ } else {
+ addFieldError("email", getText("emailDoesntExist"));
+ }
+ }
+ }
+ return INPUT;
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/org/chorem/bow/action/ForgotPasswordAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,62 @@
package org.chorem.bow.action;
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.Token;
+import org.chorem.bow.TokenActions;
+import org.chorem.bow.TokenImpl;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
import com.opensymphony.xwork2.ActionSupport;
-public class GenerateTokenAction extends ActionSupport{
+public class GenerateTokenAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 1141019772989666309L;
+ protected Map<String, Object> session;
-}
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public String execute() {
+ WikittyProxy proxy = BowProxy.getInstance();
+ User user = (User)session.get("user");
+ Criteria criteria = Search.query().eq(Token.FQ_FIELD_EMAIL, user.getEmail()).criteria();
+ Token currentToken = proxy.findByCriteria(Token.class, criteria);
+ if (currentToken != null) {
+ String id = currentToken.getWikittyId();
+ proxy.delete(id);
+ }
+ TokenActions tokenActions = (TokenActions)session.get("tokenActions");
+
+ if (tokenActions != null) {
+ String token;
+ try {
+ token = tokenActions.generateToken(); //Generates an encoding MD5 token
+ criteria = Search.query().eq(Token.FQ_FIELD_TOKEN, token).criteria();
+ Token oldToken = proxy.findByCriteria(Token.class, criteria);
+
+ if (oldToken == null) { //Checks if the token already exists
+ TokenImpl newToken = new TokenImpl();
+ newToken.setToken(token);
+ newToken.setEmail(user.getEmail());
+ proxy.store((Token) newToken); //If the token doesn't exist, it is stored
+ tokenActions.setPermanentToken(token);
+ } else {
+ tokenActions.setPermanentToken("");
+ }
+ } catch (NoSuchAlgorithmException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,171 @@
package org.chorem.bow.action;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BookmarkActions;
+import org.chorem.bow.BowInit;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.BowSearch;
+import org.chorem.bow.Import;
+import org.chorem.bow.User;
+import org.htmlparser.Node;
+import org.htmlparser.Parser;
+import org.htmlparser.util.NodeList;
+import org.htmlparser.util.ParserException;
+import org.htmlparser.util.SimpleNodeIterator;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class ImportBookmarksAction extends ActionSupport{
+public class ImportBookmarksAction extends ActionSupport implements SessionAware, ServletRequestAware {
private static final long serialVersionUID = -5962680416570797028L;
+ protected Map<String, Object> session;
+ protected HttpServletRequest request;
-}
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ protected void createImportExtension(List<Bookmark> bookmarks) {
+ if (bookmarks != null && !bookmarks.isEmpty()) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ List<String> ids = new ArrayList<String>();
+
+ for (Bookmark bookmark : bookmarks) {
+ String id = bookmark.getWikittyId();
+ ids.add(id);
+ }
+ Date date = new Date();
+ List<Import> imports = proxy.restore(Import.class, ids);
+
+ for (Import imp : imports) {
+ imp.setDate(date);
+ }
+ proxy.store(imports);
+ }
+ }
+
+ protected void parseHtmlToBookmarks(NodeList list, User user, List<Bookmark> bookmarks, List<String> tagList)
+ throws ParserException {
+ if (list != null) {
+ boolean isFolder = false;
+ SimpleNodeIterator it = list.elements();
+
+ while (it.hasMoreNodes()) {
+ Node node = it.nextNode();
+ String plainText = node.toPlainTextString(); //The text between two heads ==> <toto>plainText</toto>
+ String text = node.getText(); //The text in the head ==> <text></toto>
+
+ if (text != null && text.startsWith("H3")) { // H3 = folder
+ if (plainText != null && !plainText.isEmpty()) {
+ tagList.add(plainText); //Adds the folder name to the tagList
+ isFolder = true;
+ }
+ } else if (text != null && text.startsWith("A HREF")) { // HREF = new bookmarks
+ Bookmark bookmark = BookmarkActions.createBookmarkFromHtml(text, plainText, user);
+ BookmarkActions.addTagsToBookmark(tagList, bookmark);
+
+ if (bookmark != null) {
+ bookmarks.add(bookmark);
+ }
+ }
+ NodeList children = node.getChildren();
+
+ if (children != null) {
+ parseHtmlToBookmarks(children, user, bookmarks, tagList); //If there is an under node = recursion
+ }
+ }
+ if (isFolder) { //If we find a folder, we have to remove it
+ int index = tagList.size() - 1;
+
+ if (index > -1) {
+ tagList.remove(index);
+ }
+ }
+ }
+ }
+
+ @Override
+ public String execute() {
+ // Check that we have a file upload request
+ boolean isMultipart = ServletFileUpload.isMultipartContent(request);
+
+ if (isMultipart) {
+ // Create a factory for disk-based file items
+ DiskFileItemFactory factory = new DiskFileItemFactory();
+ // Create a new file upload handler
+ ServletFileUpload upload = new ServletFileUpload(factory);
+ // Process the uploaded items
+ // Parse the request
+ List<?> items;
+ try {
+ items = upload.parseRequest(request);
+ } catch (FileUploadException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ return ERROR;
+ }
+ for (Object obj : items) {
+ FileItem item = (FileItem) obj;
+ if (!item.isFormField()) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ String content = item.getString();
+ User user = (User)session.get("user");
+
+ try {
+ Parser parser = new Parser(content);
+ NodeList list = parser.parse(null);
+ List<Bookmark> bookmarks = new ArrayList<Bookmark>();
+ parseHtmlToBookmarks(list, user, bookmarks, new ArrayList<String>());
+ bookmarks = proxy.store(bookmarks);
+ createImportExtension(bookmarks);
+ BowInit.initHomePage(request, user);
+ return SUCCESS;
+ }
+ catch (ParserException e) {
+ request.setAttribute("errorMsgUser", "Bad bookmarks file format, expected Netscape-like bookmarks file");
+ request.setAttribute("errorMsgTech", e.getMessage());
+
+ String searchLine = request.getParameter("searchLine");
+ if (searchLine == null) {
+ BowInit.initHomePage(request, user);
+ return "home";
+ } else {
+ try {
+ BowSearch.search(request, user);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ServletException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return "search";
+ }
+ }
+ }
+ }
+ }
+ return ERROR;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,108 @@
package org.chorem.bow.action;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BookmarkActions;
+import org.chorem.bow.BowProxy;
+import org.nuiton.wikitty.Criteria;
+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 ActionSupport {
private static final long serialVersionUID = 8197008295267924063L;
+ protected String url;
+ protected String name;
+ protected String alias;
+ protected String tags;
+ protected String bookmarkId;
-}
+ /**
+ * @return the url
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * @param url the url to set
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the alias
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * @param alias the alias to set
+ */
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ /**
+ * @return the tags
+ */
+ public String getTags() {
+ return tags;
+ }
+
+ /**
+ * @param tags the tags to set
+ */
+ public void setTags(String tags) {
+ this.tags = tags;
+ }
+
+ /**
+ * @return the bookmarkId
+ */
+ public String getBookmarkId() {
+ return bookmarkId;
+ }
+
+ /**
+ * @param bookmarkId the bookmarkId to set
+ */
+ public void setBookmarkId(String bookmarkId) {
+ this.bookmarkId = bookmarkId;
+ }
+
+ @Override
+ public String execute() {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId);
+
+ if (bookmark != null) {
+ if (alias != null && !alias.isEmpty()) {
+ Criteria criteria = Search.query().eq(Bookmark.FQ_FIELD_ALIAS, alias).criteria();
+
+ if (proxy.findByCriteria(Bookmark.class, criteria) != null) {
+ alias = bookmark.getAlias();
+ }
+ }
+ BookmarkActions.updateBookmark(bookmark, name, url, tags, alias);
+ proxy.store(bookmark);
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,154 @@
package org.chorem.bow.action;
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.ServletResponseAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BookmarkActions;
+import org.chorem.bow.BowBookmark;
+import org.chorem.bow.BowConfig;
+import org.chorem.bow.BowInit;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.Preference;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.PagedResult;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
import com.opensymphony.xwork2.ActionSupport;
-public class OpenSearchResultAction extends ActionSupport{
+public class OpenSearchResultAction extends ActionSupport implements SessionAware, ServletRequestAware, ServletResponseAware {
private static final long serialVersionUID = -1691325797986483856L;
+ protected String searchLine;
+ protected String token;
+ protected Map<String, Object> session;
+ protected HttpServletRequest request;
+ protected HttpServletResponse response;
-}
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ /**
+ * @return the token
+ */
+ public String getToken() {
+ return token;
+ }
+
+ /**
+ * @param token the token to set
+ */
+ public void setToken(String token) {
+ this.token = token;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public void setServletResponse(HttpServletResponse response) {
+ this.response = response;
+ }
+
+ //TODO : gérer toutes les redirections comme il faut avec Struts2
+ @Override
+ public String execute() {
+ User user = (User)session.get("user");
+
+ if (searchLine != null && searchLine.matches("^http://[^ ]*")) {
+ //response.sendRedirect(searchLine);
+ } else if (searchLine != null
+ && (searchLine.startsWith(":") || searchLine.startsWith("t:")) ) {
+ //On fait une recherche sur les tags
+
+ int index = searchLine.indexOf(":");
+ searchLine = searchLine.substring(index+1); //Suppresses first ":"
+
+ session.put("user", user);
+ try {
+ BowInit.initializeToken(session, user);
+ } catch (NoSuchAlgorithmException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = BowBookmark.getBookmarkListCriteriaByUser(user, searchLine);
+ criteria = criteria.addSortDescending(Bookmark.FQ_FIELD_CLICK);
+ PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria); //Retrieves bookmarks by search
+ BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, searchLine);
+ request.setAttribute("bookmarkActions", bookmarkActions);
+ request.setAttribute("token", token);
+ //request.getRequestDispatcher("search.jsp").forward(request, response);
+ } else if (searchLine != null && searchLine.startsWith("f:")) {
+ // recherche fulltext dans bow
+ String fullText = searchLine.substring(2);
+
+ session.put("user", user);
+ try {
+ BowInit.initializeToken(session, user);
+ } catch (NoSuchAlgorithmException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria;
+ if (!fullText.isEmpty()) {
+ criteria = Search.query().keyword(fullText).
+ eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).criteria().
+ addFacetField(Bookmark.FQ_FIELD_TAGS);
+
+ } else {
+ criteria = BowBookmark.getBookmarkListCriteriaByUser(user, null);
+ }
+ PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, null);
+ request.setAttribute("bookmarkActions", bookmarkActions);
+ request.setAttribute("token", token);
+ //request.getRequestDispatcher("search.jsp").forward(request, response);
+ } else if (searchLine != null && searchLine.startsWith("a:")) {
+ // on redirige vers l'alias demande
+ searchLine = searchLine.substring(2);
+ //response.sendRedirect(BowConfig.getInstance().getAliasUrl() + searchLine);
+ } else {
+ // on fait une recherche sur le moteur de recherche configure
+ WikittyProxy proxy = BowProxy.getInstance();
+ Preference pref = proxy.restore(Preference.class, user.getWikittyId());
+
+ String searchEngineURL = pref.getSearchEngineUrlResults();
+ if (searchEngineURL == null || "".equals(searchEngineURL)) {
+ BowConfig config = BowConfig.getInstance();
+ searchEngineURL = config.getSearchEngine();
+ }
+ searchEngineURL = searchEngineURL.replace("{searchTerms}", searchLine);
+ searchEngineURL = response.encodeRedirectURL(searchEngineURL);
+
+ //response.sendRedirect(searchEngineURL);
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,91 @@
package org.chorem.bow.action;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.OpenSearchActions;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.FacetTopic;
+import org.nuiton.wikitty.PagedResult;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
import com.opensymphony.xwork2.ActionSupport;
-public class OpenSearchSuggestionAction extends ActionSupport{
+public class OpenSearchSuggestionAction extends ActionSupport implements SessionAware, ServletRequestAware {
private static final long serialVersionUID = 3973618635494129146L;
+ protected Map<String, Object> session;
+ protected String searchLine;
+ protected HttpServletRequest request;
-}
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public String execute() {
+ User user = (User)session.get("user");
+
+ if (user != null) {
+ if (searchLine != null) {
+ OpenSearchActions openSearchActions = new OpenSearchActions();
+ WikittyProxy proxy = BowProxy.getInstance();
+ String[] words = searchLine.split("\\s+");
+ List<String> searchLineList = new ArrayList<String>(Arrays.asList(words));
+
+ if (searchLine.charAt(searchLine.length() - 1) == ' ') {
+ searchLineList.add(""); //If the user doesn't type anything, we have to propose suggestions
+ }
+ Criteria criteria;
+
+ if (searchLineList.size() > 1) {
+ List<String> cpy = new ArrayList<String>(searchLineList);
+ cpy.remove(cpy.size() - 1);
+ criteria = Search.query().eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).
+ eq(Bookmark.FQ_FIELD_TAGS, cpy).criteria().addFacetField(Bookmark.FQ_FIELD_TAGS);
+ } else {
+ criteria = Search.query().eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).
+ criteria().addFacetField(Bookmark.FQ_FIELD_TAGS);
+ }
+ PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ List<Bookmark> bookList = result.getAll();
+ List<FacetTopic> topics = result.getTopic(Bookmark.FQ_FIELD_TAGS);
+
+ openSearchActions.setBookmarkList(bookList);
+ openSearchActions.setSuggestionList(topics);
+ openSearchActions.findSuggestions(searchLineList);
+ request.setAttribute("openSearchAction", openSearchActions);
+ }
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/OrderAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/OrderAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/OrderAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,97 @@
package org.chorem.bow.action;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BookmarkActions;
+import org.chorem.bow.BowBookmark;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.PagedResult;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class OrderAction extends ActionSupport{
+public class OrderAction extends ActionSupport implements SessionAware, ServletRequestAware {
private static final long serialVersionUID = 203690999710176818L;
+ protected Map<String, Object> session;
+ protected String type;
+ protected String searchLine;
+ protected HttpServletRequest request;
-}
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @param type the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public String execute() {
+ Criteria baseCriteria = BowBookmark.getBookmarkListCriteriaByUser((User)session.get("user"), searchLine);
+
+ if (type != null && baseCriteria != null && !type.isEmpty()) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ PagedResult<Bookmark> result = null;
+
+ if (type.equals("ascName")) {
+ Criteria criteria = baseCriteria.addSortAscending(Bookmark.FQ_FIELD_DESCRIPTION);
+ result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ } else if (type.equals("ascDate")) {
+ Criteria criteria = baseCriteria.addSortAscending(Bookmark.FQ_FIELD_DATE);
+ result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ } else if (type.equals("ascClick")) {
+ Criteria criteria = baseCriteria.addSortAscending(Bookmark.FQ_FIELD_CLICK);
+ result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ } else if (type.equals("descName")) {
+ Criteria criteria = baseCriteria.addSortDescending(Bookmark.FQ_FIELD_DESCRIPTION);
+ result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ } else if (type.equals("descDate")) {
+ Criteria criteria = baseCriteria.addSortDescending(Bookmark.FQ_FIELD_DATE);
+ result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ } else if (type.equals("descClick")) {
+ Criteria criteria = baseCriteria.addSortDescending(Bookmark.FQ_FIELD_CLICK);
+ result = proxy.findAllByCriteria(Bookmark.class, criteria);
+ }
+ BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, searchLine);
+ request.setAttribute("bookmarkActions", bookmarkActions);
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,29 @@
package org.chorem.bow.action;
+import java.util.Map;
+
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.BowProxy;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class ReIndexationAction extends ActionSupport{
+public class ReIndexationAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 6226574522402739559L;
+ protected Map<String, Object> session;
-}
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public String execute() {
+ if ((Boolean)session.get("admin")) { //If is admin
+ WikittyProxy proxy = BowProxy.getInstance();
+
+ proxy.getWikittyService().syncEngin(proxy.getSecurityToken());
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/chorem/bow/action/RegisterAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/RegisterAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/RegisterAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -2,20 +2,13 @@
import java.security.NoSuchAlgorithmException;
import java.util.Map;
-import java.util.Properties;
-
-import javax.mail.Message;
import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.Transport;
import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.SessionAware;
-import org.chorem.bow.BowConfig;
+import org.chorem.bow.BowMail;
import org.chorem.bow.BowProxy;
import org.chorem.bow.User;
import org.chorem.bow.UserImpl;
@@ -106,29 +99,6 @@
return true;
}
- protected void sendMail() throws AddressException, MessagingException {
- BowConfig config = BowConfig.getInstance();
- String smtpServer = config.getSmtpServer();
- Properties properties = new Properties();
- properties.put("mail.smtp.host", smtpServer);
-
- Session session = Session.getDefaultInstance(properties, null);
- session.setDebug(true);
-
- Message msg = new MimeMessage(session);
-
- msg.addRecipient(Message.RecipientType.TO, new InternetAddress(email));
- msg.setFrom(new InternetAddress(config.getAddressFrom()));
- msg.setSubject(getText("mailSubject"));
-
- String messageBody = getText("mailHi") + "\n\n" +
- getText("mailPwd") + password + "\n" +
- getText("mailEmail") + email + "\n\n";
- msg.setContent(messageBody, "text/plain");
-
- Transport.send(msg);
- }
-
public String execute() {
if (email != null) {
email = email.trim();
@@ -154,7 +124,10 @@
}
BowInit.initHomePage(request, login);
try {
- sendMail();
+ 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
} catch (AddressException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Modified: trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,45 @@
package org.chorem.bow.action;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BowProxy;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class RemoveBookmarkAction extends ActionSupport{
+public class RemoveBookmarkAction extends ActionSupport {
private static final long serialVersionUID = 820566716695285561L;
+ protected String bookmarkId;
-}
+ /**
+ * @return the bookmarkId
+ */
+ public String getBookmarkId() {
+ return bookmarkId;
+ }
+
+ /**
+ * @param bookmarkId the bookmarkId to set
+ */
+ public void setBookmarkId(String bookmarkId) {
+ this.bookmarkId = bookmarkId;
+ }
+
+ @Override
+ public String execute() {
+ if (bookmarkId != null && !bookmarkId.isEmpty()) {
+ try {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Bookmark bookmark = proxy.restore(Bookmark.class, bookmarkId);
+
+ if (bookmark != null) {
+ proxy.delete(bookmarkId);
+ }
+ } catch (Exception eee) {
+ //TODO: log
+ //log.error("Can't do action", eee);
+ }
+ }
+// redirectToTheGoodPage(request, response);
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Deleted: trunk/src/main/java/org/chorem/bow/action/RightMenuAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/RightMenuAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/RightMenuAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,11 +0,0 @@
-package org.chorem.bow.action;
-
-import com.opensymphony.xwork2.ActionSupport;
-
-public class RightMenuAction extends ActionSupport {
- private static final long serialVersionUID = -1167431751227151402L;
-
- public String execute() {
- return SUCCESS;
- }
-}
Modified: trunk/src/main/java/org/chorem/bow/action/SearchAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/SearchAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/SearchAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +1,117 @@
package org.chorem.bow.action;
+import java.io.IOException;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.Bookmark;
+import org.chorem.bow.BookmarkActions;
+import org.chorem.bow.BowBookmark;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.BowSearch;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.PagedResult;
+import org.nuiton.wikitty.WikittyProxy;
+
import com.opensymphony.xwork2.ActionSupport;
-public class SearchAction extends ActionSupport{
+public class SearchAction extends ActionSupport implements SessionAware, ServletRequestAware {
private static final long serialVersionUID = -2161661766242362907L;
+ protected Map<String, Object> session;
+ protected String searchLine;
+ protected String fullTextLine;
+ protected String addTag;
+ protected HttpServletRequest request;
-}
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ /**
+ * @return the searchLine
+ */
+ public String getSearchLine() {
+ return searchLine;
+ }
+
+ /**
+ * @param searchLine the searchLine to set
+ */
+ public void setSearchLine(String searchLine) {
+ this.searchLine = searchLine;
+ }
+
+ /**
+ * @return the fullTextLine
+ */
+ public String getFullTextLine() {
+ return fullTextLine;
+ }
+
+ /**
+ * @param fullTextLine the fullTextLine to set
+ */
+ public void setFullTextLine(String fullTextLine) {
+ this.fullTextLine = fullTextLine;
+ }
+
+ /**
+ * @return the addTag
+ */
+ public String getAddTag() {
+ return addTag;
+ }
+
+ /**
+ * @param addTag the addTag to set
+ */
+ public void setAddTag(String addTag) {
+ this.addTag = addTag;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public String execute() {
+ User user = (User)session.get("user");
+
+ if (searchLine == null) {
+ searchLine = "";
+ }
+ if (fullTextLine != null && !fullTextLine.isEmpty() && searchLine.isEmpty()) {
+ try {
+ BowSearch.fullText(request, user);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ServletException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } else {
+ if (addTag != null && !addTag.isEmpty()) {
+ if (searchLine.isEmpty()) {
+ searchLine = addTag;
+ } else {
+ searchLine += " " + addTag;
+ }
+ }
+ 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);
+ }
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Deleted: trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java 2010-12-30 14:45:38 UTC (rev 153)
@@ -1,8 +0,0 @@
-package org.chorem.bow.action;
-
-import com.opensymphony.xwork2.ActionSupport;
-
-public class SendPasswordAction extends ActionSupport{
- private static final long serialVersionUID = -8207951465957204954L;
-
-}
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/resources/struts.xml 2010-12-30 14:45:38 UTC (rev 153)
@@ -8,14 +8,12 @@
<package name="myPackage" extends="struts-default">
<action name="register_*" method="{1}" class="org.chorem.bow.action.RegisterAction">
<result name="input">/jsp/register.jsp</result>
- <result type="redirect">/jsp/home.jsp</result>
+ <result type="redirect">/home.action</result>
</action>
- <action name="registration">
- <result>/jsp/register.jsp</result>
+ <action name="forgotPassword_*" method="{1}" class="org.chorem.bow.action.ForgotPasswordAction">
+ <result name="input">/jsp/forgotPassword.jsp</result>
+ <result>/home.action</result>
</action>
- <action name="forgotPassword">
- <result>/jsp/forgotPassword.jsp</result>
- </action>
<action name="locale" class="org.chorem.bow.action.LocaleAction">
<result type="redirect">/jsp/login.jsp</result>
@@ -25,7 +23,7 @@
<result type="redirect">/home.action</result>
</action>
<action name="logout" class="org.chorem.bow.action.LogoutAction">
- <result type="redirect">/jsp/login.jsp</result>
+ <result type="redirect">/login_input.action</result>
</action>
<action name="home" class="org.chorem.bow.action.HomeAction">
<result name="login" type="redirect">/login_input.action</result>
@@ -34,10 +32,6 @@
<action name="addUrl" class="org.chorem.bow.action.AddUrlAction">
<!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
</action>
- <action name="sendPassword" class="org.chorem.bow.action.SendPasswordAction">
- <result name="input">/jsp/forgotPassword.jsp</result>
- <result>/jsp/login.jsp</result>
- </action>
</package>
<package name="bookmark" extends="struts-default">
@@ -72,6 +66,7 @@
<result>/jsp/search.jsp</result>
</action>
<action name="addClick" class="org.chorem.bow.action.AddClickAction">
+ <result name="error" type="redirect">/home.action</result>
<result type="redirect">${link}<!--???--></result>
</action>
<!-- temporary, permanent -->
Added: trunk/src/main/webapp/jsp/forgotPassword.jsp
===================================================================
--- trunk/src/main/webapp/jsp/forgotPassword.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/forgotPassword.jsp 2010-12-30 14:45:38 UTC (rev 153)
@@ -0,0 +1,45 @@
+<!--
+ #%L
+ bow
+
+ $Id: forgotPassword.jsp 144 2010-12-23 10:24:48Z bpoussin $
+ $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/forgotPassword.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"%>
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+ <head>
+ <link href="<s:url value='/css/connexion.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">
+ <p>
+ <s:textfield key="email" name="email" label="%{getText('email')}" />
+ <s:submit value="%{getText('submit')}" />
+ </p>
+ </s:form>
+ <a href="<%= request.getContextPath() %>" class="register"><s:property value="%{getText('loginPage')}" /></a>
+ </div>
+ </div>
+ </body>
+</html>
Property changes on: trunk/src/main/webapp/jsp/forgotPassword.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/src/main/webapp/jsp/login.jsp
===================================================================
--- trunk/src/main/webapp/jsp/login.jsp 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/webapp/jsp/login.jsp 2010-12-30 14:45:38 UTC (rev 153)
@@ -28,7 +28,7 @@
<s:a href="%{localeEN}">English</s:a><br />
<s:a href="%{localeFR}">French</s:a><br />
- <a href="<%= request.getContextPath() %>/registration.action" id="register"><s:property value="%{getText('register')}" /></a>
+ <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>
</div>
</div>
Modified: trunk/src/main/webapp/jsp/register.jsp
===================================================================
--- trunk/src/main/webapp/jsp/register.jsp 2010-12-28 09:40:42 UTC (rev 152)
+++ trunk/src/main/webapp/jsp/register.jsp 2010-12-30 14:45:38 UTC (rev 153)
@@ -32,14 +32,14 @@
<div id="content">
<div id="formFrame">
<h1><s:property value="%{getText('register')}" /></h1>
- <form method="post" action="/bow/register.action">
+ <s:form action="/bow/register.action">
<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')}" />
</p>
- </form>
+ </s:form>
<a href="<%= request.getContextPath() %>" id="register"><s:property value="%{getText('loginPage')}" /></a>
</div>
</div>
1
0
28 Dec '10
Author: kmorin
Date: 2010-12-28 10:40:42 +0100 (Tue, 28 Dec 2010)
New Revision: 152
Url: http://chorem.org/repositories/revision/bow/152
Log:
- Anomalie #272 : done
Modified:
trunk/src/main/webapp/extensions/bow4chromium.crx
trunk/src/main/webapp/extensions/bow4chromium.pem
trunk/src/main/webapp/extensions/chromium/background.html
trunk/src/main/webapp/extensions/chromium/popup.html
Modified: trunk/src/main/webapp/extensions/bow4chromium.crx
===================================================================
(Binary files differ)
Modified: trunk/src/main/webapp/extensions/bow4chromium.pem
===================================================================
--- trunk/src/main/webapp/extensions/bow4chromium.pem 2010-12-24 18:24:46 UTC (rev 151)
+++ trunk/src/main/webapp/extensions/bow4chromium.pem 2010-12-28 09:40:42 UTC (rev 152)
@@ -1,16 +1,16 @@
-----BEGIN PRIVATE KEY-----
-MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKpiR1Q4LSM+VsHQY
-lSXoJlltVAlikujpb1rokmyTAgkCakd3kmUWUETQbTsvv2PNjn0vwNUuNXdi4R45X
-iU6HxJ2ooDJ0bTQXRmvB9a5nqDFriZpFTvErqeZwVmJQTSvohGGMNw6F0UMOMXERe
-PRWuHS1/JkfzqLJ3qUpRUmL7NAgMBAAECgYADhH3mfjZoWNwfqjatemflYtUob234
-e8trKrKyBM1PCbdtV2GEcVyaXFRp8M1MnM1IywW6guBCAg3kUT6ji6d1CMklSHmFa
-H2jvvZSuXWIm8ToTMylxPbooSNGw5aCB+L1mQ5ADnKxb5r4PZ2omMsx/ALg3ILdOX
-qeIzrVHzOngQJBAN6uBidQJxmanxNgGypoz544fMu0UbxGdZHuKLUKQWJMn5lawYo
-730LsDxLozofH16ZrBvfPRUqGEWwkDp4jYq0CQQDD4QHxouyi8AMwiClQy/zDqKyg
-6mr1XajAzmc39Y+14vbc1ICKAjmlS6s5uP1zACyH+Vi+5EHe4FSEDYiLXHChAkAkc
-A2JuU/snKSTIxLO6b+vgEbLfoIxcMYkTvhSR49Tan5jNbqdyBZMeRwuV/ITvdvH25
-OUUVJhU3beXzgVIG0xAkEAmLedZF+6T28BjZ0bWTsxXvrrXKpnqdXT9D74itCRsyW
-5goLLlM4XU6CjZuWr9TV1gq4NWwdrs/EC89H5W24/AQJBANIrMnqdFwSDcviRKlyg
-rKhtkt5Txd4lVt8PGQi/d4RIJJ0rSEd5/DFXdhQM8tWDHSYspaxJQEqak0bzvFFMN
-uQ=
+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJjmILwD7CIl3TGVv
+uILgGeyqBAI4eKv5jTWm481o1l1d3rcZgf1dpcXPkDTaEs/EcKAN8RG2c5R9dY6h5
+im2R4ERH1CqWJwfdpg7nwnuFFtlkAvzNLruUe5C15dg9yexnRYR35i/5ihJp0iwEx
+ZEfwYWNH5YI7i9x2heTV8U1HLAgMBAAECgYAwiKQNamVTNZev/KuZzzLUN9a3OEqT
+jWhSj2jTnaAbbnkdq8ZLcnRRY5RkOXcao4t8pPyOtjq/Di8t8GhIYXX7Xp01BXpM3
+11R1a8oz5IAOiCAyiOWZ7g5Y4mNSmarzKrZjha/00DgMfILRT1rSKo8t7+MjBt7on
+y3UKzkLS/AmQJBAMgMMw8IunMgYE+vmKblauSLghD4BATmV0qmRQItsQaxpL56WAP
+kN+TBNM8V+YpwCdS+L0ej4CLiKe+oY72ufbcCQQDDqf0b5dX02Np/GcSYFZa62OrC
+JplUiSnzt8wDwYACLMe2pIdz7qcUKLMkr2Y8twWMMYCfmQXzTpuK4JKdSIyNAkB72
+LmffBrZ/VhC3QYXhP55QTkjwjfSxLuT9n3QjHMFHuNMHTfyKM7FqytDbWpQ323mrF
+te8cBoODYYLdqZ6rXfAkAuaQ7BZEXYuuswxLLuBAjprvQYM0GhXJuX1JvOtEIhwe9
+pMiNy60O0M2cyp2wPsLXfKArDUG+p45ZfXZ9JMWEtAkEAkIKZtSUxsHy+uYxXK2mi
+DeZYNKk51vfP7/cVM8b6o47A/kxFLk4eRV3BjVzDLRb/tV+L5436jTOkmIHUnjNHP
+A==
-----END PRIVATE KEY-----
Modified: trunk/src/main/webapp/extensions/chromium/background.html
===================================================================
--- trunk/src/main/webapp/extensions/chromium/background.html 2010-12-24 18:24:46 UTC (rev 151)
+++ trunk/src/main/webapp/extensions/chromium/background.html 2010-12-28 09:40:42 UTC (rev 152)
@@ -24,21 +24,33 @@
<html>
<head>
<script>
- var tabTitle;
- var tabUrl;
+ var tabInfos = new Array();
+ var currentTabId;
+ function getTabInfos() {
+ return tabInfos[currentTabId];
+ };
+
// Called when the url of a tab changes.
function showAction(tabId, changeInfo, tab) {
- // If the letter 'g' is found in the tab's URL...
// ... show the page action.
chrome.pageAction.show(tabId);
- tabTitle = tab.title;
- tabUrl = tab.url;
+ tabInfos[tabId] = {
+ "title" : tab.title,
+ "url" : tab.url
+ };
};
// Listen for any changes to the URL of any tab.
chrome.tabs.onUpdated.addListener(showAction);
+ function updateCurrentTabId(tabId, selectInfo) {
+ currentTabId = tabId;
+ };
+
+ // Listen for any tab selection changes.
+ chrome.tabs.onSelectionChanged.addListener(updateCurrentTabId);
+
</script>
</head>
</html>
Modified: trunk/src/main/webapp/extensions/chromium/popup.html
===================================================================
--- trunk/src/main/webapp/extensions/chromium/popup.html 2010-12-24 18:24:46 UTC (rev 151)
+++ trunk/src/main/webapp/extensions/chromium/popup.html 2010-12-28 09:40:42 UTC (rev 152)
@@ -40,7 +40,8 @@
}
function bookmark(tokenId) {
- var url = chrome.extension.getBackgroundPage().tabUrl;
+ var tabInfos = chrome.extension.getBackgroundPage().getTabInfos();
+ var url = tabInfos["url"];
var nameInput = document.getElementById("nameInput");
var nameValue = nameInput.value;
@@ -60,6 +61,8 @@
};
function init() {
+ var tabInfos = chrome.extension.getBackgroundPage().getTabInfos();
+
var title = document.getElementById("title");
title.innerHTML = chrome.i18n.getMessage("actionTitle");
@@ -67,7 +70,7 @@
nameInputLabel.innerHTML = chrome.i18n.getMessage("nameInputLabel");
var nameInput = document.getElementById("nameInput");
- nameInput.value = chrome.extension.getBackgroundPage().tabTitle;
+ nameInput.value = tabInfos["title"];
var aliasInputLabel = document.getElementById("aliasInputLabel");
aliasInputLabel.innerHTML = chrome.i18n.getMessage("aliasInputLabel");
1
0
24 Dec '10
Author: vbriand
Date: 2010-12-24 19:24:46 +0100 (Fri, 24 Dec 2010)
New Revision: 151
Url: http://chorem.org/repositories/revision/bow/151
Log:
D?\195?\169but du passage ?\195?\160 Struts 2. Tout est en chantier pour le moment. Seuls la connexion et l'enregistrement marchent.
Added:
trunk/src/main/java/org/chorem/bow/BowBookmark.java
trunk/src/main/java/org/chorem/bow/BowInit.java
trunk/src/main/java/org/chorem/bow/action/
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/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/RightMenuAction.java
trunk/src/main/java/org/chorem/bow/action/SearchAction.java
trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java
trunk/src/main/resources/org/
trunk/src/main/resources/org/chorem/
trunk/src/main/resources/org/chorem/bow/
trunk/src/main/resources/org/chorem/bow/action/
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-validation.xml
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-validation.xml
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/RightMenuAction.properties
trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_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/resources/struts.properties
trunk/src/main/resources/struts.xml
trunk/src/main/webapp/WEB-INF/decorators.xml
trunk/src/main/webapp/WEB-INF/decorators/
trunk/src/main/webapp/WEB-INF/decorators/main.jsp
trunk/src/main/webapp/WEB-INF/dwr.xml
trunk/src/main/webapp/WEB-INF/sitemesh.xml
trunk/src/main/webapp/WEB-INF/web.xml
trunk/src/main/webapp/index.jsp
trunk/src/main/webapp/js/
trunk/src/main/webapp/js/bookmark.js
trunk/src/main/webapp/jsp/
trunk/src/main/webapp/jsp/home.jsp
trunk/src/main/webapp/jsp/inc/
trunk/src/main/webapp/jsp/inc/errorFrame.jsp
trunk/src/main/webapp/jsp/inc/footer.jsp
trunk/src/main/webapp/jsp/inc/header.jsp
trunk/src/main/webapp/jsp/index.jsp
trunk/src/main/webapp/jsp/login.jsp
trunk/src/main/webapp/jsp/register.jsp
trunk/src/main/webapp/styles/
trunk/src/main/webapp/styles/forms.css
trunk/src/main/webapp/styles/layout-1col.css
trunk/src/main/webapp/styles/layout-navleft-1col.css
trunk/src/main/webapp/styles/layout-navleft-2col.css
trunk/src/main/webapp/styles/layout-navtop-1col.css
trunk/src/main/webapp/styles/layout-navtop-3col.css
trunk/src/main/webapp/styles/layout-navtop-localleft.css
trunk/src/main/webapp/styles/layout-navtop-subright.css
trunk/src/main/webapp/styles/layout.css
trunk/src/main/webapp/styles/main.css
trunk/src/main/webapp/styles/nav-horizontal.css
trunk/src/main/webapp/styles/nav-vertical.css
trunk/src/main/webapp/styles/tools.css
trunk/src/main/webapp/styles/typo.css
Removed:
trunk/src/main/webapp/WEB-INF/web.xml
Modified:
trunk/pom.xml
trunk/src/main/webapp/rightMenu.jsp
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-12-23 14:19:56 UTC (rev 150)
+++ trunk/pom.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -18,7 +20,6 @@
<version>0.4-SNAPSHOT</version>
<dependencies>
-
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
@@ -33,6 +34,13 @@
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>runtime</scope>
@@ -50,12 +58,6 @@
<version>${wikittyVersion}</version>
</dependency>
- <!--dependency>
- <groupId>org.nuiton.wikitty</groupId>
- <artifactId>wikitty-solr-impl</artifactId>
- <version>${wikittyVersion}</version>
- </dependency-->
-
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@@ -104,13 +106,42 @@
<version>1.2.1</version>
</dependency>
-
<dependency>
<groupId>org.htmlparser</groupId>
<artifactId>htmlparser</artifactId>
<version>1.6</version>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-core</artifactId>
+ <version>${struts2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-sitemesh-plugin</artifactId>
+ <version>${struts2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-spring-plugin</artifactId>
+ <version>${struts2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-config-browser-plugin</artifactId>
+ <version>${struts2.version}</version>
+ </dependency>
</dependencies>
<scm>
@@ -126,8 +157,7 @@
<!-- ************************************************************* -->
<name>bow</name>
-
- <description>bookmark on web</description>
+ <description>bookmarks on web</description>
<inceptionYear>2010</inceptionYear>
<!-- ************************************************************* -->
@@ -135,7 +165,7 @@
<!-- ************************************************************* -->
<packaging>war</packaging>
-
+
<properties>
<platform>chorem.org</platform>
<projectId>bow</projectId>
@@ -144,16 +174,15 @@
<nuitonI18nVersion>2.0</nuitonI18nVersion>
<wikittyVersion>2.0</wikittyVersion>
<slf4jVersion>1.6.1</slf4jVersion>
+ <struts2.version>2.1.8.1</struts2.version>
<locales>en</locales>
<!-- license to use -->
<license.licenseName>agpl_v3</license.licenseName>
-
</properties>
-
+
<build>
-
<resources>
<resource>
<directory>src/main/resources</directory>
@@ -213,10 +242,7 @@
<version>${wikittyVersion}</version>
</dependency>
</dependencies>
-
</plugin>
-
</plugins>
</build>
-
</project>
Added: trunk/src/main/java/org/chorem/bow/BowBookmark.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowBookmark.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/BowBookmark.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,51 @@
+package org.chorem.bow;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.FacetTopic;
+import org.nuiton.wikitty.PagedResult;
+import org.nuiton.wikitty.search.Search;
+
+public class BowBookmark {
+ static public Criteria getBookmarkListCriteriaByUser(User user, String searchLine) {
+ Criteria criteria = null;
+ if (user != null) {
+ if (searchLine != null && !searchLine.isEmpty()) {
+ String[] words = searchLine.split("\\s+"); //Puts the tags in an array
+ List<String> tags = new ArrayList<String>(Arrays.asList(words));
+ criteria = Search.query().eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).
+ eq(Bookmark.FQ_FIELD_TAGS, tags).criteria().addFacetField(Bookmark.FQ_FIELD_TAGS);
+ } else {
+ criteria = Search.query().eq(Bookmark.FQ_FIELD_EMAIL, user.getEmail()).
+ criteria().addFacetField(Bookmark.FQ_FIELD_TAGS);
+ }
+ }
+ return criteria;
+ }
+
+ static public BookmarkActions createBookmarkActions(HttpServletRequest request, PagedResult<Bookmark> result, String searchLine) {
+ String fullText = request.getParameter("fullTextLine");
+ BookmarkActions bookmarkActions = new BookmarkActions();
+ bookmarkActions.setFullTextLine(fullText);
+ List<Bookmark> bookList = result.getAll();
+
+ if (bookList != null) {
+ bookmarkActions.setBookmarks(bookList);
+ }
+ if (fullText == null || fullText.isEmpty()) {
+ if (searchLine != null && searchLine.isEmpty()) {
+ bookmarkActions.emptySearchline();
+ } else {
+ bookmarkActions.addTags(searchLine); //Adds the new tags
+ }
+ }
+ List<FacetTopic> topics = result.getTopic(Bookmark.FQ_FIELD_TAGS);
+ bookmarkActions.createTagCloud(topics);
+ return bookmarkActions;
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/BowBookmark.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/BowInit.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/BowInit.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/BowInit.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,81 @@
+package org.chorem.bow;
+
+import java.security.NoSuchAlgorithmException;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.PagedResult;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
+public class BowInit {
+ static public void checkAdmin(Map<String, Object> session, String login) {
+ String[] admins = BowConfig.getInstance().getAdmins();
+
+ if (admins != null) {
+ for (String admin : admins) {
+ if (login.equals(admin)) {
+ session.put("admin", true);
+ break;
+ }
+ }
+ }
+ else {
+ session.put("admin", false);
+ }
+ }
+
+ static public void initializeToken(Map<String, Object> session, User login)
+ throws NoSuchAlgorithmException {
+ WikittyProxy proxy = BowProxy.getInstance();
+ 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();
+ token.setToken(newToken);
+ token.setEmail(login.getEmail());
+ proxy.store(token);
+ }
+ tokenActions.setPermanentToken(token.getToken());
+ String temporaryToken = tokenActions.generateToken();
+ tokenActions.setTemporaryToken(temporaryToken);
+ session.put("tokenActions", tokenActions);
+ }
+
+ static public void initSession(Map<String, Object> session, User user) throws NoSuchAlgorithmException {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Preference preference = proxy.restore(Preference.class, user.getWikittyId());
+ session.put("user", user);
+ session.put("preference", preference);
+ initializeToken(session, user);
+ checkAdmin(session, user.getEmail());
+ }
+
+ static public void initHomePage(HttpServletRequest request, User user) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = BowBookmark.getBookmarkListCriteriaByUser(user, null);
+ if (criteria != null) {
+ Criteria sortCriteria = criteria.addSortDescending(Bookmark.FQ_FIELD_CLICK);
+ PagedResult<Bookmark> result = proxy.findAllByCriteria(Bookmark.class, sortCriteria); //Selects all bookmarks by user
+ sortCriteria = criteria.addSortDescending(Bookmark.FQ_FIELD_DATE).setEndIndex(10);
+ List<Bookmark> lastBookmarks = proxy.findAllByCriteria(Bookmark.class, sortCriteria).getAll();
+ BookmarkActions bookmarkActions = BowBookmark.createBookmarkActions(request, result, null);
+ bookmarkActions.setTagSearch(null);
+ List<Bookmark> bookList = bookmarkActions.getBookmarks();
+
+ if (bookList.size() > 10) {
+ bookList = bookmarkActions.getBookmarks().subList(0, 10);
+ bookmarkActions.setBookmarks(bookList);
+ }
+ if (lastBookmarks != null) {
+ bookmarkActions.setLastBookmarks(lastBookmarks);
+ }
+ request.setAttribute("bookmarkActions", bookmarkActions);
+ }
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/BowInit.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class AddAliasAction extends ActionSupport{
+ private static final long serialVersionUID = 2565840071468031758L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/AddAliasAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/AddClickAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/AddClickAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/AddClickAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class AddClickAction extends ActionSupport{
+ private static final long serialVersionUID = 8579081104294143087L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/AddClickAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class AddUrlAction extends ActionSupport{
+ private static final long serialVersionUID = 3389170166034184139L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/AddUrlAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class ChangePreferencesAction extends ActionSupport{
+ private static final long serialVersionUID = -1923646256914239581L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/ChangePreferencesAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class DeleteImportAction extends ActionSupport{
+ private static final long serialVersionUID = 8714394293884265516L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/DeleteImportAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class DeleteSearchResultsAction extends ActionSupport{
+ private static final long serialVersionUID = -3903724044644625507L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/DeleteSearchResultsAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class DeleteTagAction extends ActionSupport{
+ private static final long serialVersionUID = -6174966873862161966L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/DeleteTagAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class EditBookmarkAction extends ActionSupport{
+ private static final long serialVersionUID = 2706590901233864637L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/EditBookmarkAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class ExportBookmarksAction extends ActionSupport{
+ private static final long serialVersionUID = 45880214686011946L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/ExportBookmarksAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class GenerateTokenAction extends ActionSupport{
+ private static final long serialVersionUID = 1141019772989666309L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/GenerateTokenAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/HomeAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/HomeAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/HomeAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,84 @@
+package org.chorem.bow.action;
+
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.BowInit;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.Token;
+import org.chorem.bow.User;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class HomeAction extends ActionSupport implements SessionAware, ServletRequestAware {
+ private static final long serialVersionUID = -3735250067223062719L;
+ protected String token;
+ protected Map<String, Object> session;
+ protected HttpServletRequest request;
+
+ /**
+ * @return the token
+ */
+ public String getToken() {
+ return token;
+ }
+ /**
+ * @param token the token to set
+ */
+ public void setToken(String token) {
+ this.token = token;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ protected User checkPermanentToken(String token) {
+ if (token != null) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = Search.query().eq(Token.FQ_FIELD_TOKEN, token).criteria();
+ Token DbToken = proxy.findByCriteria(Token.class, criteria);
+
+ if (DbToken != null) { //Check if the token exists
+ criteria = Search.query().eq(User.FQ_FIELD_EMAIL, DbToken.getEmail()).criteria(); //Retrieves user by token
+ return proxy.findByCriteria(User.class, criteria);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String execute() {
+ User user = (User)session.get("user");
+
+ if (user == null) {
+ user = checkPermanentToken(token);
+ if (user != null) {
+ try {
+ BowInit.initSession(session, user);
+ } catch (NoSuchAlgorithmException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ if (user != null) {
+ BowInit.initHomePage(request, user);
+ return SUCCESS;
+ }
+ return LOGIN;
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/org/chorem/bow/action/HomeAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class ImportBookmarksAction extends ActionSupport{
+ private static final long serialVersionUID = -5962680416570797028L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/ImportBookmarksAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/LocaleAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/LocaleAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/LocaleAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,11 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class LocaleAction extends ActionSupport {
+ private static final long serialVersionUID = 9124549040894568467L;
+
+ public String execute() {
+ return SUCCESS;
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/LocaleAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/LoginAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/LoginAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/LoginAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,127 @@
+/*
+ * #%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%
+ */
+
+package org.chorem.bow.action;
+
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.User;
+import org.chorem.bow.BowInit;
+import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class LoginAction extends ActionSupport implements SessionAware, ServletRequestAware {
+ private static final long serialVersionUID = 6891064800288772246L;
+ protected String email;
+ protected String password;
+ protected Map<String, Object> session;
+ protected HttpServletRequest servletRequest;
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ public Map<String, Object> getSession() {
+ return this.session;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.servletRequest = request;
+ }
+
+ public HttpServletRequest getServletRequest() {
+ return this.servletRequest;
+ }
+
+ protected User checkLogin(String email, String password) throws NoSuchAlgorithmException {
+ if (email != null && password != null) {
+ if (!email.isEmpty() && !password.equals(StringUtil.encodeMD5(""))) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = Search.query().eq(User.FQ_FIELD_EMAIL, email).
+ eq(User.FQ_FIELD_PASSWORD, password).criteria();
+ User user = proxy.findByCriteria(User.class, criteria);
+
+ if (user == null) {
+ addActionError(getText("authenticationFailure"));
+ }
+ return user;
+ }
+ }
+ 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) {
+ return ERROR;
+ }
+ if (user != null) {
+ try {
+ BowInit.initSession(session, user);
+ } catch (NoSuchAlgorithmException e) {
+ return ERROR;
+ }
+ BowInit.initHomePage(servletRequest, user);
+ return SUCCESS;
+ }
+ }
+ }
+ return INPUT;
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/org/chorem/bow/action/LoginAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/LogoutAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/LogoutAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/LogoutAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,35 @@
+package org.chorem.bow.action;
+
+import java.util.Map;
+
+import org.apache.struts2.dispatcher.SessionMap;
+import org.apache.struts2.interceptor.SessionAware;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class LogoutAction extends ActionSupport implements SessionAware {
+ private static final long serialVersionUID = 4806944250461551896L;
+ protected Map<String, Object> session;
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ public Map<String, Object> getSession() {
+ return this.session;
+ }
+
+ public String execute() {
+ if (session instanceof SessionMap) {
+ try {
+ ((SessionMap<String, Object>)session).invalidate();
+ return SUCCESS;
+ } catch (IllegalStateException e) {
+ //TODO : logger l'erreur
+ //logger.error(msg, e);
+ }
+ }
+ return ERROR;
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/LogoutAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class ModifyBookmarkAction extends ActionSupport{
+ private static final long serialVersionUID = 8197008295267924063L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/ModifyBookmarkAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class OpenSearchResultAction extends ActionSupport{
+ private static final long serialVersionUID = -1691325797986483856L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/OpenSearchResultAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class OpenSearchSuggestionAction extends ActionSupport{
+ private static final long serialVersionUID = 3973618635494129146L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/OpenSearchSuggestionAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/OrderAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/OrderAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/OrderAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class OrderAction extends ActionSupport{
+ private static final long serialVersionUID = 203690999710176818L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/OrderAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class ReIndexationAction extends ActionSupport{
+ private static final long serialVersionUID = 6226574522402739559L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/ReIndexationAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/RegisterAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/RegisterAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/RegisterAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,175 @@
+package org.chorem.bow.action;
+
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.SessionAware;
+import org.chorem.bow.BowConfig;
+import org.chorem.bow.BowProxy;
+import org.chorem.bow.User;
+import org.chorem.bow.UserImpl;
+import org.chorem.bow.BowInit;
+import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.Criteria;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Search;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class RegisterAction extends ActionSupport implements SessionAware, ServletRequestAware {
+ private static final long serialVersionUID = 2204772861770399542L;
+ protected String email;
+ protected String password;
+ protected String repeatPassword;
+ protected Map<String, Object> session;
+ protected HttpServletRequest request;
+
+ /**
+ * @return the email
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * @param email the email to set
+ */
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ /**
+ * @return the password
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * @param password the password to set
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * @return the repeatPassword
+ */
+ public String getRepeatPassword() {
+ return repeatPassword;
+ }
+
+ /**
+ * @param repeatPassword the repeatPassword to set
+ */
+ public void setRepeatPassword(String repeatPassword) {
+ this.repeatPassword = repeatPassword;
+ }
+
+ @Override
+ public void setSession(Map<String, Object> session) {
+ this.session = session;
+ }
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ protected boolean checkRegister(String passwordMD5) {
+ if (email != null && passwordMD5 != null) {
+ if (!email.isEmpty() && !passwordMD5.equals(StringUtil.encodeMD5(""))) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ Criteria criteria = Search.query().eq(User.FQ_FIELD_EMAIL, email).criteria(); //Retrieves user by user name (email)
+
+ if (proxy.findByCriteria(User.class, criteria) == null) {
+ return false;
+ }
+ //FIXME : message d'erreur mais return true ???
+ addFieldError("email", getText("emailAldyUsed"));
+ return true;
+ }
+ }
+ //FIXME : message d'erreur mais return true ???
+ //request.setAttribute("errorMsgUser", "Email and password must be correctly filled");
+ return true;
+ }
+
+ protected void sendMail() throws AddressException, MessagingException {
+ BowConfig config = BowConfig.getInstance();
+ String smtpServer = config.getSmtpServer();
+ Properties properties = new Properties();
+ properties.put("mail.smtp.host", smtpServer);
+
+ Session session = Session.getDefaultInstance(properties, null);
+ session.setDebug(true);
+
+ Message msg = new MimeMessage(session);
+
+ msg.addRecipient(Message.RecipientType.TO, new InternetAddress(email));
+ msg.setFrom(new InternetAddress(config.getAddressFrom()));
+ msg.setSubject(getText("mailSubject"));
+
+ String messageBody = getText("mailHi") + "\n\n" +
+ getText("mailPwd") + password + "\n" +
+ getText("mailEmail") + email + "\n\n";
+ msg.setContent(messageBody, "text/plain");
+
+ Transport.send(msg);
+ }
+
+ public String execute() {
+ if (email != null) {
+ email = email.trim();
+ if (password != null) {
+ if (!password.equals(repeatPassword)) {
+ addActionError(getText("pwdDontMatch"));
+ return INPUT;
+ }
+ String md5 = StringUtil.encodeMD5(password);
+
+ if (!checkRegister(md5)) {
+ WikittyProxy proxy = BowProxy.getInstance();
+ UserImpl newUser = new UserImpl();
+ newUser.setPassword(md5);
+ newUser.setEmail(email);
+ User login = proxy.store((User) newUser); //Stores the new user
+
+ if (login != null) {
+ try {
+ BowInit.initSession(session, login);
+ } catch (NoSuchAlgorithmException e) {
+ return ERROR;
+ }
+ BowInit.initHomePage(request, login);
+ try {
+ sendMail();
+ } catch (AddressException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (MessagingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return SUCCESS;
+
+ } else {
+ addFieldError("email", getText("invalidLogin"));
+ }
+ }
+ }
+ }
+ return INPUT;
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/RegisterAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class RemoveBookmarkAction extends ActionSupport{
+ private static final long serialVersionUID = 820566716695285561L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/RemoveBookmarkAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/RightMenuAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/RightMenuAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/RightMenuAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,11 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class RightMenuAction extends ActionSupport {
+ private static final long serialVersionUID = -1167431751227151402L;
+
+ public String execute() {
+ return SUCCESS;
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/RightMenuAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/SearchAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/SearchAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/SearchAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class SearchAction extends ActionSupport{
+ private static final long serialVersionUID = -2161661766242362907L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/SearchAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java
===================================================================
--- trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java (rev 0)
+++ trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,8 @@
+package org.chorem.bow.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class SendPasswordAction extends ActionSupport{
+ private static final long serialVersionUID = -8207951465957204954L;
+
+}
Property changes on: trunk/src/main/java/org/chorem/bow/action/SendPasswordAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/HomeAction.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/HomeAction.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/HomeAction.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,3 @@
+mostUsedBookmarks = The most used bookmarks
+noBookmarks = No bookmarks
+latestBookmarks = The latest added bookmarks
\ No newline at end of file
Property changes on: trunk/src/main/resources/org/chorem/bow/action/HomeAction.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/HomeAction_fr.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/HomeAction_fr.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/HomeAction_fr.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,3 @@
+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
Property changes on: trunk/src/main/resources/org/chorem/bow/action/HomeAction_fr.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/LoginAction-validation.xml
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/LoginAction-validation.xml (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/LoginAction-validation.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,19 @@
+<!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="requiredstring" />
+ </field-validator>
+ <field-validator type="email">
+ <message key="wrongformat" />
+ </field-validator>
+ </field>
+ <field name="password">
+ <field-validator type="requiredstring">
+ <message key="requiredstring" />
+ </field-validator>
+ </field>
+</validators>
Property changes on: trunk/src/main/resources/org/chorem/bow/action/LoginAction-validation.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/LoginAction.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/LoginAction.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/LoginAction.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,4 @@
+login = Login
+register = Register
+forgotpwd = Forgot your password ?
+authenticationFailure = Unknown email or incorrect password
Property changes on: trunk/src/main/resources/org/chorem/bow/action/LoginAction.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/LoginAction_fr.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/LoginAction_fr.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/LoginAction_fr.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,4 @@
+login = Connexion
+register = S'enregistrer
+forgotpwd = Vous avez oublie votre mot de passe ?
+authenticationFailure = Email inconnu ou mot de passe incorrect
Property changes on: trunk/src/main/resources/org/chorem/bow/action/LoginAction_fr.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/RegisterAction-validation.xml
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/RegisterAction-validation.xml (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/RegisterAction-validation.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,24 @@
+<!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="requiredstring" />
+ </field-validator>
+ <field-validator type="email">
+ <message key="wrongformat" />
+ </field-validator>
+ </field>
+ <field name="password">
+ <field-validator type="requiredstring">
+ <message key="requiredstring" />
+ </field-validator>
+ </field>
+ <field name="repeatPassword">
+ <field-validator type="requiredstring">
+ <message key="requiredstring" />
+ </field-validator>
+ </field>
+</validators>
Property changes on: trunk/src/main/resources/org/chorem/bow/action/RegisterAction-validation.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/RegisterAction.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/RegisterAction.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/RegisterAction.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,10 @@
+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
Property changes on: trunk/src/main/resources/org/chorem/bow/action/RegisterAction.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/RegisterAction_fr.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/RegisterAction_fr.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/RegisterAction_fr.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,10 @@
+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
Property changes on: trunk/src/main/resources/org/chorem/bow/action/RegisterAction_fr.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,5 @@
+url = URL
+alias = ALIAS
+name = DESC
+tags = TAGS
+save = Save
\ No newline at end of file
Property changes on: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,5 @@
+url = URL
+alias = ALIAS
+name = DESC
+tags = TAGS
+save = Sauvegarder
\ No newline at end of file
Property changes on: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/package.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/package.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/package.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,5 @@
+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
Property changes on: trunk/src/main/resources/org/chorem/bow/action/package.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/org/chorem/bow/action/package_fr.properties
===================================================================
--- trunk/src/main/resources/org/chorem/bow/action/package_fr.properties (rev 0)
+++ trunk/src/main/resources/org/chorem/bow/action/package_fr.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,5 @@
+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
Property changes on: trunk/src/main/resources/org/chorem/bow/action/package_fr.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/struts.properties
===================================================================
--- trunk/src/main/resources/struts.properties (rev 0)
+++ trunk/src/main/resources/struts.properties 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,64 @@
+
+
+# struts.configuration=org.apache.struts2.config.DefaultConfiguration
+
+# struts.locale=en_US
+struts.i18n.encoding=UTF-8
+
+struts.objectFactory = spring
+
+struts.objectFactory.spring.autoWire = name
+
+struts.objectFactory.spring.useClassCache = true
+
+#struts.objectTypeDeterminer = tiger
+#struts.objectTypeDeterminer = notiger
+
+# struts.multipart.parser=cos
+# struts.multipart.parser=pell
+struts.multipart.parser=jakarta
+# uses javax.servlet.context.tempdir by default
+struts.multipart.saveDir=
+struts.multipart.maxSize=2097152
+
+# struts.custom.properties=application,com/webwork/extension/custom
+
+struts.mapper.class=org.apache.struts2.dispatcher.mapper.DefaultActionMapper
+
+struts.action.extension=action
+
+struts.serve.static=true
+
+struts.serve.static.browserCache=true
+
+struts.tag.altSyntax=true
+
+struts.devMode = false
+
+struts.i18n.reload=false
+
+struts.ui.theme=xhtml
+struts.ui.templateDir=template
+#sets the default template type. Either ftl, vm, or jsp
+struts.ui.templateSuffix=ftl
+
+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.dispatcher.parametersWorkaround = false
+
+#struts.freemarker.manager.classname=org.apache.struts2.views.freemarker.FreemarkerManager
+
+struts.freemarker.wrapper.altMap=true
+
+struts.xslt.nocache=false
+
Property changes on: trunk/src/main/resources/struts.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml (rev 0)
+++ trunk/src/main/resources/struts.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+ "http://struts.apache.org/dtds/struts-2.0.dtd">
+<struts>
+ <constant name="struts.devMode" value="true" />
+
+ <package name="myPackage" extends="struts-default">
+ <action name="register_*" method="{1}" class="org.chorem.bow.action.RegisterAction">
+ <result name="input">/jsp/register.jsp</result>
+ <result type="redirect">/jsp/home.jsp</result>
+ </action>
+ <action name="registration">
+ <result>/jsp/register.jsp</result>
+ </action>
+ <action name="forgotPassword">
+ <result>/jsp/forgotPassword.jsp</result>
+ </action>
+
+ <action name="locale" class="org.chorem.bow.action.LocaleAction">
+ <result type="redirect">/jsp/login.jsp</result>
+ </action>
+ <action name="login_*" method="{1}" class="org.chorem.bow.action.LoginAction">
+ <result name="input">/jsp/login.jsp</result>
+ <result type="redirect">/home.action</result>
+ </action>
+ <action name="logout" class="org.chorem.bow.action.LogoutAction">
+ <result type="redirect">/jsp/login.jsp</result>
+ </action>
+ <action name="home" class="org.chorem.bow.action.HomeAction">
+ <result name="login" type="redirect">/login_input.action</result>
+ <result>/jsp/home.jsp</result>
+ </action>
+ <action name="addUrl" class="org.chorem.bow.action.AddUrlAction">
+ <!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
+ </action>
+ <action name="sendPassword" class="org.chorem.bow.action.SendPasswordAction">
+ <result name="input">/jsp/forgotPassword.jsp</result>
+ <result>/jsp/login.jsp</result>
+ </action>
+ </package>
+
+ <package name="bookmark" extends="struts-default">
+ <!-- import, export -->
+ <action name="*Bookmarks" method="{1}" class="org.chorem.bow.action.BookmarksAction">
+ <result name="search">/jsp/search.jsp</result>
+ <result>/jsp/home.jsp</result>
+ </action>
+ <!-- modify, remove, edit -->
+ <action name="*Bookmark" method="{1}" class="org.chorem.bow.action.BookmarkAction">
+ <!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
+ <result name="home">/jsp/home.jsp</result>
+ <result name="search">/jsp/search.jsp</result>
+ </action>
+ </package>
+
+ <package name="toto" extends="struts-default">
+ <action name="search" class="org.chorem.bow.action.SearchAction">
+ <!-- Méthode actionSearch appellée dans d'autres méthodes, à voir comment organiser ça -->
+ <result>/jsp/search.jsp</result>
+ </action>
+ <action name="generateToken" class="org.chorem.bow.action.GenerateTokenAction">
+ <result>/jsp/preferences.jsp</result>
+ </action>
+ <action name="deleteTag" class="org.chorem.bow.action.DeleteTagAction">
+ <!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
+ </action>
+ <action name="addAlias" class="org.chorem.bow.action.AddAliasAction">
+ <!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment-->
+ </action>
+ <action name="order" class="org.chorem.bow.action.OrderAction">
+ <result>/jsp/search.jsp</result>
+ </action>
+ <action name="addClick" class="org.chorem.bow.action.AddClickAction">
+ <result type="redirect">${link}<!--???--></result>
+ </action>
+ <!-- temporary, permanent -->
+ <action name="*Xml">
+ <result>/jsp/{1}Xml.jsp</result>
+ </action>
+ <!-- Suggestion, Result -->
+ <action name="openSearch*" method="{1}" class="org.chorem.bow.action.OpenSearchAction">
+ <!-- Plein de types de redirections différentes, et un .forward(..., ...); que je ne sais pas comment changer -->
+ <result>/jsp/suggestions.jsp</result>
+ </action>
+ <action name="preferences">
+ <!-- Cas du getBookmarksByImportDate qu'il faudrait caller quelque part -->
+ <result>/jsp/preferences.jsp</result>
+ </action>
+ <action name="admin">
+ <result name="error">/jsp/login.jsp</result>
+ <result>/jsp/admin.jsp</result>
+ </action>
+ <action name="changePreferences" class="org.chorem.bow.action.ChangePreferencesAction">
+ <result>/jsp/preferences.jsp</result>
+ </action>
+ <action name="deleteImport" class="org.chorem.bow.action.DeleteImportAction">
+ <result>/jsp/preferences.jsp</result>
+ </action>
+ <action name="reIndexation" class="org.chorem.bow.action.ReIndexationAction">
+ <result>/jsp/admin.jsp</result>
+ </action>
+ <action name="deleteSearchResults" class="org.chorem.bow.action.DeleteSearchResultsAction">
+ <result type="redirectAction">/jsp/home.jsp</result>
+ </action>
+ </package>
+</struts>
Property changes on: trunk/src/main/resources/struts.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/WEB-INF/decorators/main.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/decorators/main.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/decorators/main.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
+<%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %>
+<%@taglib prefix="s" uri="/struts-tags" %>
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><decorator:title default="Bow" /></title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta name="description" content="Bookmarks on the web" />
+ <link rel="search" type="application/opensearchdescription+xml" title="bowTemporarySearchEngine" href="?action=temporaryXml" />
+ <link rel="search" type="application/opensearchdescription+xml" title="bowPermanentSearchEngine" href="?action=permanentXml" />
+ <link href="<s:url value='/css/global.css'/>" rel="stylesheet" type="text/css" media="all" />
+ <script type="text/javascript" src="<s:url value='/js/bookmark.js' />"></script>
+ <decorator:head />
+ </head>
+ <body id="page-home">
+ <div id="wrap">
+ <div id="page">
+ <%@include file="/jsp/inc/header.jsp" %>
+ <div id="main">
+ <%@include file="/jsp/inc/errorFrame.jsp" %>
+ <decorator:body />
+ </div>
+ </div>
+ </div>
+ <%@include file="/jsp/inc/footer.jsp" %>
+ </body>
+</html>
Property changes on: trunk/src/main/webapp/WEB-INF/decorators/main.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/WEB-INF/decorators.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/decorators.xml (rev 0)
+++ trunk/src/main/webapp/WEB-INF/decorators.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<decorators defaultdir="/WEB-INF/decorators">
+ <!-- Any urls that are excluded will never be decorated by Sitemesh -->
+ <excludes>
+ <pattern>/nodecorate/*</pattern>
+ <pattern>/styles/*</pattern>
+ <pattern>/scripts/*</pattern>
+ <pattern>/images/*</pattern>
+ <pattern>/dojo/*</pattern>
+ <pattern>/struts/*</pattern>
+ <pattern>index.jsp</pattern>
+ </excludes>
+
+ <decorator name="main" page="main.jsp">
+ <pattern>/*</pattern>
+ </decorator>
+
+</decorators>
Property changes on: trunk/src/main/webapp/WEB-INF/decorators.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/WEB-INF/dwr.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/dwr.xml (rev 0)
+++ trunk/src/main/webapp/WEB-INF/dwr.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dwr PUBLIC
+ "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
+ "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
+
+<dwr>
+ <allow>
+ <create creator="new" javascript="validator">
+ <param name="class" value="org.apache.struts2.validators.DWRValidator"/>
+ </create>
+ <convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/>
+ </allow>
+
+ <signatures>
+ <![CDATA[
+ import java.util.Map;
+ import org.apache.struts2.validators.DWRValidator;
+
+ DWRValidator.doPost(String, String, Map<String, String>);
+ ]]>
+ </signatures>
+</dwr>
Property changes on: trunk/src/main/webapp/WEB-INF/dwr.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/WEB-INF/sitemesh.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/sitemesh.xml (rev 0)
+++ trunk/src/main/webapp/WEB-INF/sitemesh.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<sitemesh>
+ <property name="decorators-file" value="/WEB-INF/decorators.xml"/>
+ <excludes file="${decorators-file}"/>
+
+ <page-parsers>
+ <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.FastPageParser"/>
+ </page-parsers>
+
+ <decorator-mappers>
+
+ <mapper class="com.opensymphony.module.sitemesh.mapper.PageDecoratorMapper">
+ <param name="property.1" value="meta.decorator"/>
+ <param name="property.2" value="decorator"/>
+ </mapper>
+
+ <mapper class="com.opensymphony.module.sitemesh.mapper.FrameSetDecoratorMapper">
+ </mapper>
+
+ <mapper class="com.opensymphony.module.sitemesh.mapper.AgentDecoratorMapper">
+ <param name="match.MSIE" value="ie"/>
+ <param name="match.Mozilla [" value="ns"/>
+ <param name="match.Opera" value="opera"/>
+ <param name="match.Lynx" value="lynx"/>
+ </mapper>
+
+ <mapper class="com.opensymphony.module.sitemesh.mapper.PrintableDecoratorMapper">
+ <param name="decorator" value="printable"/>
+ <param name="parameter.name" value="printable"/>
+ <param name="parameter.value" value="true"/>
+ </mapper>
+
+ <mapper class="com.opensymphony.module.sitemesh.mapper.RobotDecoratorMapper">
+ <param name="decorator" value="robot"/>
+ </mapper>
+
+ <mapper class="com.opensymphony.module.sitemesh.mapper.ParameterDecoratorMapper">
+ <param name="decorator.parameter" value="decorator"/>
+ <param name="parameter.name" value="confirm"/>
+ <param name="parameter.value" value="true"/>
+ </mapper>
+
+ <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
+ <param name="config" value="${decorators-file}"/>
+ </mapper>
+
+ </decorator-mappers>
+
+</sitemesh>
Property changes on: trunk/src/main/webapp/WEB-INF/sitemesh.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2010-12-23 14:19:56 UTC (rev 150)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -1,64 +0,0 @@
-<?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%
- -->
-
-<web-app id="bow" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
-
- <!-- SERVLET -->
-
- <servlet>
- <servlet-name>Controller</servlet-name>
- <servlet-class>org.chorem.bow.ControllerServlet</servlet-class>
- </servlet>
-
- <servlet>
- <servlet-name>Alias</servlet-name>
- <servlet-class>org.chorem.bow.AliasServlet</servlet-class>
- </servlet>
-
- <welcome-file-list>
- <welcome-file>bow</welcome-file>
- </welcome-file-list>
-
- <!-- tchemit 2010-11-23 : arch this is not a listener -->
- <!--listener>
- <listener-class>org.chorem.bow.ControllerServlet</listener-class>
- </listener-->
-
-
- <!-- SERVLET MAPPING -->
-
- <servlet-mapping>
- <servlet-name>Controller</servlet-name>
- <url-pattern>/bow</url-pattern>
- </servlet-mapping>
-
- <servlet-mapping>
- <servlet-name>Alias</servlet-name>
- <url-pattern>/alias/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
Added: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,100 @@
+<?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%
+ -->
+
+<web-app id="bow" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Bow</display-name>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>classpath*:applicationContext*.xml</param-value>
+ </context-param>
+
+ <!-- Filters -->
+ <filter>
+ <filter-name>action2-cleanup</filter-name>
+ <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
+ </filter>
+ <filter>
+ <filter-name>sitemesh</filter-name>
+ <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
+ </filter>
+ <filter>
+ <filter-name>struts2</filter-name>
+ <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>action2-cleanup</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>sitemesh</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>struts2</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- Listeners -->
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <!-- Servlets -->
+ <servlet>
+ <servlet-name>dwr</servlet-name>
+ <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
+ <init-param>
+ <param-name>debug</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ </servlet>
+ <servlet>
+ <servlet-name>jspSupportServlet</servlet-name>
+ <servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
+ <load-on-startup>5</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>dwr</servlet-name>
+ <url-pattern>/dwr/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- Welcome file lists -->
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <jsp-config>
+ <jsp-property-group>
+ <url-pattern>*.jsp</url-pattern>
+ <trim-directive-whitespaces>true</trim-directive-whitespaces>
+ </jsp-property-group>
+ </jsp-config>
+</web-app>
Property changes on: trunk/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/index.jsp
===================================================================
--- trunk/src/main/webapp/index.jsp (rev 0)
+++ trunk/src/main/webapp/index.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1 @@
+<% response.sendRedirect("login_input.action"); %>
\ No newline at end of file
Property changes on: trunk/src/main/webapp/index.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/js/bookmark.js
===================================================================
--- trunk/src/main/webapp/js/bookmark.js (rev 0)
+++ trunk/src/main/webapp/js/bookmark.js 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,31 @@
+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;
+ }
+}
Property changes on: trunk/src/main/webapp/js/bookmark.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/jsp/home.jsp
===================================================================
--- trunk/src/main/webapp/jsp/home.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/home.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,104 @@
+<!--
+ #%L
+ bow
+
+ $Id: home.jsp 144 2010-12-23 10:24:48Z bpoussin $
+ $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/home.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.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) {
+ %>
+ <html>
+ <head>
+ <link href="<s:url value='/css/bookmark.css'/>" rel="stylesheet" type="text/css" />
+ <s:head />
+ </head>
+ <body>
+ <div class="menu clearfix">
+ <h2><s:property value="%{getText('mostUsedBookmarks')}" /></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"><s:property value="%{getText('noBookmarks')}" /></p>
+ <% } %>
+ </div>
+
+ <div class="menu clearfix">
+ <h2><s:property value="%{getText('latestBookmarks')}" /></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"><s:property value="%{getText('noBookmarks')}" /></p>
+ <% } %>
+ </div>
+ <jsp:include page="/rightMenu.jsp" />
+ </body>
+</html>
+<% } %>
Property changes on: trunk/src/main/webapp/jsp/home.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/jsp/inc/errorFrame.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/errorFrame.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/inc/errorFrame.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,11 @@
+<%
+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>
+<% } %>
Property changes on: trunk/src/main/webapp/jsp/inc/errorFrame.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/jsp/inc/footer.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/footer.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/inc/footer.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,11 @@
+<div id="footer">
+ <p>
+ <a shape="rect" href="">bow</a>
+ <a shape="rect" href="http://www.chorem.org/projects/list_files/bow"></a> -
+ <a shape="rect" href="http://www.gnu.org/licenses/agpl.html">Licence AGPL</a> -
+ <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>
\ No newline at end of file
Property changes on: trunk/src/main/webapp/jsp/inc/footer.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/jsp/inc/header.jsp
===================================================================
--- trunk/src/main/webapp/jsp/inc/header.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/inc/header.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,3 @@
+<div id="header">
+ <a class="logo" href="">bow</a>
+</div>
\ No newline at end of file
Property changes on: trunk/src/main/webapp/jsp/inc/header.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/jsp/index.jsp
===================================================================
--- trunk/src/main/webapp/jsp/index.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/index.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,20 @@
+<!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>
+
Property changes on: trunk/src/main/webapp/jsp/index.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/jsp/login.jsp
===================================================================
--- trunk/src/main/webapp/jsp/login.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/login.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,36 @@
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@taglib prefix="s" uri="/struts-tags"%>
+
+<html>
+ <head>
+ <link href="<s:url value='/css/connexion.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">
+ <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')}" />
+ </p>
+ </s:form>
+ <s:url id="localeEN" action="login">
+ <s:param name="request_locale" >en</s:param>
+ </s:url>
+ <s:url id="localeFR" action="login">
+ <s:param name="request_locale" >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() %>/registration.action" id="register"><s:property value="%{getText('register')}" /></a>
+ <a href="<%= request.getContextPath() %>/forgotPassword.action" id="forgotPwd"><s:property value="%{getText('forgotpwd')}" /></a>
+ </div>
+ </div>
+ </body>
+</html>
Property changes on: trunk/src/main/webapp/jsp/login.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/jsp/register.jsp
===================================================================
--- trunk/src/main/webapp/jsp/register.jsp (rev 0)
+++ trunk/src/main/webapp/jsp/register.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,47 @@
+<!--
+ #%L
+ bow
+
+ $Id: register.jsp 144 2010-12-23 10:24:48Z bpoussin $
+ $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/register.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"%>
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+ <head>
+ <link href="<s:url value='/css/connexion.css'/>" rel="stylesheet" type="text/css" />
+ <s:head />
+ </head>
+ <body>
+ <div id="content">
+ <div id="formFrame">
+ <h1><s:property value="%{getText('register')}" /></h1>
+ <form method="post" action="/bow/register.action">
+ <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')}" />
+ </p>
+ </form>
+ <a href="<%= request.getContextPath() %>" id="register"><s:property value="%{getText('loginPage')}" /></a>
+ </div>
+ </div>
+ </body>
+</html>
Property changes on: trunk/src/main/webapp/jsp/register.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/src/main/webapp/rightMenu.jsp
===================================================================
--- trunk/src/main/webapp/rightMenu.jsp 2010-12-23 14:19:56 UTC (rev 150)
+++ trunk/src/main/webapp/rightMenu.jsp 2010-12-24 18:24:46 UTC (rev 151)
@@ -21,7 +21,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
#L%
-->
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@taglib prefix="s" uri="/struts-tags" %>
<%@page import="org.chorem.bow.BookmarkActions" %>
<%@page import="java.text.SimpleDateFormat" %>
<%@page import="java.util.Iterator" %>
@@ -57,11 +58,12 @@
searchLine = bookmarkActions.getSearchLine();
fullText = bookmarkActions.getFullTextLine();
}
-String formLink = (String) request.getAttribute("link");
-String formName = (String) request.getAttribute("name");
-String formTags = (String) request.getAttribute("tags");
-String formAlias = (String) request.getAttribute("alias");
-String formAction = (String) request.getAttribute("action");
+
+String formLink = (String)request.getAttribute("link");
+String formName = (String)request.getAttribute("name");
+String formTags = (String)request.getAttribute("tags");
+String formAlias = (String)request.getAttribute("alias");
+String formAction = (String)request.getAttribute("formAction"); //TODO : modifier le nom action en formAction parce que sinon ça fait tout péter
if (formLink == null)
formLink = "URL";
if (formName == null)
@@ -71,15 +73,15 @@
if (formAlias == null)
formAlias = "alias";
if (formAction == null)
- formAction = "bow?action=addUrl";
+ formAction = "bow?action=addUrl";
%>
<div id="logout">
- <form method="post" action="bow?action=logout">
+ <s:form action="/bow/logout.action">
<div class="input">
- <input type="submit" value="Logout" />
+ <s:submit value="%{getText('logout')}" />
</div>
- </form>
- <a href="http://maven-site.chorem.org/bow/" class="help" target="blank">Aide</a>
+ </s:form>
+ <a href="http://maven-site.chorem.org/bow/" class="help" target="_blank">Aide</a>
</div>
<div id="side">
<div id="colonneD">
@@ -101,13 +103,13 @@
</div>
<div id="add" class="clearfix">
<h2>Add / Modify</h2>
- <form id="bookmarkForm" method="post" action="<%=formAction%>">
- <div class="input"><label for="url">URL</label><input type="text" name="url" id="url" value="<%=formLink%>" /></div>
- <div class="input"><label for="alias">ALIAS</label><input type="text" name="alias" id="alias" value="<%=formAlias%>" /></div>
- <div class="input"><label for="name">DESC</label><input type="text" name="name" id="name" value="<%=formName%>" /></div>
- <div class="input"><label for="tags">TAGS</label><input type="text" name="tags" id="tags" value="<%=formTags%>" /></div>
- <div class="input"><input type="submit" value="Save" /></div>
- </form>
+ <s:form id="bookmarkForm" action=""> <!-- <%=formAction%> -->
+ <div class="input"><s:textfield key="url" name="url" label="%{getText('url')}" value="" /></div><!-- <%=formLink%> -->
+ <div class="input"><s:textfield key="alias" name="alias" label="%{getText('alias')}" value="" /></div><!-- <%=formAlias%> -->
+ <div class="input"><s:textfield key="name" name="name" label="%{getText('name')}" value="" /></div><!-- <%=formName%> -->
+ <div class="input"><s:textfield key="tags" name="tags" label="%{getText('tags')}" value="" /></div><!-- <%=formTags%> -->
+ <div class="input"><s:submit value="%{getText('save')}" /></div>
+ </s:form>
</div>
<div id="nuage">
<% if (searchLine != null) { %>
@@ -119,36 +121,36 @@
<% } %>
</div>
<div class="recherche">
- <h2><label for="searchLine">Search</label></h2>
- <form method="post" action="bow?action=search">
+ <h2><label for="searchLine"><s:property value="%{getText('search')}" /></label></h2>
+ <s:form action="/bow/search.action">
<div class="input">
- <input type="text" name="searchLine" id="searchLine" />
- <input type="submit" value="Find" />
+ <s:textfield key="searchLine" name="searchLine" />
+ <s:submit value="%{getText('find')}" />
</div>
- </form>
+ </s:form>
</div>
<div class="recherche">
- <h2><label for="fullTextLine">Full text search</label></h2>
- <form method="post" action="bow?action=fullText">
+ <h2><label for="fullTextLine"><s:property value="%{getText('fullTextSearch')}" /></label></h2>
+ <s:form action="/bow/fullText.action">
<div class="input">
<% if (fullText != null) { %>
- <input type="text" name="fullTextLine" id="fullTextLine" value="<%=fullText%>" />
+ <s:textfield key="fullTextLine" name="fullTextLine" value="" /> <!-- <%=fullText%> -->
<% } else { %>
- <input type="text" name="fullTextLine" id="fullTextLine" />
+ <s:textfield key="fullTextLine" name="fullTextLine" />
<% } %>
- <input type="submit" value="Find" />
+ <s:submit value="%{getText('find')}" />
</div>
- </form>
+ </s:form>
</div>
<div id="import">
- <h2>Import Bookmarks</h2>
- <form method="post" action="bow?action=importBookmarks" enctype="multipart/form-data">
+ <h2><s:property value="%{getText('importBookmarks')}" /></h2>
+ <s:form action="/bow/importBookmarks.action" enctype="multipart/form-data">
<div class="input">
- <input type="file" name="upfile" size="15%" /><br />
- <input type="submit" value="Import" />
+ <s:file name="upfile" size="15%" label="%{getText('file')}" /><br />
+ <s:submit value="%{'import'}" />
</div>
- </form>
- <a href="bow?action=exportBookmarks">Export bookmarks</a>
+ </s:form>
+ <a href="/bow/exportBookmarks.action"><s:property value="%{getText('exportBookmarks')}" /></a>
</div>
<div class="colonnebas">
<img src="img/piedmenu.jpg" width="401" height="77" alt="Pied de menu" />
Added: trunk/src/main/webapp/styles/forms.css
===================================================================
--- trunk/src/main/webapp/styles/forms.css (rev 0)
+++ trunk/src/main/webapp/styles/forms.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,100 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+/* FORM ELEMENTS */
+ form {
+ margin:0;
+ padding:0;
+ }
+ form div,
+ form p {
+ font-size: 1em;
+ margin: 0 0 1em 0;
+ padding: 0;
+ }
+ label {
+ font-weight: bold;
+ }
+ fieldset {
+ border: 1px solid #eee;
+ padding: 5px 10px;
+ margin: 0 0 1.5em 0;
+ }
+ fieldset legend {
+ color: #666;
+ font-size: 1.1em;
+ font-weight: bold;
+ margin: 0 0 0 0px;
+ padding: 0;
+ background-color: white;
+ }
+ * html fieldset legend {
+ margin: 0 0 10px -10px;
+ }
+ fieldset ul {
+ list-style: none;
+ margin: 0 0 1.5em 0;
+ padding: 0;
+ }
+ fieldset ul li {
+ list-style: none;
+ margin: 0 0 0.5em 0;
+ padding: 0;
+ }
+
+
+ input, select, textarea {
+ font-size:1em;
+ font-family: arial, helvetica, verdana, sans-serif;
+
+ margin: 0;
+ padding: 2px;
+ }
+
+ input, select {
+ vertical-align:middle;
+ }
+ textarea {
+ width: 200px;
+ height: 8em;
+ }
+
+ input.check {
+ border: none;
+ width: auto;
+ height: auto;
+ margin: 0;
+ }
+ input.radio {
+ border: none;
+ width: auto;
+ height: auto;
+ margin: 0;
+ }
+ input.file {
+ height: auto;
+ width: 250px;
+ }
+ input.readonly {
+ background-color: transparent;
+ border: none;
+ }
+ input.button {
+ width: 10em;
+ border:1px solid black;
+ background-color: #ddd;
+ }
+ input.image {
+ border: none;
+ width: auto;
+ height: auto;
+ }
+
+ form div.submit {
+ margin: 1em 0;
+ }
+ form div.submit input {
+ height: 2em;
+ width: 15em;
+ }
+/* END FORM ELEMENTS */
+
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/forms.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/layout-1col.css
===================================================================
--- trunk/src/main/webapp/styles/layout-1col.css (rev 0)
+++ trunk/src/main/webapp/styles/layout-1col.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,27 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+@import url("nav-horizontal.css");
+
+/* NAV BAR AT THE TOP AND ONE COLUMN OF CONTENT */
+ div#content {
+ position: relative;
+ width: 701px;
+
+ margin: 0 auto 20px auto;
+ padding: 0;
+
+ text-align: left;
+ }
+ div#main {
+ width: 100%;
+ }
+ div#local {
+ display: none;
+ }
+ div#sub {
+ display: none;
+ }
+ div#nav {
+ display: none;
+ }
+/* END CONTENT */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/layout-1col.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/layout-navleft-1col.css
===================================================================
--- trunk/src/main/webapp/styles/layout-navleft-1col.css (rev 0)
+++ trunk/src/main/webapp/styles/layout-navleft-1col.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,31 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+@import url("nav-vertical.css");
+
+/* NAV BAR ON THE LEFT AND ONE COLUMN OF CONTENT */
+ div#content {
+ position: relative;
+ width: 780px;
+
+ margin: 0 auto 20px auto;
+ padding: 0;
+
+ text-align: left;
+ }
+ div#main {
+ float: right;
+ width: 560px;
+ display: inline;
+ }
+ div#local {
+ display: none;
+ }
+ div#sub {
+ display: none;
+ }
+ div#nav {
+ float: left;
+ width: 200px;
+ display: inline;
+ }
+/* END CONTENT */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/layout-navleft-1col.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/layout-navleft-2col.css
===================================================================
--- trunk/src/main/webapp/styles/layout-navleft-2col.css (rev 0)
+++ trunk/src/main/webapp/styles/layout-navleft-2col.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,39 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+@import url("nav-vertical.css");
+
+/* NAV BAR ON THE LEFT AND TWO COLUMNS OF CONTENT */
+ div#content {
+ position: relative;
+ width: 780px;
+
+ margin: 0 auto 20px auto;
+ padding: 0;
+
+ text-align: left;
+ }
+ div#main {
+ float: right;
+ width: 340px;
+ display: inline;
+
+ margin-right: 220px;
+ margin-left: -220px;
+ }
+ div#local {
+ display: none;
+ }
+ div#sub {
+ float: right;
+ width: 200px;
+ display: inline;
+
+ margin-right: -340px;
+ margin-left: 200px;
+ }
+ div#nav {
+ float: left;
+ width: 200px;
+ display: inline;
+ }
+/* END CONTENT */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/layout-navleft-2col.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/layout-navtop-1col.css
===================================================================
--- trunk/src/main/webapp/styles/layout-navtop-1col.css (rev 0)
+++ trunk/src/main/webapp/styles/layout-navtop-1col.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,32 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+@import url("nav-horizontal.css");
+
+/* NAV BAR AT THE TOP AND ONE COLUMN OF CONTENT */
+ div#content {
+ position: relative;
+ width: 701px;
+
+ margin: 0 auto 20px auto;
+ padding: 0;
+
+ text-align: left;
+ }
+ div#main {
+ width: 100%;
+ }
+ div#local {
+ width: 100%;
+ }
+ div#sub {
+ width: 100%;
+ }
+ div#nav {
+ position: absolute;
+ top: -15px;
+ left: 0;
+ width: 100%;
+
+ text-align: left;
+ }
+/* END CONTENT */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/layout-navtop-1col.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/layout-navtop-3col.css
===================================================================
--- trunk/src/main/webapp/styles/layout-navtop-3col.css (rev 0)
+++ trunk/src/main/webapp/styles/layout-navtop-3col.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,43 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+@import url("nav-horizontal.css");
+
+/* NAV BAR AT THE TOP, LOCAL NAV ON THE LEFT AND TWO COLUMNS OF CONTENT */
+ div#content {
+ position: relative;
+ width: 701px;
+
+ margin: 0 auto 20px auto;
+ padding: 0;
+
+ text-align: left;
+ }
+ div#main {
+ float: left;
+ width: 300px;
+ display: inline;
+
+ margin-right: -200px;
+ margin-left: 200px;
+ }
+ div#sub {
+ float: right;
+ width: 180px;
+ display: inline;
+ }
+ div#local {
+ float: left;
+ width: 180px;
+ display: inline;
+
+ margin-left: -300px;
+ }
+ div#nav {
+ position: absolute;
+ top: -15px;
+ left: 0;
+ width: 701px;
+
+ text-align: left;
+ }
+/* END CONTENT */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/layout-navtop-3col.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/layout-navtop-localleft.css
===================================================================
--- trunk/src/main/webapp/styles/layout-navtop-localleft.css (rev 0)
+++ trunk/src/main/webapp/styles/layout-navtop-localleft.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,36 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+@import url("nav-horizontal.css");
+
+/* NAV BAR AT THE TOP, LOCAL NAVIGATION ON THE LEFT AND ONE COLUMN OF CONTENT */
+ div#content {
+ position: relative;
+ width: 701px;
+
+ margin: 0 auto 20px auto;
+ padding: 0;
+
+ text-align: left;
+ }
+ div#main {
+ float: right;
+ width: 500px;
+ display: inline;
+ }
+ div#local {
+ float: left;
+ width: 200px;
+ display: inline;
+ }
+ div#sub {
+ display: none;
+ }
+ div#nav {
+ position: absolute;
+ top: -15px;
+ left: 0;
+ width: 100%;
+
+ text-align: left;
+ }
+/* END CONTENT */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/layout-navtop-localleft.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/layout-navtop-subright.css
===================================================================
--- trunk/src/main/webapp/styles/layout-navtop-subright.css (rev 0)
+++ trunk/src/main/webapp/styles/layout-navtop-subright.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,36 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+@import url("nav-horizontal.css");
+
+/* NAV BAR AT THE TOP AND TWO COLUMNS OF CONTENT */
+ div#content {
+ position: relative;
+ width: 701px;
+
+ margin: 0 auto 20px auto;
+ padding: 0;
+
+ text-align: left;
+ }
+ div#main {
+ float: left;
+ width: 480px;
+ display: inline;
+ }
+ div#sub {
+ float: right;
+ width: 200px;
+ display: inline;
+ }
+ div#local {
+ display: none;
+ }
+ div#nav {
+ position: absolute;
+ top: -15px;
+ left: 0;
+ width: 100%;
+
+ text-align: left;
+ }
+/* END CONTENT */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/layout-navtop-subright.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/layout.css
===================================================================
--- trunk/src/main/webapp/styles/layout.css (rev 0)
+++ trunk/src/main/webapp/styles/layout.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,125 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+/* SITE SPECIFIC LAYOUT */
+ body {
+ margin: 0;
+ padding: 0;
+
+ background: white;
+
+ text-align: center;
+ }
+ div#page {
+ width: 780px;
+
+ margin: 0 auto;
+ padding: 0;
+
+ background: white;
+ text-align: center;
+ }
+
+ /* HEADER */
+ div#header {
+ margin: 0 0 5em 0;
+ padding: 40px 20px;
+
+ color: white;
+ background: black;
+
+ text-align: left;
+ }
+ div#branding {
+ float: left;
+ width: 40%;
+
+ margin: 0;
+ padding: 10px 0 10px 20px;
+
+ text-align: left;
+ }
+ div#search {
+ float: right;
+ width: 49%;
+
+ margin: 0;
+ padding: 16px 20px 0 0;
+
+ text-align: right;
+ }
+ /* END HEADER */
+
+
+ /* CONTENT */
+ div#content {
+
+ }
+
+ /* MAIN */
+ div#main {
+
+ }
+ /* END MAIN */
+
+ /* SUB */
+ div#sub {
+
+ }
+ /* END SUB */
+
+ /* END CONTENT */
+
+
+ /* FOOTER */
+ div#footer {
+ color: white;
+ background-color: black;
+ }
+ div#footer p {
+ font-size: 0.8em;
+
+ margin: 0;
+ padding: 15px;
+ }
+ /* END FOOTER */
+/* END LAYOUT */
+
+
+
+
+/* UL.SUBNAV */
+ ul.subnav {
+ margin: 0;
+ padding: 0;
+
+ font-size: 0.8em;
+ list-style: none;
+ }
+ ul.subnav li {
+ margin: 0 0 1em 0;
+ padding: 0;
+ list-style: none;
+ }
+ ul.subnav li a,
+ ul.subnav li a:link,
+ ul.subnav li a:visited,
+ ul.subnav li a:active {
+ text-decoration: none;
+ font-weight: bold;
+ color: black;
+ }
+ ul.subnav li a:hover {
+ text-decoration: underline;
+ }
+ ul.subnav li strong {
+ padding: 0 0 0 12px;
+ background: url("../i/subnav-highlight.gif") left top no-repeat transparent;
+ }
+ ul.subnav li strong a,
+ ul.subnav li strong a:link,
+ ul.subnav li strong a:visited,
+ ul.subnav li strong a:active {
+ color: white;
+ background-color: black;
+ }
+/* END UL.SUBNAV */
Property changes on: trunk/src/main/webapp/styles/layout.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/main.css
===================================================================
--- trunk/src/main/webapp/styles/main.css (rev 0)
+++ trunk/src/main/webapp/styles/main.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,21 @@
+/*
+ Css Framework
+ =============
+ - see http://www.contentwithstyle.co.uk/Articles/17/a-css-framework
+ for more info.
+*/
+@import url("tools.css");
+@import url("typo.css");
+@import url("forms.css");
+/*
+ Swap layout stylesheet:
+ layout-navtop-localleft.css
+ layout-navtop-subright.css
+ layout-navtop-3col.css
+ layout-navtop-1col.css
+ layout-navleft-1col.css
+ layout-navleft-2col.css
+*/
+@import url("layout-navtop-localleft.css");
+@import url("layout.css");
+
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/main.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/nav-horizontal.css
===================================================================
--- trunk/src/main/webapp/styles/nav-horizontal.css (rev 0)
+++ trunk/src/main/webapp/styles/nav-horizontal.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,80 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+/* NAV */
+ div#nav {
+ font-size: 0.8em;
+ }
+ * html div#nav {
+ /* hide ie/mac \*/
+ height: 1%;
+ /* end hide */
+ }
+ div#nav div.wrapper {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ }
+ div#nav ul {
+ width: auto;
+ width: 100%;
+
+ margin: 0;
+ padding: 0;
+
+ line-height: 1em;
+ list-style: none;
+ }
+ div#nav li {
+ float: left;
+ display: inline;
+
+ list-style: none;
+
+ margin: 0;
+ padding: 0;
+
+ line-height: 1em;
+ border-right: 1px solid #aaa;
+ }
+ div#nav li.last {
+ border-right: none;
+ }
+ div#nav a,
+ div#nav a:link,
+ div#nav a:active,
+ div#nav a:visited {
+ display: inline-block;
+ /* hide from ie/mac \*/
+ display: block;
+ /* end hide */
+ font-weight: bold;
+ text-decoration: none;
+
+ margin: 0;
+ padding: 5px 38px 5px 38px;
+
+ color: black;
+ background: #ddd;
+ }
+ div#nav a:hover {
+ text-decoration: underline;
+ }
+ div#nav strong {
+ display: inline-block;
+ /* hide from ie/mac \*/
+ display: block;
+ /* end hide */
+
+ color: white;
+ background: black;
+ }
+ div#nav strong a,
+ div#nav strong a:link,
+ div#nav strong a:active,
+ div#nav strong a:visited,
+ div#nav strong a:hover {
+ color: white;
+ background-color: black;
+ }
+/* END NAV */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/nav-horizontal.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/nav-vertical.css
===================================================================
--- trunk/src/main/webapp/styles/nav-vertical.css (rev 0)
+++ trunk/src/main/webapp/styles/nav-vertical.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,79 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+/* NAV */
+ div#nav {
+ font-size: 0.8em;
+ }
+ * html div#nav {
+ /* hide ie/mac \*/
+ height: 1%;
+ /* end hide */
+ }
+ div#nav div.wrapper {
+ width: 100%;
+
+ background: #ddd;
+ }
+ div#nav ul {
+ width: auto;
+ width: 100%;
+
+ margin: 0;
+ padding: 0;
+
+ line-height: 1em;
+ list-style: none;
+ }
+ div#nav li {
+ display: block;
+
+ list-style: none;
+
+ margin: 0;
+ padding: 0;
+
+ line-height: 1em;
+ }
+ * html div#nav li {
+ /* hide ie/mac \*/
+ height: 1%;
+ /* end hide */
+ }
+ div#nav li.last {
+
+ }
+ div#nav a,
+ div#nav a:link,
+ div#nav a:active,
+ div#nav a:visited {
+ display: block;
+
+ font-weight: bold;
+ text-decoration: none;
+
+ margin: 0;
+ padding: 5px 10px 5px 10px;
+
+ color: black;
+ background: white;
+ }
+ div#nav a:hover {
+ color: white;
+ background: black;
+ text-decoration: underline;
+ }
+ div#nav strong {
+ display: block;
+
+ color: white;
+ background: black;
+ }
+ div#nav strong a,
+ div#nav strong a:link,
+ div#nav strong a:active,
+ div#nav strong a:visited,
+ div#nav strong a:hover {
+ color: white;
+ background-color: black;
+ }
+/* END NAV */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/nav-vertical.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/tools.css
===================================================================
--- trunk/src/main/webapp/styles/tools.css (rev 0)
+++ trunk/src/main/webapp/styles/tools.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,68 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+/* clearing */
+ .stretch,
+ .clear {
+ clear:both;
+ height:1px;
+ margin:0;
+ padding:0;
+ font-size: 15px;
+ line-height: 1px;
+ }
+ .clearfix:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+ * html>body .clearfix {
+ display: inline-block;
+ width: 100%;
+ }
+
+ * html .clearfix {
+ /* Hides from IE-mac \*/
+ height: 1%;
+ /* End hide from IE-mac */
+ }
+/* end clearing */
+
+
+/* replace */
+ .replace {
+ display:block;
+
+ background-repeat: no-repeat;
+ background-position: left top;
+ background-color:transparent;
+ }
+ /* tidy these up */
+ .replace * {
+ text-indent: -10000px;
+ display:block;
+
+ background-repeat: no-repeat;
+ background-position: left top;
+ background-color:transparent;
+ }
+ .replace a {
+ text-indent:0;
+ }
+ .replace a span {
+ text-indent:-10000px;
+ }
+/* end replace */
+
+
+/* accessibility */
+ span.accesskey {
+ text-decoration:none;
+ }
+ .accessibility {
+ position: absolute;
+ top: -999em;
+ left: -999em;
+ }
+/* end accessibility */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/tools.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/src/main/webapp/styles/typo.css
===================================================================
--- trunk/src/main/webapp/styles/typo.css (rev 0)
+++ trunk/src/main/webapp/styles/typo.css 2010-12-24 18:24:46 UTC (rev 151)
@@ -0,0 +1,177 @@
+/* A CSS Framework by Mike Stenhouse of Content with Style */
+
+/* TYPOGRAPHY */
+ body {
+ text-align: left;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 76%;
+ line-height: 1em;
+ color: #333;
+ }
+ div {
+ font-size: 1em;
+ }
+ img {
+ border: 0;
+ }
+
+/* LINKS */
+ a,
+ a:link
+ a:active {
+ color: blue;
+ background-color: white;
+ text-decoration: underline;
+ }
+ a:visited {
+ color: purple;
+ background-color: transparent;
+ }
+ a:hover {
+ color: white;
+ background-color: black;
+ text-decoration: none;
+ }
+/* END LINKS */
+
+/* HEADINGS */
+ h1 {
+ font-size: 2em;
+ line-height: 1.5em;
+ margin: 0 0 0.5em 0;
+ padding: 0;
+ color: black;
+ }
+ h2 {
+ font-size: 1.5em;
+ line-height: 1.5em;
+ margin: 0 0 0.5em 0;
+ padding: 0;
+ color: black;
+ }
+ h3 {
+ font-size: 1.3em;
+ line-height: 1.3em;
+ margin: 0 0 0.5em 0;
+ padding:0;
+ color: black;
+ }
+ h4 {
+ font-size: 1.2em;
+ line-height: 1.3em;
+ margin: 0 0 0.25em 0;
+ padding: 0;
+ color: black;
+ }
+ h5 {
+ font-size: 1.1em;
+ line-height: 1.3em;
+ margin: 0 0 0.25em 0;
+ padding: 0;
+ color: black;
+ }
+ h6 {
+ font-size: 1em;
+ line-height: 1.3em;
+ margin: 0 0 0.25em 0;
+ padding: 0;
+ color: black;
+ }
+/* END HEADINGS */
+
+/* TEXT */
+ p {
+ font-size: 1em;
+ margin: 0 0 1.5em 0;
+ padding: 0;
+ line-height:1.4em;
+ }
+ blockquote {
+ border-left:10px solid #ddd;
+ margin-left:10px;
+ }
+ pre {
+ font-family: monospace;
+ font-size: 1.0em;
+ }
+ strong, b {
+ font-weight: bold;
+ }
+ em, i {
+ font-style:italic;
+ }
+ code {
+ font-family: "Courier New", Courier, monospace;
+ font-size: 1em;
+ white-space: pre;
+ }
+/* END TEXT */
+
+/* LISTS */
+ ul {
+ line-height:1.4em;
+ margin: 0 0 1.5em 0;
+ padding: 0;
+ }
+ ul li {
+ margin: 0 0 0.25em 30px;
+ padding: 0;
+ }
+ ol {
+ font-size: 1.0em;
+ line-height: 1.4em;
+ margin: 0 0 1.5em 0;
+ padding: 0;
+ }
+ ol li {
+ font-size: 1.0em;
+ margin: 0 0 0.25em 30px;
+ padding: 0;
+ }
+ dl {
+ margin: 0 0 1.5em 0;
+ padding: 0;
+ line-height: 1.4em;
+ }
+ dl dt {
+ font-weight: bold;
+ margin: 0.25em 0 0.25em 0;
+ padding: 0;
+ }
+ dl dd {
+ margin: 0 0 0 30px;
+ padding: 0;
+ }
+/* END LISTS */
+
+
+/* TABLE */
+ table {
+ font-size: 1em;
+ margin: 0 0 1.5em 0;
+ padding: 0;
+ }
+ table caption {
+ font-weight: bold;
+ margin: 0 0 0 0;
+ padding: 0 0 1.5em 0;
+ }
+ th {
+ font-weight: bold;
+ text-align: left;
+ }
+ td {
+ font-size: 1em;
+ }
+/* END TABLE */
+
+ hr {
+ display: none;
+ }
+ div.hr {
+ height: 1px;
+ margin: 1.5em 10px;
+ border-bottom: 1px dotted black;
+ }
+
+/* END TYPOGRAPHY */
\ No newline at end of file
Property changes on: trunk/src/main/webapp/styles/typo.css
___________________________________________________________________
Added: svn:mime-type
+ text/plain
1
0
Author: vbriand
Date: 2010-12-23 15:19:56 +0100 (Thu, 23 Dec 2010)
New Revision: 150
Url: http://chorem.org/repositories/revision/bow/150
Log:
The clicks counter is now next to the description instead of below the tags
Modified:
trunk/src/main/webapp/bookmark.jsp
trunk/src/main/webapp/css/bookmark.css
Modified: trunk/src/main/webapp/bookmark.jsp
===================================================================
--- trunk/src/main/webapp/bookmark.jsp 2010-12-23 10:47:00 UTC (rev 149)
+++ trunk/src/main/webapp/bookmark.jsp 2010-12-23 14:19:56 UTC (rev 150)
@@ -58,6 +58,7 @@
</div>
<div class="bookmarkcontenu">
<div class="screenshot"></div>
+ <div class="click"><%=bookmark.getClick()%></div>
<div class="description">
<h3>Description :</h3>
<p>
@@ -88,7 +89,6 @@
%>
</p>
</div>
- <div class="click"><%=bookmark.getClick()%></div>
</div>
</div>
<% } %>
Modified: trunk/src/main/webapp/css/bookmark.css
===================================================================
--- trunk/src/main/webapp/css/bookmark.css 2010-12-23 10:47:00 UTC (rev 149)
+++ trunk/src/main/webapp/css/bookmark.css 2010-12-23 14:19:56 UTC (rev 150)
@@ -95,7 +95,7 @@
.bookmark .bookmarkcontenu{
clear:both;
padding-top:5px;
- padding-right: 132px;
+ padding-right: 152px;
}
.bookmark .bookmarkhead .date{
@@ -177,17 +177,17 @@
width:100%;
line-height:28px;
padding-top:10px;
- margin-bottom:-90px;
+ margin-bottom:-70px;
}
.bookmark .click{
background:transparent url('/bow/img/click.jpg') no-repeat scroll 0 0;
float:right;
height:27px;
- margin:5px 5px 5px 5px;
+ margin:10px -25px 5px 5px;
padding-top:31px;
position:relative;
- right:-100px;
+ right:-120px;
width:31px;
text-align:center;
}
1
0
Author: jcouteau
Date: 2010-12-23 11:47:00 +0100 (Thu, 23 Dec 2010)
New Revision: 149
Url: http://chorem.org/repositories/revision/bow/149
Log:
Improve doc about openSearch
Modified:
trunk/src/site/rst/user/openSearch.rst
Modified: trunk/src/site/rst/user/openSearch.rst
===================================================================
--- trunk/src/site/rst/user/openSearch.rst 2010-12-23 10:39:22 UTC (rev 148)
+++ trunk/src/site/rst/user/openSearch.rst 2010-12-23 10:47:00 UTC (rev 149)
@@ -34,6 +34,41 @@
Le temporaire ne dure que le temps d'expiration de la session. Une fois ajouté
vous pouvez l'utiliser à n'importe quel moment.
+Recherche dans les tags
+-----------------------
+
+En préfixant votre recherche par ':' ou 't:', vous rechercherez dans vos tags.
+Par exemple, si je veux rechercher les marque-pages taggués avec le mot gwt,
+je recherche alors ::
+
+ :gwt
+
+ou ::
+
+ t:gwt
+
+Recherche dans les alias - Redirection
+--------------------------------------
+
+En préfixant la recherche par 'a:', vous effectuerez une redirection vers la
+page ayant cet alias. Par exemple, si vous avez une page avec l'alias 'toto'. Si
+vous recherchez::
+
+ a:toto
+
+Vous ouvrirez la page dont l'alias est 'toto'.
+
+Recherche full-text
+-------------------
+
+En préfixant la recherche par 'f:', vous effectuerez une recherche sur le
+contenu complet des marque-pages. Par exemple, si vous recherchez::
+
+ f:gwt
+
+Vous trouverez tous les marque-pages taggués gwt ainsi que tous ceux qui
+contiennent le mot gwt dans leur nom, description,...
+
Moteur de recherche externe
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -62,8 +97,9 @@
Effectuer une recherche avec le moteur externe
----------------------------------------------
-Pour cela préfixez votre recherche de **":"**. Par exemple, si je recherche::
+Pour cela tappez juste votre recherche dans votre barre de recherche. Par
+exemple, si je recherche::
- :bow
+ bow
Cela recherchera bow dans mon moteur de recherche préféré.
1
0
Author: bpoussin
Date: 2010-12-23 11:39:22 +0100 (Thu, 23 Dec 2010)
New Revision: 148
Url: http://chorem.org/repositories/revision/bow/148
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-12-23 10:39:20 UTC (rev 147)
+++ trunk/pom.xml 2010-12-23 10:39:22 UTC (rev 148)
@@ -15,7 +15,7 @@
<groupId>org.chorem</groupId>
<artifactId>bow</artifactId>
- <version>0.3</version>
+ <version>0.4-SNAPSHOT</version>
<dependencies>
@@ -114,11 +114,11 @@
</dependencies>
<scm>
- <connection>scm:svn:http://svn.chorem.org/svn/bow/tags/bow-0.3</connection>
+ <connection>scm:svn:http://svn.chorem.org/svn/bow/trunk</connection>
<developerConnection>
- scm:svn:http://svn.chorem.org/svn/bow/tags/bow-0.3
+ scm:svn:http://svn.chorem.org/svn/bow/trunk
</developerConnection>
- <url>http://www.chorem.org/repositories/browse/bow/tags/bow-0.3</url>
+ <url>http://www.chorem.org/repositories/browse/bow/trunk</url>
</scm>
<!-- ************************************************************* -->
1
0
Author: bpoussin
Date: 2010-12-23 11:39:20 +0100 (Thu, 23 Dec 2010)
New Revision: 147
Url: http://chorem.org/repositories/revision/bow/147
Log:
[maven-release-plugin] copy for tag bow-0.3
Added:
tags/bow-0.3/
1
0