cancel
Showing results for 
Search instead for 
Did you mean: 

troubles with checking subfolder ID

foxtrot1213
Champ in-the-making
Champ in-the-making
Hi,
here is my query. Obviously, I am mistake somewhere. Basially, I am trying to check whether folder exists or not (the name of folder is in a variable)

"<cmis:query xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\">
<cmis:statement>SELECT cmisSmiley SurprisedbjectId FROM cmis:folder "+result.html_dirname+"WHERE IN_TREE("+result.html_dirname+",'workspace://SpacesStore/"+globalMap.get("translation.id")+"')</cmis:statement>
<cmis:searchAllVersions>true</cmis:searchAllVersions>
        <cmis:includeAllowableActions>false</cmis:includeAllowableActions>
        <cmis:includeRelationships>none</cmis:includeRelationships>
        <cmis:renditionFilter>*</cmis:renditionFilter>
<cmis:maxItems>50</cmis:maxItems>
<cmis:skipCount>0</cmis:skipCount>
</cmis:query>"

Any help?
3 REPLIES 3

foxtrot1213
Champ in-the-making
Champ in-the-making
anyone?

fmui
Champ in-the-making
Champ in-the-making
If you have the id of the folder it is more efficient to call getObject() and check for an ObjectNotFoundException.
If you only have the name of the folder, then there is "cmis:name = 'somename'" part missing in the WHERE clause.

Is there an error message or does just not return what you are expecting?


- Florian

foxtrot1213
Champ in-the-making
Champ in-the-making
I solved it:

"<cmis:query xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\">
<cmis:statement>SELECT cmisSmiley SurprisedbjectId FROM cmis:folder WHERE cmis:name LIKE '"+DeNor.SubFolder+"' AND cmisSmiley TonguearentId LIKE 'workspace://SpacesStore/"+globalMap.get("translation_id")+"'</cmis:statement>
<cmis:searchAllVersions>true</cmis:searchAllVersions>
        <cmis:includeAllowableActions>false</cmis:includeAllowableActions>
        <cmis:includeRelationships>none</cmis:includeRelationships>
        <cmis:renditionFilter>*</cmis:renditionFilter>
<cmis:maxItems>50</cmis:maxItems>

I am using talend ETL to check for documents and folders existance. If not present then create them, if present the upload new content or update existing content.
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.