Kross
Kross

Reputation: 305

How to display a query results from Open CMIS, Alfresco?

Newcomer to Alfresco and Web Development here, so bear with me. I've so far installed Alfresco and was able to use the Maven AMP archetype to create my own custom content model for the data I need to store in it. Now I need to access this data from an external site by querying the Alfresco repository.

I've followed what I can find on CMIS and was able to execute a query using curl and get the results I expect in a large XML stream. My colleague was having an uphill battle trying to interpret these results using Coldfusion. Now I searched around, and understand that to interpret these results and make the process a bit easier, it is better to use some kind of client like Open CMIS (or Chemistry, I'm still a bit confused on the terminology here).

We've so far tried the the PHP client, but received some errors from the xmlLoad function not reading 'nbsp' characters. PHP seemed like the easiest version to implement, though we're considering moving to Java if that works better. However, we've seen very scarce documentation on either end. Are there some better examples that we may have missed or maybe some other way to do this? Seems like this should be simple to implement, yet it's given us quite the stall due to the brick wall that Alfresco and CMIS seem to be.

Upvotes: 0

Views: 956

Answers (2)

Jeff Potts
Jeff Potts

Reputation: 10538

Shouldn't be a brick wall at all. Here are some resources:

  • The custom content types tutorial has a section on CMIS, including CMIS queries which may be helpful to you even if you do not need custom types
  • The CMIS & Apache Chemistry book from Manning is a good resource (disclosure: Florian and I co-authored it along with another colleague, Jay Brown)
  • There are some Java examples on Google Code
  • There are additional resources and helpful links on the Alfresco CMIS page

Upvotes: 1

Florian Müller
Florian Müller

Reputation: 3235

If you don't want to use a library, the CMIS Browser Binding might work better for you. It returns JSON instead of XML.

Try:

http://<host>/alfresco/api/-default-/public/cmis/versions/1.1/browser?cmisselector=query&succinct=true&q=SELECT * FROM cmis:document

Upvotes: 2

Related Questions