Skip to main content
AEMing
Level 2
10月 16, 2015 2:29 午前 UTC
解決済み

How to update a lot of nodes in the content repository?

How do you go about updating a lot of nodes in the content repository? 

For example, I'd like to add another value to a page template's cq:allowedTemplates property without manually having to do this for every page based on this template. 

このトピックへの返信は締め切られました。
ogill回答
Adobe Employee
10月 16, 2015 2:29 午前 UTC

You would write a script to do this, simple way would be to write a JSP to get the nodes you need and update them. But is this a production system?

8 の返信

Feike_Visser1
Adobe Employee
Adobe Employee
10月 16, 2015 2:29 午前 UTC

Avoid using admin-sessions if you can, if the user's session has the right permissions you are good to go.

翻訳
smacdonald2008
Level 10
10月 16, 2015 2:29 午前 UTC

If you use admin session - you can use JCR API to change node props. 

翻訳
Feike_Visser1
Adobe Employee
Adobe Employee
10月 16, 2015 2:29 午前 UTC
Adobe Employee
10月 16, 2015 2:29 午前 UTC

Hi,

with JCR querying you can only read, their is no ability to modify/delete.

My JSP suggestion was simplistic, it would be more like the link you posted. 

The alternative, if you are handy with shell scripts, is to query the AEM instance using curl [1] and use that as input for using curl POST commands to modify the content [1][2].

If you haven't used fiddle it is really good for doing quick adhoc searches etc

Regards,

Opkar

[1] https://balawcm.wordpress.com/2013/02/13/curl-it-out-adobe-cq5-curl-commands-and-usage/

[2] https://forums.adobe.com/thread/1093660

翻訳
AEMing
AEMing作成者
Level 2
10月 16, 2015 2:29 午前 UTC

I was hoping that it would be as easy as writing a script in CRXDE, similar to when querying, but I guess not.

Do you have a sample of how to do this with JSP? I found http://cqblog.inside-solutions.ch/2014/12/10/update-cqallowedtemplates-property-on-existing-pages-in-content, which is a separate module which sounds more complicated to what you're suggesting.

The change is to be done in production, but we're uncertain about how to go about it. Why are you asking? Anything we need to think of :-)

翻訳
Kunal_Gaba_
New Member
10月 16, 2015 2:29 午前 UTC

You can also try using the Bulk Editor https://docs.adobe.com/docs/en/aem/6-1/administer/operations/bulk-editor.html for this use case. 

翻訳
ogillAdobe Employee回答
Adobe Employee
10月 16, 2015 2:29 午前 UTC

You would write a script to do this, simple way would be to write a JSP to get the nodes you need and update them. But is this a production system?

翻訳
edubey
Level 10
10月 16, 2015 2:29 午前 UTC

Few points from this corner:
Sometime back we got a similar requirement to create 1500 pages dynamically, Our approach involved XML which was having all the 
data, implementing it with JAXB. It was very efficient and a useful approach. You can implement it as a scheduler as well.
JCR API is very helpful for these kind of implementations. Let me know if you need any more details on this approach

翻訳