05-02-2007 12:13 PM
private static Reference FindInAlfresco(String search) {
Reference ref = new Reference();
final Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
if (suche == "") return null;
try
{
AuthenticationUtils.startSession("admin", "admin");
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
Query query = new Query(Constants.QUERY_LANG_LUCENE, search);
// Execute the query
QueryResult queryResult = repositoryService.query(STORE, query, false);
// Display the results
ResultSet resultSet = queryResult.getResultSet();
ResultSetRow[] rows = resultSet.getRows();
if (rows == null)
{
System.out.println("No query results found.");
ref = null;
}
else
{
System.out.println("Results from query:");
outputResultSet(rows);
ref.setStore(STORE);
ref.setUuid(rows[0].getNode().getId());
ResultSetRow row = rows[0];
NamedValue[] columns = row.getColumns();
System.out.println("");
System.out.println("Ausgelesen:");
String pfad = row.getColumns(columns.length-1).getValue();
System.out.println(pfad);
ref.setPath(pfad);
}
}
catch(Throwable e)
{
e.printStackTrace();
}
finally
{
AuthenticationUtils.endSession();
}
return ref;
}
05-03-2007 05:21 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.