How do I convert a page into a model
Newbie here, so go easy. Not quite sure my terminology is correct.
I'm trying to get all of the instances of a given model. I have a Video component like so:
@Model(adaptables = Resource.class, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class Video {
private url;
}
I'd like to get all instances of Video models. By convention, I can put all of my video pages in one location in the JCR tree. Then I can get all the video Page objects like so:
videoPages = new ArrayList<>();
allVideosRootPage.listChildren(page -> page.getContentResource() != null)
.forEachRemaining(videoPages::add);
But how do I actually get the models from those page objects?