| 1 | # ************************************************************************* | ||
| 2 | # Copyright (c) 2014-2017, SUSE LLC | ||
| 3 | # | ||
| 4 | # All rights reserved. | ||
| 5 | # | ||
| 6 | # Redistribution and use in source and binary forms, with or without | ||
| 7 | # modification, are permitted provided that the following conditions are met: | ||
| 8 | # | ||
| 9 | # 1. Redistributions of source code must retain the above copyright notice, | ||
| 10 | # this list of conditions and the following disclaimer. | ||
| 11 | # | ||
| 12 | # 2. Redistributions in binary form must reproduce the above copyright | ||
| 13 | # notice, this list of conditions and the following disclaimer in the | ||
| 14 | # documentation and/or other materials provided with the distribution. | ||
| 15 | # | ||
| 16 | # 3. Neither the name of SUSE LLC nor the names of its contributors may be | ||
| 17 | # used to endorse or promote products derived from this software without | ||
| 18 | # specific prior written permission. | ||
| 19 | # | ||
| 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
| 24 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 25 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 26 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| 28 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 29 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| 30 | # POSSIBILITY OF SUCH DAMAGE. | ||
| 31 | # ************************************************************************* | ||
| 32 | |||
| 33 | # Component_Config.pm - component-related configuration defaults | ||
| 34 | |||
| 35 | |||
| 36 | # DOCHAZKA_COMPONENT_DEFINITIONS | ||
| 37 | # Initial set of component definitions - sample only - can be overridden | ||
| 38 | 41 | set( 'DOCHAZKA_COMPONENT_DEFINITIONS', [ | |
| 39 | { | ||
| 40 | path => 'sample/local_time.mc', | ||
| 41 | source => 'Hello! The local time is <% scalar(localtime) %>.', | ||
| 42 | acl => 'passerby', | ||
| 43 | }, | ||
| 44 | { | ||
| 45 | path => 'sample/site_param.mc', | ||
| 46 | source => <<'EOS', | ||
| 47 | <%class> | ||
| 48 | has 'param' => (isa => 'Str', required => 1); | ||
| 49 | use Data::Dumper; | ||
| 50 | </%class> | ||
| 51 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | ||
| 52 | "http://www.w3.org/TR/html4/strict.dtd"> | ||
| 53 | <html lang="en"> | ||
| 54 | <head> | ||
| 55 | <meta http-equiv="content-type" content="text/html; charset=utf-8"> | ||
| 56 | <title>Dochazka Site Param</title> | ||
| 57 | </head> | ||
| 58 | <body> | ||
| 59 | <pre> | ||
| 60 | $site_param_name = '<% $.param %>'; | ||
| 61 | <% Data::Dumper->Dump( [ $site->get($.param) ], [ 'site_param_value' ] ) %> | ||
| 62 | </pre> | ||
| 63 | </body> | ||
| 64 | </html> | ||
| 65 | EOS | ||
| 66 | acl => 'admin', | ||
| 67 | validations => q/{ 'param' => { 'type' => SCALAR } }/, | ||
| 68 | }, | ||
| 69 | { | ||
| 70 | path => 'suse-cz-monthly.mc', | ||
| 71 | source => <<'EOS', | ||
| 72 | <%class> | ||
| 73 | has 'employee' => (isa => 'HashRef', required => 1); | ||
| 74 | has 'tsrange' => (isa => 'Str', required => 1); | ||
| 75 | use Data::Dumper; | ||
| 76 | </%class> | ||
| 77 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | ||
| 78 | "http://www.w3.org/TR/html4/strict.dtd"> | ||
| 79 | <html lang="en"> | ||
| 80 | <head> | ||
| 81 | <meta http-equiv="content-type" content="text/html; charset=utf-8"> | ||
| 82 | <title>Dochazka Monthly Report</title> | ||
| 83 | </head> | ||
| 84 | <body> | ||
| 85 | <pre> | ||
| 86 | <% Data::Dumper->Dump( [ $.employee ], [ 'employee' ] ) %> | ||
| 87 | $tsrange = '<% $.tsrange %>'; | ||
| 88 | </pre> | ||
| 89 | </body> | ||
| 90 | </html> | ||
| 91 | EOS | ||
| 92 | acl => 'active', | ||
| 93 | validations => q/ | ||
| 94 | { | ||
| 95 | employee => { type => HASHREF }, | ||
| 96 | tsrange => { type => SCALAR }, | ||
| 97 | } | ||
| 98 | /, | ||
| 99 | }, | ||
| 100 | # { | ||
| 101 | # path => '', | ||
| 102 | # source => '', | ||
| 103 | # acl => 'passerby', | ||
| 104 | # }, | ||
| 105 | ] ); | ||
| 106 | |||
| 107 | |||
| 108 | # ----------------------------------- | ||
| 109 | # DO NOT EDIT ANYTHING BELOW THIS LINE | ||
| 110 | # ----------------------------------- | ||
| 111 | 41 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 112 | 41 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 113 | |||
| 114 | 41 | 1; | |