mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
First pass at fixes/extensions/tidy ups to the search API - part of wiring FTS up as a query language MOB-568
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14361 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -418,7 +418,7 @@ public class ACLEntryAfterInvocationTest extends AbstractPermissionTest
|
||||
|
||||
Set<ChildAssociationRef> carSet = new HashSet<ChildAssociationRef>();
|
||||
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, null, false);
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, false);
|
||||
|
||||
assertEquals(0, rsIn.length());
|
||||
ResultSet answerResultSet = (ResultSet) methodResultSet.invoke(proxy, new Object[] { rsIn });
|
||||
@@ -488,7 +488,7 @@ public class ACLEntryAfterInvocationTest extends AbstractPermissionTest
|
||||
Set<ChildAssociationRef> carSet = new HashSet<ChildAssociationRef>();
|
||||
carSet.addAll(carList);
|
||||
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, null, false);
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, false);
|
||||
|
||||
assertEquals(4, rsIn.length());
|
||||
ResultSet answerResultSet = (ResultSet) methodResultSet.invoke(proxy, new Object[] { rsIn });
|
||||
@@ -549,7 +549,7 @@ public class ACLEntryAfterInvocationTest extends AbstractPermissionTest
|
||||
Set<ChildAssociationRef> carSet = new HashSet<ChildAssociationRef>();
|
||||
carSet.addAll(carList);
|
||||
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, null, false);
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, false);
|
||||
|
||||
|
||||
assertEquals(4, rsIn.length());
|
||||
@@ -622,7 +622,7 @@ public class ACLEntryAfterInvocationTest extends AbstractPermissionTest
|
||||
Set<ChildAssociationRef> carSet = new HashSet<ChildAssociationRef>();
|
||||
carSet.addAll(carList);
|
||||
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, null, false);
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, false);
|
||||
|
||||
permissionService.setPermission(new SimplePermissionEntry(rootNodeRef, getPermission(PermissionService.READ), "andy", AccessStatus.ALLOWED));
|
||||
|
||||
@@ -746,7 +746,7 @@ public class ACLEntryAfterInvocationTest extends AbstractPermissionTest
|
||||
Set<ChildAssociationRef> carSet = new HashSet<ChildAssociationRef>();
|
||||
carSet.addAll(carList);
|
||||
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, null, false);
|
||||
ChildAssocRefResultSet rsIn = new ChildAssocRefResultSet(nodeService, nodeRefList, false);
|
||||
|
||||
permissionService.setPermission(new SimplePermissionEntry(rootNodeRef, getPermission(PermissionService.READ), "andy", AccessStatus.ALLOWED));
|
||||
|
||||
|
@@ -31,11 +31,15 @@ import java.util.ListIterator;
|
||||
import org.alfresco.repo.search.ResultSetRowIterator;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.Path;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.ResultSetMetaData;
|
||||
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||
|
||||
/**
|
||||
* Filtering result set to support permission checks
|
||||
* @author andyh
|
||||
*
|
||||
*/
|
||||
public class FilteringResultSet extends ACLEntryAfterInvocationProvider implements ResultSet
|
||||
{
|
||||
private ResultSet unfiltered;
|
||||
@@ -66,11 +70,6 @@ public class FilteringResultSet extends ACLEntryAfterInvocationProvider implemen
|
||||
return inclusionMask.get(i);
|
||||
}
|
||||
|
||||
public Path[] getPropertyPaths()
|
||||
{
|
||||
return unfiltered.getPropertyPaths();
|
||||
}
|
||||
|
||||
public int length()
|
||||
{
|
||||
return inclusionMask.cardinality();
|
||||
@@ -253,6 +252,16 @@ public class FilteringResultSet extends ACLEntryAfterInvocationProvider implemen
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public boolean allowsReverse()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public ResultSet getResultSet()
|
||||
{
|
||||
return FilteringResultSet.this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ResultSetMetaData getResultSetMetaData()
|
||||
@@ -265,5 +274,15 @@ public class FilteringResultSet extends ACLEntryAfterInvocationProvider implemen
|
||||
this.resultSetMetaData = resultSetMetaData;
|
||||
}
|
||||
|
||||
public int getStart()
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public boolean hasMore()
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ public class FilteringResultSetTest extends TestCase
|
||||
cars.add(car4);
|
||||
cars.add(car5);
|
||||
|
||||
ResultSet in = new ChildAssocRefResultSet(null, cars, null);
|
||||
ResultSet in = new ChildAssocRefResultSet(null, cars);
|
||||
|
||||
FilteringResultSet filtering = new FilteringResultSet(in);
|
||||
|
||||
|
Reference in New Issue
Block a user