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");