Merged V3.2 to HEAD

17029: Merged V3.1 to V3.2
      17026: Fix for ETWOTWO-1158 - login.jsp does no longer redirects authenticated users.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17030 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2009-10-19 15:30:46 +00:00
parent d0ab977953
commit 162ef0aaec

View File

@@ -24,13 +24,12 @@
*/ */
package org.alfresco.web.bean.repository; package org.alfresco.web.bean.repository;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.transaction.UserTransaction;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
@@ -91,11 +90,28 @@ public final class Preferences implements Serializable
public void setValue(String name, Serializable value) public void setValue(String name, Serializable value)
{ {
QName qname = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, name); QName qname = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, name);
// persist the property to the repo // persist the property to the repo
UserTransaction tx = null;
try
{
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context, true);
tx.begin();
getNodeService().setProperty(this.preferencesRef, qname, value); getNodeService().setProperty(this.preferencesRef, qname, value);
tx.commit();
// update the cache // update the cache
this.cache.put(name, value); this.cache.put(name, value);
} }
catch (Throwable err)
{
// we cannot update the properties if a user is no longer authenticated
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
}
}
/** /**
* @return the NodeService instance. * @return the NodeService instance.