public Page getChildPage(String name) throws Exception { File childDirectory = getChildPageDirectory(name); return DispatcherLogic.getPage(childDirectory); }
public Root() { Page rootPage = DispatcherLogic.getPage(pagesDirectory); pageInstance = new PageInstance(null, pagesDirectory, rootPage, null); }
@Override @Before public Resolution prepare() { originalPath = "/"; File rootDir = pagesDir; Page rootPage; try { rootPage = DispatcherLogic.getPage(rootDir); } catch (Exception e) { throw new Error("Couldn't load root page", e); } pageInstance = new PageInstance(null, rootDir, rootPage, SafeModeAction.class); dispatch = new Dispatch(pageInstance); return null; }
/** * Recursively applies a template to a subtree of pages. * @param directory the starting page directory (root of the subtree). * @param filter the filter for selecting pages. * @param edit the object holding template configuration. */ protected void updateTemplate(File directory, FileFilter filter, EditPage edit) { File[] children = directory.listFiles(filter); for(File child : children) { if(!child.getName().equals(PageInstance.DETAIL)) { try { Page page = DispatcherLogic.getPage(child); page.getLayout().setTemplate(edit.template); page.getDetailLayout().setTemplate(edit.detailTemplate); DispatcherLogic.savePage(child, page); } catch (Exception e) { logger.warn("Could not set template of " + child.getAbsolutePath(), e); } } updateTemplate(child, filter, edit); } }
public static SelectionProvider createPagesSelectionProvider (File baseDir, boolean includeRoot, boolean includeDetailChildren, File... excludes) { DefaultSelectionProvider selectionProvider = new DefaultSelectionProvider("pages"); if (includeRoot) { Page rootPage; try { rootPage = getPage(baseDir); } catch (Exception e) { throw new RuntimeException("Couldn't load root page", e); } selectionProvider.appendRow("/", rootPage.getTitle() + " (top level)", true); } appendChildrenToPagesSelectionProvider (baseDir, baseDir, null, selectionProvider, includeDetailChildren, excludes); return selectionProvider; }
Page page = DispatcherLogic.getPage(childDirectory); Class<? extends PageAction> actionClass = DispatcherLogic.getActionClass(configuration, childDirectory);
Page page; try { page = getPage(file); } catch (Exception e) { throw new RuntimeException("Couldn't load page", e);
String title; try { Page page = DispatcherLogic.getPage(dir); title = page.getTitle(); } catch (Exception e) {
Page rootPage = DispatcherLogic.getPage(pagesDirectory); PageInstance pageInstance = new PageInstance(null, pagesDirectory, rootPage, null);
Page page = DispatcherLogic.getPage(pageDir); EmbeddedPageAction embeddedPageAction = new EmbeddedPageAction(
File dir = pagesDir; try { newParent = new PageInstance(null, dir, DispatcherLogic.getPage(dir), null); } catch (Exception e) { throw new Error("Couldn't load root page", e); FileUtils.copyDirectory(pageInstance.getDirectory(), newDirectory); logger.debug("Generating a new Id for the new page"); Page newPage = DispatcherLogic.getPage(newDirectory); String pageId = RandomUtil.createRandomId(); newPage.setId(pageId);
setupCalendar(childPages); Page rootPage = DispatcherLogic.getPage(pagesDir); Collections.sort(childPages, new Comparator<ChildPage>() { public int compare(ChildPage o1, ChildPage o2) {
Page page; try { page = DispatcherLogic.getPage(pageDir); } catch (Exception e) { logger.warn("Nonexisting child page: " + pageDir);
Page rootPage = DispatcherLogic.getPage(rootDirectory); PageInstance rootPageInstance = new PageInstance(null, rootDirectory, rootPage, null); if(SecurityLogic.hasPermissions(portofinoConfiguration, rootPageInstance, subject, AccessLevel.EDIT)) {
parentDirectory = pagesDir; directory = new File(parentDirectory, fragment); parentPage = DispatcherLogic.getPage(parentDirectory); parentLayout = parentPage.getLayout(); configurePath = "";