Examples of GadgetRegistryService


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

      if (selectedCategory == null)
         return null;
      List<Application> apps = selectedCategory.getApplications();

      //Correct IconURL of Gadget
      GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
      for (Application app : apps)
      {
         if (ApplicationType.GADGET.equals(app.getType()))
         {
            try
            {
               Gadget gadget;
               gadget = gadgetService.getGadget(app.getApplicationName());
               if (gadget != null)
                  app.setIconURL(gadget.getThumbnail());
            }
            catch (Exception e)
            {
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

      {
         return createApplicationsFromPortlets(true);
      }
      else if (ApplicationType.GADGET == type)
      {
         GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
         List<Gadget> gadgets = gadgetService.getAllGadgets();
         List<Application> applications = new ArrayList<Application>(gadgets.size());
         for (Gadget gadget : gadgets)
         {
            Application app = new Application();
            app.setApplicationName(gadget.getName());
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

      }
   }

   public void initData() throws Exception
   {
      GadgetRegistryService service = getApplicationComponent(GadgetRegistryService.class);
      gadgets_ = service.getAllGadgets(new Util.GadgetComparator());
   }
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

      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())
         {
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

      {
         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)
            {
               return GadgetUtil.reproduceUrl(gadget.getUrl(), gadget.isLocal());
            }
         }
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

            List<String> accessPermission = app.getAccessPermissions();
            if (accessPermission == null || accessPermission.size() == 0) {
                continue;
            }

            GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
            for (String p : accessPermission) {
                if (userACL.hasPermission(p)) {
                    if (ApplicationType.GADGET.equals(app.getType())) {
                        try {
                            Gadget gadget;
                            gadget = gadgetService.getGadget(app.getApplicationName());
                            if (gadget != null)
                                app.setIconURL(gadget.getThumbnail());
                        } catch (Exception e) {
                        }
                    }
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

    @Deprecated
    public static String fetchGagdetMetadata(String urlStr) {
        String result = null;

        ExoContainer container = ExoContainerContext.getCurrentContainer();
        GadgetRegistryService gadgetService = (GadgetRegistryService) container
                .getComponentInstanceOfType(GadgetRegistryService.class);
        try {
            String data = "{\"context\":{\"country\":\"" + gadgetService.getCountry() + "\",\"language\":\""
                    + gadgetService.getLanguage() + "\"},\"gadgets\":[" + "{\"moduleId\":" + gadgetService.getModuleId()
                    + ",\"url\":\"" + urlStr + "\",\"prefs\":[]}]}";

            // Send data
            String gadgetServer = getGadgetServerUrl();
            URL url = new URL(gadgetServer + (gadgetServer.endsWith("/") ? "" : "/") + "metadata");
View Full Code Here

Examples of org.exoplatform.application.gadget.GadgetRegistryService

     */
    public static String fetchGagdetRpcMetadata(String urlStr) {
        String result = null;

        ExoContainer container = ExoContainerContext.getCurrentContainer();
        GadgetRegistryService gadgetService = (GadgetRegistryService) container
                .getComponentInstanceOfType(GadgetRegistryService.class);
        try {
            String data = "[{method:\"gadgets.metadata\", id:\"test\", params: {ids:[\"" + urlStr
                    + "\"], container:\"default\", language:\"" + gadgetService.getLanguage() + "\", country:\""
                    + gadgetService.getCountry() + "\", view:\"home\"}}]";

            // Send data
            String gadgetServer = getGadgetServerUrl();
            URL url = new URL(gadgetServer + (gadgetServer.endsWith("/") ? "" : "/") + "api/rpc");
            URLConnection conn = url.openConnection();
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.