QueryBuilder and path - adobe

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).

Related

How to add POI to Here Maps

I am not able to find an endpoint in Places ( Search ) API to add a new POI, Can you please tell me which entry point should be used for POST to add a Place to HERE MAPS?
I would also like to know if the following API will let me add a missing place/business to HERE Maps :
https://developer.here.com/documentation/examples/rest/map_feedback/map-feedback-about-a-missing-place
As far as I know (I work for HERE, but do not know everything), the endpoint you found for Map Feedback would be how you would add information about a missing resource.

find alfresco nodeRef without using luceneSearch

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.

CMIS QL get folder path using CONTAIN (ALL:)

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.

Merge new GET param with current route in Twig

I have a question. I'm creating a view file for product listing which have filter function. For example, My current Url is
mysite/category/electronics?p=1
And in my template I have a tag to add a some filter criteria. When click on a, I want my uri will be mysite/category/electronics?p=1&c=2 for example.
But I don't know what's the best practice to generate href for a tag, by current uri(app.request.uri) or generate uri from route (use path())..... Waiting for help!
Let's say you are on the route name product_show I'd say you should use path()
path("product_show", { p : 1, c : 2, i : "another_parameter"})
PS: If you have a large amount of parameters your should use url_encode to make it more readable.
Ref: http://twig.sensiolabs.org/doc/filters/url_encode.html#url-encode
And finally and good to know. app.request.query.all will give you all current query parameters in your current url.

Confusion in datafetching from oodle API

I am currently editing my previous question because I finally found the solution "how to manage with oodle API ?" Now the actual point is I dont know how to integrate the result !
let me give you example I have generated my API key and through my API key I can access data from oodle !
http://api.oodle.com/api/v2/listings?key=TEST&region=chicago&category=vehicle/car
In case of "TEST" i write my API key.
Now the problem is this link returns value in XML but how can i fetch it from XML ? Now the point is I don't want to open this link but I want XML data from the page ! Try to visit link given above. You can get idea.
Hope for the positive answer !
For more information I have read this link
http://developer.oodle.com/

Resources