Examples of Gadget


Examples of org.exoplatform.portal.pom.spi.gadget.Gadget

      super.tearDown();
   }

   public void testBilto() throws Exception
   {
      Gadget gadget = new Gadget();
      gadget.setUserPref("user_pref");
      TransientApplicationState<Gadget> state = new TransientApplicationState<Gadget>("bar", gadget);
      Application<Gadget> gadgetApplication = Application.createGadgetApplication();
      gadgetApplication.setState(state);

      Page container = new Page();
      container.setPageId("portal::test::gadget_page");
      container.getChildren().add(gadgetApplication);

      storage_.create(container);

      container = storage_.getPage("portal::test::gadget_page");
      gadgetApplication = (Application<Gadget>)container.getChildren().get(0);

      gadget = storage_.load(gadgetApplication.getState(), ApplicationType.GADGET);
      assertNotNull(gadget);
      assertEquals("user_pref", gadget.getUserPref());
   }
View Full Code Here

Examples of org.exoplatform.portal.pom.spi.gadget.Gadget

        // Marshal ApplicationState
        ApplicationState<Gadget> state = gadgetApplication.getState();

        // Marshal application state
        String contentId;
        Gadget gadget;
        // If transient we have all the information we need
        if (state instanceof TransientApplicationState) {
            TransientApplicationState<Gadget> transientApplicationState = (TransientApplicationState<Gadget>) state;
            contentId = transientApplicationState.getContentId();
            gadget = transientApplicationState.getContentState();
View Full Code Here

Examples of org.exoplatform.portal.pom.spi.gadget.Gadget

            throws XMLStreamException {
        requiresChild(navigator, Element.GADGET_REF);
        String gadgetRef = getRequiredContent(navigator, true);

        // TODO: Implement userPref unmarshalling when gatein_objects support it
        Gadget gadget = null;

        if (navigator.next() != null) {
            throw unexpectedElement(navigator);
        }
View Full Code Here

Examples of org.exoplatform.portal.pom.spi.gadget.Gadget

        TransientApplicationState state;
        // Since we don't support dashboard's here, this only works for gadgets using the gadget wrapper portlet.
        if ("gadget-application".equals(m_name)) {
            ctx.parsePastStartTag(m_uri, "gadget");
            String gadgetName = ctx.parseElementText(m_uri, "gadget-ref");
            Gadget gadget = null;
            // Once the gadget portlet wrapper is able to use gadget userPref's, include parsing logic here.
            // Gadget gadget = new Gadget();
            // gadget.setUserPref();
            state = new TransientApplicationState<Gadget>(gadgetName, gadget);
            app = Application.createGadgetApplication();
View Full Code Here

Examples of org.jboss.cache.aop.test.Gadget

   }

   public void testTransientAnnotation() throws Exception
   {
      log_.info("testTransientAnnotation() ....");
      Gadget ga = new Gadget();
      ga.setName("Printer");
      Resource res = new Resource();
      res.setName("Inet");
      res.setConnection("Eth0");
      ga.setResource(res);

      cache_.putObject("/gadget", ga);
      Object obj = cache_.getObject("/gadget");
      assertEquals(ga, obj);

      Gadget ga1 = (Gadget)cache1_.getObject("/gadget");
      assertEquals("Name is ", ga.getName(), ga1.getName());

      assertNotNull("Resource should not be null on cache1 ", ga.getResource());
      assertNull("Resource should be null", ga1.getResource());
   }
View Full Code Here

Examples of org.wso2.carbon.dashboard.common.bean.Gadget

        }

        Gadget[] gadgetList = new Gadget[rsList.size()];

        Resource tempRes;
        Gadget tempGadget;

        try {
            registry = getConfigSystemRegistry();
            for (int i = 0; i < rsList.size(); i++) {
                tempRes = rsList.get(i);

                if ((tempRes.getProperty(DashboardConstants.GADGET_NAME) != null)
                        && (tempRes.getProperty(DashboardConstants.GADGET_URL) != null)) {
                    tempGadget = new Gadget();
                    tempGadget.setGadgetName(tempRes
                            .getProperty(DashboardConstants.GADGET_NAME));

                    tempGadget.setGadgetUrl(tempRes
                            .getProperty(DashboardConstants.GADGET_URL));

                    if (tempRes.getProperty(DashboardConstants.GADGET_DESC) != null) {
                        tempGadget.setGadgetDesc(tempRes
                                .getProperty(DashboardConstants.GADGET_DESC));
                    } else {
                        tempGadget.setGadgetDesc("");
                    }

                    if (tempRes.getProperty(DashboardConstants.USER_CONTER) != null)
                        tempGadget.setUserCount(tempRes
                                .getProperty(DashboardConstants.USER_CONTER));

                    if (tempRes.getProperty(DashboardConstants.DEFAULT_GADGET) != null)
                        tempGadget
                                .setDefaultGadget(tempRes
                                        .getProperty(DashboardConstants.DEFAULT_GADGET));

                    if (tempRes
                            .getProperty(DashboardConstants.UNSIGNED_USER_GADGET) != null)
                        tempGadget
                                .setUnsignedUserGadget(tempRes
                                        .getProperty(DashboardConstants.UNSIGNED_USER_GADGET));

                    if (tempRes.getProperty(DashboardConstants.GADGET_THUMB_URL) != null) {
                        tempGadget.setThumbUrl(tempRes.getProperty(DashboardConstants.GADGET_THUMB_URL));
                    }

                    tempGadget.setGadgetPath(tempRes.getPath());

                    tempGadget.setRating(registry.getAverageRating(tempRes
                            .getPath()));

                    gadgetList[i] = tempGadget;
                }
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.