Examples of Pager


Examples of org.apache.tuscany.das.rdb.Pager

    //Build command to read all customers
    Command custCommand = Command.FACTORY.createCommand("select * from CUSTOMER order by ID");
    custCommand.setConnection(getConnection());

    //Create a pager with the command
    Pager pager = new PagerImpl(custCommand, 2);

    //Get and work with first page
    DataObject root = pager.next();
    DataObject customer1 = root.getDataObject("CUSTOMER[1]");
    DataObject customer2 = root.getDataObject("CUSTOMER[2]");
    assertEquals(1, customer1.getInt("ID"));
    assertEquals(2, customer2.getInt("ID"));

    //Get and work with the second page
    root = pager.next();
    customer1 = root.getDataObject("CUSTOMER[1]");
    customer2 = root.getDataObject("CUSTOMER[2]");
    assertEquals(3, customer1.getInt("ID"));
    assertEquals(4, customer2.getInt("ID"));
   
    // First page again
    root = pager.previous();
    customer1 = root.getDataObject("CUSTOMER[1]");
    customer2 = root.getDataObject("CUSTOMER[2]");
    assertEquals(1, customer1.getInt("ID"));
    assertEquals(2, customer2.getInt("ID"));

View Full Code Here

Examples of org.apache.tuscany.das.rdb.Pager

    //Parameterize the command
    select.setConnection(getConnection());

    //Create a pager
    Pager pager = new PagerImpl(select, 2);

    //Get the first page
    DataObject root = pager.getPage(1);
    DataObject customer1 = root.getDataObject("CUSTOMER[1]");
    DataObject customer2 = root.getDataObject("CUSTOMER[2]");
    assertEquals(1, customer1.getInt("ID"));
    assertEquals(2, customer2.getInt("ID"));

    //Get the second page
    root = pager.getPage(2);
    customer1 = root.getDataObject("CUSTOMER[1]");
    customer2 = root.getDataObject("CUSTOMER[2]");
    assertEquals(3, customer1.getInt("ID"));
    assertEquals(4, customer2.getInt("ID"));

   
    // Get the first page again
    root = pager.getPage(1);
    customer1 = root.getDataObject("CUSTOMER[1]");
    customer2 = root.getDataObject("CUSTOMER[2]");
    assertEquals(1, customer1.getInt("ID"));
    assertEquals(2, customer2.getInt("ID"));
  }
View Full Code Here

Examples of org.apache.tuscany.das.rdb.Pager

        DAS das = DAS.FACTORY.createDAS(getConnection());
        // Build command to read all customers
        Command custCommand = das.createCommand("select * from CUSTOMER order by ID");

        // Create a pager with the command
        Pager pager = new PagerImpl(custCommand, 2);

        // Get and work with first page
        DataObject root = pager.next();
        DataObject customer1 = root.getDataObject("CUSTOMER[1]");
        DataObject customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(1, customer1.getInt("ID"));
        assertEquals(2, customer2.getInt("ID"));

        // Get and work with the second page
        root = pager.next();
        customer1 = root.getDataObject("CUSTOMER[1]");
        customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(3, customer1.getInt("ID"));
        assertEquals(4, customer2.getInt("ID"));

        // First page again
        root = pager.previous();
        customer1 = root.getDataObject("CUSTOMER[1]");
        customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(1, customer1.getInt("ID"));
        assertEquals(2, customer2.getInt("ID"));

View Full Code Here

Examples of org.apache.tuscany.das.rdb.Pager

        DAS das = DAS.FACTORY.createDAS(getConnection());
        // Build the select command
        Command select = das.createCommand("select * from CUSTOMER order by ID");

        // Create a pager
        Pager pager = new PagerImpl(select, 2);

        // Get the first page
        DataObject root = pager.getPage(1);
        DataObject customer1 = root.getDataObject("CUSTOMER[1]");
        DataObject customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(1, customer1.getInt("ID"));
        assertEquals(2, customer2.getInt("ID"));

        // Get the second page
        root = pager.getPage(2);
        customer1 = root.getDataObject("CUSTOMER[1]");
        customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(3, customer1.getInt("ID"));
        assertEquals(4, customer2.getInt("ID"));

        // Get the first page again
        root = pager.getPage(1);
        customer1 = root.getDataObject("CUSTOMER[1]");
        customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(1, customer1.getInt("ID"));
        assertEquals(2, customer2.getInt("ID"));
    }
