- CCT Public Page
- [CCT Members Area]
import com.atlassian.confluence.pages.Page;
import bucket.container.ContainerManager;
def index = null //request.getSession(true).getServletContext().getAttribute("climb.index")
if (index == null )
{
out.println "Creating index..."
index = new Index()
String pageTitle="Climbing Guides"
Page page = ContainerManager.getComponent("pageManager").getPage(context.spaceKey,pageTitle);
addChildren(page)
request.getSession(true).getServletContext().setAttribute("climb.index", index)
}
def static addChildren(Page page)
{
for (child in page.children)
}
def static doPage (Page page)
{
int index1 = page.content.indexOf("
String xml = page.content.substring(index1+7, index2)
out.println ("Page:" + page + " xml=" + xml )
def x = new XmlParser().parseText(xml)
def climbs = x.guide.climb
for (climb in climbs)
}
addChildren(page)
for (c in index.climbs)
out.println c
}
class Index
{
List climbs = new ArrayList()
}
class Climb
{
String name
String grade
String stars
String length
String extra
String number
String toString()
}