Deleting nodes in JCR via Author dialog | Adobe Higher Education
Skip to main content
Level 3
January 31, 2018
해결됨

Deleting nodes in JCR via Author dialog

  • January 31, 2018
  • 4 답변들
  • 2855 조회

I need to create a component (say componentA) whose aim is to allow a user to add a variable number of components (choosing from componentB and componentC). So componentA is like a parsys which contains others components.

I'm using a multifieldpanel to create a component's dialog with a user controlled number of field. Something like this:

The problem is when I try to eliminate one of the elements added directly from the dialog of componentA: the element is effectively eliminated from the dialog but it actually remains inside the CRX. My CRX is something like:

  • componentA
    • componentASon_0
    • componentASon_1

My question is how can I do this in a proper way. Is there a java service needed for this or is there a direct way to delete and manipulate nodes in the JCR from a Dialog.

Thanks and regards!

이 주제는 답변이 닫혔습니다.
최고의 답변: smacdonald2008

To delete Nodes, you use the JCR AP, which is Java. You need a session with permission too that is able to delete that node. This is typically not handled at the dialog level.

Hiwever, one way i can see is creating a custom xtype. I see you are working in classic ui. From the JS, pass a request to a Servlet where you can use Java JCR API to delete a node,

4 답변

kautuk_sahni
Community Manager
Community Manager
January 31, 2018

I would recommend you to see Template editor. This will is the recommended way of restricting the components to the page via policy configurations.

Whereas you can have a look at this article covering JCR API to do CURD operations on the JCR :- Adobe Experience Manager Help | Programmatically Accessing Adobe Experience Manager Content using the JCR API

// JCR API:- Apache Jackrabbit - JCR API

-Kautuk

Kautuk Sahni
Level 3
January 31, 2018

Hi, does this mean its not possible to do it directly via the dialog? AEM build-in functionality?

What I need is a function behind the deletion button (the red minus) that deletes the node with the according name from the multifield as shown in the picture above.

kautuk_sahni
Community Manager
Community Manager
January 31, 2018

OOTB there is no component to do this. Where as you can create a custom component where dialog can select the node to be deleted and backed logic can delete that node.

Directly we can do it from CRX/de.

-Kautuk

Kautuk Sahni
smacdonald2008
Level 10
January 31, 2018

To delete Nodes, you use the JCR AP, which is Java. You need a session with permission too that is able to delete that node. This is typically not handled at the dialog level.

Hiwever, one way i can see is creating a custom xtype. I see you are working in classic ui. From the JS, pass a request to a Servlet where you can use Java JCR API to delete a node,