Hello,
Given the ManagedObject (mo) via event listener, how can I obtain the mo's template?
Based on the API, the first step is to get the ContentInstancePage, then from there, get the Template.
public static ContentInstancePage findBySiteAndContentInstanceId(java.lang.String siteAppObjId, java.lang.String contentInstanceVCMID)
Here is what I have:
Site site = Site.findByName(siteName);
SiteRef sr = new SiteRef(site.getId());
ContentInstancePage cip = ContentInstancePage.findBySiteAndContentInstanceId(sr.getId(), mo.getContentManagementId().getId());
I am getting a null result for cip. The mo is from the event listener and my log output indicates that it is passing in the content instance correctly. I do a test for the cip output ( if(cip != null) {do stuff} else { log.error("cannot get cip"); } I am getting the cannot get cip message consistently.
Am I doing something wrong?
Thanks.
Christine