Fixed issues found as a result of ALF-9636: SVC 67: Lucene removal: Sanity test Share UI with Lucene turned off

Fixed ALF-9686: It's impossible to find any group at the Manage Space Users page

Fixed ALF-9673: It's impossible to find any site

Fixed ALF-9669: Site invite fails using SOLR while building email - need to remove query use in invite.

NOTE: Searches from the UI are now consistent in that by default a canned query based search (consistent results) are performed by default for people, group, user & site searches, to force a lucene based search that support the "contains" type query users must prefix their search with *, this is no longer added by default by the UI.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29628 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2011-08-09 11:35:51 +00:00
parent 5c4f984dd2
commit 6dbe542032
7 changed files with 108 additions and 52 deletions

View File

@@ -27,13 +27,13 @@ import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.model.Repository;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
@@ -50,6 +50,10 @@ public class FolderContentsParameterConstraint extends BaseParameterConstraint
private DictionaryService dictionaryService;
private NamespaceService namespaceService;
private Repository repository;
private String searchPath;
private List<String> nodeInclusionFilter = Collections.emptyList();
@@ -74,6 +78,16 @@ public class FolderContentsParameterConstraint extends BaseParameterConstraint
this.dictionaryService = dictionaryService;
}
public void setNamespaceService(NamespaceService namespaceService)
{
this.namespaceService = namespaceService;
}
public void setRepository(Repository repository)
{
this.repository = repository;
}
/**
* This optional property defines a list of file extensions which should be included in the result set from
* this class. By implication, all other file extensions will be excluded. (The dot should not be specified
@@ -102,19 +116,18 @@ public class FolderContentsParameterConstraint extends BaseParameterConstraint
* @see org.alfresco.service.cmr.action.ParameterConstraint#getAllowableValues()
*/
protected Map<String, String> getAllowableValuesImpl()
{
ResultSet resultSet = searchService.query(
StoreRef.STORE_REF_WORKSPACE_SPACESSTORE,
SearchService.LANGUAGE_LUCENE,
"PATH:\"" + searchPath + "\"");
{
List<NodeRef> nodeRefs = searchService.selectNodes(repository.getRootHome(),
this.searchPath, null, this.namespaceService, false);
NodeRef rootFolder = null;
if (resultSet.length() == 0)
if (nodeRefs.size() == 0)
{
throw new AlfrescoRuntimeException("The path '" + searchPath + "' did not return any results.");
}
else
{
rootFolder = resultSet.getNodeRef(0);
rootFolder = nodeRefs.get(0);
}
Map<String, String> result = new HashMap<String, String>(23);