r151 - in trunk: . src/main/java/org/chorem/bow src/main/java/org/chorem/bow/action src/main/resources src/main/resources/org src/main/resources/org/chorem src/main/resources/org/chorem/bow src/main/resources/org/chorem/bow/action src/main/webapp src/main/webapp/WEB-INF src/main/webapp/WEB-INF/decorators src/main/webapp/js src/main/webapp/jsp src/main/webapp/jsp/inc src/main/webapp/styles
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
participants (1)
-
vbriand@users.chorem.org