Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to reinheritance a Component Java class that inherits WCMUsePojo

pdg2491
Level 2
Level 2

Hello,

I am currently configuring a component using the Java Use-API. (under the apps folder)

In a situation where i need to create another Component that inherits Container Component,
i want to use a Java class by inheriting a Java class that inherits Container Component's WCMUsePojo.

[Test Code]

1. Conatiner java

public class Container extends WCMUsePojo {

     @Override

     public void activate() throws Exception {}

     public String getText(String text) {

          ...

          return String

}

2. Controller java

public class Controller extends Container {

  private  String resourceData;

   @Override
   public void activate() throws Exception {

        String testText = "This is Test Text"

        resourceData = getText(testText);
        ...

   }

}

I ran the test with the code above, I could see one thing.

When Authoring Controller Component, Error message occurs until Authoring Container Component and executing getText method.

[error message]

Identifier Controller cannot be correctly instantiated by the Use API

I guess to the issue, Java class configured in Component is not used in AEM Memory before Page Authoring

Can't i use this method?

0 Replies