App::Dochazka::REST - Dochazka REST server
Version 0.559
Alpha.
Start the server with default settings:
$ dochazka-rest
Point browser to:
http://localhost:5000/
Use App::Dochazka::CLI command-line interface to access full functionality:
$ dochazka-cli
This distribution, App::Dochazka::REST, including all the modules in lib/, the scripts in bin/, and the configuration files in config/, constitutes the REST server (API) component of Dochazka, the open-source Attendance/Time Tracking (ATT) system.
lib/
bin/
config/
Dochazka as a whole aims to be a convenient, open-source ATT solution.
Dochazka consists of four main components:
Dochazka clients
REST server (this module)
PostgreSQL database
Data model
In a nutshell, clients attempt to translate user intent into REST API calls, which are transmitted over a network (using the HTTP protocol) to the server. The server processes incoming HTTP requests. Requests for valid REST resources are passed to the API for processing and errors are generated for invalid requests. The result is returned to the client in an HTTP response. The REST API uses the PostgreSQL server to save state. The clients and the REST API use the data model to represent and manipulate objects.
App::Dochazka::REST::Guide
A detailed guide to the REST server.
App::Dochazka::REST::Docs::Resources
Dochazka REST API documentation.
App::Dochazka::Common
Dochazka data model and other bits used by all Dochazka components.
App::Dochazka::CLI and App::Dochazka::CLI::Guide
Reference Dochazka command-line client.
App::Dochazka::WWW
Reference Dochazka WWW client.
Takes a DBIx::Connector object and an array of SQL statements. Runs them one by one until an exception is thrown or the last statement completes successfully. Returns a status object which will be either OK or ERR. If NOT_OK, the error text will be in $status->text.
$status->text
Create the audit triggers. Wrapper for _do_audit_triggers
Delete the audit triggers. Wrapper for _do_audit_triggers
Wipe out and re-create the Mason state directory. Returns status object. Upon success, level will be 'OK' and payload will contain the full path to the Mason component root.
Create the activities defined in the site parameter DOCHAZKA_ACTIVITY_DEFINITIONS
Drop and re-create a Dochazka database. Takes superuser credentials as arguments.
Be very, _very_, _VERY_ careful with this function.
Obtain the EIDs of a list of employee nicks. Returns a reference to a hash where the keys are the nicks and the values are the corresponding EIDs.
NOTE 1: This routine expects to receive a DBIx::Connector object as its first argument. It does not use the $dbix_conn singleton.
$dbix_conn
NOTE 2: The nicks are expected to exist and no provision (other than logging a DOCHAZKA_DBI_ERR) is made for their non-existence.
Accessor method (to be called like a constructor) providing access to $VERSION variable
$VERSION
For scripts that need to manipulate the database directly (i.e. via the data model).
In Dochazka, some commonly-used terms have special meanings:
employee -- Regardless of whether they are employees in reality, for the purposes of Dochazka employees are the folks whose attendance/time is being tracked. Employees are expected to interact with Dochazka using the following functions and commands.
administrator -- In Dochazka, administrators are employees with special powers. Certain REST/CLI functions are available only to administrators.
CLI client -- CLI stands for Command-Line Interface. The CLI client is the Perl script that is run when an employee types dochazka at the bash prompt.
dochazka
REST server -- REST stands for ... . The REST server is a collection of Perl modules running on a server at the site.
site -- In a general sense, the "site" is the company, organization, or place that has implemented (installed, configured) Dochazka for attendance/time tracking. In a technical sense, a site is a specific instance of the Dochazka REST server that CLI clients connect to.
Nathan Cutler, <ncutler@suse.cz>
<ncutler@suse.cz>
To report bugs or request features, use the GitHub issue tracker at https://github.com/smithfarm/dochazka-rest/issues.
The full documentation comes with the distro, and can be comfortably perused at metacpan.org:
https://metacpan.org/pod/App::Dochazka::REST
You can also read the documentation for individual modules using the perldoc command, e.g.:
perldoc App::Dochazka::REST perldoc App::Dochazka::REST::Model::Activity
Other resources:
GitHub issue tracker (report bugs here)
https://github.com/smithfarm/dochazka-rest
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/App-Dochazka-REST
Copyright (c) 2014-2015, SUSE LLC All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of SUSE LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install App::Dochazka::REST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Dochazka::REST
CPAN shell
perl -MCPAN -e shell install App::Dochazka::REST
For more information on module installation, please visit the detailed CPAN module installation guide.