#################### main pod documentation begin ################### =head1 NAME Zymonic::Manifest::superset - Superset manifest =head1 SYNOPSIS Describes what should be installed as part of the superset integration. =head1 DESCRIPTION Describes what should be installed as part of the superset integration. =head1 USAGE TODO =head1 BUGS NONE =head1 SUPPORT As in the license, Zymonic is provided without warranty or support unless purchased separately, however... If you email zymonic-support@zednax.com your issue will be noted and may receive a response. For security issues, please contact zymonic-security@zednax.com and someone will respond within 8 working hours. =head1 AUTHOR Alex Masidlover et al. CPAN ID: MODAUTHOR Zednax Limited alex.masidlover@zednax.com http://www.zednax.com =head1 COPYRIGHT This program is free software licensed under the... Zymonic Public License 1.0 The full text of the license can be found in the LICENSE file included with this module. Other licenses may be acceptable if including parts of Zymonic in larger projects, please contact Zednax for details. =head1 SEE ALSO Zymonic perl(1). =cut #################### main pod documentation end ################### package Zymonic::Manifest::superset; use strict; BEGIN { use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $Working_copy); $VERSION = '0.01'; $Working_copy = ''; @ISA = qw(Exporter); #Give a hoot don't pollute, do not export more than needed by default @EXPORT = qw(); @EXPORT_OK = qw(); %EXPORT_TAGS = (); } use Zymonic::Utils qw(get_array debug); use base "Zymonic::Manifest"; use Zymonic; use Exception::Class ( 'Zymonic::Exception::Manifest' => { isa => 'Zymonic::Exception', fields => ['module'], description => 'Manifest related exceptions' }, ); #################### subroutine header begin #################### =head2 get_contents Usage : @opts = $ManS->get_opts; Purpose : get contents for manifest Returns : options as an array of hash refs Argument : nothing Throws : nothing Comment : See Also : =cut #################### subroutine header end #################### #need to make a function in makefile.pl to record the files downloaded to be passed into a global variable in this file (se version setting) sub get_contents { my $self = shift; my $app_server = shift; #loads all the folders as specified into a hash # the hash here needs to load all the files in which need to be installed my %Manifest = ( perl_modules => { destination => '', files => ["$Working_copy/modules/ZymonicSuperset/"], post_install => [ sub { my $app_server = shift; $app_server->install_perl_module( "Zymonic Superset", "$Working_copy/modules/ZymonicSuperset/" ); } ] }, xml => { destination => '', files => ["$Working_copy/modules/ZymonicSuperset/xml/"], post_install => [ sub { my $app_server = shift; my @changed_files = $self->get_changed_files('xml'); $app_server->offer_config_build( "$Working_copy/modules/ZymonicSuperset/xml/", @changed_files ); } ] }, javascript => { destination => 'javascript', files => ["$Working_copy/modules/ZymonicSuperset/javascript/"], user => $self->{app_server}->{options}->{apache_user}, group => $self->{app_server}->{options}->{apache_group}, post_install => [] }, ); return %Manifest; } #################### subroutine header begin #################### =head2 working_copy Usage : $manifest_obj->working_copy(); Purpose : Returns the working copy directory for the manifest Returns : see purpose Argument : none Throws : Zymonic::Exception::Manifest::NoWorkingCopy Comment : STUB See Also : =cut #################### subroutine header end #################### sub working_copy { return $Working_copy; } #################### subroutine header begin #################### =head2 get_options Usage : $self->get_options($option_hash, $app_server_obj); Purpose : Adds options to the option hash and adds the definitions to the app server Returns : nothing Argument : hash of option key value pairs Throws : nothing Comment : will be called for each installed manifest See Also : Zymonic::Manifest::superset for an example. =cut #################### subroutine header end #################### sub get_options { my $self = shift; my $opts = shift; my $app_server = shift; my $option_definitions = { superset_sqlite => { 'ZName' => { 'content' => 'superset_sqlite' }, 'DisplayName' => { 'content' => 'Superset SQLite file' }, 'ShortDescription' => { 'content' => 'The path of the Superset SQLite file (usually [sqlite home]/.superset/superset.db' }, 'ExtraCharacters' => { 'content' => '/.-_' }, }, superset_bin => { 'ZName' => { 'content' => 'superset_bin' }, 'DisplayName' => { 'content' => 'Superset bin dir' }, 'ShortDescription' => { 'content' => 'The bin dir of superset (where superset_config.py resides)' }, 'ExtraCharacters' => { 'content' => '/.-_' }, }, superset_user => { 'ZName' => { 'content' => 'superset_user' }, 'DisplayName' => { 'content' => 'Superset user' }, 'ShortDescription' => { 'content' => 'The user that the superset server will run as.' }, 'ExtraCharacters' => { 'content' => '/.-_' }, }, superset_group => { 'ZName' => { 'content' => 'superset_group' }, 'DisplayName' => { 'content' => 'Superset group' }, 'ShortDescription' => { 'content' => 'The group that the superset server will run as.' }, 'ExtraCharacters' => { 'content' => '/.-_' }, }, superset_master_system => { 'ZName' => { 'content' => 'superset_master_system' }, 'DisplayName' => { 'content' => 'Superset master system' }, 'ShortDescription' => { 'content' => 'The system of which the superusers are also Admin users of Superset' }, 'ExtraCharacters' => { 'content' => '.-_' }, }, superset_ssl_key => { 'ZName' => { 'content' => 'superset_ssl_key' }, 'DisplayName' => { 'content' => 'Superset SSL key' }, 'ShortDescription' => { 'content' => 'The path of the Superset SSL key file' }, 'ExtraCharacters' => { 'content' => '/.-_' }, }, superset_ssl_cert => { 'ZName' => { 'content' => 'superset_ssl_cert' }, 'DisplayName' => { 'content' => 'Superset SSL cert' }, 'ShortDescription' => { 'content' => 'The path of the Superset SSL certificate file' }, 'ExtraCharacters' => { 'content' => '/.-_' }, }, superset_ip => { 'ZName' => { 'content' => 'superset_ip' }, 'DisplayName' => { 'content' => 'Superset ip address' }, 'ShortDescription' => { 'content' => 'The IP address superset will listen on' }, 'DefaultValue' => { content => '0.0.0.0' }, 'ExtraCharacters' => { 'content' => '.' }, }, superset_host => { 'ZName' => { 'content' => 'superset_host' }, 'DisplayName' => { 'content' => 'Superset hostname' }, 'ShortDescription' => { 'content' => 'The hostname users will use to connect to Superset' }, 'DefaultValue' => { content => '0.0.0.0' }, 'ExtraCharacters' => { 'content' => '.' }, }, superset_port => { 'ZName' => { 'content' => 'superset_port' }, 'DisplayName' => { 'content' => 'Superset port' }, 'ShortDescription' => { 'content' => 'The port on which superset will listen' }, 'DefaultValue' => { content => '8088' }, 'ExtraCharacters' => { 'content' => '' }, }, superset_proxy_path => { 'ZName' => { 'content' => 'superset_proxy_path' }, 'DisplayName' => { 'content' => 'Superset proxy path' }, 'ShortDescription' => { 'content' => 'The proxy path being used in apache (with no slashes) e.g. "analytics" - currently not fully implemented in Superset (avoid using)' }, 'DefaultValue' => { content => '' }, 'ExtraCharacters' => { 'content' => '' }, }, superset_log => { 'ZName' => { 'content' => 'superset_log' }, 'DisplayName' => { 'content' => 'Superset log directory' }, 'ShortDescription' => { 'content' => 'The superset log file - will be rotated daily' }, 'DefaultValue' => { content => '/var/log/superset/' }, 'ExtraCharacters' => { 'content' => '/.-_' }, }, }; foreach my $opt ( keys( %{$option_definitions} ) ) { $opts->{$opt} = '' unless $opts->{$opt}; } $app_server->add_option_definitions($option_definitions); } 1;