I am using Query builder as below to get the list of distinct pages which uses the component (component name will passed as a parameter) in property. I need to pass two parameters, cq:lastReplicationAction=Activate and sling:resourceType=component path. I tried above JSON query but no result and it is failing since the component may be used at any level of page node. E.g, /jcr:content/par/component or /jcr:content/par/mainpar/component
https://host:port/bin/querybuilder.json?1_property=sling:resourceType&1_property.value=COMPONENTPATH&2_property=jcr:content/cq:lastReplicationAction&2_property.value=Activate&path=FROM_WHICH_CONTENT_PATH&type=cq:Page&p.limit=-1
Components are placed under par node of page, and Replication property is part of page JCR node. That's the reason your query is returning 0 result. Try this query:
http://localhost:4502/bin/querybuilder.json?1_property=jcr:content/par/*/sling:resourceType&1_property.value=<Component-Path>&2_property=jcr:content/cq:lastReplicationAction&2_property.value=Activate&path=<BASE-Content-Path>&type=cq:Page&p.limit=-1
I have used following property to find component: jcr:content/par/*/sling:resourceType If your par node has different name then use correct name of par node.
A xpath query can be used to get the pages where a components used.
Goto CRXDELight using http://AEM-AUTHOR-HOST/crx/de/index.jsp, open Tools -> Query. Place the query into the Query box:
/jcr:root/content//*[jcr:contains(#sling:resourceType, 'COMPONENT_NAME/PATH')] order by #jcr:score
if you know exact path of the component then use below query.
/jcr:root/content//*[#sling:resourceType = 'COMPONENT_PATH'] order by #jcr:score
It will return list of paths of content nodes where your component being used. You may split the each path before /jcr:content to get exact page paths.
Related
i am trying to get the direct child of parents, this is the query i have used (Scenario: File system in which a folder contains other folder)
MATCH (n:Folder) WHERE ID(n)=${req.query.id}
OPTIONAL MATCH (b:Folder)<-[r:CONTAINS*0..]-(n:Folder)
return{parent:n.name,child : {name :collect(b)}}
but im getting all the children either direct or indirect childrens, whereas i need only the direct children
i need to get only b4,inner1, and inner2 as direct child, but im getting inner3 also using this query.
managed to get this working with this query
MATCH (n:Folder)-[:CONTAINS]->(childs:Folder)
WHERE id(n) = 24
RETURN childs
I'm developing a recoursive bar chart with the capability to navigate through a tree hierarchy by getting parent and child data from stored procedures.
It works well but I need to define a different action for the last node that instead of go to report should be: go to URL.
ssrs Action
Is there any way to do that?
I finally solved by using go to url for both: go to report and go to url.
this is possible by specifying the Url of the report as go to url concatenating the parameters using the HTTG GET syntax.
As you cannot set the report action via an expression, the easiest way I can think of doing this is to have two copies of your control or whatever you need the the action on. Have one point to your report as normal and one that points to your URL. Then set the visibility of each control based on the node.
So, assuming it's the series property that you have the action on...normally the Goto report series would be visible but when you are at the last node, the goto URL series would be visible.
This should work but I've not tested it.
Alternatively, if you can determine if the next node will be the last one, you could have two copies of the report. The first would be your report as it is now and the seconds would be exactly the same but with as different action. You can set an expression to call the correct report in the goto report action properties based on the node level. As I said before though, you will need to know if the node you are looking at is the penultimate one.
Neither solution is that elegant but it should give you what you want,.
Using Rules modules, I set up a rule "After saving new content of type X".
So, adding a new content of "X" should:
Based on its nid, call a view, which returns back a JSON, from where I fetch the info to work later. The info I need is on this view, not in the node I am inserting, but to get this view I need the nid and some other info from the node I am creating
The problem is that even if I get the nid of the new node, when I call the view it just returns an empty result. It seems like the data it's still not on Drupal database, so the view results empty. I tried to add a sleep(10) before calling the view, giving some time to Drupal, but no success.
The Content is published, and I added also a 'Save entity' Action to the Rule
Hope with this code here helps to understand:
dsm($node); //I can see al attributes from the node I am inserting
$url="http://localhost/bopa/?q=export_cultivos/$node->nid";
dpm($url);
//it gives me a correct URL, that tested later directly on the browser, works
$data=file_get_contents($url);
$data2 = json_decode($data,true);
dsm($data2);
//EMPTY array
I guess you are passing nid as string not as variable in URL. $node->nid is not getting substituted. So use following code snippet
$url="http://localhost/bopa/?q=export_cultivos/".$node->nid;
I'm researching options to synchronize external data to a Category and Keyword list.
I have a metadata field with a states field that uses a category called US States.
When I preview my component with a simple XSLT component template (<xsl:copy-of select="." />), I can see:
<tcm:Content>
...
</tcm:Content>
<tcm:Metadata><Metadata xmlns="http://createandbreak.net/schema/generic">
<states>California</states>
<states>New York</states>
</Metadata></tcm:Metadata>
When I update the keyword and preview, I can see updated values.
<tcm:Content>
...
</tcm:Content>
<tcm:Metadata><Metadata xmlns="http://createandbreak.net/schema/generic">
<states>Californias</states>
<states>New York</states>
</Metadata></tcm:Metadata>
Which is great. It looks like we do not need to synchronize components (open, edit, and save) to use updated keywords. Is that a safe assumption?
If I update a keyword, do I need to update components that use it in order to publish component presentations with the updated values?
Do I need to also be careful when moving components with content porter?
No, you don't need to do anything manually for those Keyword fields to be "Content Porter"-safe. Tridion stores the link from your Keyword field to the Keyword definition (in the category) as a so-called managed link (a TCM URI).
The reason you don't see this value in your XSLT has to do with the way Tridion traditionally exposes the Keywords in WebDAV: it hides the TCM URIs there and instead just exposes the value of the selected keyword. Since Keyword values must be unique within their category, this will always allow you to look up the correct TCM URI if needed.
But when exporting (and in general when you're using the API to access content) you should retrieve the Component XML with the TCM URIs in place. Check the API documentation for your programming language to see which Filter/ReadOption you need to specify for that.
For every taxonomy term I can access a page (I am not using the Views module) showing all contents that are tagged with the specific term by using the a path like this: www.example.com/taxonomy/term/1.
Now, I wonder if I could do the same with content-types (e.g. for showing all contents of content type article), using a URL such as www.example.com/content/type/1.
I'm assuming Views 3. You could create a View and supply a contextual filter in the URL to dynamically display all nodes of that content type.
Add "Content: Type" as a contextual filter. Under "When The Filter Is Not Available" section, select "Provide default value", and then Raw value from url. For your example, you would select "3" for the path component.
You can set the Path to "/content/type/%" where the % is the name of the content type. I'm not sure if it will work with numeric values, however.
Without using the Views module, you should create a custom module for doing that, which would be doing what Views is already doing.
If you don't need all the features present in Views, then you can create your own module, even if I would not suggest doing it when Views already exists.
Your module should associate a menu item to a path like "content/type/%" and render a page containing all the nodes of that content type.
For rendering the nodes you could use node_view_multiple(). For retrieving the list of the nodes, and rendering it, you could use code similar to the following one:
$query = new EntityFieldQuery();
$entities = $query->entityCondition('entity_type', 'node')
->entityCondition('bundle', $content_type)
->propertyCondition('status', 1)
->execute();
$nodes = entity_load('node', array_keys($entities['node']));
return node_view_multiple($nodes, 'teaser');
$content_type is the string passed to the menu item.
The code I reported would not use a pager, but it would show all the nodes in a single page.