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 dc7a27cbf9eb16ee72e6d60a05efd94ea1db5125 Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sun Aug 2 01:47:35 2015 +0200 add support for BowAuthentication on all Bookmark - add description in BowAuthentication - inverse link now: BowUser <- BowAuthentication -> BowBookmark via field target:Wikitty - register new extension in Proxy --- bow-ui/src/main/java/org/chorem/bow/BowProxy.java | 5 +- .../main/java/org/chorem/bow/BowSearchResult.java | 20 +++- .../src/main/java/org/chorem/bow/BowSession.java | 33 ++++++ .../action/bookmark/AuthenticationEditAction.java | 126 +++++++++++++++++++++ .../action/bookmark/DeleteSearchResultsAction.java | 27 ++++- .../org/chorem/bow/action/bookmark/HomeAction.java | 14 ++- .../chorem/bow/action/bookmark/RemoveAction.java | 20 +++- .../action/preference/PreferenceBaseAction.java | 8 +- .../preference/UpdateAuthenticationAction.java | 18 +-- bow-ui/src/main/resources/{BowPwd.sh => bowpwd.sh} | 0 .../main/resources/i18n/bow-ui_en_GB.properties | 13 +++ .../main/resources/i18n/bow-ui_fr_FR.properties | 13 +++ bow-ui/src/main/resources/struts.xml | 20 ++++ .../main/webapp/WEB-INF/jsp/authenticationEdit.jsp | 76 +++++++++++++ bow-ui/src/main/webapp/WEB-INF/jsp/home.jsp | 1 + .../src/main/webapp/WEB-INF/jsp/inc/bookmark.jsp | 30 ++++- bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp | 27 +++-- .../src/main/webapp/WEB-INF/jsp/sharedUserView.jsp | 1 - bow-ui/src/main/webapp/css/bookmark.css | 11 +- bow-ui/src/main/webapp/img/cadena.png | Bin 0 -> 647 bytes bow-ui/src/main/xmi/bow-model.properties | 2 - bow-ui/src/main/xmi/bow-model.zargo | Bin 11957 -> 11741 bytes 22 files changed, 415 insertions(+), 50 deletions(-) diff --git a/bow-ui/src/main/java/org/chorem/bow/BowProxy.java b/bow-ui/src/main/java/org/chorem/bow/BowProxy.java index cf00c45..0493f97 100644 --- a/bow-ui/src/main/java/org/chorem/bow/BowProxy.java +++ b/bow-ui/src/main/java/org/chorem/bow/BowProxy.java @@ -80,10 +80,11 @@ public class BowProxy extends WikittyClient { // enregistrement des extensions List<WikittyExtension> extensions = new ArrayList<WikittyExtension>(); - extensions.addAll(BowUserImpl.extensions); // inherit BowPreference, WikittyUser + extensions.addAll(BowSharedUserImpl.extensions); // inherit BowUser, BowPreference, WikittyUser extensions.addAll(BowImportImpl.extensions); // inherit BowBookmark, WikittyLabel, WikittyAuthorisation extensions.addAll(BowSearchPrefixImpl.extensions); // inherit BowBookmark, WikittyLabel - extensions.addAll(BowGroupImpl.extensions); // inherit BowBookmark, WikittyLabel + extensions.addAll(BowGroupImpl.extensions); + extensions.addAll(BowAuthenticationImpl.extensions); ws = WikittyServiceFactory.buildWikittyService(config); ws.storeExtension(null, extensions); diff --git a/bow-ui/src/main/java/org/chorem/bow/BowSearchResult.java b/bow-ui/src/main/java/org/chorem/bow/BowSearchResult.java index ce85a2d..2ddfe5e 100644 --- a/bow-ui/src/main/java/org/chorem/bow/BowSearchResult.java +++ b/bow-ui/src/main/java/org/chorem/bow/BowSearchResult.java @@ -25,8 +25,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; import org.nuiton.wikitty.query.FacetTopic; import org.nuiton.wikitty.query.WikittyQueryResult; @@ -53,6 +55,8 @@ public class BowSearchResult { protected List<BowBookmark> bookmarks; + protected Map<String, BowAuthentication> authMap; + protected List<FacetTopic> tagsCloud; protected int tmax = -1; @@ -66,7 +70,8 @@ public class BowSearchResult { * @param result * @param tagLine (optionel) le liste des tags a rechercher */ - public BowSearchResult(WikittyQueryResult<BowBookmark> result, String tagLine) { + public BowSearchResult(WikittyQueryResult<BowBookmark> result, + WikittyQueryResult<BowAuthentication> auths, String tagLine) { bookmarkCount = result.getTotalResult(); if (log.isDebugEnabled()) { @@ -76,6 +81,11 @@ public class BowSearchResult { setBookmarks(result.getAll()); + authMap = new HashMap<String, BowAuthentication>(); + for (BowAuthentication auth : auths) { + authMap.put(auth.getTarget(), auth); + } + List<FacetTopic> topics = result.getTopic(BowBookmark.FQ_FIELD_WIKITTYLABEL_LABELS); if (log.isDebugEnabled()) { log.debug(String.format("There are %s tag in cloud", @@ -139,6 +149,14 @@ public class BowSearchResult { return bookmarks; } + public BowAuthentication getAuthentication(String id) { + return authMap.get(id); + } + + public BowAuthentication getAuthentication(BowBookmark bookmark) { + return getAuthentication(bookmark.getWikittyId()); + } + protected void setBookmarks(List<BowBookmark> bookmarks) { this.bookmarks = new ArrayList<BowBookmark>(); if (bookmarks != null) { diff --git a/bow-ui/src/main/java/org/chorem/bow/BowSession.java b/bow-ui/src/main/java/org/chorem/bow/BowSession.java index 7419966..891873e 100644 --- a/bow-ui/src/main/java/org/chorem/bow/BowSession.java +++ b/bow-ui/src/main/java/org/chorem/bow/BowSession.java @@ -30,6 +30,7 @@ import javax.servlet.http.HttpSession; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -111,6 +112,38 @@ public class BowSession implements Serializable { return user; } + /** + * Get default user authentication + * @return + */ + public BowAuthentication getAuthentication() { + BowUser user = getUser(); + BowAuthentication result = getAuthentication(user.getWikittyId()); + return result; + } + + /** + * get authentication for specified target (User or bookmark) + * @param wikittyId + * @return + */ + public BowAuthentication getAuthentication(String wikittyId) { + WikittyQuery criteria = new WikittyQueryMaker().and() + .exteq(BowAuthentication.EXT_BOWAUTHENTICATION) + .eq(BowAuthentication.ELEMENT_FIELD_BOWAUTHENTICATION_TARGET, wikittyId) + .end(); + BowAuthentication result = getProxy().findByQuery(BowAuthentication.class, criteria); + if (result == null) { + BowUser user = getUser(); + + result = new BowAuthenticationImpl(); + result.setTarget(wikittyId); + result.setOwner(user); + result.setReader(Collections.singleton(user.getWikittyId())); + } + return result; + } + public List<BowSearchPrefix> getSearchPrefix() { BowUser user = getUser(); diff --git a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/AuthenticationEditAction.java b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/AuthenticationEditAction.java new file mode 100644 index 0000000..fbe3147 --- /dev/null +++ b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/AuthenticationEditAction.java @@ -0,0 +1,126 @@ +/* + * #%L + * BOW UI + * %% + * Copyright (C) 2010 - 2015 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.bookmark; + +import java.util.Collections; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.bow.BowAuthentication; +import org.chorem.bow.BowProxy; +import org.chorem.bow.action.BowBaseAction; + +/** + * Handles RSS flux demande + * - tagLine + * - fullTextLine + * - count: number of bookmark to retrieve + * + * @author poussin + * @version $Revision$ + * <p/> + * Last update: $Date$ + * by : $Author$ + */ +public class AuthenticationEditAction extends BowBaseAction { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + private static final Log log = LogFactory.getLog(AuthenticationEditAction.class); + + private static final long serialVersionUID = 1L; + + protected String bookmarkId; + protected BowAuthentication authentication; + + public String getBookmarkId() { + return bookmarkId; + } + + public void setBookmarkId(String bookmarkId) { + this.bookmarkId = bookmarkId; + } + + public boolean isShareSecurity() { + BowAuthentication auth = getAuthentication(); + boolean result = !CollectionUtils.isEmpty(auth.getParent()); + return result; + } + + public void setShareSecurity(boolean shareSecurity) { + if (shareSecurity) { + getAuthentication().setParent(Collections.singleton(bookmarkId)); + } else { + getAuthentication().clearParent(); + } + } + + public BowAuthentication getAuthentication() { + if (authentication == null) { + authentication = getBowSession().getAuthentication(bookmarkId); + log.info("authentication loaded " + authentication); + if (log.isDebugEnabled()) { + log.debug("authentication loaded " + authentication); + } + } + return authentication; + } + + public String load() throws Exception { + return SUCCESS; + } + + public String save() throws Exception { + log.info("authentication save " + authentication); + if (log.isDebugEnabled()) { + log.debug("authentication save " + authentication); + } + String result = SUCCESS; + try { + BowProxy proxy = getBowProxy(); + + proxy.store(authentication); + + } catch (Exception eee) { + addActionError(t("bow.error.internal")); + log.error(eee.getMessage(), eee); + result = ERROR; + } + return result; + } + + public String delete() throws Exception { + log.info("authentication delete " + authentication); + if (log.isDebugEnabled()) { + log.debug("authentication delete " + authentication); + } + String result = SUCCESS; + try { + BowProxy proxy = getBowProxy(); + proxy.delete(authentication); + } catch (Exception eee) { + addActionError(t("bow.error.internal")); + log.error(eee.getMessage(), eee); + result = ERROR; + } + return result; + } + +} 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 13b9b0c..a5ebd87 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 @@ -20,6 +20,7 @@ */ package org.chorem.bow.action.bookmark; +import java.util.ArrayList; import org.apache.commons.lang3.StringUtils; import org.chorem.bow.BookmarkUtils; import org.chorem.bow.BowUser; @@ -28,8 +29,10 @@ import org.chorem.bow.action.BowBaseAction; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.bow.BowAuthentication; import org.chorem.bow.BowProxy; import org.nuiton.wikitty.query.WikittyQuery; +import org.nuiton.wikitty.query.WikittyQueryMaker; /** * Supprime des bookmarks qui satisfont le critere de recherche. @@ -40,9 +43,13 @@ public class DeleteSearchResultsAction extends BowBaseAction { private static final long serialVersionUID = -3903724044644625507L; - private static Log log = LogFactory.getLog(DeleteSearchResultsAction.class); + private static final Log log = LogFactory.getLog(DeleteSearchResultsAction.class); - /** Deletes the search results */ + /** + * Deletes the search results + * @return SUCCES or ERROR + */ + @Override public String execute() { try { if (StringUtils.isNotBlank(tagLine) @@ -59,12 +66,22 @@ public class DeleteSearchResultsAction extends BowBaseAction { BowProxy proxy = getBowProxy(); List<String> ids = proxy.findAllByQuery(criteria).getAll(); + criteria = new WikittyQueryMaker().and() + .exteq(BowAuthentication.EXT_BOWAUTHENTICATION) + .containsOne(BowAuthentication.ELEMENT_FIELD_BOWAUTHENTICATION_TARGET, ids) + .end(); + List<String> authIds = proxy.findAllByQuery(criteria).getAll(); + if (log.isDebugEnabled()) { - log.debug("Will delete " + ids.size() + " bookmarks"); + log.debug(String.format("Will delete %s bookmarks and %s authentications", ids.size(), authIds.size())); } - proxy.delete(ids); - addActionMessage(t("bow.search.results.deleted")); + List<String> all = new ArrayList<String>(ids.size() + authIds.size()); + all.addAll(ids); + all.addAll(authIds); + + proxy.delete(all); + addActionMessage(t("bow.search.results.deleted", ids.size())); } } catch (Exception eee) { addActionError(t("bow.error.internal")); 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 d1ed600..32a6089 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 @@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.bow.BookmarkUtils; +import org.chorem.bow.BowAuthentication; import org.chorem.bow.BowBookmark; import org.chorem.bow.BowProxy; import org.chorem.bow.BowSearchResult; @@ -34,6 +35,7 @@ import org.chorem.bow.BowUser; import org.chorem.bow.action.BowBaseAction; import org.nuiton.util.TimeLog; import org.nuiton.wikitty.query.WikittyQuery; +import org.nuiton.wikitty.query.WikittyQueryMaker; import org.nuiton.wikitty.query.WikittyQueryResult; /** @@ -98,8 +100,18 @@ public class HomeAction extends BowBaseAction { WikittyQueryResult<BowBookmark> result = proxy.findAllByQuery(BowBookmark.class, criteria); + criteria = new WikittyQueryMaker().and() + .exteq(BowAuthentication.EXT_BOWAUTHENTICATION) + .containsOne(BowAuthentication.ELEMENT_FIELD_BOWAUTHENTICATION_TARGET, result.getAll()) + .end(); + + WikittyQueryResult<BowAuthentication> auths = + proxy.findAllByQuery(BowAuthentication.class, criteria); + log.debug("******** query was: " + result.getQueryString()); - searchResult = new BowSearchResult(result, tagLine); + log.info("******** auths query was: " + auths.getQueryString()); + + searchResult = new BowSearchResult(result, auths, tagLine); } /** Initializes everything before displaying the home page */ diff --git a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/RemoveAction.java b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/RemoveAction.java index f59e8bd..a68efeb 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/bookmark/RemoveAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/bookmark/RemoveAction.java @@ -20,12 +20,17 @@ */ package org.chorem.bow.action.bookmark; +import java.util.Arrays; +import java.util.List; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.bow.BowAuthentication; import org.chorem.bow.BowProxy; import org.chorem.bow.BowUtils; import org.chorem.bow.action.BowBaseAction; +import org.nuiton.wikitty.query.WikittyQuery; +import org.nuiton.wikitty.query.WikittyQueryMaker; /** * Supprime un bookmark @@ -56,13 +61,24 @@ public class RemoveAction extends BowBaseAction { return redirectTo; } - /** Removes a bookmark */ + /** + * Removes a bookmark + * @return SUCCESS or ERROR + */ @Override public String execute() { if (StringUtils.isNotEmpty(bookmarkId)) { try { BowProxy proxy = getBowProxy(); - proxy.delete(bookmarkId); + + WikittyQuery criteria = new WikittyQueryMaker().and() + .exteq(BowAuthentication.EXT_BOWAUTHENTICATION) + .eq(BowAuthentication.ELEMENT_FIELD_BOWAUTHENTICATION_TARGET, bookmarkId) + .end(); + String authId = proxy.findByQuery(criteria); + List<String> ids = Arrays.asList(bookmarkId, authId); + + proxy.delete(ids); addActionMessage(t("bow.bookmark.remove.successful")); } catch (Exception eee) { addActionError(t("bow.error.internal")); diff --git a/bow-ui/src/main/java/org/chorem/bow/action/preference/PreferenceBaseAction.java b/bow-ui/src/main/java/org/chorem/bow/action/preference/PreferenceBaseAction.java index 10bf854..0150c96 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/preference/PreferenceBaseAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/preference/PreferenceBaseAction.java @@ -38,7 +38,6 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.bow.BowAuthentication; -import org.chorem.bow.BowAuthenticationImpl; import org.chorem.bow.BowSearchPrefix; import org.nuiton.wikitty.query.FacetTopic; import org.nuiton.wikitty.query.WikittyQuery; @@ -107,12 +106,7 @@ public class PreferenceBaseAction extends BowBaseAction { if (bowAuth == null) { BowSession session = getBowSession(); BowUser user = session.getUser(); - - bowAuth = user.getBowAuthentication(false); - if (bowAuth == null) { - bowAuth = new BowAuthenticationImpl(); - user.setBowAuthentication(bowAuth); - } + bowAuth = session.getAuthentication(user.getWikittyId()); } return bowAuth; } diff --git a/bow-ui/src/main/java/org/chorem/bow/action/preference/UpdateAuthenticationAction.java b/bow-ui/src/main/java/org/chorem/bow/action/preference/UpdateAuthenticationAction.java index 51140a9..0f4c9d2 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/preference/UpdateAuthenticationAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/preference/UpdateAuthenticationAction.java @@ -20,6 +20,7 @@ */ package org.chorem.bow.action.preference; +import java.util.Collections; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.bow.BowProxy; @@ -40,26 +41,13 @@ public class UpdateAuthenticationAction extends PreferenceBaseAction { private static final long serialVersionUID = 1L; - /** - * ACTION STRUTS - * <p/> - * Modifie l'email et le password si necessaire. Si la modif est impossible - * email deja utilise, ou mauvais password, alors la methode return ERROR - * Si tout ce passe bien, la methode retourne SUCCES - * - * @return - */ @Override public String execute() { String result = SUCCESS; try { - BowSession session = getBowSession(); - BowProxy proxy = session.getProxy(); - BowUser user = session.getUser(); - user.setBowAuthentication(bowAuth); - - proxy.store(user, bowAuth); + BowProxy proxy = getBowProxy(); + proxy.store(bowAuth); addActionMessage(t("bow.preferences.update.successful")); } catch (Exception eee) { diff --git a/bow-ui/src/main/resources/BowPwd.sh b/bow-ui/src/main/resources/bowpwd.sh similarity index 100% rename from bow-ui/src/main/resources/BowPwd.sh rename to bow-ui/src/main/resources/bowpwd.sh diff --git a/bow-ui/src/main/resources/i18n/bow-ui_en_GB.properties b/bow-ui/src/main/resources/i18n/bow-ui_en_GB.properties index 0d3b163..5ecbd82 100644 --- a/bow-ui/src/main/resources/i18n/bow-ui_en_GB.properties +++ b/bow-ui/src/main/resources/i18n/bow-ui_en_GB.properties @@ -12,6 +12,19 @@ bow.admin.panel=Admin panel bow.admin.reIndexationDone=Data reindexed successfully bow.alias.already.exists=The alias {0} already exists bow.alias.bookmarkId.unknown=There is no bookmark with id {0} +bow.authenticationEdit.delete= +bow.authenticationEdit.description= +bow.authenticationEdit.domain= +bow.authenticationEdit.exclude= +bow.authenticationEdit.form= +bow.authenticationEdit.include= +bow.authenticationEdit.login= +bow.authenticationEdit.maxLength= +bow.authenticationEdit.prefix= +bow.authenticationEdit.save= +bow.authenticationEdit.shareSecurity= +bow.authenticationEdit.suffix= +bow.authenticationEdit.title= bow.bookmark.add.successful=Bookmark successfully added bow.bookmark.badFileFormat=Bad bookmarks file format \: unsuccessful import (expected Netscape-like bookmarks file) bow.bookmark.description=Description diff --git a/bow-ui/src/main/resources/i18n/bow-ui_fr_FR.properties b/bow-ui/src/main/resources/i18n/bow-ui_fr_FR.properties index a93f8a5..a20ba20 100644 --- a/bow-ui/src/main/resources/i18n/bow-ui_fr_FR.properties +++ b/bow-ui/src/main/resources/i18n/bow-ui_fr_FR.properties @@ -12,6 +12,19 @@ bow.admin.panel=Panneau d''administration bow.admin.reIndexationDone=Les données ont bien été réindexées (et migration si nécessaire) bow.alias.already.exists=L''alias {0} existe déjà bow.alias.bookmarkId.unknown=Il n''y a pas de marque-page correspondant à l''identifiant {0} +bow.authenticationEdit.delete= +bow.authenticationEdit.description= +bow.authenticationEdit.domain= +bow.authenticationEdit.exclude= +bow.authenticationEdit.form= +bow.authenticationEdit.include= +bow.authenticationEdit.login= +bow.authenticationEdit.maxLength= +bow.authenticationEdit.prefix= +bow.authenticationEdit.save= +bow.authenticationEdit.shareSecurity= +bow.authenticationEdit.suffix= +bow.authenticationEdit.title= bow.bookmark.add.successful=Marque-page ajouté avec succès bow.bookmark.badFileFormat=Mauvais format de fichier de favoris \: import impossible (le format de type Netscape n'est pas supporté) bow.bookmark.description=Description diff --git a/bow-ui/src/main/resources/struts.xml b/bow-ui/src/main/resources/struts.xml index 6f7adb0..6c452c8 100644 --- a/bow-ui/src/main/resources/struts.xml +++ b/bow-ui/src/main/resources/struts.xml @@ -57,6 +57,10 @@ <param name="store.operationMode">AUTOMATIC</param> <param name="fileUpload.allowedExtensions">.html</param> <param name="params.ordered">true</param> + + <param name="exception.logEnabled">true</param> + <param name="exception.logLevel">ERROR</param> + </interceptor-ref> </interceptor-stack> </interceptors> @@ -162,6 +166,22 @@ </action> </package> + <package name="authentication" extends="restrictedArea"> + <action name="authenticationEdit" class="org.chorem.bow.action.bookmark.AuthenticationEditAction" method="load"> + <result name="error">/WEB-INF/jsp/authenticationEdit.jsp</result> + <result>/WEB-INF/jsp/authenticationEdit.jsp</result> + </action> + <action name="authenticationSave" class="org.chorem.bow.action.bookmark.AuthenticationEditAction" method="save"> + <result name="input">/WEB-INF/jsp/home.jsp</result> + <result name="error">/WEB-INF/jsp/authenticationEdit.jsp</result> + <result type="redirectAction">home</result> + </action> + <action name="authenticationDelete" class="org.chorem.bow.action.bookmark.AuthenticationEditAction" method="delete"> + <result name="error">/WEB-INF/jsp/authenticationEdit.jsp</result> + <result type="redirectAction">home</result> + </action> + </package> + <package name="group" extends="restrictedArea"> <action name="groupView" class="org.chorem.bow.action.group.GroupViewAction"> <result name="error">/WEB-INF/jsp/groupView.jsp</result> diff --git a/bow-ui/src/main/webapp/WEB-INF/jsp/authenticationEdit.jsp b/bow-ui/src/main/webapp/WEB-INF/jsp/authenticationEdit.jsp new file mode 100644 index 0000000..7d4c6dc --- /dev/null +++ b/bow-ui/src/main/webapp/WEB-INF/jsp/authenticationEdit.jsp @@ -0,0 +1,76 @@ +<%-- +#%L +bow + +$Id$ +$HeadURL$ +%% +Copyright (C) 2010-2015 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" %> + +<html xmlns:s="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" + xmlns:jsp="http://java.sun.com/JSP/Page"> +<head> + <title><s:text name="bow.authenticationEdit.title"/></title> +</head> +<body> + <div id="content"> + <div class="menu clearfix"> + <h2><s:text name="bow.authenticationEdit.title" /></h2> + </div> + <div class="formFrame fond"> + <s:form id="authenticationEditForm" cssClass="pretty-form" action="authenticationSave" + method="post"> + <s:hidden name="tagLine" /> + <s:hidden name="fullTextLine" /> + <s:hidden name="bookmarkId"/> + <s:hidden name="authentication.target"/> + + <s:checkbox key="bow.authenticationEdit.shareSecurity" labelposition="left" labelSeparator=" " + name="shareSecurity" /> + + <s:textarea key="bow.authenticationEdit.description" labelSeparator=" " + name="authentication.description" /> + + <s:textfield key="bow.authenticationEdit.domain" labelSeparator=" " + name="authentication.domain" /> + <s:textfield key="bow.authenticationEdit.login" labelSeparator=" " + name="authentication.login" /> + <s:textfield key="bow.authenticationEdit.maxLength" labelSeparator=" " + name="authentication.maxLength" /> + <s:textfield key="bow.authenticationEdit.include" labelSeparator=" " + name="authentication.include" /> + <s:textfield key="bow.authenticationEdit.exclude" labelSeparator=" " + name="authentication.exclude" /> + <s:textfield key="bow.authenticationEdit.prefix" labelSeparator=" " + name="authentication.prefix" /> + <s:textfield key="bow.authenticationEdit.suffix" labelSeparator=" " + name="authentication.suffix" /> + + <s:textarea key="bow.authenticationEdit.form" labelSeparator=" " + name="authentication.form" /> + + <s:submit cssClass="submit-button" key="bow.authenticationEdit.save" name="submit" /> + <s:submit cssClass="submit-button" key="bow.authenticationEdit.delete" name="delete" action="authenticationDelete"/> + </s:form> + </div> + </div> +</body> +</html> diff --git a/bow-ui/src/main/webapp/WEB-INF/jsp/home.jsp b/bow-ui/src/main/webapp/WEB-INF/jsp/home.jsp index eec243a..2188574 100644 --- a/bow-ui/src/main/webapp/WEB-INF/jsp/home.jsp +++ b/bow-ui/src/main/webapp/WEB-INF/jsp/home.jsp @@ -79,6 +79,7 @@ <s:else> <s:iterator value="searchResult.bookmarks" var="bookmark"> <s:set name="bookmark" value="bookmark"/> + <s:set name="auth" value="searchResult.getAuthentication(#bookmark)"/> <jsp:include page="inc/bookmark.jsp" flush="true"/> </s:iterator> </s:else> diff --git a/bow-ui/src/main/webapp/WEB-INF/jsp/inc/bookmark.jsp b/bow-ui/src/main/webapp/WEB-INF/jsp/inc/bookmark.jsp index e5914f4..b2b6803 100644 --- a/bow-ui/src/main/webapp/WEB-INF/jsp/inc/bookmark.jsp +++ b/bow-ui/src/main/webapp/WEB-INF/jsp/inc/bookmark.jsp @@ -56,6 +56,12 @@ </s:a> </s:if> </span> + <span class="left"> + <s:if test="#auth != null"> + <a href="${u:scriptletPassword(auth)}">BowPwd${bookmark.privateAlias}</a> + <a href="${u:scriptPassword(auth)}" download="BowPwd${bookmark.privateAlias}.sh">BowPwd${bookmark.privateAlias}.sh</a> + </s:if> + </span> <span class="spacemax"></span> <span class="right"> <s:url var="screenshotBookmark" action="screenshotBookmark" escapeAmp="true"> @@ -67,7 +73,17 @@ </s:url> <s:a cssClass="screenshotLink" href="%{screenshotBookmark}"/> </span> - <span class="right"> + <span class="right"> + <s:url var="authenticationEdit" action="authenticationEdit" escapeAmp="true"> + <s:param name="bookmarkId" value="%{#bookmark.wikittyId}" /> + <s:param name="tagLine" value="%{tagLine}" /> + <s:param name="fullTextLine" value="%{fullTextLine}" /> + <s:param name="order" value="%{order}"/> + <s:param name="first" value="%{first}"/> + </s:url> + <s:a cssClass="edit-authentication" href="%{authenticationEdit}"/> + </span> + <span class="right"> <s:url var="editBookmark" action="editBookmark" escapeAmp="true"> <s:param name="id" value="%{#bookmark.wikittyId}" /> <s:param name="tagLine" value="%{tagLine}" /> @@ -111,6 +127,18 @@ <div class="markdown"> ${u:toHtml(bookmark.description)} </div> + <c:if test="#auth != null"> + <s:if test="!#auth.description.empty"> + <div class="markdown"> + ${u:toHtml(auth.description)} + </div> + </s:if> + <s:if test="!#auth.form.empty"> + <div class="markdown"> + ${u:toHtml(auth.form)} + </div> + </s:if> + </c:if> <p class="tags"> <strong><s:text name="bow.bookmark.tags" /> :</strong> <s:iterator value="#bookmark.labels" var="tag"> diff --git a/bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp b/bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp index 75b4a87..e2b69ba 100644 --- a/bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp +++ b/bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp @@ -124,23 +124,26 @@ </h3> <br/> <s:form action="updateAuthenticationPref" cssClass="pretty-form" method="post"> - <s:textfield name="bowAuth.login" key="bow.preference.authentication.login" - labelposition="top" tooltip="bow.preference.authentication.login.tooltip"/> + <s:textarea name="bowAuth.description" key="bow.authenticationEdit.description" + labelposition="top" tooltip="bow.authenticationEdit.description.tooltip"/> - <s:textfield name="bowAuth.maxLength" key="bow.preference.authentication.maxLength" - labelposition="top" tooltip="bow.preference.authentication.maxLength.tooltip"/> + <s:textfield name="bowAuth.login" key="bow.authenticationEdit.login" + labelposition="top" tooltip="bow.authenticationEdit.login.tooltip"/> - <s:textfield name="bowAuth.include" key="bow.preference.authentication.include" - labelposition="top" tooltip="bow.preference.authentication.include.tooltip"/> + <s:textfield name="bowAuth.maxLength" key="bow.authenticationEdit.maxLength" + labelposition="top" tooltip="bow.authenticationEdit.maxLength.tooltip"/> - <s:textfield name="bowAuth.exclude" key="bow.preference.authentication.exclude" - labelposition="top" tooltip="bow.preference.authentication.exclude.tooltip"/> + <s:textfield name="bowAuth.include" key="bow.authenticationEdit.include" + labelposition="top" tooltip="bow.authenticationEdit.include.tooltip"/> - <s:textfield name="bowAuth.prefix" key="bow.preferences.authentication.prefix" - labelposition="top" tooltip="bow.preferences.authentication.prefix.tooltip"/> + <s:textfield name="bowAuth.exclude" key="bow.authenticationEdit.exclude" + labelposition="top" tooltip="bow.authenticationEdit.exclude.tooltip"/> + + <s:textfield name="bowAuth.prefix" key="bow.authenticationEdit.prefix" + labelposition="top" tooltip="bow.authenticationEdit.prefix.tooltip"/> - <s:textfield name="bowAuth.suffix" key="bow.preferences.authentication.suffix" - labelposition="top" tooltip="bow.preferences.authentication.suffix.tooltip"/> + <s:textfield name="bowAuth.suffix" key="bow.authenticationEdit.suffix" + labelposition="top" tooltip="bow.authenticationEdit.suffix.tooltip"/> <s:hidden name="update" value="authentication"/> <s:submit key="bow.preferences.submit" name="submit"/> diff --git a/bow-ui/src/main/webapp/WEB-INF/jsp/sharedUserView.jsp b/bow-ui/src/main/webapp/WEB-INF/jsp/sharedUserView.jsp index ad63f78..507d4da 100644 --- a/bow-ui/src/main/webapp/WEB-INF/jsp/sharedUserView.jsp +++ b/bow-ui/src/main/webapp/WEB-INF/jsp/sharedUserView.jsp @@ -38,7 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. <h2><s:text name="bow.sharedUserView.title"/></h2> </div> <s:actionerror/> - <%=org.chorem.bow.BowUtils.class.getResource("/struts.xml")%> <div class="formFrame fond"> <s:a action="sharedUserEdit"><s:text name="bow.sharedUser.new" /></s:a> <ul> diff --git a/bow-ui/src/main/webapp/css/bookmark.css b/bow-ui/src/main/webapp/css/bookmark.css index b4ba97e..1387cf8 100644 --- a/bow-ui/src/main/webapp/css/bookmark.css +++ b/bow-ui/src/main/webapp/css/bookmark.css @@ -116,12 +116,21 @@ position:absolute; margin-top: 10px; top:0; - right:64px; + right:96px; width:31px; height:32px; background:url('../img/camera.png') no-repeat; } +.bookmark .bookmarkhead .edit-authentication{ + background:url('../img/cadena.png') no-repeat; + width:31px; + height:32px; + position:absolute; + top:0; + right:64px; +} + .bookmark .bookmarkhead .edit{ background:url('../img/edit.jpg') no-repeat; width:31px; diff --git a/bow-ui/src/main/webapp/img/cadena.png b/bow-ui/src/main/webapp/img/cadena.png new file mode 100644 index 0000000..0f2c9b7 Binary files /dev/null and b/bow-ui/src/main/webapp/img/cadena.png differ diff --git a/bow-ui/src/main/xmi/bow-model.properties b/bow-ui/src/main/xmi/bow-model.properties index 3163fcd..e69de29 100644 --- a/bow-ui/src/main/xmi/bow-model.properties +++ b/bow-ui/src/main/xmi/bow-model.properties @@ -1,2 +0,0 @@ -org.chorem.bow.BowUser.class.tagvalue.preload=BowUser.bowAuthentication -org.chorem.bow.BowBookmark.class.tagvalue.preload=BowBookmark.bowAuthentication diff --git a/bow-ui/src/main/xmi/bow-model.zargo b/bow-ui/src/main/xmi/bow-model.zargo index 9a22b10..51be7ec 100644 Binary files a/bow-ui/src/main/xmi/bow-model.zargo and b/bow-ui/src/main/xmi/bow-model.zargo differ -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.