diff --git a/source/java/org/alfresco/web/bean/LoginBean.java b/source/java/org/alfresco/web/bean/LoginBean.java index 08dc752dd1..a516e52b3a 100644 --- a/source/java/org/alfresco/web/bean/LoginBean.java +++ b/source/java/org/alfresco/web/bean/LoginBean.java @@ -349,7 +349,9 @@ public class LoginBean implements Serializable { try { - Map session = fc.getExternalContext().getSessionMap(); + // Perform a full session invalidation to ensure no cached data is left around + // - important if the login page has been accessed directly rather than via the Login/out action links + Application.logOut(fc); // Authenticate via the authentication service, then save the details of user in an object // in the session - this is used by the servlet filter etc. on each page to check for login @@ -358,9 +360,6 @@ public class LoginBean implements Serializable // Set the user name as stored by the back end this.username = this.getAuthenticationService().getCurrentUserName(); - // remove the session invalidated flag (used to remove last username cookie by AuthenticationFilter) - session.remove(AuthenticationHelper.SESSION_INVALIDATED); - // setup User object and Home space ID User user = new User( this.username, diff --git a/source/java/org/alfresco/web/bean/NavigationBean.java b/source/java/org/alfresco/web/bean/NavigationBean.java index 964eef1a25..3ad6fa9526 100644 --- a/source/java/org/alfresco/web/bean/NavigationBean.java +++ b/source/java/org/alfresco/web/bean/NavigationBean.java @@ -1092,10 +1092,7 @@ public class NavigationBean implements Serializable // ------------------------------------------------------------------------------ // Inner classes - - - -/** + /** * Class to handle breadcrumb interaction for top-level navigation pages */ public class NavigationBreadcrumbHandler implements IRepoBreadcrumbHandler diff --git a/source/java/org/alfresco/web/bean/content/VersionedDocumentDetailsDialog.java b/source/java/org/alfresco/web/bean/content/VersionedDocumentDetailsDialog.java index e870349ea7..8dde183ab8 100644 --- a/source/java/org/alfresco/web/bean/content/VersionedDocumentDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/content/VersionedDocumentDetailsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Alfresco Software Limited. + * Copyright (C) 2005-2012 Alfresco Software Limited. * * This file is part of Alfresco * @@ -32,7 +32,6 @@ import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import org.alfresco.model.ContentModel; -import org.alfresco.repo.version.common.VersionHistoryImpl.VersionComparatorDesc; import org.alfresco.repo.web.scripts.FileTypeImageUtils; import org.alfresco.service.cmr.ml.ContentFilterLanguagesService; import org.alfresco.service.cmr.ml.EditionService; @@ -71,8 +70,6 @@ public class VersionedDocumentDetailsDialog implements Serializable transient private MultilingualContentService multilingualContentService; transient private ContentFilterLanguagesService contentFilterLanguagesService; - private static final Comparator VERSION_COMPARATOR_DESC = new VersionComparatorDesc(); - /** Determine if the version is a translation of a old edition */ private boolean fromPreviousEditon; @@ -175,7 +172,6 @@ public class VersionedDocumentDetailsDialog implements Serializable /** * Navigates to next item in the list of versioned content for the current VersionHistory */ - @SuppressWarnings("unchecked") public void nextItem(ActionEvent event) { // Get the properties of the action event @@ -196,7 +192,6 @@ public class VersionedDocumentDetailsDialog implements Serializable } else { - Collections.sort(nextVersions, VERSION_COMPARATOR_DESC); this.documentVersion = nextVersions.get(0); } } @@ -209,7 +204,6 @@ public class VersionedDocumentDetailsDialog implements Serializable /** * Navigates to previous item in the list of versioned content for the current VersionHistory */ - @SuppressWarnings("unchecked") public void previousItem(ActionEvent event) { // Get the properties of the action event diff --git a/source/java/org/alfresco/web/bean/rules/CreateRuleWizard.java b/source/java/org/alfresco/web/bean/rules/CreateRuleWizard.java index e04ef04b50..9227ef2f57 100644 --- a/source/java/org/alfresco/web/bean/rules/CreateRuleWizard.java +++ b/source/java/org/alfresco/web/bean/rules/CreateRuleWizard.java @@ -23,6 +23,7 @@ import java.io.ObjectInputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.ResourceBundle; @@ -32,9 +33,6 @@ import javax.faces.model.DataModel; import javax.faces.model.ListDataModel; import javax.faces.model.SelectItem; -import org.springframework.extensions.config.Config; -import org.springframework.extensions.config.ConfigElement; -import org.springframework.extensions.config.ConfigService; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ActionCondition; @@ -58,6 +56,9 @@ import org.alfresco.web.data.QuickSort; import org.alfresco.web.ui.common.Utils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.extensions.config.Config; +import org.springframework.extensions.config.ConfigElement; +import org.springframework.extensions.config.ConfigService; /** * Bean implementation for the "Create Rule" wizard @@ -71,6 +72,9 @@ public class CreateRuleWizard extends BaseActionWizard protected static final String PROP_CONDITION_NAME = "conditionName"; protected static final String PROP_CONDITION_SUMMARY = "conditionSummary"; + private static final String RULE_OUTBOUND = "outbound"; + private static final String ACTION_CHECK_OUT = "check-out"; + transient private RuleService ruleService; protected RulesDialog rulesDialog; @@ -413,7 +417,38 @@ public class CreateRuleWizard extends BaseActionWizard } } - return this.types; + return shouldFilterTypes() ? filterTypes(this.types) : this.types; + } + + private boolean shouldFilterTypes() + { + boolean filter = false; + + for (Map actionProperty: this.allActionsProperties) + { + if (actionProperty.get(PROP_ACTION_NAME).toString().equalsIgnoreCase(ACTION_CHECK_OUT)) + { + filter = true; + break; + } + } + + return filter; + } + + private List filterTypes(List types) + { + List filteredTypes = new ArrayList(types); + for (Iterator iterator = filteredTypes.iterator(); iterator.hasNext();) + { + SelectItem selectItem = iterator.next(); + if (selectItem.getValue().toString().equalsIgnoreCase(RULE_OUTBOUND)) + { + iterator.remove(); + } + } + + return filteredTypes; } /** diff --git a/source/java/org/alfresco/web/ui/common/component/debug/BaseDebugComponent.java b/source/java/org/alfresco/web/ui/common/component/debug/BaseDebugComponent.java index d91f75e194..55dadddec6 100644 --- a/source/java/org/alfresco/web/ui/common/component/debug/BaseDebugComponent.java +++ b/source/java/org/alfresco/web/ui/common/component/debug/BaseDebugComponent.java @@ -26,6 +26,7 @@ import javax.faces.context.ResponseWriter; import javax.faces.el.ValueBinding; import org.alfresco.web.app.Application; +import org.alfresco.web.ui.common.Utils; import org.springframework.extensions.webscripts.ui.common.component.SelfRenderingComponent; /** @@ -77,7 +78,7 @@ public abstract class BaseDebugComponent extends SelfRenderingComponent for (Object key : session.keySet()) { out.write(""); - out.write(key.toString()); + out.write(Utils.encode(key.toString())); out.write(""); Object obj = session.get(key); if (obj == null) @@ -95,7 +96,7 @@ public abstract class BaseDebugComponent extends SelfRenderingComponent { // replace any ; characters with ; as that will help break up long lines value = value.replaceAll(";", "; "); - out.write(value); + out.write(Utils.encode(value)); } } out.write("");