« lib/EWS/Calendar/Viewer/Controller/Calendar.pm
↑ Summary
lib/EWS/Calendar/Viewer/Controller/Root.pm »
| 1 | package EWS::Calendar::Viewer; | ||
| 2 | BEGIN { | ||
| 3 | $EWS::Calendar::Viewer::VERSION = '1.111982'; | ||
| 4 | } | ||
| 5 | |||
| 6 | use strict; | ||
| 7 | use warnings FATAL => 'all'; | ||
| 8 | |||
| 9 | use File::ShareDir (); | ||
| 10 | use Try::Tiny; | ||
| 11 | use MRO::Compat; | ||
| 12 | use Catalyst qw/ | ||
| 13 | ConfigLoader | ||
| 14 | Static::Simple | ||
| 15 | /; | ||
| 16 | |||
| 17 | # skip s3krits from dumped data | ||
| 18 | sub dump_these { | ||
| 19 | my $c = shift; | ||
| 20 | my @variables = $c->next::method(@_); | ||
| 21 | return grep { $_->[0] !~ m/^(?:Config|Stash)$/ } @variables; | ||
| 22 | } | ||
| 23 | |||
| 24 | __PACKAGE__->config({ | ||
| 25 | name => 'EWS::Calendar::Viewer', | ||
| 26 | static => { | ||
| 27 | include_path => [ | ||
| 28 | try { | ||
| 29 | File::ShareDir::dist_dir('EWS-Calendar-Viewer') | ||
| 30 | } catch { | ||
| 31 | './share' | ||
| 32 | } | ||
| 33 | ], | ||
| 34 | }, | ||
| 35 | }); | ||
| 36 | |||
| 37 | __PACKAGE__->setup; | ||
| 38 | |||
| 39 | 1; | ||
| 40 | |||
| 41 | |||
| 42 | =pod | ||
| 43 | |||
| 44 | =head1 NAME | ||
| 45 | |||
| 46 | EWS::Calendar::Viewer - View Your MS Exchange Calendar as a Standalone Web App | ||
| 47 | |||
| 48 | =head1 VERSION | ||
| 49 | |||
| 50 | version 1.111982 | ||
| 51 | |||
| 52 | =head1 SYNOPSIS | ||
| 53 | |||
| 54 | I recommend you use something like L<App::BundleDeps> to deploy this under a | ||
| 55 | fastcgi server environment. Configure the application like so: | ||
| 56 | |||
| 57 | privacy_level = limited | ||
| 58 | start_of_week = 1 | ||
| 59 | |||
| 60 | <Model::EWSClient> | ||
| 61 | <args> | ||
| 62 | server = myserver.example.com | ||
| 63 | username = oliver | ||
| 64 | password = s3kr1t # or in EWS_PASS environment variable | ||
| 65 | </args> | ||
| 66 | </Model::EWSClient> | ||
| 67 | |||
| 68 | And then start the Catalyst application, perhaps using one of the bundled | ||
| 69 | server scripts. | ||
| 70 | |||
| 71 | =head1 CONFIGURATION | ||
| 72 | |||
| 73 | =head2 privacy_level | ||
| 74 | |||
| 75 | This can be set to C<public> to show only your free/busy status, C<limited> to | ||
| 76 | show the title of the event as well, or C<private> to show all details of the | ||
| 77 | event in a tooltip. | ||
| 78 | |||
| 79 | =head2 start_of_week | ||
| 80 | |||
| 81 | Set this to a number from 0 to 6 representing Sunday through to Saturday | ||
| 82 | respectively. | ||
| 83 | |||
| 84 | =head2 EWS Client | ||
| 85 | |||
| 86 | You'll need to set the server fully qualified domain name, and username for | ||
| 87 | the calendar's account. The password can be set in the file using the | ||
| 88 | C<password> option or via the environment variable C<EWS_PASS>. | ||
| 89 | |||
| 90 | If the Exchange server uses NTLM Negotiated Auth then also pass the following: | ||
| 91 | |||
| 92 | <Model::EWSClient> | ||
| 93 | <args> | ||
| 94 | use_negotiated_auth = 1 | ||
| 95 | </args> | ||
| 96 | </Model::EWSClient> | ||
| 97 | |||
| 98 | Obviously, this setting is in addition to the other C<args> mentioned above. | ||
| 99 | If you're unsure whether NTLM is required, try it without and if you get an | ||
| 100 | C<Error: Unauthorised> response then you probably need the setting. | ||
| 101 | |||
| 102 | =head1 QUICK START SCRIPT | ||
| 103 | |||
| 104 | This application brings with it a lightweight web server environment, so you | ||
| 105 | can get up and running quickly. First, install the module and its | ||
| 106 | dependencies. | ||
| 107 | |||
| 108 | Then create a configuration file as in the L</SYNOPSIS> section, above, and | ||
| 109 | save it in your current directory as C<ews_calendar_viewer_local.conf>. | ||
| 110 | Finally, run the C<ews_calendar_viewer_server.pl> script. It listens on port | ||
| 111 | 3000 by default but you can change that (see C<--help>): | ||
| 112 | |||
| 113 | $> EWS_PASS=s3kr1t ews_calendar_viewer_server.pl | ||
| 114 | [info] EWS::Calendar::Viewer powered by Catalyst 5.80032 | ||
| 115 | You can connect to your server at http://localhost:3000 | ||
| 116 | |||
| 117 | =head1 AUTHOR | ||
| 118 | |||
| 119 | Oliver Gorwits <oliver@cpan.org> | ||
| 120 | |||
| 121 | =head1 COPYRIGHT AND LICENSE | ||
| 122 | |||
| 123 | This software is copyright (c) 2011 by Oliver Gorwits. | ||
| 124 | |||
| 125 | This is free software; you can redistribute it and/or modify it under | ||
| 126 | the same terms as the Perl 5 programming language system itself. | ||
| 127 | |||
| 128 | =cut | ||
| 129 | |||
| 130 | |||
| 131 | __END__ |