09-30-2010 12:00 PM
public static List<Reference> searchLuceneFromTheRoot(String toSearch) {
List<Reference> toReturn = new ArrayList<Reference>();
RepositoryServiceSoapBindingStub repoService = WebServiceFactory.getRepositoryService();
String encodedString = ISO9075.encode(toSearch);
String queryPath = "PATH:\"/app:company_home//*\" ";
String queryTitlet = "+@cm\\:name:\"" + encodedString + "\"";
String statement = queryPath.concat(queryTitlet);
if (log.isDebugEnabled()) {
log.debug("searchLuceneFromTheRoot, statement [" + statement + "]");
}
Query query = new Query(Constants.QUERY_LANG_LUCENE, statement);
QueryResult results = null;
ResultSet resultSet = null;
NamedValue currentNamedValue;
String path;
String id;
try {
results = repoService.query(getStore(), query, false);
resultSet = results.getResultSet();
if (resultSet.getTotalRowCount() == 0) {
log.info("searchLuceneFromTheRoot, NON ho trovato nessun file con titolo [" + toSearch + "]");
} else {
log.info("searchLuceneFromTheRoot, ho trovato [" + resultSet.getTotalRowCount() + "] file con nome [" + toSearch + "]");
for (int i = 0; i < resultSet.getTotalRowCount(); i++) {
NamedValue[] namedValues = resultSet.getRows()[i].getColumns();
path = null;
id = null;
for (int y = 0; y < namedValues.length; y++) {
currentNamedValue = namedValues[y];
if (currentNamedValue.getName().equals(ContentModel.PROP_NODE_UUID.toString())) {
id = currentNamedValue.getValue();
if (log.isDebugEnabled()) {
log.debug("searchLuceneFromTheRoot, ID: " + id);
}
}
if (currentNamedValue.getName().equals("{http://www.alfresco.org/model/content/1.0}path")) {
path = rewritePathFromProp(currentNamedValue.getValue());
if (log.isDebugEnabled()) {
log.debug("searchLuceneFromTheRoot, PATH: " + path);
}
}
if (id != null && path != null) {
Reference toInsert = new Reference(getStore(), id, path);
toReturn.add(toInsert);
}
}
}
}
} catch (ContentFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RepositoryFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return toReturn;
}
10-04-2010 11:01 AM
03-23-2011 11:10 AM
03-23-2011 11:30 AM
03-23-2011 11:51 AM
public static boolean userExist(String userName, String nome, String cognome) throws RepositoryFault, RemoteException {
RepositoryServiceSoapBindingStub repoService = WebServiceFactory.getRepositoryService();
String queryTitlet = "+@cm\\:firstName:\"" + nome + "\" +@cm\\:lastName:\"" + cognome + "\"";
Query query = new Query(Constants.QUERY_LANG_LUCENE, queryTitlet);
QueryResult results = null;
ResultSet resultSet = null;
results = repoService.query(new Store(Constants.WORKSPACE_STORE, "SpacesStore"), query, false);
resultSet = results.getResultSet();
}
03-23-2011 12:24 PM
# The maximum time spent pruning results
# system.acl.maxPermissionCheckTimeMillis=10000
system.acl.maxPermissionCheckTimeMillis=600000
03-23-2011 12:54 PM
Hi,
i sometimes found Alfresco's out-of-the-box settings for pruning lucene query a source of nasty bugs, so maybe try this (as an elaborated guess) in your alfresco-global.properties
# The maximum time spent pruning results
# system.acl.maxPermissionCheckTimeMillis=10000
system.acl.maxPermissionCheckTimeMillis=600000
03-24-2011 09:28 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.