public void switchToEditMode() throws Exception {
PageService pageService = this.getApplicationComponent(PageService.class);
DataStorage dataStorage = this.getApplicationComponent(DataStorage.class);
PageKey pageKey = new PageKey(getSiteKey(), getName());
PageContext pageContext = pageService.loadPage(pageKey);
if (pageContext == null) {
UIPortalApplication uiApp = Util.getUIPortalApplication();
ApplicationMessage msg = new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { pageKey.format() }, 1);
uiApp.addMessage(msg);
} else {