mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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,10 +90,27 @@ 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
|
||||||
getNodeService().setProperty(this.preferencesRef, qname, value);
|
UserTransaction tx = null;
|
||||||
// update the cache
|
try
|
||||||
this.cache.put(name, value);
|
{
|
||||||
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
tx = Repository.getUserTransaction(context, true);
|
||||||
|
tx.begin();
|
||||||
|
|
||||||
|
getNodeService().setProperty(this.preferencesRef, qname, value);
|
||||||
|
|
||||||
|
tx.commit();
|
||||||
|
|
||||||
|
// update the cache
|
||||||
|
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) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user