r154 - in trunk/src/main: resources resources/org/chorem/bow/action webapp webapp/jsp webapp/jsp/inc
Author: vbriand Date: 2010-12-30 18:57:29 +0100 (Thu, 30 Dec 2010) New Revision: 154 Url: http://chorem.org/repositories/revision/bow/154 Log: L'ajout manuel de bookmark commence ?\195?\160 marchouiller mais pas encore l'affichage Added: trunk/src/main/webapp/jsp/inc/bookmark.jsp trunk/src/main/webapp/jsp/inc/rightMenu.jsp trunk/src/main/webapp/jsp/inc/tagsCloud.jsp trunk/src/main/webapp/jsp/preferences.jsp Removed: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties trunk/src/main/webapp/rightMenu.jsp trunk/src/main/webapp/tagsCloud.jsp Modified: trunk/src/main/resources/struts.xml trunk/src/main/webapp/jsp/home.jsp trunk/src/main/webapp/jsp/login.jsp Deleted: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties 2010-12-30 14:45:38 UTC (rev 153) +++ trunk/src/main/resources/org/chorem/bow/action/RightMenuAction.properties 2010-12-30 17:57:29 UTC (rev 154) @@ -1,5 +0,0 @@ -url = URL -alias = ALIAS -name = DESC -tags = TAGS -save = Save \ No newline at end of file Deleted: trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties =================================================================== --- trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties 2010-12-30 14:45:38 UTC (rev 153) +++ trunk/src/main/resources/org/chorem/bow/action/RightMenuAction_fr.properties 2010-12-30 17:57:29 UTC (rev 154) @@ -1,5 +0,0 @@ -url = URL -alias = ALIAS -name = DESC -tags = TAGS -save = Sauvegarder \ No newline at end of file Modified: trunk/src/main/resources/struts.xml =================================================================== --- trunk/src/main/resources/struts.xml 2010-12-30 14:45:38 UTC (rev 153) +++ trunk/src/main/resources/struts.xml 2010-12-30 17:57:29 UTC (rev 154) @@ -30,6 +30,7 @@ <result>/jsp/home.jsp</result> </action> <action name="addUrl" class="org.chorem.bow.action.AddUrlAction"> + <result type="redirect">/home.action</result> <!-- La redirection change selon le type de page sur laquelle on est, donc je ne vois pas trop comment faire ça pour le moment--> </action> </package> Modified: trunk/src/main/webapp/jsp/home.jsp =================================================================== --- trunk/src/main/webapp/jsp/home.jsp 2010-12-30 14:45:38 UTC (rev 153) +++ trunk/src/main/webapp/jsp/home.jsp 2010-12-30 17:57:29 UTC (rev 154) @@ -60,7 +60,7 @@ request.setAttribute("bookmark", bookmark); request.setAttribute("sdf", sdf); %> - <jsp:include page="/bookmark.jsp" flush="true" /> + <jsp:include page="/jsp/inc/bookmark.jsp" flush="true" /> <% ++count; if (count >= nbBookmarks) { @@ -69,7 +69,7 @@ } } else { %> - <p class="nobookmarks"><s:property value="%{getText('noBookmarks')}" /></p> + <p class="nobookmarks"><s:property value="%{getText('noBookmarks')}" /></p><s:set var="formAction" value="%{formAction}" /> <% } %> </div> @@ -86,7 +86,7 @@ request.setAttribute("bookmark", bookmark); request.setAttribute("sdf", sdf); %> - <jsp:include page="/bookmark.jsp" flush="true" /> + <jsp:include page="/jsp/inc/bookmark.jsp" flush="true" /> <% ++count; if (count >= nbBookmarks) { @@ -97,8 +97,8 @@ else { %> <p class="nobookmarks"><s:property value="%{getText('noBookmarks')}" /></p> <% } %> - </div> - <jsp:include page="/rightMenu.jsp" /> - </body> -</html> + </div> + <jsp:include page="/jsp/inc/rightMenu.jsp" /> + </body> + </html> <% } %> Added: trunk/src/main/webapp/jsp/inc/bookmark.jsp =================================================================== --- trunk/src/main/webapp/jsp/inc/bookmark.jsp (rev 0) +++ trunk/src/main/webapp/jsp/inc/bookmark.jsp 2010-12-30 17:57:29 UTC (rev 154) @@ -0,0 +1,94 @@ +<!-- + #%L + bow + + $Id: bookmark.jsp 150 2010-12-23 14:19:56Z vbriand $ + $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/bookmark.jsp $ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="org.chorem.bow.BowConfig" %> +<%@page import="org.chorem.bow.Bookmark" %> +<%@page import="java.text.SimpleDateFormat" %> +<%@page import="org.chorem.bow.BookmarkActions" %> +<%@page import="java.util.Set" %> +<% +Bookmark bookmark = (Bookmark) request.getAttribute("bookmark"); +BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); +SimpleDateFormat sdf = (SimpleDateFormat) request.getAttribute("sdf"); +String url = (String) request.getAttribute("bowUrl"); +String aliasUrl = BowConfig.getInstance().getServletAliasUrl(); +String search = ""; +String searchLine = request.getParameter("searchLine"); +if (searchLine != null) { + search += "&searchLine=" + searchLine; +} +String fullTextLine = request.getParameter("fullTextLine"); +if (fullTextLine != null) { + search += "&fullTextLine=" + fullTextLine; +} +if (url != null && bookmark != null && sdf != null && bookmarkActions != null) { + String formBookmarkId = (String) request.getAttribute("formBookmarkId"); + String link = bookmark.getLink(); + link = link.replace("'", "\\'"); +%> +<div class="bookmark"> + <div class="bookmarkhead"> + <a class="alias" href="<%=aliasUrl + bookmark.getAlias()%>" title="<%=bookmark.getLink()%>" onclick="window.open(this.href); return false;"> + <%=bookmark.getAlias()%> + </a> + <p class="date"> (<%=sdf.format(bookmark.getDate())%>)</p> + <a class="edit" href="/bow/editBookmark.action&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow/modifyBookmark.action&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>', '<%=bookmark.getWikittyId()%>');"></a> + <a class="supprim" href="/bow/removeBookmark.action&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>"></a> + </div> + <div class="bookmarkcontenu"> + <div class="screenshot"></div> + <div class="click"><%=bookmark.getClick()%></div> + <div class="description"> + <h3>Description :</h3> + <p> + <a title ="<%=bookmark.getLink()%>" href="/bow/addClick.action&bookmarkId=<%=bookmark.getWikittyId()%>" onclick="window.open(this.href); return false;"><%=bookmark.getDescription()%></a> + </p> + <p class="tags"> + <strong>Tags :</strong> + <% + Set<String> tagList = bookmark.getTags(); + if (tagList != null && !tagList.isEmpty()) { + for (String tag : tagList) { + if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) { + %> + <a style="text-decoration: none;" href="/bow/deleteTag.action&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%><%=search%>"> + <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" /> + </a> + <% + } else { + %> + <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="/bow/deleteTag.action&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%><%=search%>"> + <img style="border:none;" src="img/delete.png" alt="Delete tag" title="Delete" /> + </a> + <% } %> + <a href="/bow/search.action&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a> + <% + } + } + %> + </p> + </div> + </div> +</div> +<% } %> Property changes on: trunk/src/main/webapp/jsp/inc/bookmark.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain Copied: trunk/src/main/webapp/jsp/inc/rightMenu.jsp (from rev 152, trunk/src/main/webapp/rightMenu.jsp) =================================================================== --- trunk/src/main/webapp/jsp/inc/rightMenu.jsp (rev 0) +++ trunk/src/main/webapp/jsp/inc/rightMenu.jsp 2010-12-30 17:57:29 UTC (rev 154) @@ -0,0 +1,160 @@ +<!-- + #%L + bow + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@taglib prefix="s" uri="/struts-tags" %> +<%@page import="org.chorem.bow.BookmarkActions" %> +<%@page import="java.text.SimpleDateFormat" %> +<%@page import="java.util.Iterator" %> +<%@page import="java.util.Set" %> +<%@page import="java.util.ArrayList" %> +<%@page import="java.util.List" %> +<%@page import="org.chorem.bow.TokenActions" %> +<%@page import="org.nuiton.wikitty.FacetTopic" %> +<%@page import="org.chorem.bow.Bookmark" %> +<%@page import="org.chorem.bow.Preference" %> +<% +TokenActions tokenActions = (TokenActions)session.getAttribute("tokenActions"); +BookmarkActions bookmarkActions = (BookmarkActions)request.getAttribute("bookmarkActions"); +Boolean admin = (Boolean)session.getAttribute("admin"); +if (admin == null) { + admin = false; +} + +String temporaryToken = tokenActions.getTemporaryToken(); +String permanentToken = tokenActions.getPermanentToken(); +String url = (String) request.getAttribute("bowUrl"); +int nbTags = 100; +Preference preference = (Preference)session.getAttribute("preference"); +if (preference != null) { + int tags = preference.getTags(); + if (tags > 0) + nbTags = tags; +} +request.setAttribute("nbTags", nbTags); +String searchLine = null; +String fullText = null; +if (bookmarkActions != null){ + searchLine = bookmarkActions.getSearchLine(); + fullText = bookmarkActions.getFullTextLine(); +} + +String formLink = (String)request.getAttribute("link"); +String formName = (String)request.getAttribute("name"); +String formTags = (String)request.getAttribute("tags"); +String formAlias = (String)request.getAttribute("alias"); +String formAction = (String)request.getAttribute("formAction"); //TODO : modifier le nom action en formAction parce que sinon ça fait tout péter + +if (formLink == null) + formLink = "URL"; +if (formName == null) + formName = "name"; +if (formTags == null) + formTags = "tag1 tag2..."; +if (formAlias == null) + formAlias = "alias"; +if (formAction == null) + formAction = "/bow/addUrl.action"; +%> +<div id="logout"> + <s:form action="/bow/logout.action"> + <div class="input"> + <s:submit value="%{getText('logout')}" /> + </div> + </s:form> + <a href="http://maven-site.chorem.org/bow/" class="help" target="_blank"><s:property value="%{getText('help')}" /></a> +</div> +<div id="side"> + <div id="colonneD"> + <ul class="droite"> + <% if (admin) { %> + <li><a href="/bow/admin.action"><s:property value="%{getText('admin')}" /></a></li> + <% } %> + <li><a href="/bow/preferences.action"><s:property value="%{getText('preferences')}" /></a></li> + <li><a title="%{getText('temporaryLinkDescription')}" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>/addUrl.action&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:property value="%{getText('temporaryLink')}" /></a></li> + <li><a title="%{getText('permanentLinkDescription')}" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>/addUrl.action&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);"><s:property value="%{getText('permanentLink')}" /></a></li> + </ul> + <div id="extensions"> + <h2><s:property value="%{getText('extensions')}" /></h2> + <ul class="droite"> + <li><a href="extensions/bow4chromium.crx"><img src="img/chromium.png" class="extensionIcon" /><div class="extensionName">Extension pour Chromium</div></a></li> + <li><strong><s:property value="%{getText('permanentTokenId')}" /></strong> <%= permanentToken %></li> + <li><strong><s:property value="%{getText('sessionTokenId')}" /></strong> <%= temporaryToken %></li> + </ul> + </div> + <div id="add" class="clearfix"> + <h2><s:property value="%{getText('addModify')}" /></h2> + <s:form id="bookmarkForm" action="/bow/addUrl.action"> + <div class="input"><s:textfield key="link" name="link" label="%{getText('link')}" /></div><!-- <%=formLink%> --> + <div class="input"><s:textfield key="alias" name="alias" label="%{getText('alias')}" value="" /></div><!-- <%=formAlias%> --> + <div class="input"><s:textfield key="name" name="name" label="%{getText('name')}" value="" /></div><!-- <%=formName%> --> + <div class="input"><s:textfield key="tags" name="tags" label="%{getText('tags')}" value="" /></div><!-- <%=formTags%> --> + <div class="input"><s:submit value="%{getText('save')}" /></div> + </s:form> + </div> + <div id="nuage"> + <% if (searchLine != null) { %> + <jsp:include page="tagsCloud.jsp" flush="true"> + <jsp:param name="searchLine" value="<%=searchLine%>" /> + </jsp:include> + <% } else { %> + <jsp:include page="tagsCloud.jsp" flush="true" /> + <% } %> + </div> + <div class="recherche"> + <h2><label for="searchLine"><s:property value="%{getText('search')}" /></label></h2> + <s:form action="/bow/search.action"> + <div class="input"> + <s:textfield key="searchLine" name="searchLine" /> + <s:submit value="%{getText('find')}" /> + </div> + </s:form> + </div> + <div class="recherche"> + <h2><label for="fullTextLine"><s:property value="%{getText('fullTextSearch')}" /></label></h2> + <s:form action="/bow/fullText.action"> + <div class="input"> + <% if (fullText != null) { %> + <s:textfield key="fullTextLine" name="fullTextLine" value="" /> <!-- <%=fullText%> --> + <% } else { %> + <s:textfield key="fullTextLine" name="fullTextLine" /> + <% } %> + <s:submit value="%{getText('find')}" /> + </div> + </s:form> + </div> + <div id="import"> + <h2><s:property value="%{getText('importBookmarks')}" /></h2> + <s:form action="/bow/importBookmarks.action" enctype="multipart/form-data"> + <div class="input"> + <s:file name="upfile" size="15%" label="%{getText('file')}" /><br /> + <s:submit value="%{getText('import')}" /> + </div> + </s:form> + <a href="/bow/exportBookmarks.action"><s:property value="%{getText('exportBookmarks')}" /></a> + </div> + <div class="colonnebas"> + <img src="img/piedmenu.jpg" width="401" height="77" alt="Pied de menu" /> + </div> + </div> +</div> Property changes on: trunk/src/main/webapp/jsp/inc/rightMenu.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Copied: trunk/src/main/webapp/jsp/inc/tagsCloud.jsp (from rev 152, trunk/src/main/webapp/tagsCloud.jsp) =================================================================== --- trunk/src/main/webapp/jsp/inc/tagsCloud.jsp (rev 0) +++ trunk/src/main/webapp/jsp/inc/tagsCloud.jsp 2010-12-30 17:57:29 UTC (rev 154) @@ -0,0 +1,51 @@ +<!-- + #%L + bow + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page import="org.chorem.bow.BookmarkActions" %> +<%@page import="java.util.List" %> +<%@page import="org.nuiton.wikitty.FacetTopic" %> +<% +BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); +int nbTags = (Integer) request.getAttribute("nbTags"); +String search = ""; +String searchLine = request.getParameter("searchLine"); +if (searchLine != null) { + search += "&searchLine=" + searchLine; +} +if (bookmarkActions != null) { + List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud(); + int count = 0; + for (FacetTopic tag : tagCloud) { + int value = tag.getCount(); + String tagName = tag.getTopicName(); + int font = bookmarkActions.getFont(value); + %> + <a href="bow?action=search&addTag=<%=tagName%><%=search%>" title="<%=value%> result<%=(value != 1 ? "s" : "")%>" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a> + <% + ++count; + if (count >= nbTags) { + break; + } + } +} +%> Property changes on: trunk/src/main/webapp/jsp/inc/tagsCloud.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/src/main/webapp/jsp/login.jsp =================================================================== --- trunk/src/main/webapp/jsp/login.jsp 2010-12-30 14:45:38 UTC (rev 153) +++ trunk/src/main/webapp/jsp/login.jsp 2010-12-30 17:57:29 UTC (rev 154) @@ -19,10 +19,10 @@ <s:submit value="%{getText('login')}" /> </p> </s:form> - <s:url id="localeEN" action="login"> + <s:url id="localeEN" action="login_input"> <s:param name="request_locale" >en</s:param> </s:url> - <s:url id="localeFR" action="login"> + <s:url id="localeFR" action="login_input"> <s:param name="request_locale" >fr</s:param> </s:url> Added: trunk/src/main/webapp/jsp/preferences.jsp =================================================================== --- trunk/src/main/webapp/jsp/preferences.jsp (rev 0) +++ trunk/src/main/webapp/jsp/preferences.jsp 2010-12-30 17:57:29 UTC (rev 154) @@ -0,0 +1,141 @@ +<!-- + #%L + bow + + $Id: preferences.jsp 144 2010-12-23 10:24:48Z bpoussin $ + $HeadURL: http://svn.chorem.org/svn/bow/trunk/src/main/webapp/preferences.jsp $ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@taglib prefix="s" uri="/struts-tags"%> +<%@page import="org.chorem.bow.Preference"%> +<%@page import="org.chorem.bow.User"%> +<%@page import="org.chorem.bow.TokenActions"%> +<%@page import="org.chorem.bow.BookmarkActions"%> +<%@page import="org.chorem.bow.Bookmark" %> +<%@page import="org.chorem.bow.Import" %> +<%@page import="org.nuiton.wikitty.FacetTopic" %> +<%@page import="java.util.List" %> +<%@page import="java.util.Date" %> +<% +User user = (User) session.getAttribute("user"); +Preference preference = (Preference) session.getAttribute("preference"); +TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); +//Boolean admin = (Boolean) session.getAttribute("admin"); +//if (admin == null) { +// admin = false; +//} +int nbTags = 100; + +if (user != null && preference != null && tokenActions != null){ + int tags = preference.getTags(); + if (tags > 0) { + nbTags = tags; + } + request.setAttribute("nbTags", nbTags); +// String url = (String) request.getAttribute("bowUrl"); +// String version = (String) request.getAttribute("version"); +// String temporaryToken = tokenActions.getTemporaryToken(); +// String permanentToken = tokenActions.getPermanentToken(); + String check = preference.getColors(); + if (check == null) { + preference.setColors(""); + } + check = preference.getSearchEngineUrlResults(); + if (check == null) { + preference.setSearchEngineUrlResults(""); + } + check = preference.getSearchEngineUrlSuggestions(); + if (check == null) { + preference.setSearchEngineUrlSuggestions(""); + } + %> + <html> + <head> + <link href="<s:url value='/css/bookmark.css'/>" rel="stylesheet" type="text/css" /> + <s:head /> + </head> + <body> + <div id="content"> + <div class="menu clearfix"> + <h2><s:property value="%{getText('preferences')}" /></h2> + </div> + <s:form action="/bow/changePreferences.action"> + <div class="formFrame"> + <h3><s:property value="%{getText('userInfo')}" /></h3> + <p> + <s:textfield key="email" name="email" label="%{getText('email')}" /><br /><br /><!-- value="<%=user.getEmail()%>" --> + <s:password key="currentPassword" name="currentPassword" label="%{getText('currentPassword')}" /> + <s:password key="newPassword" name="newPassword" label="%{getText('newPassword')}" /> + <s:password key="confirmNewPassword" name="confirmNewPassword" label="%{getText('confirmNewPassword')}" /> + <a href="/bow/generateToken.action" id="regenPermToken"><s:property value="%{getText('regenPermToken')}" /></a> + </p> + </div> + <div class="formFrame"> + <h3><s:property value="%{getText('siteLook')}" /></h3> + <p> + <s:textfield key="colors" name="colors" label="%{getText('siteColor')}" /><br /> <!-- value="<%=preference.getColors()%>" --> + <s:textfield key="tagsNb" name="tagsNb" label="%{getText('tagsNb')}" /><br /> + <s:textfield key="bookmarksHomePage" name="bookmarksHomePage" label="%{getText('bookmarksHomePage')}" /><br /> + <s:textfield key="searchEngineUrlSuggestions" name="searchEngineUrlSuggestions" label="%{getText('searchEngineUrlSuggestions')}" /><br /> + <s:textfield key="searchEngineUrlResults" name="searchEngineUrlResults" label="%{getText('searchEngineUrlResults')}" /> + <s:submit value="%{getText('changePreferences')}" /> + <br /><br /> + <a href="/bow/home.action" id="homePage"><s:property value="%{getText('homePage')}" /></a> + </p> + </div> + </s:form> + <div class="menu clearfix"> + <h2><s:property value="%{getText('importedBookmarks')}" /></h2> + </div> + <% + List<FacetTopic> bookmarkImportList = (List<FacetTopic>)request.getAttribute("bookmarksImportDate"); + if (bookmarkImportList != null) { + if (bookmarkImportList.size() > 0) { + String bgColors[] = {"Pink", "White"}; + int i = 0; + int colorsNb = bgColors.length; + + for (FacetTopic bookmarkImport : bookmarkImportList) { + String date = bookmarkImport.getTopicName(); + String dateSave = date; + + date = date.replaceAll("[^0-9:-]+", " ").trim(); + date = date.substring(0, date.lastIndexOf(' ')); + %> + <div class="deleteImport deleteImport<%=bgColors[i % colorsNb]%>"> + <span><%= date + " (" + bookmarkImport.getCount() + " bookmarks)" %></span> + <a class="deleteImportButton" href="" onclick="deleteConfirmation('/bow/deleteImport.action&date=<%=dateSave%>',<%=bookmarkImport.getCount()%>,'<%=date%>'); return(false);"></a> + </div> + <% + i++; + } + } else { + %> + <div class="deleteImport deleteImportWhite"> + <span><s:property value="%{getText('noImportedBookmarks')}" /></span> + </div> + <% + } + } + %> + </div> + <jsp:include page="/jsp/inc/rightMenu.jsp" flush="true" /> + </body> + </html> +<% } %> \ No newline at end of file Property changes on: trunk/src/main/webapp/jsp/preferences.jsp ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: trunk/src/main/webapp/rightMenu.jsp =================================================================== --- trunk/src/main/webapp/rightMenu.jsp 2010-12-30 14:45:38 UTC (rev 153) +++ trunk/src/main/webapp/rightMenu.jsp 2010-12-30 17:57:29 UTC (rev 154) @@ -1,159 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> -<%@taglib prefix="s" uri="/struts-tags" %> -<%@page import="org.chorem.bow.BookmarkActions" %> -<%@page import="java.text.SimpleDateFormat" %> -<%@page import="java.util.Iterator" %> -<%@page import="java.util.Set" %> -<%@page import="java.util.ArrayList" %> -<%@page import="java.util.List" %> -<%@page import="org.chorem.bow.TokenActions" %> -<%@page import="org.nuiton.wikitty.FacetTopic" %> -<%@page import="org.chorem.bow.Bookmark" %> -<%@page import="org.chorem.bow.Preference" %> -<% -TokenActions tokenActions = (TokenActions) session.getAttribute("tokenActions"); -BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); -Boolean admin = (Boolean) session.getAttribute("admin"); -if (admin == null) { - admin = false; -} - -String temporaryToken = tokenActions.getTemporaryToken(); -String permanentToken = tokenActions.getPermanentToken(); -String url = (String) request.getAttribute("bowUrl"); -int nbTags = 100; -Preference preference = (Preference) session.getAttribute("preference"); -if (preference != null) { - int tags = preference.getTags(); - if (tags > 0) - nbTags = tags; -} -request.setAttribute("nbTags", nbTags); -String searchLine = null; -String fullText = null; -if (bookmarkActions != null){ - searchLine = bookmarkActions.getSearchLine(); - fullText = bookmarkActions.getFullTextLine(); -} - -String formLink = (String)request.getAttribute("link"); -String formName = (String)request.getAttribute("name"); -String formTags = (String)request.getAttribute("tags"); -String formAlias = (String)request.getAttribute("alias"); -String formAction = (String)request.getAttribute("formAction"); //TODO : modifier le nom action en formAction parce que sinon ça fait tout péter -if (formLink == null) - formLink = "URL"; -if (formName == null) - formName = "name"; -if (formTags == null) - formTags = "tag1 tag2..."; -if (formAlias == null) - formAlias = "alias"; -if (formAction == null) - formAction = "bow?action=addUrl"; -%> -<div id="logout"> - <s:form action="/bow/logout.action"> - <div class="input"> - <s:submit value="%{getText('logout')}" /> - </div> - </s:form> - <a href="http://maven-site.chorem.org/bow/" class="help" target="_blank">Aide</a> -</div> -<div id="side"> - <div id="colonneD"> - <ul class="droite"> - <% if (admin) { %> - <li><a href="bow?action=admin">Admin</a></li> - <% } %> - <li><a href="bow?action=preferences">Preferences</a></li> - <li><a title="Add this link to your favourites to bookmark others in the future. This link is just available while you are connected on the site!" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>?action=addUrl&token=<%=temporaryToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);">Bookmark add link (session)</a></li> - <li><a title="Add this link to your favourites to bookmark others in the future. This link is always available!" href="javascript:var%20url=location.href;var%20nameAndTags=prompt('Entrez%20le%20nom%20du%20lien%20et%20la%20liste%20des%20tags%20sous%20la%20forme:%20name|tag1%20tag2%20tag3',%20document.title+'|');if%20(nameAndTags!=(document.title+'|')){var%20link='<%=url%>?action=addUrl&token=<%=permanentToken%>&url='+encodeURIComponent(url)+'&nameAndTags='+encodeURIComponent(nameAndTags);var%20script=document.createElement('script');script.src=link;script.type='text/javascript';document.body.appendChild(script);}void(0);">Bookmark add link (permanent)</a></li> - </ul> - <div id="extensions"> - <h2>Extensions</h2> - <ul class="droite"> - <li><a href="extensions/bow4chromium.crx"><img src="img/chromium.png" class="extensionIcon" /><div class="extensionName">Extension pour Chromium</div></a></li> - <li><strong>Permanent token id:</strong> <%= permanentToken %></li> - <li><strong>Session token id:</strong> <%= temporaryToken %></li> - </ul> - </div> - <div id="add" class="clearfix"> - <h2>Add / Modify</h2> - <s:form id="bookmarkForm" action=""> <!-- <%=formAction%> --> - <div class="input"><s:textfield key="url" name="url" label="%{getText('url')}" value="" /></div><!-- <%=formLink%> --> - <div class="input"><s:textfield key="alias" name="alias" label="%{getText('alias')}" value="" /></div><!-- <%=formAlias%> --> - <div class="input"><s:textfield key="name" name="name" label="%{getText('name')}" value="" /></div><!-- <%=formName%> --> - <div class="input"><s:textfield key="tags" name="tags" label="%{getText('tags')}" value="" /></div><!-- <%=formTags%> --> - <div class="input"><s:submit value="%{getText('save')}" /></div> - </s:form> - </div> - <div id="nuage"> - <% if (searchLine != null) { %> - <jsp:include page="tagsCloud.jsp" flush="true"> - <jsp:param name="searchLine" value="<%=searchLine%>" /> - </jsp:include> - <% } else { %> - <jsp:include page="tagsCloud.jsp" flush="true" /> - <% } %> - </div> - <div class="recherche"> - <h2><label for="searchLine"><s:property value="%{getText('search')}" /></label></h2> - <s:form action="/bow/search.action"> - <div class="input"> - <s:textfield key="searchLine" name="searchLine" /> - <s:submit value="%{getText('find')}" /> - </div> - </s:form> - </div> - <div class="recherche"> - <h2><label for="fullTextLine"><s:property value="%{getText('fullTextSearch')}" /></label></h2> - <s:form action="/bow/fullText.action"> - <div class="input"> - <% if (fullText != null) { %> - <s:textfield key="fullTextLine" name="fullTextLine" value="" /> <!-- <%=fullText%> --> - <% } else { %> - <s:textfield key="fullTextLine" name="fullTextLine" /> - <% } %> - <s:submit value="%{getText('find')}" /> - </div> - </s:form> - </div> - <div id="import"> - <h2><s:property value="%{getText('importBookmarks')}" /></h2> - <s:form action="/bow/importBookmarks.action" enctype="multipart/form-data"> - <div class="input"> - <s:file name="upfile" size="15%" label="%{getText('file')}" /><br /> - <s:submit value="%{'import'}" /> - </div> - </s:form> - <a href="/bow/exportBookmarks.action"><s:property value="%{getText('exportBookmarks')}" /></a> - </div> - <div class="colonnebas"> - <img src="img/piedmenu.jpg" width="401" height="77" alt="Pied de menu" /> - </div> - </div> -</div> Deleted: trunk/src/main/webapp/tagsCloud.jsp =================================================================== --- trunk/src/main/webapp/tagsCloud.jsp 2010-12-30 14:45:38 UTC (rev 153) +++ trunk/src/main/webapp/tagsCloud.jsp 2010-12-30 17:57:29 UTC (rev 154) @@ -1,51 +0,0 @@ -<!-- - #%L - bow - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<%@page import="org.chorem.bow.BookmarkActions" %> -<%@page import="java.util.List" %> -<%@page import="org.nuiton.wikitty.FacetTopic" %> -<% -BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); -int nbTags = (Integer) request.getAttribute("nbTags"); -String search = ""; -String searchLine = request.getParameter("searchLine"); -if (searchLine != null) { - search += "&searchLine=" + searchLine; -} -if (bookmarkActions != null) { - List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud(); - int count = 0; - for (FacetTopic tag : tagCloud) { - int value = tag.getCount(); - String tagName = tag.getTopicName(); - int font = bookmarkActions.getFont(value); - %> - <a href="bow?action=search&addTag=<%=tagName%><%=search%>" title="<%=value%> result<%=(value != 1 ? "s" : "")%>" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a> - <% - ++count; - if (count >= nbTags) { - break; - } - } -} -%>
participants (1)
-
vbriand@users.chorem.org