Examples of GadgetRegistryService


Examples of org.exoplatform.application.gadget.GadgetRegistryService

   {
      WebAppController webController = getApplicationComponent(WebAppController.class);
      GadgetApplication application = webController.getApplication("eXoGadgets/" + gadgetId);
      if (application == null)
      {
         GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
         Gadget model;
         try
         {
            model = gadgetService.getGadget(gadgetId);
         }
         catch (Exception ex)
         {
            return null;
         }
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

     * @return Gadget Application
     * @throws Exception
     */
    private Gadget getApplication() {
        try {
            GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
            return gadgetService.getGadget(gadgetId);
        } catch (Exception ex) {
            return null;
        }
    }
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

    public void importExoGadgets() throws Exception {
        ContentRegistry registry = getContentRegistry();

        //
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        GadgetRegistryService gadgetService = (GadgetRegistryService) container
                .getComponentInstanceOfType(GadgetRegistryService.class);
        List<Gadget> eXoGadgets = gadgetService.getAllGadgets();

        //
        if (eXoGadgets != null) {
            ArrayList<String> permissions = new ArrayList<String>();
            permissions.add(UserACL.EVERYONE);
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

   {
      ContentRegistry registry = getContentRegistry();

      //
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
      List<Gadget> eXoGadgets = gadgetService.getAllGadgets();

      //
      if (eXoGadgets != null)
      {
         ArrayList<String> permissions = new ArrayList<String>();
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

         UIAddGadgetForm uiForm = event.getSource();

         UIDashboard uiDashboard = uiForm.getAncestorOfType(UIDashboard.class);
         UIDashboardContainer uiContainer = uiDashboard.getChild(UIDashboardContainer.class);

         GadgetRegistryService service = uiForm.getApplicationComponent(GadgetRegistryService.class);
         String url = uiForm.getUIStringInput(FIELD_URL).getValue();
         UIApplication uiApplication = context.getUIApplication();
         if (url == null || url.trim().length() == 0)
         {
            uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.required", null));
            return;
         }
         url = url.trim();
         if (!url.matches(URLValidator.URL_REGEX))
         {
            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()));
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

    public void importExoGadgets() throws Exception {
        ContentRegistry registry = getContentRegistry();

        //
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        GadgetRegistryService gadgetService = (GadgetRegistryService) container
                .getComponentInstanceOfType(GadgetRegistryService.class);
        List<Gadget> eXoGadgets = gadgetService.getAllGadgets();

        //
        if (eXoGadgets != null) {
            ArrayList<String> permissions = new ArrayList<String>();
            permissions.add(UserACL.EVERYONE);
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

    public void importExoGadgets() throws Exception {
        ContentRegistry registry = getContentRegistry();

        //
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        GadgetRegistryService gadgetService = (GadgetRegistryService) container
                .getComponentInstanceOfType(GadgetRegistryService.class);
        List<Gadget> eXoGadgets = gadgetService.getAllGadgets();

        //
        if (eXoGadgets != null) {
            ArrayList<String> permissions = new ArrayList<String>();
            permissions.add(anyOfAdminGroup);
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

        String urlPref = pref.getValue("url", "local://Calendar");
        if (urlPref.startsWith(LOCAL_STRING)) {
            try {
                String gadgetName = urlPref.replaceFirst(LOCAL_STRING, "");
                ExoContainer container = ExoContainerContext.getCurrentContainer();
                GadgetRegistryService gadgetService = (GadgetRegistryService) container
                        .getComponentInstanceOfType(GadgetRegistryService.class);
                Gadget gadget = gadgetService.getGadget(gadgetName);
                if (gadget != null) {
                    url = GadgetUtil.reproduceUrl(gadget.getUrl(), gadget.isLocal());
                } else {
                    if (log.isWarnEnabled()) {
                        log.warn("The local gadget '" + gadgetName + "' was not found, nothing rendered");
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.