Google Groups

Re: [Lift] How Do I Serve PDF Files in a Lift Application


Neil Visnapuu Apr 30, 2012 2:27 PM
Posted in group: Lift
Thanks!  I am literally getting Lift into some of the largest
investment houses, via a compliance framework, and it's going great,
but for their absolute insistence on having all data that resides in a
nice, meaningful database, splattered on timestamped PDFs!

On Mon, Apr 30, 2012 at 4:57 PM, David Pollak
<feeder.of...@gmail.com> wrote:
> Please see Lift's RestHelper and Scala's pattern matching and guards:
>
> object MyPdfServer extends RestHelper {
>   serve {
>     case "api" :: "pdf" Get _ if canServePdf => LiftResponse(...)
>   }
> }
>
> The logic in canServePdf computes if it's legal to serve the PDF file.  For
> more info, please
> see http://simply.liftweb.net/index-5.3.html#toc-Section-5.3
>
>
> On Mon, Apr 30, 2012 at 10:08 AM, Neil Visnapuu <neil.v...@gmail.com>
> wrote:
>>
>>
>> Hi - I'm looking for some guidance as to how one might incorporate PDF
>> files in a lift stack.  I know you can just link to a PDF, but what I'd like
>> to do is serve / not serve the PDF based on similar logic as to how I serve
>> HTML pages.  For example, if I want a subset of users to have access to a
>> view, I can define that subset via query in Boot, define a function that
>> determines if the current users is in that group, and attach that function
>> to the Loc / Menu.
>>
>> Can I do the same thing for a PDF, or XLS, or Word document?
>>
>> --
>> Lift, the simply functional web framework: http://liftweb.net
>> Code: http://github.com/lift
>> Discussion: http://groups.google.com/group/liftweb
>> Stuck? Help us help you:
>> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>
>
>
> --
> Visi.Pro, Cloud Computing for the Rest of Us http://visi.pro
> Lift, the simply functional web framework http://liftweb.net
> Follow me: http://twitter.com/dpp
> Blog: http://goodstuff.im
>
>
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code