Expand my Community achievements bar.

SOLVED

Issue with importing JcrTagImpl class in OSGI

Avatar

Level 3

I need to import JcrTagImpl class which is located in CQ Day Communique 5 Tagging jar file(com.day.cq.cq-tagging)

Then I tried to add the above jar in my pom.xml's dependency as below then I can import the whole package as com.day.cq.tagging.*;

<code><dependency> <groupId>com.day.cq</groupId> <artifactId>cq-tagging</artifactId> <version>5.7.18</version> <scope>provided</scope> </dependency></code>

UPDATE:
I need to call getTagID method which is located in com.day.cq.tagging.JcrTagImpl class. AEM uses com.day.cq.tagging.TagCommandServlet to display the TagID in tagging console. TagCommandServlet is importing JcrTagImpl class and calling getTagID method.

I have my own servlet and I wanted to call getTagID. I could not call directly getTagID of JcrTagImpl implementation since it is not exposed. Can it done by any annotation?Can you please guide me how to call getTagId method.

1 Accepted Solution

Avatar

Correct answer by
Employee

Normally .impl packages are not exported, so you can't use those inside AEM.

View solution in original post

5 Replies

Avatar

Employee

Is jcrtagutilimpl not visible when running in AEM? or is it not visible in eclipse?

Avatar

Level 10

Hi Sachin,

cq-tagging is already present in AEM. You dont have to export package for the same. Give the below dependency (5.7.20 is the version in AEM 6) and remove <export-package>.

<dependency>

    <groupId>com.day.cq</groupId>

    <artifactId>cq-tagging</artifactId>

    <version>5.7.20</version>

    <scope>provided</scope>

</dependency>

Avatar

Correct answer by
Employee

Normally .impl packages are not exported, so you can't use those inside AEM.

Avatar

Level 3

Hi Bsloki,  I have tried as you have mentioned but still i am getting the same error in eclipse. Is there anything I need to verify?

Avatar

Level 10

We will do a community article on this use case so you will know exactly how to work with this API.