Hi,
in my SR scripts I often use PageManager methods (especially getPage()) to get information about pages.
As by https://docs.atlassian.com/ConfluenceServer/javadoc/7.9.1/ I noticed that getPage() is deprecated, and ContentService.find() is recommended.
Sorry to admit that I've never used yet succesfully ContentService to get done what I need, due to my knowledge lack.
Looking at the following simple code, which obviously runs with no problems in my instance:
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.pages.PageManager
import com.atlassian.confluence.pages.Page
def myKnownPageTitle='Title of my page'
def mySpaceString='Name of my space'
def pageManager = ComponentLocator.getComponent(PageManager)
def myPage = pageManager.getPage(mySpaceString, myKnownPageTitle)
def myRetrievedId = myPage.getId()
def myRetrievedPageVersion=myPage.getVersion()
log.warn("Page searched: ${myKnownPageTitle}")
log.warn("Retrieved page ID is: ${myRetrievedId}")
log.warn("Current page version is: ${myRetrievedPageVersion}")
How should I implement ContentService to get the same result?
I have no problem in living with deprecated methods (until they run :-)) but of course I'd like to progressively improve.
Thanks in advance for any hint.
Ciao, Andrea