String logonGuid="69322821E01E49A9A50CF20E382C6CA2";
String sessionKey="FB46C0BE11BE48CD8645D17E381851D3";
String projectGuid="06BE79A1D9F549388F06F6B649E27152";
CmsClient client = new CmsClient(logonGuid);
Project project = client.getProject(sessionKey, projectGuid);
Page startPg = project.getPageById("27007");
// prepare action
Class.forName("org.hsqldb.jdbcDriver");
Connection connection = DriverManager.getConnection("jdbc:hsqldb:mem:cacpat", "sa", "");
String[] skipSuffixes = {"_fragment"};
ContentAreaCollectorPageAction action = new ContentAreaCollectorPageAction(connection, "cacpat", skipSuffixes, "company");
// 1. add all
PageArrayList children = startPg.getListChildPages("content_pages_list");
for (Iterator iterator = children.iterator(); iterator.hasNext();) {
Page child = (Page) iterator.next();
action.invoke(child);
}
// 2. add some with different content area
action.setContentAreaName("business_administration");
// already existing pages
action.invoke(project.getPageById("161"));
action.invoke(project.getPageById("713"));
// new page
action.invoke(project.getPageById("27001"));
// 3. retrieve save values
while(action.nextPage()) {
System.out.printf("%s\t%s\t%s\t%s\n", action.getCurrentPageGuid(), action.getCurrentPageId(), action.getCurrentPageHeadline(), action.getCurrentPageContentAreas());
}