Examples of Gadget


Examples of org.encuestame.persistence.domain.dashboard.Gadget

            @PathVariable final String gadgetId,
            HttpServletRequest request,
            HttpServletResponse response){
        try {
             final Map<String, Object> jsonResponse = new HashMap<String, Object>();
             final Gadget gadget = getDashboardService().addGadgetOnDashboard(boardId, String.valueOf(gadgetId));
             jsonResponse.put("gadget", ConvertDomainBean.convertGadgetDomaintoBean(gadget));
             setItemResponse(jsonResponse);
        } catch (Exception e) {
             log.error(e);
             setError(e.getMessage(), response);
View Full Code Here

Examples of org.eurekastreams.server.domain.Gadget

     *             should not be thrown
     */
    @Test
    public void performActionWithGoodParams() throws Exception
    {
        final Gadget expected = context.mock(Gadget.class);

        context.checking(new Expectations()
        {
            {
                allowing(principalMock).getId();
                will(returnValue(1L));

                allowing(deleteCacheKeysMapper).execute(with(any(Set.class)));

                oneOf(gadgetMapper).findById(GADGET_ID1);
                will(returnValue(expected));

                oneOf(expected).setMinimized(true);
                oneOf(expected).setMaximized(false);

                oneOf(gadgetMapper).flush();
            }
        });

        SetGadgetStateRequest currentRequest = new SetGadgetStateRequest(GADGET_ID1, State.MINIMIZED);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);
        Gadget actual = sut.execute(currentContext);

        assertEquals("Did not return the right Tab", actual, expected);
    }
View Full Code Here

Examples of org.exoplatform.application.gadget.Gadget

      {
         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.Gadget

            }
         }
         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");
         }
View Full Code Here

Examples of org.exoplatform.application.gadget.Gadget

   {
      GadgetRegistry registry = getRegistry();
      List<Gadget> gadgets = new ArrayList<Gadget>();
      for (GadgetDefinition def : registry.getGadgets())
      {
         Gadget gadget = loadGadget(def);
         gadgets.add(gadget);
      }
      if (sortComparator != null)
      {
         Collections.sort(gadgets, sortComparator);
View Full Code Here

Examples of org.exoplatform.application.gadget.Gadget

         RemoteGadgetData remoteData = (RemoteGadgetData)data;
         url = remoteData.getURL();
      }

      //
      Gadget gadget = new Gadget();
      gadget.setName(def.getName());
      gadget.setDescription(def.getDescription());
      gadget.setLocal(def.isLocal());
      gadget.setTitle(def.getTitle());
      gadget.setReferenceUrl(def.getReferenceURL());
      gadget.setThumbnail(def.getThumbnail());
      gadget.setUrl(url);
      return gadget;
   }
View Full Code Here

Examples of org.exoplatform.application.gadget.Gadget

         {
            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());
            }
         }
         catch (Exception e)
         {
            log.warn("Failure retrieving gadget from url!");
View Full Code Here

Examples of org.exoplatform.application.gadget.Gadget

     *
     * @return url of gadget application, such as "http://www.google.com/ig/modules/horoscope.xml"
     */
    public String getUrl() {
        if (url_ == null) {
            Gadget gadget = getApplication();
            url_ = GadgetUtil.reproduceUrl(gadget.getUrl(), gadget.isLocal());
        }
        return url_;
    }
View Full Code Here

Examples of org.exoplatform.application.gadget.Gadget

            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) {
                        }
                    }
                    apps.add(app);
                    break;
View Full Code Here

Examples of org.exoplatform.application.gadget.Gadget

public class GadgetUtil {

    private static final Logger log = LoggerFactory.getLogger(GadgetUtil.class);

    public static Gadget toGadget(String name, String path, boolean isLocal) throws Exception {
        Gadget gadget = new Gadget();
        gadget.setName(name);
        gadget.setUrl(path);
        gadget.setLocal(isLocal);
        Map<String, String> metaData = getMapMetadata(reproduceUrl(path, isLocal));
        if (metaData.containsKey("errors"))
            throw new Exception("error on the server: " + metaData.get("errors"));
        String title = metaData.get("directoryTitle");
        if (title == null || title.trim().length() < 1)
            title = metaData.get("title");
        if (title == null || title.trim().length() < 1)
            title = gadget.getName();
        gadget.setTitle(title);
        gadget.setDescription(metaData.get("description"));
        gadget.setReferenceUrl(metaData.get("titleUrl"));
        gadget.setThumbnail(metaData.get("thumbnail"));
        return gadget;
    }
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.