mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ACE-1640: Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
70000: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud) 69998: Merged V4.1-BUG-FIX (4.1.9) to V4.2-BUG-FIX (4.2.3) 69997: MNT-11437: Merged V4.1.5 (4.1.5.14) to V4.1-BUG-FIX (4.1.9) 69995: Revised fix for MNT-11107 Documents uploaded by another user are not filtered via tags in My Files Fix for MNT-11427 Impossible to start reindex process for bm-0010 and bm-0013 tests: api/solr/aclchangesets return status:502 - fixed as described - no complex join - pull back and check inherited shared are indexed when the defining acls is indexed if it exists - will also be indexed if created lazily git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@70001 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
<result property="aclCount" column="acl_count" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_Acl" type="SOLRAcl">
|
||||
<id property="id" column="acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="id" column="acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="inheritedId" column="inherited_acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="aclChangeSetId" column="acl_changeset_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
<resultMap id="result_Transaction" type="SOLRTransaction">
|
||||
@@ -41,7 +42,7 @@
|
||||
alf_acl_change_set acs
|
||||
join alf_access_control_list acl on (acl.acl_change_set = acs.id)
|
||||
<where>
|
||||
exists (select 1 from alf_node admnode where admnode.acl_id = acl.id OR admnode.acl_id = acl.inherits_from)
|
||||
exists (select 1 from alf_node admnode where admnode.acl_id = acl.id)
|
||||
<if test="fromCommitTimeInclusive != null">
|
||||
and <![CDATA[acs.commit_time_ms >= #{fromCommitTimeInclusive}]]>
|
||||
</if>
|
||||
@@ -62,11 +63,12 @@
|
||||
<select id="select_AclsByChangeSetIds" parameterType="SOLRTrackingParameters" resultMap="result_Acl">
|
||||
select
|
||||
acl.acl_change_set as acl_changeset_id,
|
||||
acl.id as acl_id
|
||||
acl.id as acl_id,
|
||||
acl.inherited_acl as inherited_acl_id
|
||||
from
|
||||
alf_access_control_list acl
|
||||
<where>
|
||||
exists (select 1 from alf_node admnode where admnode.acl_id = acl.id OR admnode.acl_id = acl.inherits_from)
|
||||
exists (select 1 from alf_node admnode where admnode.acl_id = acl.id)
|
||||
<if test="fromIdInclusive != null">
|
||||
and <![CDATA[acl.id >= #{fromIdInclusive}]]>
|
||||
</if>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -29,22 +29,21 @@ import org.alfresco.repo.solr.Acl;
|
||||
public class AclEntity implements Acl
|
||||
{
|
||||
private Long id;
|
||||
private Long inheritedId;
|
||||
private Long aclChangeSetId;
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "AclEntity " +
|
||||
"[id=" + id +
|
||||
", aclChangeSetId=" + aclChangeSetId +
|
||||
"]";
|
||||
return "AclEntity [id=" + id + ", inheritedId=" + inheritedId + ", aclChangeSetId=" + aclChangeSetId + "]";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@@ -59,4 +58,15 @@ public class AclEntity implements Acl
|
||||
{
|
||||
this.aclChangeSetId = aclChangeSetId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getInheritedId()
|
||||
{
|
||||
return inheritedId;
|
||||
}
|
||||
|
||||
public void setInheritedId(Long inheritedId)
|
||||
{
|
||||
this.inheritedId = inheritedId;
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -18,11 +18,14 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.solr.ibatis;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.domain.node.Node;
|
||||
import org.alfresco.repo.domain.qname.QNameDAO;
|
||||
import org.alfresco.repo.domain.solr.AclEntity;
|
||||
import org.alfresco.repo.domain.solr.NodeParametersEntity;
|
||||
import org.alfresco.repo.domain.solr.SOLRDAO;
|
||||
import org.alfresco.repo.domain.solr.SOLRTrackingParameters;
|
||||
@@ -120,15 +123,40 @@ public class SOLRDAOImpl implements SOLRDAO
|
||||
params.setIds(aclChangeSetIds);
|
||||
params.setFromIdInclusive(minAclId);
|
||||
|
||||
List<Acl> source;
|
||||
if (maxResults <= 0 || maxResults == Integer.MAX_VALUE)
|
||||
{
|
||||
return (List<Acl>) template.selectList(SELECT_ACLS_BY_CHANGESET_IDS, params);
|
||||
source = (List<Acl>) template.selectList(SELECT_ACLS_BY_CHANGESET_IDS, params);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (List<Acl>) template.selectList(SELECT_ACLS_BY_CHANGESET_IDS, params, new RowBounds(0, maxResults));
|
||||
source = (List<Acl>) template.selectList(SELECT_ACLS_BY_CHANGESET_IDS, params, new RowBounds(0, maxResults));
|
||||
}
|
||||
|
||||
// Add any unlinked shared ACLs from defining nodes to index them now
|
||||
ArrayList<Acl> answer = new ArrayList<Acl>(source);
|
||||
HashSet<Long> acls = new HashSet<Long>();
|
||||
for(Acl acl : answer)
|
||||
{
|
||||
acls.add(acl.getId());
|
||||
}
|
||||
ArrayList<Acl> sharedAndUnlinked = new ArrayList<Acl>();
|
||||
for(Acl acl : answer)
|
||||
{
|
||||
if(acl.getInheritedId() != null)
|
||||
{
|
||||
if(!acls.contains(acl.getInheritedId()))
|
||||
{
|
||||
AclEntity shared = new AclEntity();
|
||||
shared.setId(acl.getInheritedId());
|
||||
shared.setAclChangeSetId(acl.getAclChangeSetId());
|
||||
shared.setInheritedId(acl.getInheritedId());
|
||||
sharedAndUnlinked.add(shared);
|
||||
acls.add(shared.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
answer.addAll(sharedAndUnlinked);
|
||||
return answer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -27,5 +27,6 @@ package org.alfresco.repo.solr;
|
||||
public interface Acl
|
||||
{
|
||||
Long getId();
|
||||
Long getInheritedId();
|
||||
Long getAclChangeSetId();
|
||||
}
|
||||
|
Reference in New Issue
Block a user