@Override public void processRender(WebuiRequestContext context) throws Exception { RenderingService renderingService = (RenderingService) PortalContainer.getComponent(RenderingService.class); WikiService wikiService = (WikiService) PortalContainer.getComponent(WikiService.class); String syntaxId = org.exoplatform.wiki.commons.Utils.getDefaultSyntax(); PageImpl syntaxHelpPage = wikiService.getHelpSyntaxPage(syntaxId); this.syntaxName = syntaxId.replace("/", " ").toUpperCase(); if (syntaxHelpPage != null) { String markup = syntaxHelpPage.getContent().getText(); this.htmlOutput = renderingService.render(markup, syntaxId, Syntax.XHTML_1_0.toIdString(), false); this.syntaxFullPageUrl = "/" + PortalContainer.getInstance().getRestContextName() + "/wiki/help/" + syntaxId.replace("/", Utils.SLASH).replace(".", Utils.DOT); } else { this.htmlOutput = null; } super.processRender(context); }
@Override public void execute(Event<UIWikiPermalinkForm> event) throws Exception { UIWikiPermalinkForm uiWikiPermalinkForm = event.getSource(); UIWikiPortlet uiWikiPortlet = uiWikiPermalinkForm.getAncestorOfType(UIWikiPortlet.class); if (uiWikiPermalinkForm.canModifyPagePermission()) { UIPopupContainer uiPopupContainer = uiWikiPortlet.getPopupContainer(PopupLevel.L1); uiPopupContainer.cancelPopupAction(); UIWikiPermissionForm uiWikiPermissionForm = uiPopupContainer.createUIComponent( UIWikiPermissionForm.class, null, "UIWikiPagePermissionForm"); uiPopupContainer.activate(uiWikiPermissionForm, 800, 0); uiWikiPermissionForm.setPopupLevel(PopupLevel.L1); uiWikiPermissionForm.setScope(Scope.PAGE); PageImpl page = (PageImpl) Utils.getCurrentWikiPage(); HashMap<String, String[]> permissionMap = page.getPermission(); List<PermissionEntry> permissionEntries = uiWikiPermissionForm.convertToPermissionEntryList(permissionMap); uiWikiPermissionForm.setPermission(permissionEntries); event.getRequestContext().addUIComponentToUpdateByAjax(uiPopupContainer); } }