Changeset 31617 for main/trunk/greenstone2
- Timestamp:
- 2017-04-20T20:31:54+12:00 (7 years ago)
- Location:
- main/trunk/greenstone2/perllib/cgiactions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm
r31602 r31617 35 35 use JSON; 36 36 37 # This class is conditionally expanded with set-metadata, remove-metadata and insert-metadata subroutines 38 # defined in modmetadataaction.pm. The BEGIN code block determines whether the condition holds. 39 # See 37 40 # http://stackoverflow.com/questions/3998619/what-is-the-role-of-the-begin-block-in-perl 38 41 # http://www.perlmonks.org/?node_id=881761 - splitting module into multiple files … … 52 55 53 56 if(!defined $ENV{'GSDL3HOME'} || (defined $ENV{'GS3_AUTHENTICATED'} && $ENV{'GS3_AUTHENTICATED'} eq "true")) { 54 print STDERR "\nIncluding modmeta...\n";55 57 require modmetadataaction; 56 58 } … … 58 60 $modmeta_action_table = {}; 59 61 } 60 print STDERR "End of metadata::BEGIN\n\n";61 62 } 62 63 … … 95 96 }; 96 97 97 print STDERR "\nMODMETA_TABLE 2: " .join(",", keys $metadataaction::modmeta_action_table) ."\n"; 98 99 100 # merge the hashes - http://www.perlmonks.org/?node_id=52445698 # To get the final action_table of all available subroutines in this class, 99 # merge the get- and mod-metadata hashes. See http://www.perlmonks.org/?node_id=524456 100 # Note that modmeta_action_table will be empty of subroutines if the user does not have permissions 101 # to modify metadata. 101 102 my $action_table = { %$getmeta_action_table, %$modmeta_action_table }; 102 103 -
main/trunk/greenstone2/perllib/cgiactions/modmetadataaction.pm
r31602 r31617 32 32 # and how variables declared with 'our' are used there. 33 33 34 # http://stackoverflow.com/questions/3998619/what-is-the-role-of-the-begin-block-in-perl35 # http://www.perlmonks.org/?node_id=881761 - splitting module into multiple files36 # http://www.perlmonks.org/?node_id=524456 - merging hashes37 38 34 package metadataaction; 39 35 … … 46 42 47 43 use JSON; 48 49 50 BEGIN {51 print STDERR "In ModMeta\n";52 }53 44 54 45 … … 134 125 'optional-args' => [ ] } 135 126 }; 136 137 print STDERR "\nMODMETA_TABLE: " .join(",", keys $metadataaction::modmeta_action_table) ."\n";138 127 139 128 … … 2670 2659 2671 2660 # not returning 1; here since this file is conditionally included by metadataction.pm 2661 # and not otherwise meant to be used on its own 2662
Note:
See TracChangeset
for help on using the changeset viewer.