cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Question - How to browse?

mcirwin
Champ in-the-making
Champ in-the-making
I've just started with Alfresco and I realise that this is a very basic question.  I am writing a very basic application which is hosted in a separate Tomcat instance on another machine and accessing Alfresco via the Remote API.  All I want to do (for the moment) is crudely browse an Alfresco repository.

I can authenticate (via AuthenticationUtils), get a reference to the RepositoryServiceSoapBindingStub (WebServiceFactory.getRepositoryService()) and then a list of all the stores (repService.getStores()).  How do I go beyond this though?  I can't see any way of programmatically navigating the stores.

I've checked the wiki, the examples, guides and javadocs; and I'm sure it's documented somewhere as it is probably the most basic thing anyone would need to do, but I can't seem to find out how!

Apologies if this is the wrong forum.
1 REPLY 1

mcirwin
Champ in-the-making
Champ in-the-making
Typical…about 15 minutes after I ask a question I stumble on a potential answer, this is an excerpt from my code:

for (Store store : stores)
{
    Reference storeRef = new Reference();
    storeRef .setStore(store);
    storeRef .setPath("/");
                 
    QueryResult qresult = repositoryService. queryChildren(storeRef);
    if (qresult.getResultSet().getRows()!=null)
    {
        for (int i=0; i<qresult.getResultSet().getRows().length; i++)
        {
            Reference node_child = new Reference();
            node_child.setStore(store);
            node_child.setUuid(qresult.getResultSet().getRows(i).getNode().getId());
            //More will be done with this later…
        }
    }
}
Is this "correct", or is there a more proper way of obtaining child objects?

And, later on, when all I have is the path or the UUID; how do I get access to that item (to get properties etc)?  I can't see any way to do this via the RepositoryService.

Thanks!