From 156ff56ed9b0254c6acb3316a64772467882ba05 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Thu, 24 May 2007 11:08:53 +0000 Subject: [PATCH] MySpaces webscript now shows Ajax wait animation while loading inner panel area. Summary pop-up panel fade-out anim removed (improves user experience). Reorg of broken action evaluator class hiearchy (after ML UI changes). More fixes to ML UI (browse.jsp missing component IDs breaks screen when panels collapsed then expanded). Code reorg in interceptors to help performance. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5772 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/portlets/myspaces_get_html.ftl | 12 + config/alfresco/web-client-config-actions.xml | 134 ++++++----- .../web-client-config-forum-actions.xml | 4 +- .../evaluator/AddTranslationEvaluator.java | 42 ++-- .../action/evaluator/CutNodeEvaluator.java | 28 +-- .../action/evaluator/DeleteDocEvaluator.java | 51 +++-- ...ator.java => DiscussionCopyEvaluator.java} | 6 +- .../evaluator/DiscussionCutEvaluator.java | 70 ++++++ .../evaluator/MakeMultilingualEvaluator.java | 31 ++- .../MultilingualDetailsEvaluator.java | 12 +- .../org/alfresco/web/bean/BrowseBean.java | 65 +++--- .../web/bean/UserPreferencesBean.java | 209 +++++++++--------- source/web/css/main.css | 17 +- source/web/jsp/browse/browse.jsp | 9 +- source/web/jsp/ml/ml-container-details.jsp | 2 +- source/web/scripts/ajax/myspaces.js | 4 + source/web/scripts/ajax/summary-info.js | 7 +- 17 files changed, 381 insertions(+), 322 deletions(-) rename source/java/org/alfresco/web/action/evaluator/{DiscussionCutCopyEvaluator.java => DiscussionCopyEvaluator.java} (92%) create mode 100644 source/java/org/alfresco/web/action/evaluator/DiscussionCutEvaluator.java diff --git a/config/alfresco/templates/webscripts/org/alfresco/portlets/myspaces_get_html.ftl b/config/alfresco/templates/webscripts/org/alfresco/portlets/myspaces_get_html.ftl index 1d8eee4500..e3d0587857 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/portlets/myspaces_get_html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/portlets/myspaces_get_html.ftl @@ -86,6 +86,7 @@ +
<#-- populated via an AJAX call to 'myspacespanel' webscript --> <#-- resolved path, filter and home.noderef required as arguments --> @@ -151,6 +152,17 @@ a.spacefilterLinkSelected:link, a.spacefilterLinkSelected:visited visibility: hidden; } +#spacePanelOverlay +{ + background-image: url(${url.context}/images/icons/ajax_anim.gif); + background-position: center; + background-repeat: no-repeat; + position: absolute; + height: 320px; + width: 720px; + overflow: hidden; +} + .spaceRow { padding-top: 4px; diff --git a/config/alfresco/web-client-config-actions.xml b/config/alfresco/web-client-config-actions.xml index 920faa52f1..62fd36f397 100644 --- a/config/alfresco/web-client-config-actions.xml +++ b/config/alfresco/web-client-config-actions.xml @@ -42,68 +42,6 @@ - - - - Write - - org.alfresco.web.action.evaluator.MakeMultilingualEvaluator - make_multilingual - make_multilingual_tooltip - /images/icons/make_ml.gif - dialog:makeMultilingual - - #{actionContext.id} - - - - - - - Write - - org.alfresco.web.action.evaluator.AddTranslationEvaluator - add_translation - add_translation_tooltip - /images/icons/add_tranlsation.gif - #{AddTranslationDialog.start} - addTranslation - - #{actionContext.id} - - - - - - - Write - - org.alfresco.web.action.evaluator.AddTranslationEvaluator - add_translation_wc - add_translation_wc_tooltip - /images/icons/add_tranlsation_wc.gif - dialog:addTranslationWithoutContent - - #{actionContext.id} - - - - - - - Read - - org.alfresco.web.action.evaluator.MultilingualDetailsEvaluator - manage_multilingual_details - manage_multilingual_details_tooltip - /images/icons/multilingual_details.gif - #{BrowseBean.setupContentAction} - dialog:showMLContainerDetails - - #{actionContext.id} - - - @@ -633,6 +571,68 @@ /images/icons/reset.gif #{NavigatorPluginBean.reset} + + + + + Write + + org.alfresco.web.action.evaluator.MakeMultilingualEvaluator + make_multilingual + make_multilingual_tooltip + /images/icons/make_ml.gif + dialog:makeMultilingual + + #{actionContext.id} + + + + + + + Write + + org.alfresco.web.action.evaluator.AddTranslationEvaluator + add_translation + add_translation_tooltip + /images/icons/add_tranlsation.gif + #{AddTranslationDialog.start} + addTranslation + + #{actionContext.id} + + + + + + + Write + + org.alfresco.web.action.evaluator.AddTranslationEvaluator + add_translation_wc + add_translation_wc_tooltip + /images/icons/add_tranlsation_wc.gif + dialog:addTranslationWithoutContent + + #{actionContext.id} + + + + + + + Read + + org.alfresco.web.action.evaluator.MultilingualDetailsEvaluator + manage_multilingual_details + manage_multilingual_details_tooltip + /images/icons/multilingual_details.gif + #{BrowseBean.setupContentAction} + dialog:showMLContainerDetails + + #{actionContext.id} + + @@ -747,19 +747,11 @@ - - + - - - - - - - diff --git a/config/alfresco/web-client-config-forum-actions.xml b/config/alfresco/web-client-config-forum-actions.xml index 9b00e7a83a..af2aa3e377 100644 --- a/config/alfresco/web-client-config-forum-actions.xml +++ b/config/alfresco/web-client-config-forum-actions.xml @@ -20,7 +20,7 @@ - org.alfresco.web.action.evaluator.CutNodeEvaluator + org.alfresco.web.action.evaluator.DiscussionCutEvaluator Delete @@ -36,7 +36,7 @@ - org.alfresco.web.action.evaluator.DiscussionCutCopyEvaluator + org.alfresco.web.action.evaluator.DiscussionCopyEvaluator copy /images/icons/copy.gif #{ClipboardBean.copyNode} diff --git a/source/java/org/alfresco/web/action/evaluator/AddTranslationEvaluator.java b/source/java/org/alfresco/web/action/evaluator/AddTranslationEvaluator.java index 0679956109..b08ee43708 100644 --- a/source/java/org/alfresco/web/action/evaluator/AddTranslationEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/AddTranslationEvaluator.java @@ -43,28 +43,24 @@ import org.alfresco.web.bean.repository.Node; */ public class AddTranslationEvaluator implements ActionEvaluator { + public boolean evaluate(Node node) + { + FacesContext fc = FacesContext.getCurrentInstance(); - public boolean evaluate(Node node) - { - FacesContext fc = FacesContext.getCurrentInstance(); - - MultilingualContentService mlservice = - (MultilingualContentService) FacesHelper.getManagedBean(fc, "MultilingualContentService"); - - UserPreferencesBean userprefs = - (UserPreferencesBean) FacesHelper.getManagedBean(fc, "UserPreferencesBean"); - - // the number of translation of this document - int availableTranslationCount = mlservice.getTranslations(node.getNodeRef()).size(); - // the total number of available languages for the translation - int contentFilterLanguagesCount = userprefs.getContentFilterLanguages(false).length; - - return ( - node.isLocked() == false && - node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false && - node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT) == true && - availableTranslationCount < contentFilterLanguagesCount - ); - } + MultilingualContentService mlservice = + (MultilingualContentService) FacesHelper.getManagedBean(fc, "MultilingualContentService"); -} + UserPreferencesBean userprefs = + (UserPreferencesBean) FacesHelper.getManagedBean(fc, "UserPreferencesBean"); + + // the number of translation of this document + int availableTranslationCount = mlservice.getTranslations(node.getNodeRef()).size(); + // the total number of available languages for the translation + int contentFilterLanguagesCount = userprefs.getContentFilterLanguages(false).length; + + return (node.isLocked() == false && + node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false && + node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT) == true && + availableTranslationCount < contentFilterLanguagesCount); + } +} \ No newline at end of file diff --git a/source/java/org/alfresco/web/action/evaluator/CutNodeEvaluator.java b/source/java/org/alfresco/web/action/evaluator/CutNodeEvaluator.java index 10adf61ca8..efe667181b 100644 --- a/source/java/org/alfresco/web/action/evaluator/CutNodeEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/CutNodeEvaluator.java @@ -40,20 +40,22 @@ import org.alfresco.web.bean.repository.Node; * * @author yanipig */ -public class CutNodeEvaluator extends DiscussionCutCopyEvaluator +public class CutNodeEvaluator implements ActionEvaluator { - public boolean evaluate(Node node) - { - boolean eval = super.evaluate(node); - - if(eval == true) - { - eval = !node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT); - } - - return eval; - - } + { + boolean eval = true; + // impossible to cut/copy a translation without content. + if (node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION)) + { + eval = false; + } + else + { + eval = !node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT); + } + + return eval; + } } diff --git a/source/java/org/alfresco/web/action/evaluator/DeleteDocEvaluator.java b/source/java/org/alfresco/web/action/evaluator/DeleteDocEvaluator.java index 500c05e2b0..8fc5d75f95 100644 --- a/source/java/org/alfresco/web/action/evaluator/DeleteDocEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/DeleteDocEvaluator.java @@ -44,33 +44,32 @@ public class DeleteDocEvaluator implements ActionEvaluator */ public boolean evaluate(Node node) { - boolean isPivot = false; - - // special case for multilingual documents - if(node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT)) - { - FacesContext fc = FacesContext.getCurrentInstance(); - - MultilingualContentService mlservice = + boolean isPivot = false; + + // special case for multilingual documents + if (node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT)) + { + FacesContext fc = FacesContext.getCurrentInstance(); + + MultilingualContentService mlservice = (MultilingualContentService) FacesHelper.getManagedBean(fc, "MultilingualContentService"); - - // if the translation is the last translation, user can delete it - if(mlservice.getTranslations(node.getNodeRef()).size() == 1) - { - isPivot = false; - } - // Else if the node is the pivot language, user can't delete it - else if( mlservice.getPivotTranslation(node.getNodeRef()).getId() - .equalsIgnoreCase(node.getNodeRef().getId())) - { - isPivot = true; - } - // finally, the node is not the pivot translation, user can delete it - } - - return (node.isLocked() == false && + + // if the translation is the last translation, user can delete it + if (mlservice.getTranslations(node.getNodeRef()).size() == 1) + { + isPivot = false; + } + // Else if the node is the pivot language, user can't delete it + else if (mlservice.getPivotTranslation(node.getNodeRef()).getId() + .equalsIgnoreCase(node.getNodeRef().getId())) + { + isPivot = true; + } + // finally, the node is not the pivot translation, user can delete it + } + + return (node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false && - isPivot == false - ); + isPivot == false); } } \ No newline at end of file diff --git a/source/java/org/alfresco/web/action/evaluator/DiscussionCutCopyEvaluator.java b/source/java/org/alfresco/web/action/evaluator/DiscussionCopyEvaluator.java similarity index 92% rename from source/java/org/alfresco/web/action/evaluator/DiscussionCutCopyEvaluator.java rename to source/java/org/alfresco/web/action/evaluator/DiscussionCopyEvaluator.java index 51c3b0235e..4505d6578f 100644 --- a/source/java/org/alfresco/web/action/evaluator/DiscussionCutCopyEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/DiscussionCopyEvaluator.java @@ -36,13 +36,13 @@ import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; /** - * Evaluates whether the cut or copy action should be visible. + * Evaluates whether the copy action should be visible. * * If the node is a discussion don't allow the action. * * @author gavinc */ -public class DiscussionCutCopyEvaluator implements ActionEvaluator +public class DiscussionCopyEvaluator implements ActionEvaluator { /** * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node) @@ -66,7 +66,7 @@ public class DiscussionCutCopyEvaluator implements ActionEvaluator } // impossible to copy a translation without content. - if(result && node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION)) + if (result && node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION)) { result = false; } diff --git a/source/java/org/alfresco/web/action/evaluator/DiscussionCutEvaluator.java b/source/java/org/alfresco/web/action/evaluator/DiscussionCutEvaluator.java new file mode 100644 index 0000000000..1d6906d77a --- /dev/null +++ b/source/java/org/alfresco/web/action/evaluator/DiscussionCutEvaluator.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2005-2007 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * 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 General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.web.action.evaluator; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.ContentModel; +import org.alfresco.model.ForumModel; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; +import org.alfresco.web.action.ActionEvaluator; +import org.alfresco.web.bean.repository.Node; +import org.alfresco.web.bean.repository.Repository; + +/** + * Evaluates whether the cut action should be visible. + * + * If the node is a discussion don't allow the action. + * + * @author gavinc + */ +public class DiscussionCutEvaluator extends CutNodeEvaluator +{ + /** + * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node) + */ + public boolean evaluate(Node node) + { + boolean result = super.evaluate(node); + + // if the node in question is a forum... + if (result && node.getType().equals(ForumModel.TYPE_FORUM)) + { + // get the association type + FacesContext context = FacesContext.getCurrentInstance(); + NodeService nodeService = Repository.getServiceRegistry(context).getNodeService(); + + ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(node.getNodeRef()); + QName assocType = parentAssoc.getTypeQName(); + + // only allow the action if the association type is not the discussion assoc + result = (assocType.equals(ForumModel.ASSOC_DISCUSSION) == false); + } + + return result; + } +} diff --git a/source/java/org/alfresco/web/action/evaluator/MakeMultilingualEvaluator.java b/source/java/org/alfresco/web/action/evaluator/MakeMultilingualEvaluator.java index 856ce9aecf..da7169f965 100644 --- a/source/java/org/alfresco/web/action/evaluator/MakeMultilingualEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/MakeMultilingualEvaluator.java @@ -41,22 +41,19 @@ import org.alfresco.web.bean.repository.Node; */ public class MakeMultilingualEvaluator implements ActionEvaluator { + public boolean evaluate(Node node) + { + FacesContext fc = FacesContext.getCurrentInstance(); - public boolean evaluate(Node node) - { - FacesContext fc = FacesContext.getCurrentInstance(); - - UserPreferencesBean userprefs = - (UserPreferencesBean) FacesHelper.getManagedBean(fc, "UserPreferencesBean"); - - // the total number of available languages for the translation have to be greather that 0 - int contentFilterLanguagesCount = userprefs.getContentFilterLanguages(false).length; - - return (node.isLocked() == false && - node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false && - node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT) == false && - contentFilterLanguagesCount > 0 - ); - } + UserPreferencesBean userprefs = + (UserPreferencesBean) FacesHelper.getManagedBean(fc, "UserPreferencesBean"); -} + // the total number of available languages for the translation have to be greather that 0 + int contentFilterLanguagesCount = userprefs.getContentFilterLanguages(false).length; + + return (node.isLocked() == false && + node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false && + node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT) == false && + contentFilterLanguagesCount > 0); + } +} \ No newline at end of file diff --git a/source/java/org/alfresco/web/action/evaluator/MultilingualDetailsEvaluator.java b/source/java/org/alfresco/web/action/evaluator/MultilingualDetailsEvaluator.java index 7c4409dd8a..1530ae79dd 100644 --- a/source/java/org/alfresco/web/action/evaluator/MultilingualDetailsEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/MultilingualDetailsEvaluator.java @@ -37,12 +37,8 @@ import org.alfresco.web.bean.repository.Node; */ public class MultilingualDetailsEvaluator implements ActionEvaluator { - - public boolean evaluate(Node node) - { - return ( - node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT) == true - ); - } - + public boolean evaluate(Node node) + { + return (node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT) == true); + } } diff --git a/source/java/org/alfresco/web/bean/BrowseBean.java b/source/java/org/alfresco/web/bean/BrowseBean.java index d2b6f72d7f..adc04d6aca 100644 --- a/source/java/org/alfresco/web/bean/BrowseBean.java +++ b/source/java/org/alfresco/web/bean/BrowseBean.java @@ -52,7 +52,6 @@ import org.alfresco.service.cmr.repository.ContentData; import org.alfresco.service.cmr.repository.InvalidNodeRefException; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; -import org.alfresco.service.cmr.repository.Path; import org.alfresco.service.cmr.search.LimitBy; import org.alfresco.service.cmr.search.ResultSet; import org.alfresco.service.cmr.search.ResultSetRow; @@ -1055,40 +1054,40 @@ public class BrowseBean implements IContextListener return (content != null ? new Long(content.getSize()) : 0L); } }; - - public NodePropertyResolver resolverLang = new NodePropertyResolver() { - public Object get(Node node) { - - String lang = null; - - if(node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT)) - { - Locale locale = (Locale) node.getProperties().get(ContentModel.PROP_LOCALE); - - // the content filter lang defined by the user - String userLang = userPreferencesBean.getContentFilterLanguage(); - // the node lang - String nodeLang = locale.getLanguage(); - - // if filter equals all languages : display the lang for each translation - if(nodeLang == null) - { - lang = nodeLang; - } - - // if filter is different : display the lang - else if (!nodeLang.equalsIgnoreCase(userLang)) - { - lang = nodeLang; - } - - // else if the filter is equal to the lang node : nothing to do [lang = null] - - } - return lang; + public NodePropertyResolver resolverLang = new NodePropertyResolver() { + public Object get(Node node) { + + String lang = null; + + if (node.getAspects().contains(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT)) + { + Locale locale = (Locale) node.getProperties().get(ContentModel.PROP_LOCALE); + + // the content filter lang defined by the user + String userLang = userPreferencesBean.getContentFilterLanguage(); + // the node lang + String nodeLang = locale.getLanguage(); + + // if filter equals all languages : display the lang for each translation + if (nodeLang == null) + { + lang = nodeLang; + } + + // if filter is different : display the lang + else if (!nodeLang.equalsIgnoreCase(userLang)) + { + lang = nodeLang; + } + + // else if the filter is equal to the lang node : nothing to do [lang = null] } - }; + + return lang; + } + }; + // ------------------------------------------------------------------------------ // Navigation action event handlers diff --git a/source/java/org/alfresco/web/bean/UserPreferencesBean.java b/source/java/org/alfresco/web/bean/UserPreferencesBean.java index b16f0840c7..cd0ee165e2 100644 --- a/source/java/org/alfresco/web/bean/UserPreferencesBean.java +++ b/source/java/org/alfresco/web/bean/UserPreferencesBean.java @@ -53,9 +53,9 @@ import org.alfresco.web.config.LanguagesConfigElement; public class UserPreferencesBean { private static final String PREF_STARTLOCATION = "start-location"; - + private static final String PREF_CONTENTFILTERLANGUAGE = "content-filter-language"; - + /** * Remplacement message for set the filter at 'all languages'. * Must be considered as a null value. @@ -64,13 +64,13 @@ public class UserPreferencesBean /** language locale selection */ private String language = null; - + /** content language locale selection */ private String contentFilterLanguage = null; - + /** the injected MultilingualContentService */ MultilingualContentService multilingualContentService; - + /** the injected ContentFilterLanguagesService */ ContentFilterLanguagesService contentFilterLanguagesService; @@ -82,28 +82,28 @@ public class UserPreferencesBean */ public SelectItem[] getLanguages() { - // Get the item selection list - SelectItem[] items = getLanguageItems(); - // Change the current language - if (this.language == null) - { - // first try to get the language that the current user is using - Locale lastLocale = Application.getLanguage(FacesContext.getCurrentInstance()); - if (lastLocale != null) - { - this.language = lastLocale.toString(); - } - // else we default to the first item in the list - else if (items.length > 0) - { - this.language = (String) items[0].getValue(); - } - else - { - throw new AlfrescoRuntimeException("The language list is empty"); - } - } - return items; + // Get the item selection list + SelectItem[] items = getLanguageItems(); + // Change the current language + if (this.language == null) + { + // first try to get the language that the current user is using + Locale lastLocale = Application.getLanguage(FacesContext.getCurrentInstance()); + if (lastLocale != null) + { + this.language = lastLocale.toString(); + } + // else we default to the first item in the list + else if (items.length > 0) + { + this.language = (String) items[0].getValue(); + } + else + { + throw new AlfrescoRuntimeException("The language list is empty"); + } + } + return items; } /** @@ -121,11 +121,11 @@ public class UserPreferencesBean { this.language = language; Application.setLanguage(FacesContext.getCurrentInstance(), language); - + // Set the current locale in the server I18NUtil.setLocale(I18NUtil.parseLocale(language)); } - + /** * @return current content filter language, or null if all languages was selected */ @@ -133,61 +133,59 @@ public class UserPreferencesBean { if (this.contentFilterLanguage == null) { - Locale locale = (Locale) PreferencesService.getPreferences().getValue(PREF_CONTENTFILTERLANGUAGE); - // Null means All Languages - if (locale == null) - { - this.contentFilterLanguage = null; - } - else - { - this.contentFilterLanguage = locale.toString(); - } + Locale locale = (Locale) PreferencesService.getPreferences().getValue(PREF_CONTENTFILTERLANGUAGE); + // Null means All Languages + if (locale == null) + { + this.contentFilterLanguage = null; + } + else + { + this.contentFilterLanguage = locale.toString(); + } } - + // set the content filter locale on the core I18NUtil.setContentLocale(I18NUtil.parseLocale(this.contentFilterLanguage)); - + return this.contentFilterLanguage; - //return (contentFilterLanguage.equals(MSG_CONTENTALLLANGUAGES)) ? "en" : contentFilterLanguage; } - - + /** * @param languageStr A valid locale string or {@link #MSG_CONTENTALLLANGUAGES} */ public void setContentFilterLanguage(String contentFilterLanguage) { this.contentFilterLanguage = contentFilterLanguage; - Locale language = null; - if (contentFilterLanguage.equals(MSG_CONTENTALLLANGUAGES)) - { - // The generic "All Languages" was selected - persist this as a null - this.contentFilterLanguage = null; - } - else - { - // It should be a proper locale string - language = I18NUtil.parseLocale(contentFilterLanguage); - } - PreferencesService.getPreferences().setValue(PREF_CONTENTFILTERLANGUAGE, language); - - // set the content filter locale on the core + Locale language = null; + if (contentFilterLanguage.equals(MSG_CONTENTALLLANGUAGES)) + { + // The generic "All Languages" was selected - persist this as a null + this.contentFilterLanguage = null; + } + else + { + // It should be a proper locale string + language = I18NUtil.parseLocale(contentFilterLanguage); + } + PreferencesService.getPreferences().setValue(PREF_CONTENTFILTERLANGUAGE, language); + + // set the content filter locale on the core I18NUtil.setContentLocale(language); - - // Ensure a refresh - UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans(); + + // Ensure a refresh + UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans(); } - + /** * @return list of items for the content filtering language selection include the label 'all langaguages' */ public SelectItem[] getContentFilterLanguages() { - // Get the item selection list + // Get the item selection list return getContentFilterLanguages(true); } - + /** * @param includeAllLanguages if true, the list must include the label 'all languages' * @return list of items for the content filtering language selection @@ -196,68 +194,61 @@ public class UserPreferencesBean { FacesContext fc = FacesContext.getCurrentInstance(); ResourceBundle msg = Application.getBundle(fc); - + // get the list of filter languages List languages = contentFilterLanguagesService.getFilterLanguages(); - + // set the item selection list SelectItem[] items = new SelectItem[(includeAllLanguages) ? languages.size() + 1 : languages.size()]; int idx = 0; - + // include the item if needed if (includeAllLanguages) { - String allLanguagesStr = msg.getString(MSG_CONTENTALLLANGUAGES); - items[idx] = new SelectItem(MSG_CONTENTALLLANGUAGES, allLanguagesStr); - idx++; - } - - for(String lang : languages) - { - String label = contentFilterLanguagesService.getLabelByCode(lang); - - items[idx] = new SelectItem( - lang, - label); - + String allLanguagesStr = msg.getString(MSG_CONTENTALLLANGUAGES); + items[idx] = new SelectItem(MSG_CONTENTALLLANGUAGES, allLanguagesStr); idx++; } - + + for (String lang : languages) + { + String label = contentFilterLanguagesService.getLabelByCode(lang); + items[idx++] = new SelectItem(lang, label); + idx++; + } + return items; } - - - - /** - * return the list of languages in which the given node hasn't be translated yet. - * + + /** + * return the list of languages in which the given node hasn't be translated yet. + * * @param translation the translatable node ref * @param returnTranslationLanguage if true, return the language of the given translation. * @return the list of languages */ public SelectItem[] getAvailablesContentFilterLanguages(NodeRef translation, boolean returnTranslationLanguage) - { + { // get the list of missing translation of this node List missingLocales = multilingualContentService.getMissingTranslations(translation, returnTranslationLanguage); - + // set the item selection list SelectItem[] items = new SelectItem[missingLocales.size()]; int idx = 0; - + for(Locale locale : missingLocales) { String label = contentFilterLanguagesService.getLabelByCode(locale.getLanguage()); - + items[idx] = new SelectItem( - locale.toString(), - label); + locale.toString(), + label); idx++; } - + return items; } - - + /** * Helper to return the available language items * @@ -270,7 +261,7 @@ public class UserPreferencesBean Config config = Application.getConfigService(fc).getConfig("Languages"); LanguagesConfigElement langConfig = (LanguagesConfigElement)config.getConfigElement( LanguagesConfigElement.CONFIG_ELEMENT_ID); - + List languages = langConfig.getLanguages(); List items = new ArrayList(10); @@ -280,10 +271,10 @@ public class UserPreferencesBean String label = langConfig.getLabelForLanguage(locale); items.add(new SelectItem(locale, label)); } - + return items.toArray(new SelectItem[items.size()]); } - + /** * @return the start location for this user (@see NavigationBean) */ @@ -297,7 +288,7 @@ public class UserPreferencesBean } return location; } - + /** * @param location The current start location for this user (@see NavigationBean) */ @@ -305,7 +296,7 @@ public class UserPreferencesBean { PreferencesService.getPreferences().setValue(PREF_STARTLOCATION, location); } - + /** * @return the list of available start locations */ @@ -314,34 +305,34 @@ public class UserPreferencesBean FacesContext fc = FacesContext.getCurrentInstance(); NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, "NavigationBean"); ResourceBundle msg = Application.getBundle(fc); - + List locations = new ArrayList(4); - + // add My Alfresco location locations.add(new SelectItem( NavigationBean.LOCATION_MYALFRESCO, msg.getString(NavigationBean.MSG_MYALFRESCO))); - + // add My Home location locations.add(new SelectItem( NavigationBean.LOCATION_HOME, msg.getString(NavigationBean.MSG_MYHOME))); - + // add Company Home location if visible if (navigator.getCompanyHomeVisible()) { locations.add(new SelectItem( NavigationBean.LOCATION_COMPANY, msg.getString(NavigationBean.MSG_COMPANYHOME))); } - + // add Guest Home location if visible if (navigator.getGuestHomeVisible()) { locations.add(new SelectItem( NavigationBean.LOCATION_GUEST, msg.getString(NavigationBean.MSG_GUESTHOME))); } - + return locations.toArray(new SelectItem[locations.size()]); } - + /** * @return true if the Guest user is allowed to configure the user preferences */ @@ -357,7 +348,7 @@ public class UserPreferencesBean { return multilingualContentService; } - + /** * @param multilingualContentService the multilingualContentService to set */ diff --git a/source/web/css/main.css b/source/web/css/main.css index aa60b873df..e8642edc95 100644 --- a/source/web/css/main.css +++ b/source/web/css/main.css @@ -500,14 +500,15 @@ a.topToolbarLinkHighlight, a.topToolbarLinkHighlight:link, a.topToolbarLinkHighl .langCode { - color:#FFFFFF; - padding-left:2px; - padding-right:2px; - letter-spacing:1px; - border:1px solid #000000; - background-color:#0000FF; - font-weight:bolder; - text-transform:uppercase; + color: #FFFFFF; + padding-left: 2px; + padding-right: 2px; + margin-left: 4px; + letter-spacing: 1px; + border: 1px solid #000000; + background-color: #0000FF; + font-weight: bolder; + text-transform: uppercase; } .userGroupPickerList diff --git a/source/web/jsp/browse/browse.jsp b/source/web/jsp/browse/browse.jsp index 2755dd44fb..593918a22d 100644 --- a/source/web/jsp/browse/browse.jsp +++ b/source/web/jsp/browse/browse.jsp @@ -422,8 +422,7 @@ - - + @@ -436,8 +435,7 @@ - - + @@ -450,8 +448,7 @@ - - + diff --git a/source/web/jsp/ml/ml-container-details.jsp b/source/web/jsp/ml/ml-container-details.jsp index 6a5cdfcef6..1ff0fcdf14 100644 --- a/source/web/jsp/ml/ml-container-details.jsp +++ b/source/web/jsp/ml/ml-container-details.jsp @@ -219,7 +219,7 @@ <%-- Document Actions --%> - + diff --git a/source/web/scripts/ajax/myspaces.js b/source/web/scripts/ajax/myspaces.js index d08889d3f5..ba47ac529e 100644 --- a/source/web/scripts/ajax/myspaces.js +++ b/source/web/scripts/ajax/myspaces.js @@ -40,6 +40,8 @@ var MySpaces = { init: function() { MySpaces.parseSpacePanels(); + // hide the ajax wait panel and show the main spaces panel + $('spacePanelOverlay').setStyle('visibility', 'hidden'); $('spacePanel').setStyle('visibility', 'visible'); }, @@ -324,6 +326,8 @@ var MySpaces = { // empty the main panel div and restart by reloading the panel contents var spacePanel = $('spacePanel'); spacePanel.setStyle('visibility', 'hidden'); + // show the ajax wait panel + $('spacePanelOverlay').setStyle('visibility', 'visible'); spacePanel.empty(); spacePanel.removeEvents('mouseleave'); MySpaces.start(); diff --git a/source/web/scripts/ajax/summary-info.js b/source/web/scripts/ajax/summary-info.js index 848b775477..049ab9471c 100644 --- a/source/web/scripts/ajax/summary-info.js +++ b/source/web/scripts/ajax/summary-info.js @@ -216,7 +216,7 @@ Alfresco.InfoPanel.prototype = if (this.popupElement != null && this.visible == true) { // fade out and set the visiblilty flag on complete of the anim - var fxAnim = new Fx.Style(this.popupElement, 'opacity', + /*var fxAnim = new Fx.Style(this.popupElement, 'opacity', { duration: 300, transition: Fx.Transitions.linear, @@ -225,7 +225,10 @@ Alfresco.InfoPanel.prototype = this.element.panel.visible = false; } }); - fxAnim.start(1, 0); + fxAnim.start(1, 0);*/ + this.popupElement.setStyle("opacity", 0); + this.popupElement.setStyle("display", "none"); + this.popupElement.panel.visible = false; } } }