I'm trying to bind a sling model with my sightly via use api. But facing couple of issues.
1) The specific sling model seems not getting registered successfully while checking adapter status. (but bundle is active and running)
2) Flow is not getting inside @PostConstruct method.
3) Although dialog values with exact property name are present in JCR, when the page is viewed, its showing null.
Steps followed to rectify:
1) in the models core pom file, added below build plugin with <Sling-Model-Packages>
<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Import-Package>javax.inject;version=0.0.0,*</Import-Package> <Sling-Model-Packages> com.XX.YY.models
</Sling-Model-Packages> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> </instructions> </configuration></plugin>
2) Added the below dependency at core pom.
<dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId></dependency>
3) added simlar dependency at parent pom under <dependencyManagement />. Also the artifact 'geronimo-atinject_1.0_spec' is already existing in parent POM.
<dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId> <version>1</version> <scope>provided</scope></dependency>
4) the page where the component has been used, (in which sling model is tied), is correctly reflecting authored values at JCR /content/.. level.
sightly markup with dialog nodes.
6) Model class as below.
Can anyone suggest how to solve this issue??