View Full Code Here

Examples of org.apache.tuscany.das.rdb.Pager

        DAS das = DAS.FACTORY.createDAS(getConnection());
        // Build command to read all customers
        Command custCommand = das.createCommand("select * from CUSTOMER order by ID");

        // Create a pager with the command
        Pager pager = new PagerImpl(custCommand, 2);

        // Get and work with first page
        DataObject root = pager.next();
        DataObject customer1 = root.getDataObject("CUSTOMER[1]");
        DataObject customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(1, customer1.getInt("ID"));
        assertEquals(2, customer2.getInt("ID"));

        // Get and work with the second page
        root = pager.next();
        customer1 = root.getDataObject("CUSTOMER[1]");
        customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(3, customer1.getInt("ID"));
        assertEquals(4, customer2.getInt("ID"));

        // First page again
        root = pager.previous();
        customer1 = root.getDataObject("CUSTOMER[1]");
        customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(1, customer1.getInt("ID"));
        assertEquals(2, customer2.getInt("ID"));

View Full Code Here

Examples of org.apache.tuscany.das.rdb.Pager

        DAS das = DAS.FACTORY.createDAS(getConnection());
        // Build the select command
        Command select = das.createCommand("select * from CUSTOMER order by ID");

        // Create a pager
        Pager pager = new PagerImpl(select, 2);

        // Get the first page
        DataObject root = pager.getPage(1);
        DataObject customer1 = root.getDataObject("CUSTOMER[1]");
        DataObject customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(1, customer1.getInt("ID"));
        assertEquals(2, customer2.getInt("ID"));

        // Get the second page
        root = pager.getPage(2);
        customer1 = root.getDataObject("CUSTOMER[1]");
        customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(3, customer1.getInt("ID"));
        assertEquals(4, customer2.getInt("ID"));

        // Get the first page again
        root = pager.getPage(1);
        customer1 = root.getDataObject("CUSTOMER[1]");
        customer2 = root.getDataObject("CUSTOMER[2]");
        assertEquals(1, customer1.getInt("ID"));
        assertEquals(2, customer2.getInt("ID"));
    }
View Full Code Here

Examples of org.eurekastreams.web.client.ui.common.Pager

     *            Value of parameter to look for in the URL to determine if URL change events apply to this list.
     */
    public PagedListPanel(final String inListId, final String inContextParam, final String inContextParamValue)
    {
        listId = inListId;
        bottomPager = new Pager("filteredPager" + listId, true);

        waitSpinner.addStyleName(StaticResourceBundle.INSTANCE.coreCss().waitSpinner());
        renderContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().renderContainer());

        addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionMaster());
View Full Code Here

Examples of org.jboss.seam.wiki.core.action.Pager

    public List<BlogEntry> getBlogEntries(WikiPluginMacro macro) {
        BlogPreferences prefs = Preferences.instance().get(BlogPreferences.class, macro);

        if (pager == null) {
            log.debug("creating new pager with page size from macro preferences: " + prefs.getPageSize());
            pager = new Pager(prefs.getPageSize());
            pager.setPage(page);
        }

        if (blogEntries == null || !pager.getPageSize().equals(prefs.getPageSize())) {
            log.debug("blog entries list is null or pager is outdated, loading blog entries");
View Full Code Here

Examples of org.jboss.seam.wiki.core.action.Pager

        BlogPreferences prefs = Preferences.instance().get(BlogPreferences.class);
        List<BlogEntry> recentBlogEntriesNonAggregated =
            blogDAO.findBlogEntriesInDirectory(
                    currentDirectory,
                    currentDocument,
                    new Pager(prefs.getRecentEntriesItems()),
                    null, null, null,
                    null, false
            );

        // Now aggregate by day
View Full Code Here

Examples of org.jboss.seam.wiki.core.action.Pager

    @In("#{preferences.get('Forum')}")
    ForumPreferences forumPrefs;

    @RequestParameter
    public void setPage(Integer page) {
        if (pager == null) pager = new Pager(forumPrefs.getTopicsPerPage());
        pager.setPage(page);
        Contexts.getSessionContext().set(TOPIC_PAGE, page);
    }
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.