mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.0 to HEAD
12140: Merged V2.2 to V3.0 11732: Fixed ETWOTWO-804: Node and Transaction Cleanup Job 11747: Missed config for Node and Txn purging 11826: WCM - fix ETWOTWO-817 11951: Fixed ETWOTWO-901: NodeService cleanup must be pluggable 11961: Merged V2.1 to V2.2 11561: ETWOONE-224: when renaming duplicates during copy association names where not renamed 11583: (ALREADY PRESENT) Updated NTLM config example in web.xml - adding missing servlet mappings 11584: Fix for ETWOONE-209 - JavaScript People.createGroup() API now correctly checks for actual group name when testing for existence 11585: Fix for ETWOONE-214 - View In CIFS link now works even when users des not have view permissions on the parent folder 11612: Fix for ETWOONE-91: the description textarea in the modify space properties web form eats one leading newline each time it is submitted 11613: Fix 2.1 build and adjust implementation of ETWOONE-224 fix 11621: Fix for ETWOONE-343 11669: Improved debug from index tracking when exceptions occur 12141: Avoid annoying Spring WARN messages for ClientAbortException 12143: File that should have been deleted in CHK-5460 (rev 12140) 12177: Fix failing FS Deployment Tests since introduction of transaction check advice. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12507 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -86,9 +86,6 @@ public final class AuthenticationHelper
|
|||||||
/** cookie names */
|
/** cookie names */
|
||||||
private static final String COOKIE_ALFUSER = "alfUser";
|
private static final String COOKIE_ALFUSER = "alfUser";
|
||||||
|
|
||||||
/** portal mode key name */
|
|
||||||
private static ThreadLocal<String> portalUserKeyName = new ThreadLocal<String>();
|
|
||||||
|
|
||||||
private static Log logger = LogFactory.getLog(AuthenticationHelper.class);
|
private static Log logger = LogFactory.getLog(AuthenticationHelper.class);
|
||||||
|
|
||||||
|
|
||||||
@@ -434,24 +431,16 @@ public final class AuthenticationHelper
|
|||||||
// naff solution as we need to enumerate all session keys until we find the one that
|
// naff solution as we need to enumerate all session keys until we find the one that
|
||||||
// should match our User objects - this is weak but we don't know how the underlying
|
// should match our User objects - this is weak but we don't know how the underlying
|
||||||
// Portal vendor has decided to encode the objects in the session
|
// Portal vendor has decided to encode the objects in the session
|
||||||
if (portalUserKeyName.get() == null)
|
Enumeration enumNames = session.getAttributeNames();
|
||||||
|
while (enumNames.hasMoreElements())
|
||||||
{
|
{
|
||||||
Enumeration enumNames = session.getAttributeNames();
|
String name = (String)enumNames.nextElement();
|
||||||
while (enumNames.hasMoreElements())
|
if (name.endsWith(AUTHENTICATION_USER))
|
||||||
{
|
{
|
||||||
String name = (String)enumNames.nextElement();
|
user = (User)session.getAttribute(name);
|
||||||
if (name.endsWith(AUTHENTICATION_USER))
|
break;
|
||||||
{
|
|
||||||
// cache the key value once found!
|
|
||||||
portalUserKeyName.set(name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (portalUserKeyName.get() != null)
|
|
||||||
{
|
|
||||||
user = (User)session.getAttribute(portalUserKeyName.get());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
|
@@ -46,6 +46,7 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
|||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
import org.alfresco.repo.tenant.TenantService;
|
import org.alfresco.repo.tenant.TenantService;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||||
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.lock.LockService;
|
import org.alfresco.service.cmr.lock.LockService;
|
||||||
@@ -476,6 +477,36 @@ public final class Repository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolve a Path by converting each element into its display NAME attribute.
|
||||||
|
* Note: This method resolves path regardless access permissions.
|
||||||
|
* Fixes the UI part of the ETWOONE-214 and ETWOONE-238 issues
|
||||||
|
*
|
||||||
|
* @param path Path to convert
|
||||||
|
* @param separator Separator to user between path elements
|
||||||
|
* @param prefix To prepend to the path
|
||||||
|
*
|
||||||
|
* @return Path converted using NAME attribute on each element
|
||||||
|
*/
|
||||||
|
public static String getNamePathEx(FacesContext context, final Path path, final NodeRef rootNode, final String separator, final String prefix)
|
||||||
|
{
|
||||||
|
String result = null;
|
||||||
|
|
||||||
|
RetryingTransactionHelper transactionHelper = getRetryingTransactionHelper(context);
|
||||||
|
transactionHelper.setMaxRetries(1);
|
||||||
|
final NodeService runtimeNodeService = (NodeService)FacesContextUtils.getRequiredWebApplicationContext(context).getBean("nodeService");
|
||||||
|
result = transactionHelper.doInTransaction(
|
||||||
|
new RetryingTransactionCallback<String>()
|
||||||
|
{
|
||||||
|
public String execute() throws Throwable
|
||||||
|
{
|
||||||
|
return getNamePath(runtimeNodeService, path, rootNode, separator, prefix);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the mimetype code for the specified file name.
|
* Return the mimetype code for the specified file name.
|
||||||
* <p>
|
* <p>
|
||||||
|
@@ -406,7 +406,7 @@ public final class Utils extends StringUtils
|
|||||||
NodeRef rootNode = contentCtx.getRootNode();
|
NodeRef rootNode = contentCtx.getRootNode();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
url = Repository.getNamePath(nodeService, node.getNodePath(), rootNode, "\\",
|
url = Repository.getNamePathEx(context, node.getNodePath(), rootNode, "\\",
|
||||||
"file:///" + navBean.getCIFSServerPath(diskShare));
|
"file:///" + navBean.getCIFSServerPath(diskShare));
|
||||||
}
|
}
|
||||||
catch (AccessDeniedException e)
|
catch (AccessDeniedException e)
|
||||||
|
@@ -27,6 +27,7 @@ package org.alfresco.web.ui.repo.renderer;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import javax.faces.component.UIComponent;
|
import javax.faces.component.UIComponent;
|
||||||
|
import javax.faces.component.ValueHolder;
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import javax.faces.context.ResponseWriter;
|
import javax.faces.context.ResponseWriter;
|
||||||
|
|
||||||
@@ -44,6 +45,17 @@ import org.apache.myfaces.renderkit.html.HtmlTextareaRenderer;
|
|||||||
*/
|
*/
|
||||||
public class MultilingualTextAreaRenderer extends HtmlTextareaRenderer
|
public class MultilingualTextAreaRenderer extends HtmlTextareaRenderer
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
|
protected void encodeTextArea(FacesContext facesContext, UIComponent uiComponent) throws IOException
|
||||||
|
{
|
||||||
|
// to workaround a bug in MyFaces where it appears a new line gets removed
|
||||||
|
// in the process view/edit process add it back (ETWOONE-91)
|
||||||
|
Object value = ((ValueHolder) uiComponent).getValue();
|
||||||
|
String valueStr = "\r\n" + (String)value;
|
||||||
|
((ValueHolder) uiComponent).setValue(valueStr);
|
||||||
|
super.encodeTextArea(facesContext, uiComponent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException
|
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user