Package org.eurekastreams.server.action.request.gallery

Examples of org.eurekastreams.server.action.request.gallery.GetGalleryItemsRequest


        // Calling this gadgets so it works with a GadgetMetaDataRenderer. Do NOT change to plugins.
        pluginTab = new PagedListPanel("gadgets", new SingleColumnPagedListRenderer());
        galleryPortalContainer.add(pluginTab);

        pluginTab.addSet("All", PluginDefinitionModel.getInstance(), new PluginMetaDataRenderer(),
                new GetGalleryItemsRequest("recent", "", 0, 0));
        pluginTab.addSet("Internet Services", PluginDefinitionModel.getInstance(), new PluginMetaDataRenderer(),
                new GetGalleryItemsRequest("recent", "Internet Services", 0, 0));

        Session.getInstance().getEventBus().addObserver(GotGadgetMetaDataEvent.class,
                new Observer<GotGadgetMetaDataEvent>()
                {
                    public void update(final GotGadgetMetaDataEvent event)
View Full Code Here


                new Observer<GotGadgetDefinitionCategoriesResponseEvent>()
                {
                    public void update(final GotGadgetDefinitionCategoriesResponseEvent event)
                    {
                        gadgetTab.addSet("All", GadgetDefinitionModel.getInstance(), new GadgetMetaDataRenderer(),
                                new GetGalleryItemsRequest("recent", "", 0, 0), "Recent");
                        gadgetTab.addSet("All", GadgetDefinitionModel.getInstance(), new GadgetMetaDataRenderer(),
                                new GetGalleryItemsRequest("popularity", "", 0, 0), "Popular");

                        for (String category : event.getResponse())
                        {
                            gadgetTab.addSet(category, GadgetDefinitionModel.getInstance(),
                                    new GadgetMetaDataRenderer(), new GetGalleryItemsRequest("recent", category, 0, 0),
                                    "Recent");
                            gadgetTab.addSet(category, GadgetDefinitionModel.getInstance(),
                                    new GadgetMetaDataRenderer(), new GetGalleryItemsRequest("popularity", category, 0,
                                            0), "Popular");
                        }

                        Session.getInstance().getEventBus().removeObserver(
                                GotGadgetDefinitionCategoriesResponseEvent.class, this);
                    }
                });

        Session.getInstance().getEventBus().addObserver(GotGadgetDefinitionCategoriesResponseEvent.class,
                new Observer<GotGadgetDefinitionCategoriesResponseEvent>()
                {
                    public void update(final GotGadgetDefinitionCategoriesResponseEvent event)
                    {
                        if (Session.getInstance().getParameterValue("action").equals("newApp")
                                || Session.getInstance().getParameterValue("action").equals("editApp"))
                        {
                            renderCreateOrEditGadget(event.getResponse());
                        }
                    }
                });

        Session.getInstance().getEventBus().addObserver(GotThemeDefinitionsResponseEvent.class,
                new Observer<GotThemeDefinitionsResponseEvent>()
                {
                    public void update(final GotThemeDefinitionsResponseEvent event)
                    {
                        themeTab.render(event.getResponse(), "There are no themes in this category.");
                    }
                });

        Session.getInstance().getEventBus().addObserver(GotThemeDefinitionCategoriesResponseEvent.class,
                new Observer<GotThemeDefinitionCategoriesResponseEvent>()
                {
                    public void update(final GotThemeDefinitionCategoriesResponseEvent event)
                    {
                        themeTab.addSet("All", ThemeModel.getInstance(), new ThemeRenderer(),
                                new GetGalleryItemsRequest("recent", "", 0, 0), "Recent");
                        themeTab.addSet("All", ThemeModel.getInstance(), new ThemeRenderer(),
                                new GetGalleryItemsRequest("popularity", "", 0, 0), "Popular");

                        for (String category : event.getResponse())
                        {
                            themeTab.addSet(category, ThemeModel.getInstance(), new ThemeRenderer(),
                                    new GetGalleryItemsRequest("recent", category, 0, 0), "Recent");
                            themeTab.addSet(category, ThemeModel.getInstance(), new ThemeRenderer(),
                                    new GetGalleryItemsRequest("popularity", category, 0, 0), "Popular");
                        }

                        Session.getInstance().getEventBus().removeObserver(
                                GotThemeDefinitionCategoriesResponseEvent.class, this);
View Full Code Here

                new Observer<GotGalleryTabTemplateCategoriesResponseEvent>()
                {
                    public void update(final GotGalleryTabTemplateCategoriesResponseEvent event)
                    {
                        tabTemplateTab.addSet("All", GalleryTabTemplateModel.getInstance(),
                                new GalleryTabTemplateDTORenderer(), new GetGalleryItemsRequest("recent", "", 0, 0),
                                "Recent");
                        tabTemplateTab.addSet("All", GalleryTabTemplateModel.getInstance(),
                                new GalleryTabTemplateDTORenderer(),
                                new GetGalleryItemsRequest("popularity", "", 0, 0), "Popular");

                        for (String category : event.getResponse())
                        {
                            tabTemplateTab.addSet(category, GalleryTabTemplateModel.getInstance(),
                                    new GalleryTabTemplateDTORenderer(), new GetGalleryItemsRequest("recent", category,
                                            0, 0), "Recent");
                            tabTemplateTab.addSet(category, GalleryTabTemplateModel.getInstance(),
                                    new GalleryTabTemplateDTORenderer(), new GetGalleryItemsRequest("popularity",
                                            category, 0, 0), "Popular");
                        }

                        Session.getInstance().getEventBus().removeObserver(
                                GotGalleryTabTemplateCategoriesResponseEvent.class, this);
View Full Code Here

                will(returnValue(pagedSet));
            }
        });

        // Set up the call parameters
        GetGalleryItemsRequest currentRequest = new GetGalleryItemsRequest("popularity", "News", 0, 7);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        // Make the call
        PagedSet<GadgetDefinition> results = sut.execute(currentContext);
View Full Code Here

                will(returnValue(pagedSet));
            }
        });

        // Set up the call parameters
        GetGalleryItemsRequest currentRequest = new GetGalleryItemsRequest("popularity", "", 0, 7);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        // Make the call
        PagedSet<GadgetDefinition> results = sut.execute(currentContext);
