Package org.exoplatform.portal.webui.application

Examples of org.exoplatform.portal.webui.application.UIGadget


    * @return <code>false</code> if and only if this UIDashboardContainer has no UIGadget<br> <code>true</code>
    *         otherwise
    */
   public boolean hasUIGadget()
   {
      UIGadget gadget = findFirstComponentOfType(UIGadget.class);
      return (gadget != null);
   }
View Full Code Here


         {
            UIApplication uiApplication = context.getUIApplication();
            uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
            return;
         }
         UIGadget uiGadget = event.getSource().createUIComponent(context, UIGadget.class, null, null);
         uiGadget.setState(new TransientApplicationState<Gadget>(application.getApplicationName()));
         UIDashboardContainer uiDashboardContainer = uiDashboard.getChild(UIDashboardContainer.class);
         uiDashboardContainer.addUIGadget(uiGadget, col, row);
         uiDashboardContainer.save();
         context.addUIComponentToUpdateByAjax(uiDashboardContainer);
      }
View Full Code Here

         {
            uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.notUrl", null));
            return;
         }
         Gadget gadget;
         UIGadget uiGadget;

         //TODO check the way we create the unique ID, is it really unique?
         try
         {
            String name = "gadget" + url.hashCode();
            gadget = GadgetUtil.toGadget(name, url, false);
            service.saveGadget(gadget);
            uiGadget = uiForm.createUIComponent(context, UIGadget.class, null, null);
            uiGadget.setState(new TransientApplicationState<org.exoplatform.portal.pom.spi.gadget.Gadget>(gadget.getName()));
         }
         catch (Exception e)
         {
            try
            {
               URI uri = URI.create(url);
               RSSParser parser = new RSSParser();
               RSSDocument<DefaultRSSChannel, DefaultRSSItem> doc = parser.createDocument(uri, "UTF-8");
               if (doc == null)
                  throw new Exception("Wrong url");
            }
            catch (Exception e1)
            {
               uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.notUrl", null));
               return;
            }

            String aggregatorId = uiDashboard.getAggregatorId();
            gadget = service.getGadget(aggregatorId);
            //TODO make sure it's an rss feed
            // TODO make sure that we did not add it already
            uiGadget = uiForm.createUIComponent(context, UIGadget.class, null, null);
            uiGadget.setState(new TransientApplicationState<org.exoplatform.portal.pom.spi.gadget.Gadget>(gadget.getName()));

            String params = "{'rssurl':'" + url + "'}";

            // Julien : I commented those 2 lines
            // we need to save the same way it is done in the UIGadget clas
View Full Code Here

         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

         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;
         }
         if (maximize.equals("maximize"))
         {
            uiGadget.setView(UIGadget.CANVAS_VIEW);
            uiDashboard.setMaximizedGadget(uiGadget);
         }
         else
         {
            uiGadget.setView(UIGadget.HOME_VIEW);
            uiDashboard.setMaximizedGadget(null);
         }
      }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.webui.application.UIGadget

Copyright © 2018 www.massapicom. 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.