branch develop updated (2ed8277 -> 5935a25)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository bow. See http://git.chorem.org/bow.git from 2ed8277 fixes #1262: add support to track bookmark add throw atom feed new e7b3213 fixes #1262: add support to track bookmark add throw atom feed - fixes bug in atom format new 92b801d add support to filter on specific BowBookmark wikittyId (listId) useful to show bookmark after editing or for atom link new 28e6673 improve redirect after add (reditect to editing if no information) use new funtionnality (filter on id) to present bookmark after editing new 5935a25 url to web site for one entry use new filter on id to display only one bookmark The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 5935a25d64d68381f7dbb81957c786f6bd3ab3ca Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sat Jul 18 00:21:55 2015 +0200 url to web site for one entry use new filter on id to display only one bookmark commit 28e6673b7cf3a7f5d303d4012f0d650407a8fd1d Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sat Jul 18 00:15:07 2015 +0200 improve redirect after add (reditect to editing if no information) use new funtionnality (filter on id) to present bookmark after editing commit 92b801d849e62c3aecf5412a20166e11e6bb121e Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sat Jul 18 00:12:38 2015 +0200 add support to filter on specific BowBookmark wikittyId (listId) useful to show bookmark after editing or for atom link commit e7b32138e4e839669169ec5aee90377932a2335b Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Fri Jul 17 21:46:08 2015 +0200 fixes #1262: add support to track bookmark add throw atom feed - fixes bug in atom format Summary of changes: .../main/java/org/chorem/bow/BookmarkUtils.java | 13 +- bow-ui/src/main/java/org/chorem/bow/BowUtils.java | 34 ++++- .../java/org/chorem/bow/action/AtomAction.java | 9 +- .../java/org/chorem/bow/action/BowBaseAction.java | 11 ++ .../bow/action/bookmark/AddOrUpdateAction.java | 150 ++++----------------- .../action/bookmark/DeleteSearchResultsAction.java | 6 +- .../org/chorem/bow/action/bookmark/HomeAction.java | 3 +- bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp | 38 +++--- 8 files changed, 103 insertions(+), 161 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository bow. See http://git.chorem.org/bow.git commit e7b32138e4e839669169ec5aee90377932a2335b Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Fri Jul 17 21:46:08 2015 +0200 fixes #1262: add support to track bookmark add throw atom feed - fixes bug in atom format --- .../java/org/chorem/bow/action/AtomAction.java | 7 +++-- bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp | 32 +++++++++++----------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/bow-ui/src/main/java/org/chorem/bow/action/AtomAction.java b/bow-ui/src/main/java/org/chorem/bow/action/AtomAction.java index c262307..7c6803c 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/AtomAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/AtomAction.java @@ -20,6 +20,7 @@ */ package org.chorem.bow.action; +import java.util.Date; import java.util.List; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; @@ -58,7 +59,7 @@ public class AtomAction extends BowBaseAction { protected List<BowBookmark> bookmarks; - protected String date; + protected Date date; protected String redirectTo = "/"; @@ -78,7 +79,7 @@ public class AtomAction extends BowBaseAction { return bookmarks; } - public String getDate() { + public Date getDate() { return date; } @@ -100,7 +101,7 @@ public class AtomAction extends BowBaseAction { criteria.setLimit(count); WikittyQueryResult<String> bookmarksId = proxy.findAllByQuery(criteria); bookmarks = proxy.restore(BowBookmark.class, bookmarksId.getAll(), "WikittyAuthorisation.owner"); - date = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(System.currentTimeMillis()); + date = new Date(); if (log.isDebugEnabled()) { log.debug(String.format("Rss found='%s'" + bookmarks.size())); diff --git a/bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp b/bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp index ccc8f97..ab3a756 100644 --- a/bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp +++ b/bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp @@ -31,12 +31,12 @@ <title>Bow</title> <subtitle>tag='${tagLine}' search='${fullTextLine}'</subtitle> - <s:url var="bowUrl" action="home" escapeAmp="false"> + <s:url var="bowUrl" action="home" escapeAmp="true"> <s:param name="token" value="%{bowSession.permanentToken}" /> <s:param name="tagLine" value="%{tagLine}" /> <s:param name="fullTextLine" value="%{fullTextLine}" /> </s:url> - <s:url var="atomUrl" action="atom" escapeAmp="false"> + <s:url var="atomUrl" action="atom" escapeAmp="true"> <s:param name="token" value="%{bowSession.permanentToken}" /> <s:param name="tagLine" value="%{tagLine}" /> <s:param name="fullTextLine" value="%{fullTextLine}" /> @@ -45,7 +45,7 @@ <link rel="alternate" type="text/html" href="${bowDomain}${bowUrl}"/> <link rel="self" type="application/atom+xml" href="${bowDomain}${atomUrl}"/> - <updated>${date}</updated> + <updated><fmt:formatDate value="${date}" pattern="yyyy-MM-dd'T'HH:mm:ssXXX" /></updated> <author> <name>${bowSession.user.login}</name> </author> @@ -57,38 +57,38 @@ <s:set name="bookmark" value="bookmark"/> <entry> <title><s:property value="%{#bookmark.link}" /></title> - <s:url var="bookmarkUrl" action="home" escapeAmp="false"> + <s:url var="bookmarkUrl" action="home" escapeAmp="true"> <s:param name="token" value="%{bowSession.permanentToken}" /> <s:param name="fullTextLine" value="%{#bookmark.link}" /> </s:url> <link rel="alternate" type="text/html" href="${bowDomain}${bookmarkUrl}"/> <link href="${bookmark.link}"/> <id>${bowDomain}${bookmark.wikittyId}</id> - <updated><fmt:formatDate value="${bookmark.creationDate}" pattern="yyyy-MM-dd'T'HH:mm:ssZ" /></updated> + <updated><fmt:formatDate value="${bookmark.creationDate}" pattern="yyyy-MM-dd'T'HH:mm:ssXXX" /></updated> <author> <name><s:property value="%{#bookmark.getOwner(false).login}" /></name> </author> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <span class="left"> + <span> <s:set var="favicon" value="#bookmark.favicon"/> <c:if test="${fn:length(favicon) > 0}"> - <img class="favicon" src="data:image/png;base64,${u:base64(favicon)}"/> + <img src="data:image/png;base64,${u:base64(favicon)}"/> </c:if> - <span class="left date"><fmt:formatDate value="${bookmark.creationDate}" pattern="yyyy-MM-dd" /></updated></span> + <span><fmt:formatDate value="${bookmark.creationDate}" pattern="yyyy-MM-dd" /></span> <c:if test="${not empty bookmark.privateAlias}"> - <span class="left"> - <s:a cssClass="alias" href="%{config.aliasUrl + #bookmark.wikittyId}.action" + <span> + <s:a href="%{config.aliasUrl + #bookmark.wikittyId}.action" title="%{#bookmark.link}" target="_blank"> alias: ${bookmark.privateAlias} </s:a> </span> </c:if> <c:if test="${not empty bookmark.publicAlias}"> - <span class="left"> - <s:a cssClass="alias" href="%{config.aliasUrl + #bookmark.publicAlias}.action" + <span> + <s:a href="%{config.aliasUrl + #bookmark.publicAlias}.action" title="%{#bookmark.link}" target="_blank"> alias public: ${bookmark.publicAlias} </s:a> @@ -96,7 +96,7 @@ </c:if> </span> - <div class="description"> + <div> <p> <s:a href="%{config.aliasUrl + #bookmark.wikittyId}.action">${bookmark.link}</s:a> </p> @@ -104,17 +104,17 @@ <p> ${bookmark.description} </p> - <p class="tags"> + <p> <strong><s:text name="bow.bookmark.tags" /> :</strong> <s:iterator value="#bookmark.labels" var="tag"> - <s:url var="search" action="home" escapeAmp="false"> + <s:url var="search" action="home" escapeAmp="true"> <s:param name="addTag" value="%{#tag}"/> <s:param name="tagLine" value="%{tagLine}"/> <s:param name="fullTextLine" value="%{fullTextLine}"/> <s:param name="order" value="%{order}"/> <%-- on ne met pas 'first', il faut repartir de 0 --%> </s:url> - <a href="${bowDomain}${search}" cssClass="tag"><s:property value="%{#tag}"/></a> + <a href="${bowDomain}${search}"><s:property value="%{#tag}"/></a> </s:iterator> </p> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository bow. See http://git.chorem.org/bow.git commit 92b801d849e62c3aecf5412a20166e11e6bb121e Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sat Jul 18 00:12:38 2015 +0200 add support to filter on specific BowBookmark wikittyId (listId) useful to show bookmark after editing or for atom link --- .../main/java/org/chorem/bow/BookmarkUtils.java | 13 ++++++--- bow-ui/src/main/java/org/chorem/bow/BowUtils.java | 34 ++++++++++++++++++---- .../java/org/chorem/bow/action/AtomAction.java | 2 +- .../java/org/chorem/bow/action/BowBaseAction.java | 11 +++++++ .../action/bookmark/DeleteSearchResultsAction.java | 6 ++-- .../org/chorem/bow/action/bookmark/HomeAction.java | 3 +- 6 files changed, 54 insertions(+), 15 deletions(-) diff --git a/bow-ui/src/main/java/org/chorem/bow/BookmarkUtils.java b/bow-ui/src/main/java/org/chorem/bow/BookmarkUtils.java index e615c74..690d348 100644 --- a/bow-ui/src/main/java/org/chorem/bow/BookmarkUtils.java +++ b/bow-ui/src/main/java/org/chorem/bow/BookmarkUtils.java @@ -31,6 +31,8 @@ import org.nuiton.util.StringUtil; import java.util.Date; import java.util.Set; import java.util.HashSet; +import java.util.List; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.IOUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; @@ -69,13 +71,16 @@ public class BookmarkUtils { } public static WikittyQuery getBookmarkListCriteriaByUser(BowUser user, - String tagLine, - String fullTextLine, - String order, - int first) { + List<String> listId, String tagLine, String fullTextLine, + String order, int first) { + WikittyQueryMaker search = new WikittyQueryMaker().and(); addEqUser(search, user.getWikittyId()); + if (CollectionUtils.isNotEmpty(listId)) { + search.containsOne(Element.ID, listId); + } + if (StringUtils.isNotBlank(fullTextLine)) { search.keyword(fullTextLine); } diff --git a/bow-ui/src/main/java/org/chorem/bow/BowUtils.java b/bow-ui/src/main/java/org/chorem/bow/BowUtils.java index 1abf130..b4dd42a 100644 --- a/bow-ui/src/main/java/org/chorem/bow/BowUtils.java +++ b/bow-ui/src/main/java/org/chorem/bow/BowUtils.java @@ -28,9 +28,11 @@ import org.nuiton.util.StringUtil; import java.util.Arrays; import java.util.Date; import java.util.HashSet; +import java.util.List; import java.util.Set; import java.util.UUID; import org.apache.commons.codec.binary.Base64; +import org.apache.commons.collections4.CollectionUtils; import org.nuiton.wikitty.query.WikittyQuery; import org.nuiton.wikitty.query.WikittyQueryMaker; @@ -141,20 +143,40 @@ public class BowUtils { * @return the page where the user will be redirected */ public static String redirectTo(String tagLine, String fullTextLine) { + String result = redirectTo(null, tagLine, fullTextLine); + return result; + } + + /** + * Redirects the user either on the home page or on the search page + * + * @param listId list of bookmark id + * @param tagLine search line + * @param fullTextLine full text search + * @return the page where the user will be redirected + */ + public static String redirectTo(List<String> listId, String tagLine, String fullTextLine) { String result = "home.action"; + + boolean listIdNotEmpty = CollectionUtils.isNotEmpty(listId); boolean tagLineNotBlank = StringUtils.isNotBlank(tagLine); boolean fullTextLineNotBlank = StringUtils.isNotBlank(fullTextLine); - if (tagLineNotBlank || fullTextLineNotBlank) { + if (listIdNotEmpty || tagLineNotBlank || fullTextLineNotBlank) { result += "?"; - if (tagLineNotBlank) { - result += "tagLine=" + tagLine; + String sep = ""; + if (listIdNotEmpty) { + for (String id : listId) { + result += sep + "listId=" + id; + sep = "&"; + } } - if (tagLineNotBlank && fullTextLineNotBlank) { - result += "&"; + if (tagLineNotBlank) { + result += sep + "tagLine=" + tagLine; + sep = "&"; } if (fullTextLineNotBlank) { - result += "fullTextLine=" + fullTextLine; + result += sep + "fullTextLine=" + fullTextLine; } } return result; diff --git a/bow-ui/src/main/java/org/chorem/bow/action/AtomAction.java b/bow-ui/src/main/java/org/chorem/bow/action/AtomAction.java index 7c6803c..fcfd311 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/AtomAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/AtomAction.java @@ -97,7 +97,7 @@ public class AtomAction extends BowBaseAction { BowProxy proxy = session.getProxy(); WikittyQuery criteria = BookmarkUtils.getBookmarkListCriteriaByUser( - user, tagLine, fullTextLine, "descDate", 0); + user, listId, tagLine, fullTextLine, "descDate", 0); criteria.setLimit(count); WikittyQueryResult<String> bookmarksId = proxy.findAllByQuery(criteria); bookmarks = proxy.restore(BowBookmark.class, bookmarksId.getAll(), "WikittyAuthorisation.owner"); diff --git a/bow-ui/src/main/java/org/chorem/bow/action/BowBaseAction.java b/bow-ui/src/main/java/org/chorem/bow/action/BowBaseAction.java index 65ec010..f15856c 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/BowBaseAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/BowBaseAction.java @@ -62,6 +62,9 @@ public class BowBaseAction extends BaseAction implements SessionAware { /** Configuration, default null for lazy loading */ protected transient BowConfig config; + /** des identifiants de bookmark a recherche explicitemnet */ + protected List<String> listId; + /** Les tags a recherche separer par un espace */ protected String tagLine; @@ -100,6 +103,14 @@ public class BowBaseAction extends BaseAction implements SessionAware { this.session = session; } + public List<String> getListId() { + return listId; + } + + public void setListId(List<String> listId) { + this.listId = listId; + } + /** @return the tagLine */ public String getTagLine() { return tagLine; diff --git a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/DeleteSearchResultsAction.java b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/DeleteSearchResultsAction.java index db0f67c..fd7f466 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/DeleteSearchResultsAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/DeleteSearchResultsAction.java @@ -52,10 +52,10 @@ public class DeleteSearchResultsAction extends BowBaseAction { // potentiellement des bookmarks qui ne nous appartiennent pas, // dans ce cas, ne faudrait-il pas seulement ce supprimer des // reader/write/admin ? - // FIXME tchemit 20110829 J'ai mis en dernier paramètre 0 car ça ne compilait pô mais je sais pas si c'est le bon!... WikittyQuery criteria = BookmarkUtils.getBookmarkListCriteriaByUser( - user, tagLine, fullTextLine, null, 0); - + user, listId, tagLine, fullTextLine, null, 0); + criteria.setLimit(Integer.MAX_VALUE); + BowProxy proxy = getBowProxy(); List<String> ids = proxy.findAllByQuery(criteria).getAll(); diff --git a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/HomeAction.java b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/HomeAction.java index 56dab4c..7161053 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/HomeAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/HomeAction.java @@ -21,6 +21,7 @@ package org.chorem.bow.action.bookmark; import com.opensymphony.xwork2.ActionContext; +import java.util.List; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -93,7 +94,7 @@ public class HomeAction extends BowBaseAction { BowProxy proxy = session.getProxy(); WikittyQuery criteria = BookmarkUtils.getBookmarkListCriteriaByUser( - user, tagLine, fullTextLine, order, first); + user, listId, tagLine, fullTextLine, order, first); WikittyQueryResult<BowBookmark> result = proxy.findAllByQuery(BowBookmark.class, criteria); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository bow. See http://git.chorem.org/bow.git commit 28e6673b7cf3a7f5d303d4012f0d650407a8fd1d Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sat Jul 18 00:15:07 2015 +0200 improve redirect after add (reditect to editing if no information) use new funtionnality (filter on id) to present bookmark after editing --- .../bow/action/bookmark/AddOrUpdateAction.java | 150 ++++----------------- 1 file changed, 26 insertions(+), 124 deletions(-) diff --git a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/AddOrUpdateAction.java b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/AddOrUpdateAction.java index 640023d..8a6889a 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/AddOrUpdateAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/AddOrUpdateAction.java @@ -20,7 +20,9 @@ */ package org.chorem.bow.action.bookmark; +import java.util.Collections; import java.util.Date; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -134,135 +136,23 @@ public class AddOrUpdateAction extends BowBaseAction { return redirectTo; } -// @Override -// public String execute() { -// String result = SUCCESS; -// try { -// BowProxy proxy = getBowProxy(); -// BowBookmark bookmark = null; -// BowBookmark bookmarkToModify = null; -// -// BowUser user = getBowSession().getUser(); -// String userId = user.getWikittyId(); -// if (StringUtils.isNotBlank(bookmarkId)) { -// bookmarkToModify = proxy.restore(BowBookmark.class, bookmarkId); -// } -// if (log.isDebugEnabled()) { -// log.debug("Change old wikitty: " + bookmarkToModify); -// } -// -// // gere le cas d'une mise a jour ou d'un ajout via le formulaire -// if (name != null) { -// // Si l'alias prive souhaite est deja utilise on ne l'accept pas -// // Si l'alias public souhaite est deja utilise on ne l'accept pas -// // TODO sletellier 20110416 : return error message when public or private alias is already used -// WikittyQuery privateAliasCriteria = null; -// WikittyQuery publicAliasCriteria = null; -// if (StringUtils.isNotEmpty(privateAlias)) { -// privateAliasCriteria = new WikittyQueryMaker().and() -// .eq(BowBookmark.FQ_FIELD_BOWBOOKMARK_PRIVATEALIAS, privateAlias) -// .eq(BowBookmark.FQ_FIELD_WIKITTYAUTHORISATION_OWNER, userId) -// .end().setLimit(0); -// } -// if (StringUtils.isNotEmpty(publicAlias)) { -// publicAliasCriteria = new WikittyQueryMaker() -// .eq(BowBookmark.FQ_FIELD_BOWBOOKMARK_PUBLICALIAS, publicAlias) -// .end().setLimit(0); -// } -// WikittyQueryResult<String>[] aliasResult = proxy.findAllByQuery( -// privateAliasCriteria, publicAliasCriteria); -// -// if (aliasResult[0] != null && aliasResult[0].getTotalResult() > 0) { -// if (bookmarkToModify == null) { -// privateAlias = ""; -// } else { -// privateAlias = bookmarkToModify.getPrivateAlias(); -// } -// } -// if (aliasResult[1] != null && aliasResult[1].getTotalResult() > 0) { -// if (bookmarkToModify == null) { -// publicAlias = ""; -// } else { -// publicAlias = bookmarkToModify.getPublicAlias(); -// } -// } -// -// if (bookmarkToModify == null) { -// bookmark = BookmarkUtils.createBookmark( -// link, name, tags, user, privateAlias, publicAlias, null); -// } else { -// BookmarkUtils.updateBookmark( -// bookmarkToModify, name, link, tags, privateAlias, publicAlias); -// } -// } else { //This part is for the bookmark addition by script -// if (nameAndTags != null) { -// bookmark = BookmarkUtils.createBookmark(link, nameAndTags, user); -// } -// } -// // si on a reussi a creer le bookmark, on regarde s'il ne faut pas -// // le fusionner avec un deja existant -// if (bookmark != null && !bookmark.getDescription().isEmpty() -// && !bookmark.getOwner().isEmpty()) { -// -// // looking for already bookmark with same url, to fusion them -// String link = bookmark.getLink(); -// WikittyQuery criteria = new WikittyQueryMaker().and() -// .eq(BowBookmark.FQ_FIELD_BOWBOOKMARK_LINK, link) -// .eq(BowBookmark.FQ_FIELD_WIKITTYAUTHORISATION_OWNER, userId) -// .end(); -// BowBookmark oldBookmark = -// proxy.findByQuery(BowBookmark.class, criteria); -// if (oldBookmark != null) { -// // fusionne les descriptions et les tags -// // par contre on prend le dernier privateAlias prive choisi par -// // l'utilisateur s'il y en a un -// String description = oldBookmark.getDescription(); -// if (!StringUtils.isEmpty(bookmark.getDescription())) { -// description += "\n"; -// description += BowUtils.formatDate( -// bookmark.getCreationDate()) + ": "; -// description += bookmark.getDescription(); -// } -// -// oldBookmark.setDescription(description); -// oldBookmark.addAllLabels(bookmark.getLabels()); -// String privateAlias = bookmark.getPrivateAlias(); -// if (!StringUtils.isEmpty(privateAlias)) { -// oldBookmark.setPrivateAlias(privateAlias); -// } -// -// bookmark = oldBookmark; -// } -// -// } -// -// if (bookmark != null || bookmarkToModify != null) { -// proxy.store(bookmark, bookmarkToModify); //Stores the bookmark if everything is ok -// addActionMessage(t("bow.bookmark.add.successful")); -// if (log.isDebugEnabled()) { -// log.debug("Adding URL"); -// } -// } -// redirectTo = BowUtils.redirectTo(tagLine, fullTextLine); -// } catch (Exception eee) { -// result = ERROR; -// addActionError(t("bow.error.internal")); -// log.error(eee.getMessage(), eee); -// } -// return result; -// } - @Override public String execute() { String result = SUCCESS; try { + boolean isScriptlet = false; BowProxy proxy = getBowProxy(); BowBookmark bookmark = null; // if we don't have link, link is last entry in nameAndTags if (StringUtils.isBlank(link)) { - link = StringUtils.substringAfterLast(nameAndTags, "|"); - nameAndTags = StringUtils.substringBeforeLast(nameAndTags, "|"); + if (StringUtils.contains(nameAndTags, "|")) { + link = StringUtils.substringAfterLast(nameAndTags, "|"); + nameAndTags = StringUtils.substringBeforeLast(nameAndTags, "|"); + } else { + link = nameAndTags; + nameAndTags = ""; + } } // gere le cas d'une mise a jour ou d'un ajout via le formulaire @@ -270,12 +160,10 @@ public class AddOrUpdateAction extends BowBaseAction { // on est dans le cas ou l'ajout a ete fait par le scriptlet qui // utilise une seul chaine pour name et tags, on decoupe // et on continue normalement + isScriptlet = true; nameAndTags = StringUtils.trimToEmpty(nameAndTags); name = StringUtils.substringBeforeLast(nameAndTags, "|"); tags = StringUtils.substringAfterLast(nameAndTags, "|"); - - // on essai d'afficher l'entree ajoutee - fullTextLine = link; } @@ -384,7 +272,21 @@ public class AddOrUpdateAction extends BowBaseAction { if (log.isDebugEnabled()) { log.debug("Adding URL"); } - redirectTo = BowUtils.redirectTo(tagLine, fullTextLine); + + if (isScriptlet && StringUtils.isBlank(bookmark.getDescription()) + && CollectionUtils.isEmpty(bookmark.getLabels())) { + // le bookmark est trop peu renseigne, on renvoie vers l'edition + redirectTo = String.format("editBookmark.action?id=%s", bookmark.getWikittyId()); + } else { + // on essai d'afficher l'entree ajoutee/modifiee + if (StringUtils.isEmpty(tagLine) && StringUtils.isEmpty(fullTextLine)) { + // il n'y avait pas de filtre on filtre sur l'element qui vient d'etre modifie + listId = Collections.singletonList(bookmark.getWikittyId()); + redirectTo = BowUtils.redirectTo(listId, tagLine, fullTextLine); + } else { + redirectTo = BowUtils.redirectTo(tagLine, fullTextLine); + } + } } catch (Exception eee) { result = ERROR; addActionError(t("bow.error.internal")); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository bow. See http://git.chorem.org/bow.git commit 5935a25d64d68381f7dbb81957c786f6bd3ab3ca Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sat Jul 18 00:21:55 2015 +0200 url to web site for one entry use new filter on id to display only one bookmark --- bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp b/bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp index ab3a756..b3e6f4b 100644 --- a/bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp +++ b/bow-ui/src/main/webapp/WEB-INF/jsp/atom.jsp @@ -56,13 +56,13 @@ <s:iterator value="bookmarks" var="bookmark"> <s:set name="bookmark" value="bookmark"/> <entry> - <title><s:property value="%{#bookmark.link}" /></title> + <title>${bookmark.link}</title> <s:url var="bookmarkUrl" action="home" escapeAmp="true"> <s:param name="token" value="%{bowSession.permanentToken}" /> - <s:param name="fullTextLine" value="%{#bookmark.link}" /> + <s:param name="listId" value="%{#bookmark.wikittyId}" /> </s:url> <link rel="alternate" type="text/html" href="${bowDomain}${bookmarkUrl}"/> - <link href="${bookmark.link}"/> + <link rel="via" href="${bookmark.link}"/> <id>${bowDomain}${bookmark.wikittyId}</id> <updated><fmt:formatDate value="${bookmark.creationDate}" pattern="yyyy-MM-dd'T'HH:mm:ssXXX" /></updated> <author> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm