Examples of WebuiRequestContext


Examples of org.exoplatform.webui.application.WebuiRequestContext

   {

      public void execute(Event<UIGadgetManagement> event) throws Exception
      {
         UIGadgetManagement uiManagement = event.getSource();
         WebuiRequestContext ctx = event.getRequestContext();
         String name = ctx.getRequestParameter(OBJECTID);
         GadgetRegistryService service = uiManagement.getApplicationComponent(GadgetRegistryService.class);
         if (service.getGadget(name) == null)
         {
            uiManagement.reload();
            ctx.addUIComponentToUpdateByAjax(uiManagement);
            return;
         }
         UIGadgetEditor uiEditor = uiManagement.getChild(UIGadgetEditor.class);
         if (uiEditor != null)
         {
            Source source = uiEditor.getSource();
            if (source != null && name.equals(uiEditor.getSourceName()))
            {
               UIApplication uiApp = ctx.getUIApplication();
               uiApp.addMessage(new ApplicationMessage("UIGadgetManagement.msg.deleteGadgetInUse", null));
               return;
            }
         }
         service.removeGadget(name);
         WebAppController webController = uiManagement.getApplicationComponent(WebAppController.class);
         webController.removeApplication(GadgetApplication.EXO_GADGET_GROUP + "/" + name);
         Gadget gadget = uiManagement.getGadget(name);
         if (gadget.isLocal())
         {
            // get dir path of gadget
            String gadgetUrl = gadget.getUrl();
            String[] gaggetUrlPart = gadgetUrl.split("/");
            String dirPath = gaggetUrlPart[gaggetUrlPart.length - 2];
            SourceStorage sourceStorage = uiManagement.getApplicationComponent(SourceStorage.class);
            sourceStorage.removeSource(dirPath + "/" + name + ".xml");
         }
         uiManagement.reload();

         // update to ApplicationOrganizer
         removeFromApplicationRegistry(name);
         UIApplicationOrganizer uiOrganizer =
            uiManagement.getParent().findFirstComponentOfType(UIApplicationOrganizer.class);
         ApplicationCategory selectedCate = uiOrganizer.getSelectedCategory();
         uiOrganizer.reload();
         uiOrganizer.setSelectedCategory(selectedCate);

         ctx.addUIComponentToUpdateByAjax(uiManagement);
      }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

         for (String per : uiListPermissionSelector.getValue())
            pers.add(per);
      application_.setAccessPermissions(pers);
      ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
      application_.setModifiedDate(Calendar.getInstance().getTime());
      WebuiRequestContext ctx = WebuiRequestContext.getCurrentInstance();
      if (service.getApplication(application_.getId()) == null)
      {
         UIApplication uiApp = ctx.getUIApplication();
         uiApp.addMessage(new ApplicationMessage("application.msg.changeNotExist", null));
         return;
      }
      service.update(application_);
      Application selectedApplication = getApplication();
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

   public String getMetadata()
   {
      String url = getUrl();
      if (url == null)
      {
         WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
         UIApplication uiApplication = context.getUIApplication();
         uiApplication.addMessage(new ApplicationMessage("UIGadgetPortlet.msg.url-invalid", null));
      }

      String metadata_ = GadgetUtil.fetchGagdetMetadata(url);
      try
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

   public static class MinimizeGadgetActionListener extends EventListener<UIDashboard>
   {
      public final void execute(final Event<UIDashboard> event) throws Exception
      {
         WebuiRequestContext context = event.getRequestContext();
         UIDashboard uiDashboard = event.getSource();
         String objectId = context.getRequestParameter(OBJECTID);
         String minimized = context.getRequestParameter("minimized");

         UIDashboardContainer uiDashboardCont = uiDashboard.getChild(UIDashboardContainer.class);
         UIGadget uiGadget = uiDashboard.getChild(UIDashboardContainer.class).getUIGadget(objectId);
         if (uiGadget.isLossData())
         {
            UIPortalApplication uiApp = Util.getUIPortalApplication();
            uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
            uiDashboardCont.removeUIGadget(uiGadget.getId());
            context.addUIComponentToUpdateByAjax(uiDashboard);
         }
         else
         {
            uiGadget.getProperties().setProperty("minimized", minimized);
         }
         uiDashboardCont.save();
         context.addUIComponentToUpdateByAjax(uiGadget);
      }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

   public static class MaximizeGadgetActionListener extends EventListener<UIDashboard>
   {
      public final void execute(final Event<UIDashboard> event) throws Exception
      {
         WebuiRequestContext context = event.getRequestContext();
         UIDashboard uiDashboard = event.getSource();
         String objectId = context.getRequestParameter(OBJECTID);
         String maximize = context.getRequestParameter("maximize");
         UIDashboardContainer uiDashboardCont = uiDashboard.getChild(UIDashboardContainer.class);
         UIGadget uiGadget = uiDashboardCont.getUIGadget(objectId);
         if (uiGadget == null || uiGadget.isLossData())
         {
            UIPortalApplication uiApp = Util.getUIPortalApplication();
            uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
            if (uiGadget != null)
               uiDashboardCont.removeUIGadget(uiGadget.getId());
            uiDashboardCont.save();
            context.addUIComponentToUpdateByAjax(uiDashboard);
            return;
         }
        
         //TODO nguyenanhkien2a@gmail.com
         //We need to expand unminimized state of uiGadget to view all body of gadget, not just a title with no content
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

     *
     * @return the preferences of the portlet
     * @throws Exception any exception
     */
    public Portlet getPreferences() throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        return adapter.getState(container, state.getApplicationState());
    }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

     *
     * @return the portlet context
     * @throws Exception any exception
     */
    public StatefulPortletContext<C> getPortletContext() throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        return adapter.getPortletContext(container, applicationId, state.getApplicationState());
    }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

     *
     * @param updateState the state update
     * @throws Exception any exception
     */
    public void update(C updateState) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        state.setApplicationState(adapter.update(container, updateState, state.getApplicationState()));
        setState(state);
    }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

    public static class SelectPageActionListener extends EventListener<UIPageBrowser> {
        public void execute(Event<UIPageBrowser> event) throws Exception {
            UIPageBrowser uiPageBrowser = event.getSource();
            String id = event.getRequestContext().getRequestParameter(OBJECTID);
            WebuiRequestContext ctx = event.getRequestContext();
            UIApplication uiApp = ctx.getUIApplication();
            UIPageSelector uiPageSelector = uiPageBrowser.getAncestorOfType(UIPageSelector.class);
            UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasPermission(service.getPageService().loadPage(PageKey.parse(id)))) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.NoPermission", new String[] { id }));
            }
            uiPageSelector.setValue(id);
            // uiPageBrowser.feedDataWithQuery(null);

            UIForm uiForm = uiPageSelector.getAncestorOfType(UIForm.class);
            if (uiForm != null) {
                ctx.addUIComponentToUpdateByAjax(uiForm.getParent());
            } else {
                ctx.addUIComponentToUpdateByAjax(uiPageSelector.getParent());
            }
            UIFormPopupWindow uiPopup = uiPageSelector.getChild(UIFormPopupWindow.class);
            uiPopup.setUIComponent(null);
            uiPopup.setShow(false);
        }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

public class OrganizationUtils {

    private static String cachedGroupLabel;

    public static String getGroupLabel(String groupId) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        OrganizationService orgService = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);
        Group group = orgService.getGroupHandler().findGroupById(groupId);
        if (group == null) {
            return cachedGroupLabel;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.