View Full Code Here

                will(returnValue(pagedSet));
            }
        });

        // Set up the call parameters
        GetGalleryItemsRequest currentRequest = new GetGalleryItemsRequest("recent", "News", 0, 7);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        // Make the call
        PagedSet<GadgetDefinition> results = sut.execute(currentContext);
View Full Code Here

                will(returnValue(pagedSet));
            }
        });

        // Set up the call parameters
        GetGalleryItemsRequest currentRequest = new GetGalleryItemsRequest("recent", "", 0, 7);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        // Make the call
        PagedSet<GadgetDefinition> results = sut.execute(currentContext);
View Full Code Here

     * Test that the sort criteria was correctly entered.
     */
    @Test
    public void testSuccessfulValidationPopularSortCriteria()
    {
        GetGalleryItemsRequest currentRequest = new GetGalleryItemsRequest(POPULARITY_SORT_CRITERIA, "", 0, 1);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        sut.validate(currentContext);
    }
View Full Code Here

     * Test that the sort criteria was correctly entered.
     */
    @Test
    public void testSuccessfulValidationRecentSortCriteria()
    {
        GetGalleryItemsRequest currentRequest = new GetGalleryItemsRequest(RECENT_SORT_CRITERIA, "", 0, 1);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        sut.validate(currentContext);
    }
View Full Code Here

     * Test that the sort criteria was incorrectly entered.
     */
    @Test(expected = ValidationException.class)
    public void testFailureValidationBadSortCriteria()
    {
        GetGalleryItemsRequest currentRequest = new GetGalleryItemsRequest("incompatible sort criteria", "", 0, 1);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        sut.validate(currentContext);
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.request.gallery.GetGalleryItemsRequest

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.