I am having a problem retrieving the path of a folder which contains '(' and ')' when I do a query in CMIS.
how can i get the below working ?
SELECT cmis:path FROM cmis:folder WHERE IN_TREE('a53471aa-b447-4fdd-a451-4a2beb494226') AND CONTAINS('ALL:Tom_(Robot)')
So (Robot) that's causing not to find the path.
Any idea how I can make ( and ) as part of my query?
Solution to this problem is
SELECT cmis:path FROM cmis:folder WHERE IN_TREE('a53471aa-b447-4fdd-a451-4a2beb494226') AND CONTAINS('ALL:Tom_Robot')
By removing the brackets it returns me folder path, somehow it gives me the correct result, but I am still interested on other peoples opinion on this, this does not sound good to me, whether this is openCMIS issue or an Alfresco.
Related
I got a problem since the update on EHP8 for SAP.
We got many directories under the main directory "transfer.test/te11/" but since the update we can´t see the directory anymore if "S_DATASET" doesn´t have the entry in filename like this "transfer.test/te11*".
For some people the authorisation object "S_DATASET" contains the filename "transfer.test/te11/test*" but they don´t see anything neither the entry for the main directory nor the subdirector which they are authorisated in AL11.
Does somebody have an idea ? SU53, authorisation check, doesn´t through an error.
Greetz
The "solution" that we did was in the authorization object S_DATASET . There we could insert a value from...to and I did it with from "transfer.test/te11" to "transfer.test/te11" and another value for "transfer.test/te11/test*" that helped.
I'm using insomnia to make calls to the Artifactory API.
I have the following query, which works really well:
items.find({"repo":{"$eq":"my-repository-virt"}}, {"$and":[{"#my.fileType":{"$match": "jar"}},{"#my.otherType":{"$match": "type2"}},{"#prodVersion":{"$match": "false"}}]})
But I have a problem in that there are duplicate files in some sub-folders with the same properties/filename that I would like to exclude.
I would like to add path to this query, but I can never get any results returned.
The repository is a virtual repository that links to 3 other real repositories.
One of my colleagues can call the following query with the command line tool and get the expected results:
jfrog rt search my-repo-snapshots/myproject/subfolder/jars/*.jar
I have tried adding the path parameter to my query, I've tried removing everything except the repo and the path, like this:
items.find({"repo":{"$eq":"my-repo-snapshots"}},{"path" : "my-repo-snapshots/myproject/subfolder/jars/*.jar"})
I've tried with just the path, with variations on the path, including/excluding the repo name, using the virtual repo, the actual repo, but I always get a successful search with 0 results returned.
How can I build this query to search the virtual repo, along a certain path, and including certain properties?
EDIT:
I've also tried:
items.find({"repo":{"$eq":"my-repo-snapshots"}},{"path" : {"$match":"my-repo-snapshots/myproject/subfolder/jars/*.jar"}})
Both with the repo in the path and without, I still get 0 results.
OK I figured it out.
The path part needs to be added in with the {"$and": ...} section where the properties are included. Like so:
items.find({"repo":{"$eq":"my-repository-virt"}},
{"$and":[
{"path":{"$match":"path/to/relevant/folders/*"}},
{"#my.fileType":{"$match": "jar"}},
{"#my.otherType":{"$match": "type2"}},
{"#prodVersion":{"$match": "false"}}
]})
The easier fix would have been:
items.find({"repo":{"$eq":"my-repo-snapshots"}},{"path" : {"$eq":"my-repo-snapshots/myproject/subfolder/jars"}, {"name" : {"$match":"*.jar"}})
So the problem with your initial attempt, is that the "path" should match the folder and the "name" should match the filename
I have a js webscript who return a list of documents from a specific repository in Alfresco. i used the luceneSearch to get the nodeRef of the repository, this works fine.
The repository primary path is: /app:company_home/app:dictionary/cm:StarXpert_x0020_Workflow/cm:fichiers_x0020_JSON and i used the luceneSearch like this to get the nodeRef from the primary path
var nodes = search.luceneSearch("PATH:\"/app:company_home/app:dictionary/cm:StarXpert_x0020_Workflow/cm:fichiers_x0020_JSON//*\" AND TYPE:\"cm:content\"","#cm:name", true);
But when i execute my code in the server side, i have an error, that my webScript can't get the nodes from the path i took it. I searched and i found that the problem is an indexation problem on the server alfresco version.
So my question is: can us get a nodeRef from a primary path, whithout using luceneSearch?
Thanks for any help
If I understand the documentation, you can use other methods with the search root object. The xpathSearch seems interesting :
org.mozilla.javascript.Scriptable xpathSearch(String search)
Execute a XPath search
The selectNodes(String search) might be interesting too.
I am trying to find out the contents of a folder in Alfresco, using the following CMIS query:
SELECT *
FROM cmis:document
WHERE CONTAINS('PATH:"/app:company_home/st:sites/cm:GM/cm:emir/cm:FAQ//*"')
In Node Browser, if I navigate to that folder I see the following value for Primary Path
(I have added line breaks to make it easier to read):
/{http://www.alfresco.org/model/application/1.0}company_home
/{http://www.alfresco.org/model/site/1.0}sites
/{http://www.alfresco.org/model/content/1.0}GM
/{http://www.alfresco.org/model/content/1.0}EMIR
/{http://www.alfresco.org/model/content/1.0}FAQ
But Alfresco is failing with the following message:
Caused by: org.alfresco.scripts.ScriptException: 05120032 Failed to
execute script
'classpath*:alfresco/templates/webscripts/org/alfresco/cmis/queries.post.cmisquery.js':
05120 031 Unknown column/property PATH
I am testing against Alfresco Community 3.3.
You can use the following query for simple search
SELECT * FROM cmis:document WHERE IN_FOLDER('id_of_folder')
or the following query for recursive search
SELECT * FROM cmis:document WHERE IN_TREE('id_of_folder').
if you want search by path, you can use:
SELECT * FROM cmis:folder
WHERE CONTAINS('PATH:\"/app:company_home/st:sites/cm:my_site/cm:documentLibrary//*\"')
For more details view also the official specification
http://docs.oasis-open.org/cmis/CMIS/v1.1/os/CMIS-v1.1-os.html
Do yourself a favor and upgrade.
Your query works for me in the share node browser (does not throw exceptions) as either cmis-strict or cmis-alfresco .
SELECT *
FROM cmis:document
WHERE CONTAINS('PATH:"/app:company_home/st:sites//*"')
Gives me a whole lot of results.
I'm using Adobe AEM, and I can't fetch the informations I want from the repository with the QueryBuilder.
I could reproduce my problem with the servlet.
When I enter this URL :
http://localhost:4502/bin/querybuilder.json?path=/content/geometrixx/en/products/triangle&type=cq:Page
It returns 2 results : Features and Overview.
But I would like the query to also return Triangle which is a cq:Page.
Can you help me plz ?
Thanks.
This is because, Querybuilder would search only the subtree if the path property alone is set.
In case you want to include the given path too in the search, then you need to add path.self=true to the request.
http://localhost:4502/bin/querybuilder.json?path=/content/geometrixx/en/products/triangle&type=cq:Page&path.self=true
For more info on Path Predicate, refer this (updated link).