01-29-2009 04:52 AM
Query query = new Query(Constants.QUERY_LANG_LUCENE, queryString );
// Execute the query
QueryResult queryResult = null;
try {
queryResult = WebServiceFactory.getRepositoryService().query(STORE, query,false);
}catch (Exception ex){
ex.printStackTrace();
}
//Display the results
ResultSet resultSet = queryResult.getResultSet();
ResultSetRow[] rows = resultSet.getRows();
//Get the information from the result set
for(ResultSetRow row : rows) {
for (NamedValue namedValue : row.getColumns()) {
String name = namedValue.getName();
String value = namedValue.getValue();
System.out.println(name + " - " +value);
}
}
query: +@candidate\:Objid: 100001505500000 OwnerType: 8
{http://www.alfresco.org/model/content/1.0}name - pgadmin.log
{http://www.alfresco.org/model/system/1.0}node-dbid - 4358246
{http://www.alfresco.org/model/content/1.0}modified - 2009-01-29T10:42:00.674+01:00
{candidate.model}Objid - 100001505500000
{http://www.alfresco.org/model/content/1.0}description - test
{http://www.alfresco.org/model/system/1.0}node-uuid - d6a2d65b-0bb6-45df-a05a-1489b0382d57
{candidate.model}OwnerType - 8
{http://www.alfresco.org/model/system/1.0}store-protocol - workspace
{http://www.alfresco.org/model/content/1.0}modifier - admin
{http://www.alfresco.org/model/content/1.0}categories - null
{http://www.alfresco.org/model/content/1.0}title - -
{candidate.model}registrationDate - 2008-01-30T01:00:00.000+01:00
{http://www.alfresco.org/model/content/1.0}content - contentUrl=store://2009/1/29/10/42/66bd32da-d8eb-40ee-8034-40cc9a54f26a.bin|mimetype=application/octet-stream|size=7229|encoding=Base64|locale=en_US_
{http://www.alfresco.org/model/system/1.0}store-identifier - SpacesStore
{http://www.alfresco.org/model/content/1.0}created - 2009-01-28T18:22:34.940+01:00
{candidate.model}name - Schilling, Charles
{http://www.alfresco.org/model/content/1.0}creator - Admin, Super
{http://www.alfresco.org/model/content/1.0}path - /{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1....
02-03-2009 08:47 AM
public String[] getAssignedCategories(String referencePath) {
Reference root = new Reference(STORE, null, referencePath);
String result [] = null;
try {
CategoriesResult[] categories = categoryService.getCategories(new Predicate(new Reference[]{root}, STORE, null));
if(categories != null)
for (CategoriesResult categoriesResult : categories) {
Reference [] reference = (Reference[])categoriesResult.getCategories(0).getCategories();
if(reference != null){
result = new String[reference.length];
int i = 0;
for (Reference category : reference) {
result[i++] = category.getPath();
}
}
}
}catch (Exception ex){
return null;
}
return result;
}
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.