Skip to content

pagination and preview #142

Open
Open

Description

@GtrPksRnt4eatin

Hey, Thanks for your help the other day,
I have an email box full of log files that are auto-sent daily as attachments.
I need to periodically check through the entire inbox and cross-reference the attachment file names with the data stored in the DB.

The problem that I have is that there does not seem to be a way to "peek" at items without downloading them entirely, and also there does not seem to be any pagination handling.

The peek function may be a limitation of the API, but i figured I'd ask because I was curious.

The pagination could be implemented though because when a request asks for too many items it sends a response with an error code and tells you to use pagination.
I have handled it for now by rescuing the exception and iterating through the mailbox by week until everything is downloaded

It would be amazing to have a peek method where i could retrieve the file names of the attachments before deciding if I wanted to download them..

No rush or pressure here, just trying to get my thoughts down and bounce ideas off the group..

Activity

  1. GtrPksRnt4eatin commented on Apr 22, 2014

    @GtrPksRnt4eatin
    Author

    sorry, i am looking through some of the other posts and realizing that the pagination issue is already under discussion, but any insight on peek would be welcome..

  2. matheustardivo commented on Sep 9, 2014

    @matheustardivo

    Hey guys,

    I don't know if you still looking for paging the folder items, but actually this is already supported by the current code, but this feature isn't so clear to figure out.

    Looking to the actual code and after take a look at the exchange EWS documentation for paging (here: http://msdn.microsoft.com/en-us/library/office/dn592093(v=exchg.150).aspx), here is how to add paging to folder items:

    inbox.messages(
         indexed_page_item_view: { 'MaxEntriesReturned' => 10,
                                   'Offset' => 0,
                                   'BasePoint' => 'End' })

    In my forked repo, I added a method to GenericFolder type to make this easier and also added instructions on the README.md. I'll create a PR with this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions