cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS query

kimberlyalord
Champ in-the-making
Champ in-the-making
I am trying to create a query to return all documents that have cmis:createdBy as the currently logged in user but am not sure how to get the user id.  I have:

select cmis:name from cmis:document where cmis:createdBy=

This will be from a webservice .js page running in the share tier.

Thanks for your help.
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
I am not certain what a "webservice .js page" is. If you are running as a JavaScript controller in a web script, there is a root-scoped object called person that will always equal the currently authenticated user. If you want the user name, you would ask for the person object's cm:userName property, like this:

person.properties['cm:userName']

Hope that helps,

Jeff

kimberlyalord
Champ in-the-making
Champ in-the-making
Thanks for the reply.  I got it working using select cmis:name from cmis:document where cmis:createdBy='" + user.id + "'

What I am getting is documents like dashboard.xml, I want to filter these out.  Is there a way to filter by document extension. For example filter out .xml, .js,.ftl  and just return .doc, pfd …

Thanks