cancel
Showing results for 
Search instead for 
Did you mean: 

Method for extracting document metadata from search results

cszamudio
Champ on-the-rise
Champ on-the-rise
Hi,

I'm using the Java Web Services (Alfresco 3.2) to query and then display the results from a search in a non-web Java app.  I've been able to search just fine and getting the appropriate matches in my test cases. However, in parsing out the QueryResult object, I can't seem to quite figure out how to retrieve specific document match metadata (title, author, creation date, etc.).

When I extract the resulting ResultSetRow object  from the search results, and pull out the columns data as a NameValue array, the only value set for the matching document  is associated with the "path" property, and no other properties are set.

I use the flow as described in the sample code:

RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
QueryResult queryResult = repositoryService.query(searchStore, searchQuery, false);   
ResultSet resultSet = queryResult.getResultSet();
ResultSetMetaData resultSetMetadata = resultSet.getMetaData();
ResultSetRow[] rows = resultSet.getRows();
for(ResultSetRow row : rows)
{
        NameValue [] rowColumnNameValues = row.getColumns();
        …
}
If I query for the parents of a match,  here I get all of the relevant name/value properties (title, author, date, etc.), but the metadata relates to the folder (or workflow), not the document.

Is this behavior expected (only being able to extract the Path property from a match)? If so, what web service would allow me to retrieve a specific document's metadata?

Thanks for any advice on this.

Carlos S. Zamudio
2 REPLIES 2

luisg
Champ in-the-making
Champ in-the-making
Hi there

I'm having the same difficulty… I cant reach the object meta-data. I did create a custom model, but I cant reach the news model documents meta-data. Neither the default Alfresco documents meta-data…
Did you find the solution?

Any of you can help me out?

Luis

igdolmo
Champ in-the-making
Champ in-the-making
Alfresco has changed the way to access metadata. after looking for them i finally did it. in this example i get the content_url :

Reference r = new Reference(STORE, uuid, null);
        Node[] a = repositoryService.get(new Predicate(new Reference[]{r}, STORE, null));
        for(int i=0;i<a[0].getProperties().length;i++){
            if(a[0].getProperties(i).getName().equalsIgnoreCase("{http://www.alfresco.org/model/content/1.0}content")){
                url=a[0].getProperties(i).getValue();
            }
        }

if you get all the properties array you have all the information

byes
Getting started

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.