r320 - in trunk/bow-ui/src/main: java/org/chorem/bow java/org/chorem/bow/action/opensearch java/org/chorem/bow/action/preference resources resources/i18n webapp/WEB-INF/jsp
Author: bpoussin Date: 2011-08-22 03:22:06 +0200 (Mon, 22 Aug 2011) New Revision: 320 Url: http://chorem.org/repositories/revision/bow/320 Log: Evolution #430: Permit search prefix configurable for each user - all is done (backend and ui) (ui with beurk table, but i have no more time :() Modified: trunk/bow-ui/src/main/java/org/chorem/bow/BowSession.java trunk/bow-ui/src/main/java/org/chorem/bow/action/opensearch/OpenSearchBaseAction.java trunk/bow-ui/src/main/java/org/chorem/bow/action/opensearch/OpenSearchResultAction.java trunk/bow-ui/src/main/java/org/chorem/bow/action/preference/PreferenceBaseAction.java trunk/bow-ui/src/main/java/org/chorem/bow/action/preference/UpdateSiteAction.java trunk/bow-ui/src/main/resources/i18n/bow-ui_en_GB.properties trunk/bow-ui/src/main/resources/i18n/bow-ui_fr_FR.properties trunk/bow-ui/src/main/resources/struts.xml trunk/bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp Modified: trunk/bow-ui/src/main/java/org/chorem/bow/BowSession.java =================================================================== --- trunk/bow-ui/src/main/java/org/chorem/bow/BowSession.java 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/java/org/chorem/bow/BowSession.java 2011-08-22 01:22:06 UTC (rev 320) @@ -134,7 +134,7 @@ preference.setPrefixSeparator(BowConfig.getPrefixSeparator()); } if (StringUtils.isBlank(preference.getTagSearchPrefix())) { - preference.setPrefixSeparator(BowConfig.getTagSearchPrefix()); + preference.setTagSearchPrefix(BowConfig.getTagSearchPrefix()); } if (StringUtils.isBlank(preference.getFullTextSearchPrefix())) { preference.setFullTextSearchPrefix(BowConfig.getFullTextSearchPrefix()); @@ -145,6 +145,9 @@ if (StringUtils.isBlank(preference.getAliasPrefix())) { preference.setAliasPrefix(BowConfig.getAliasPrefix()); } + if (StringUtils.isBlank(preference.getDefaultPrefix())) { + preference.setDefaultPrefix(BowConfig.getDefaultPrefix()); + } if (StringUtils.isBlank(preference.getDefaultAction())) { preference.setDefaultAction(BowConfig.getDefaultAction()); } Modified: trunk/bow-ui/src/main/java/org/chorem/bow/action/opensearch/OpenSearchBaseAction.java =================================================================== --- trunk/bow-ui/src/main/java/org/chorem/bow/action/opensearch/OpenSearchBaseAction.java 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/java/org/chorem/bow/action/opensearch/OpenSearchBaseAction.java 2011-08-22 01:22:06 UTC (rev 320) @@ -24,6 +24,8 @@ package org.chorem.bow.action.opensearch; import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.chorem.bow.BowUser; import org.chorem.bow.action.BowBaseAction; @@ -37,6 +39,10 @@ * @author poussin */ abstract public class OpenSearchBaseAction extends BowBaseAction { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(OpenSearchBaseAction.class); + private static final long serialVersionUID = 1L; /** [in] le token d'identification */ @@ -95,14 +101,25 @@ prefix = StringUtils.substringBefore(searchLine, prefixSeparator); String query = StringUtils.substringAfter(searchLine, prefixSeparator); + if (log.isDebugEnabled()) { + log.debug(String.format("Cut '%s' with '%s' result is '%s' and '%s'", + searchLine, prefixSeparator, prefix, query)); + } + if (StringUtils.isEmpty(prefix)) { // on a le separateur mais pas de prefix prefix = user.getDefaultPrefix(); - } else if (StringUtils.equals(searchLine, query)) { + } else if (StringUtils.equals(searchLine, prefix)) { // on a pas de separateur prefix = user.getDefaultAction(); + query = searchLine; } + if (log.isDebugEnabled()) { + log.debug(String.format("Prefix is '%s' and query '%s'", + prefix, query)); + } + String result = SUCCESS; if (StringUtils.equals(prefix, user.getTagSearchPrefix())) { result = executeTagSearchAction(query); Modified: trunk/bow-ui/src/main/java/org/chorem/bow/action/opensearch/OpenSearchResultAction.java =================================================================== --- trunk/bow-ui/src/main/java/org/chorem/bow/action/opensearch/OpenSearchResultAction.java 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/java/org/chorem/bow/action/opensearch/OpenSearchResultAction.java 2011-08-22 01:22:06 UTC (rev 320) @@ -26,6 +26,8 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.struts2.interceptor.ServletResponseAware; import org.chorem.bow.BowBookmark; import org.chorem.bow.BowConfig; @@ -42,6 +44,9 @@ * @author poussin */ public class OpenSearchResultAction extends OpenSearchBaseAction implements ServletResponseAware { + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(OpenSearchResultAction.class); + private static final long serialVersionUID = 1L; protected String redirectTo; @@ -60,12 +65,12 @@ } protected String executeTagSearchAction(String query) { - redirectTo = BowUtils.redirectTo(searchLine, null); + redirectTo = BowUtils.redirectTo(query, null); return SUCCESS; } protected String executeFulltextSearchAction(String query) { - redirectTo = BowUtils.redirectTo(null, searchLine); + redirectTo = BowUtils.redirectTo(null, query); return SUCCESS; } Modified: trunk/bow-ui/src/main/java/org/chorem/bow/action/preference/PreferenceBaseAction.java =================================================================== --- trunk/bow-ui/src/main/java/org/chorem/bow/action/preference/PreferenceBaseAction.java 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/java/org/chorem/bow/action/preference/PreferenceBaseAction.java 2011-08-22 01:22:06 UTC (rev 320) @@ -32,6 +32,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.commons.lang.StringUtils; import org.chorem.bow.BowImport; import org.chorem.bow.BowSession; @@ -57,27 +58,38 @@ return (PreferenceBaseAction) action; } + public static enum DefaultPrefix {TAG, FULLTEXT, WEB, ALIAS}; + /** la liste des differentes data que l'on peut charger */ - protected enum PreferenceType{USER_PREF, SITE_PREF, LABELS, IMPORTS}; + protected static enum PreferenceType{USER_PREF, SITE_PREF, LABELS, IMPORTS}; + protected String email; + protected String newPassword; + protected String currentPassword; + protected String confirmNewPassword; + protected String colors; protected String tagsNb; protected String bookmarksHomePage; protected String searchEngineUrlSuggestions; protected String searchEngineUrlResults; - protected String email; - protected String newPassword; - protected String currentPassword; - protected String confirmNewPassword; - protected String update; - protected Map<String, Integer> bookmarksImportDate; - + protected String separator; + protected String tagPrefix; + protected String fulltextPrefix; + protected String webPrefix; + protected String aliasPrefix; + protected DefaultPrefix defaultPrefix; + protected DefaultPrefix defaultAction; + protected List<FacetTopic> labels; protected String[] selectedLabels; protected String rename; protected String delete; protected String newLabel; + protected String update; + protected Map<String, Integer> bookmarksImportDate; + public String getNewLabel() { return newLabel; } @@ -172,6 +184,62 @@ this.searchEngineUrlResults = searchEngineUrlResults; } + public String getSeparator() { + return separator; + } + + public void setSeparator(String separator) { + this.separator = separator; + } + + public String getTagPrefix() { + return tagPrefix; + } + + public void setTagPrefix(String tagPrefix) { + this.tagPrefix = tagPrefix; + } + + public String getFulltextPrefix() { + return fulltextPrefix; + } + + public void setFulltextPrefix(String fulltextPrefix) { + this.fulltextPrefix = fulltextPrefix; + } + + public String getWebPrefix() { + return webPrefix; + } + + public void setWebPrefix(String webPrefix) { + this.webPrefix = webPrefix; + } + + public String getAliasPrefix() { + return aliasPrefix; + } + + public void setAliasPrefix(String aliasPrefix) { + this.aliasPrefix = aliasPrefix; + } + + public DefaultPrefix getDefaultPrefix() { + return defaultPrefix; + } + + public void setDefaultPrefix(String defaultPrefix) { + this.defaultPrefix = DefaultPrefix.valueOf(defaultPrefix); + } + + public DefaultPrefix getDefaultAction() { + return defaultAction; + } + + public void setDefaultAction(String defaultAction) { + this.defaultAction = DefaultPrefix.valueOf(defaultAction); + } + /** * @return the email */ @@ -335,13 +403,62 @@ BowSession session = getBowSession(); BowUser user = session.getUser(); + if(log.isDebugEnabled()) { + log.debug("Load site pref for " + user); + } + setColors(user.getColors()); setTagsNb(String.valueOf(user.getTags())); setBookmarksHomePage(String.valueOf(user.getBookmarks())); setSearchEngineUrlSuggestions(user.getSearchEngineUrlSuggestions()); setSearchEngineUrlResults(user.getSearchEngineUrlResults()); + + setSeparator(user.getPrefixSeparator()); + setTagPrefix(user.getTagSearchPrefix()); + setFulltextPrefix(user.getFullTextSearchPrefix()); + setWebPrefix(user.getWebSearchPrefix()); + setAliasPrefix(user.getAliasPrefix()); + + defaultAction = getDefaultConst(user, user.getDefaultAction()); + defaultPrefix = getDefaultConst(user, user.getDefaultPrefix()); + } + protected String getDefaultValue(BowUser user, DefaultPrefix constValue) { + String result = user.getAliasPrefix(); + switch(constValue) { + case TAG: + result = user.getTagSearchPrefix(); + break; + case FULLTEXT: + result = user.getFullTextSearchPrefix(); + break; + case WEB: + result = user.getWebSearchPrefix(); + break; + case ALIAS: + result = user.getAliasPrefix(); + break; + default: + break; + } + return result; + } + + protected DefaultPrefix getDefaultConst(BowUser user, String value) { + DefaultPrefix result = DefaultPrefix.ALIAS; + if (StringUtils.equals(value, user.getTagSearchPrefix())) { + result = DefaultPrefix.TAG; + } else if (StringUtils.equals(value, user.getFullTextSearchPrefix())) { + result = DefaultPrefix.FULLTEXT; + } else if (StringUtils.equals(value, user.getWebSearchPrefix())) { + result = DefaultPrefix.WEB; + } else if (StringUtils.equals(value, user.getAliasPrefix())) { + result = DefaultPrefix.ALIAS; + } + return result; + } + /** * Charge la liste des imports que l'utilisateur a fait */ Modified: trunk/bow-ui/src/main/java/org/chorem/bow/action/preference/UpdateSiteAction.java =================================================================== --- trunk/bow-ui/src/main/java/org/chorem/bow/action/preference/UpdateSiteAction.java 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/java/org/chorem/bow/action/preference/UpdateSiteAction.java 2011-08-22 01:22:06 UTC (rev 320) @@ -45,6 +45,16 @@ preference.setSearchEngineUrlSuggestions(searchEngineUrlSuggestions); preference.setSearchEngineUrlResults(searchEngineUrlResults); + preference.setPrefixSeparator(separator); + + preference.setTagSearchPrefix(tagPrefix); + preference.setFullTextSearchPrefix(fulltextPrefix); + preference.setWebSearchPrefix(webPrefix); + preference.setAliasPrefix(aliasPrefix); + + preference.setDefaultAction(getDefaultValue(preference, defaultAction)); + preference.setDefaultPrefix(getDefaultValue(preference, defaultPrefix)); + preference = proxy.store(preference); getBowSession().setUser(preference); } catch (Exception eee) { Modified: trunk/bow-ui/src/main/resources/i18n/bow-ui_en_GB.properties =================================================================== --- trunk/bow-ui/src/main/resources/i18n/bow-ui_en_GB.properties 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/resources/i18n/bow-ui_en_GB.properties 2011-08-22 01:22:06 UTC (rev 320) @@ -65,6 +65,7 @@ bow.login.title=Login bow.mail.badFormat=Your email format is incorrect and therefore the email hasn't been sent bow.mail.sendError=An error occurred while sending email +bow.preference.opensearch.prefix.separator= bow.preferences.badCurrentPassword=Your current password is incorrect bow.preferences.bookmarksHomePage=Number of bookmarks displayed on the home page bow.preferences.colors=Site color @@ -82,6 +83,15 @@ bow.preferences.labels.rename.submit=Rename bow.preferences.newPassword=New password bow.preferences.noImportedBookmarks=No imported bookmarks +bow.preferences.opensearch.alias.prefix=Alias +bow.preferences.opensearch.default.action=Default action +bow.preferences.opensearch.default.prefix=Default prefix +bow.preferences.opensearch.fulltext.search.prefix=Search fulltext +bow.preferences.opensearch.prefix=Prefix +bow.preferences.opensearch.prefix.separator=Prefix seperator +bow.preferences.opensearch.tag.search.prefix=Search by tag +bow.preferences.opensearch.value=Value +bow.preferences.opensearch.web.search.prefix=Search on the Web bow.preferences.regenPermToken=Regenerate permanent token bow.preferences.searchEngineUrlResults=Search Engine URL Results ('{'searchTerms'}' will be replaced by your text) bow.preferences.searchEngineUrlSuggestions=Search Engine URL Suggestions Modified: trunk/bow-ui/src/main/resources/i18n/bow-ui_fr_FR.properties =================================================================== --- trunk/bow-ui/src/main/resources/i18n/bow-ui_fr_FR.properties 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/resources/i18n/bow-ui_fr_FR.properties 2011-08-22 01:22:06 UTC (rev 320) @@ -31,10 +31,10 @@ bow.config.bow.url.description= bow.config.configFileName.description= bow.config.data.dir.description= -bow.config.opensearch.alias.prefix.description= -bow.config.opensearch.default.action.description= -bow.config.opensearch.default.prefix.description= -bow.config.opensearch.fulltext.search.prefix.description= +bow.config.opensearch.alias.prefix.description=Prefix d'alias +bow.config.opensearch.default.action.description=action par d\u00E9faut +bow.config.opensearch.default.prefix.description=Prefix par d\u00E9faut +bow.config.opensearch.fulltext.search.prefix.description=Fulltext bow.config.opensearch.prefix.separator.description= bow.config.opensearch.tag.search.prefix.description= bow.config.opensearch.web.search.prefix.description= @@ -52,7 +52,7 @@ bow.home.title=Accueil bow.label.locale.english= bow.label.locale.french= -bow.login.admin.failback=Probl\u00E8me d''authentification, vous devriez reconstruire l''index via la page d'admin +bow.login.admin.failback=Probl\u00E8me d'authentification, vous devriez reconstruire l'index via la page d'admin bow.login.authenticationFailure=Soit votre adresse email n''existe pas, soit votre mot de passe est eronn\u00E9 bow.login.email=Email bow.login.email.required=Veuillez entrer votre adresse email @@ -65,6 +65,7 @@ bow.login.title=Connexion bow.mail.badFormat=Votre adresse email est mal form\u00E9e \: aucun mail n''a pu \u00EAtre envoy\u00E9 bow.mail.sendError=Une erreur s''est produite lors de l''envoi du mail +bow.preference.opensearch.prefix.separator= bow.preferences.badCurrentPassword=Votre mot de passe actuel est incorrect bow.preferences.bookmarksHomePage=Nombre de marque-pages affich\u00E9s bow.preferences.colors=Couleur du site @@ -82,6 +83,15 @@ bow.preferences.labels.rename.submit=Renomer bow.preferences.newPassword=Nouveau mot de passe bow.preferences.noImportedBookmarks=Aucun marque-page import\u00E9 +bow.preferences.opensearch.alias.prefix=Alias +bow.preferences.opensearch.default.action=action par d\u00E9faut +bow.preferences.opensearch.default.prefix=Prefix par d\u00E9faut +bow.preferences.opensearch.fulltext.search.prefix=Recherche Fulltext +bow.preferences.opensearch.prefix=Pr\u00E9fix +bow.preferences.opensearch.prefix.separator=S\u00E9parateur de pr\u00E9fix +bow.preferences.opensearch.tag.search.prefix=Recherche par tag +bow.preferences.opensearch.value=Valeur +bow.preferences.opensearch.web.search.prefix=Recherche Web bow.preferences.regenPermToken=Reg\u00E9n\u00E9rer le token permanent bow.preferences.searchEngineUrlResults=Search Engine URL Results ('{'searchTerms'}' sera remplac\u00E9 par votre recherche) bow.preferences.searchEngineUrlSuggestions=Search Engine URL Suggestions Modified: trunk/bow-ui/src/main/resources/struts.xml =================================================================== --- trunk/bow-ui/src/main/resources/struts.xml 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/resources/struts.xml 2011-08-22 01:22:06 UTC (rev 320) @@ -99,21 +99,21 @@ <action name="alias/*" class="org.chorem.bow.action.AliasAction"> <param name="alias">{1}</param> <result name="success" type="redirect">${redirectTo}</result> - <result name="error">/jsp/error.jsp</result> + <result name="error">/WEB-INF/jsp/error.jsp</result> </action> </package> <package name="login" extends="loginArea"> <action name="register_*" method="{1}" class="org.chorem.bow.action.login.RegisterAction"> - <result name="input">/jsp/register.jsp</result> + <result name="input">/WEB-INF/jsp/register.jsp</result> <result type="redirectAction">home</result> </action> <action name="forgotPassword_*" method="{1}" class="org.chorem.bow.action.login.ForgotPasswordAction"> - <result name="input">/jsp/forgotPassword.jsp</result> + <result name="input">/WEB-INF/jsp/forgotPassword.jsp</result> <result type="redirectAction">login_input</result> </action> <action name="login_*" method="{1}" class="org.chorem.bow.action.login.LoginAction"> - <result name="input">/jsp/login.jsp</result> + <result name="input">/WEB-INF/jsp/login.jsp</result> <result name="login" type="redirectAction">home</result> <result type="redirectAction">home</result> </action> @@ -124,19 +124,19 @@ <package name="bookmark" extends="restrictedArea"> <action name="home" class="org.chorem.bow.action.bookmark.HomeAction"> - <result name="error">/jsp/home.jsp</result> - <result>/jsp/home.jsp</result> + <result name="error">/WEB-INF/jsp/home.jsp</result> + <result>/WEB-INF/jsp/home.jsp</result> </action> <action name="removeBookmark" class="org.chorem.bow.action.bookmark.RemoveAction"> <result name="error" type="redirect">${redirectTo}</result> <result type="redirect">${redirectTo}</result> </action> <action name="editBookmark" class="org.chorem.bow.action.bookmark.EditAction"> - <result name="error">/jsp/editBookmark.jsp</result> - <result>/jsp/editBookmark.jsp</result> + <result name="error">/WEB-INF/jsp/editBookmark.jsp</result> + <result>/WEB-INF/jsp/editBookmark.jsp</result> </action> <action name="addUrl" class="org.chorem.bow.action.bookmark.AddOrUpdateAction"> - <result name="error">/jsp/editBookmark.jsp</result> + <result name="error">/WEB-INF/jsp/editBookmark.jsp</result> <result type="redirect">${redirectTo}</result> </action> <action name="deleteSearchResults" class="org.chorem.bow.action.bookmark.DeleteSearchResultsAction"> @@ -148,17 +148,17 @@ <!-- Fragment: en prevision de faire un peu d'ajax si l'utilisateur le souhaite --> <package name="fragment" namespace="/fragment" extends="restrictedArea"> <action name="editBookmark" class="org.chorem.bow.action.bookmark.EditAction"> - <result name="error">/jsp/editBookmark.jsp</result> - <result>/jsp/editBookmark.jsp</result> + <result name="error">/WEB-INF/jsp/editBookmark.jsp</result> + <result>/WEB-INF/jsp/editBookmark.jsp</result> </action> </package> <package name="search" extends="restrictedArea"> - <action name="openSearchResult" class="org.chorem.bow.action.OpenSearchResultAction"> + <action name="openSearchResult" class="org.chorem.bow.action.opensearch.OpenSearchResultAction"> <result type="redirect">${redirectTo}</result> </action> - <action name="openSearchSuggestion" class="org.chorem.bow.action.OpenSearchSuggestionAction"> -<!-- <result>/jsp/suggestions.jsp</result> --> + <action name="openSearchSuggestion" class="org.chorem.bow.action.opensearch.OpenSearchSuggestionAction"> +<!-- <result>/WEB-INF/jsp/suggestions.jsp</result> --> <result type="stream"> <param name="contentType">application/x-suggestions+json</param> <param name="inputName">inputStream</param> @@ -167,52 +167,52 @@ </result> </action> <action name="*Xml"> - <result>/jsp/{1}Xml.jsp</result> + <result>/WEB-INF/jsp/{1}Xml.jsp</result> </action> </package> <package name="preference" extends="restrictedArea"> <action name="locale" class="org.chorem.bow.action.LocaleAction"> - <result type="redirect">/jsp/login.jsp</result> + <result type="redirect">/WEB-INF/jsp/login.jsp</result> </action> <action name="preferences" class="org.chorem.bow.action.preference.PreferenceBaseAction" method="input"> - <result name="error">/jsp/preferences.jsp</result> - <result>/jsp/preferences.jsp</result> + <result name="error">/WEB-INF/jsp/preferences.jsp</result> + <result>/WEB-INF/jsp/preferences.jsp</result> </action> <action name="generateToken" class="org.chorem.bow.action.preference.GenerateTokenAction"> - <result name="error">/jsp/preferences.jsp</result> - <result>/jsp/preferences.jsp</result> + <result name="error">/WEB-INF/jsp/preferences.jsp</result> + <result>/WEB-INF/jsp/preferences.jsp</result> </action> <action name="updateUserPref" class="org.chorem.bow.action.preference.UpdateUserAction"> - <result name="error">/jsp/preferences.jsp</result> - <result>/jsp/preferences.jsp</result> + <result name="error">/WEB-INF/jsp/preferences.jsp</result> + <result>/WEB-INF/jsp/preferences.jsp</result> </action> <action name="updateSitePref" class="org.chorem.bow.action.preference.UpdateSiteAction"> - <result name="error">/jsp/preferences.jsp</result> - <result>/jsp/preferences.jsp</result> + <result name="error">/WEB-INF/jsp/preferences.jsp</result> + <result>/WEB-INF/jsp/preferences.jsp</result> </action> <action name="adminlabels" class="org.chorem.bow.action.preference.AdminTagAction"> - <result name="error">/jsp/preferences.jsp</result> - <result>/jsp/preferences.jsp</result> + <result name="error">/WEB-INF/jsp/preferences.jsp</result> + <result>/WEB-INF/jsp/preferences.jsp</result> </action> <action name="deleteImport" class="org.chorem.bow.action.preference.DeleteImportAction"> - <result name="error">/jsp/preferences.jsp</result> - <result>/jsp/preferences.jsp</result> + <result name="error">/WEB-INF/jsp/preferences.jsp</result> + <result>/WEB-INF/jsp/preferences.jsp</result> </action> <action name="importBookmarks" class="org.chorem.bow.action.preference.ImportBookmarksAction"> - <result name="error">/jsp/preferences.jsp</result> - <result>/jsp/preferences.jsp</result> + <result name="error">/WEB-INF/jsp/preferences.jsp</result> + <result>/WEB-INF/jsp/preferences.jsp</result> </action> <action name="exportBookmarks" class="org.chorem.bow.action.preference.ExportBookmarksAction"> - <result name="error">/jsp/preferences.jsp</result> + <result name="error">/WEB-INF/jsp/preferences.jsp</result> <result type="stream"> <param name="contentType">text/html</param> <param name="inputName">inputStream</param> @@ -223,16 +223,16 @@ <package name="admin" extends="restrictedArea"> <action name="admin"> - <result name="error">/jsp/login.jsp</result> - <result>/jsp/admin.jsp</result> + <result name="error">/WEB-INF/jsp/login.jsp</result> + <result>/WEB-INF/jsp/admin.jsp</result> </action> <action name="reIndexation" class="org.chorem.bow.action.admin.ReIndexationAction"> - <result name="error">/jsp/admin.jsp</result> - <result>/jsp/admin.jsp</result> + <result name="error">/WEB-INF/jsp/admin.jsp</result> + <result>/WEB-INF/jsp/admin.jsp</result> </action> <action name="migrateData" class="org.chorem.bow.action.admin.MigrateDataAction"> - <result name="error">/jsp/admin.jsp</result> - <result>/jsp/admin.jsp</result> + <result name="error">/WEB-INF/jsp/admin.jsp</result> + <result>/WEB-INF/jsp/admin.jsp</result> </action> </package> </struts> Modified: trunk/bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp =================================================================== --- trunk/bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp 2011-08-21 18:31:08 UTC (rev 319) +++ trunk/bow-ui/src/main/webapp/WEB-INF/jsp/preferences.jsp 2011-08-22 01:22:06 UTC (rev 320) @@ -21,9 +21,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #L% --%> +<%@page import="org.chorem.bow.action.preference.PreferenceBaseAction"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@taglib prefix="s" uri="/struts-tags" %> +<% +PreferenceBaseAction action = PreferenceBaseAction.getAction(); +PreferenceBaseAction.DefaultPrefix defaultAction = action.getDefaultAction(); +PreferenceBaseAction.DefaultPrefix defaultPrefix = action.getDefaultPrefix(); +%> + <html xmlns:s="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" xmlns:jsp="http://java.sun.com/JSP/Page"> <head> @@ -119,6 +126,50 @@ size="50" labelposition="top"/><br/> + <s:text name="bow.preference.opensearch.prefix.separator"/> + <s:textfield name="separator" size="1" maxLength="1"/><br/> + + <table> + <tr> + <th><s:text name="bow.preferences.opensearch.prefix"/></th> + <th><s:text name="bow.preferences.opensearch.value"/></th> + <th><s:text name="bow.preferences.opensearch.default.prefix"/></th> + <th><s:text name="bow.preferences.opensearch.default.action"/></th> + </tr> + <tr> + <td><s:text name="bow.preferences.opensearch.tag.search.prefix"/></td> + <td><s:textfield name="tagPrefix" size="1" maxLength="1"/></td> + <td><input type="radio" name="defaultPrefix" value="<%=PreferenceBaseAction.DefaultPrefix.TAG%>" + <%=(defaultPrefix==PreferenceBaseAction.DefaultPrefix.TAG?"checked='true'":"")%>/></td> + <td><input type="radio" name="defaultAction" value="<%=PreferenceBaseAction.DefaultPrefix.TAG%>" + <%=(defaultAction==PreferenceBaseAction.DefaultPrefix.TAG?"checked='true'":"")%>/></td> + </tr> + <tr> + <td><s:text name="bow.preferences.opensearch.fulltext.search.prefix"/></td> + <td><s:textfield name="fulltextPrefix" size="1" maxLength="1"/></td> + <td><input type="radio" name="defaultPrefix" value="<%=PreferenceBaseAction.DefaultPrefix.FULLTEXT%>" + <%=(defaultPrefix==PreferenceBaseAction.DefaultPrefix.FULLTEXT?"checked='true'":"")%>/></td> + <td><input type="radio" name="defaultAction" value="<%=PreferenceBaseAction.DefaultPrefix.FULLTEXT%>" + <%=(defaultAction==PreferenceBaseAction.DefaultPrefix.FULLTEXT?"checked='true'":"")%>/></td> + </tr> + <tr> + <td><s:text name="bow.preferences.opensearch.web.search.prefix"/></td> + <td><s:textfield name="webPrefix" size="1" maxLength="1"/></td> + <td><input type="radio" name="defaultPrefix" value="<%=PreferenceBaseAction.DefaultPrefix.WEB%>" + <%=(defaultPrefix==PreferenceBaseAction.DefaultPrefix.WEB?"checked='true'":"")%>/></td> + <td><input type="radio" name="defaultAction" value="<%=PreferenceBaseAction.DefaultPrefix.WEB%>" + <%=(defaultAction==PreferenceBaseAction.DefaultPrefix.WEB?"checked='true'":"")%>/></td> + <tr> + <td><s:text name="bow.preferences.opensearch.alias.prefix"/></td> + <td><s:textfield name="aliasPrefix" size="1" maxLength="1"/></td> + <td><input type="radio" name="defaultPrefix" value="<%=PreferenceBaseAction.DefaultPrefix.ALIAS%>" + <%=(defaultPrefix==PreferenceBaseAction.DefaultPrefix.ALIAS?"checked='true'":"")%>/></td> + <td><input type="radio" name="defaultAction" value="<%=PreferenceBaseAction.DefaultPrefix.ALIAS%>" + <%=(defaultAction==PreferenceBaseAction.DefaultPrefix.ALIAS?"checked='true'":"")%>/></td> + </tr> + </tr> + </table> + <s:hidden name="update" value="site"/> <s:submit key="bow.preferences.submit" name="submit"/> </s:form>
participants (1)
-
bpoussin@users.chorem.org