diff --git a/Targets/Nfsshare-Custom.pm b/Targets/Nfsshare-Custom.pm index 5ff90d7..c250937 100644 --- a/Targets/Nfsshare-Custom.pm +++ b/Targets/Nfsshare-Custom.pm @@ -2,7 +2,7 @@ # Routines to be editted by the developer to provide validation for parameters # and provison of the control data for table(s) # -# Generated by SME2Gen version:0.6 Chameleon version:4.5.4 On Python:3.10.12 at 2024-04-27 10:35 +# Generated by SME2Gen version:0.7 Chameleon version:4.5.4 On Python:3.10.12 at 2024-05-06 08:40 # use esmith::util; @@ -23,14 +23,16 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); # Validation routines - parameters for each panel sub validate_PARAMS { - $prefix_data = shift; #Data hash as parameter - $ret = 'ok'; + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; return $ret; } sub validate_TABLE { - $prefix_data = shift; #Data hash as parameter - $ret = 'ok'; + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; return $ret; } @@ -39,7 +41,7 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); sub get_ibays { my $c = shift; - my @res; + my @ret = {}; my @ibays = $adb->ibays(); foreach my $i (@ibays){ # Taken pretty well verbatim from /usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/nfsshare.pm @@ -59,7 +61,7 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); my $actionModify = ' '; if ($modifiable eq 'yes'){ - $actionModify .= ""." " + $actionModify .= ""." " } my %hash = ('Name'=> $ibayname, @@ -67,22 +69,27 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); 'Flag' => $ibaynfs, 'Modify' => $actionModify ); - push(@res,\%hash); + push(@ret,\%hash); } - return \@res + return \@ret } + # Return hash with values from row in which link clicked on table - sub validate_get_selected_PARAMS { - $selected = shift; #Parameter is name of selected row. - %ret = {}; + sub get_selected_PARAMS { + my $c = shift; + my $selected = shift; #Parameter is name of selected row. + my $is_new_record = shift; #Indicates new record required (defaults) + my %ret = {}; return $ret; } - sub validate_get_selected_TABLE { - $selected = shift; #Parameter is name of selected row. - %ret = {}; + sub get_selected_TABLE { + my $c = shift; + my $selected = shift; #Parameter is name of selected row. + my $is_new_record = shift; #Indicates new record required (defaults) + my %ret = {}; return $ret; } @@ -90,18 +97,27 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); #after sucessful modify or create or whatever and submit then perfom (if the params validate) sub perform_PARAMS { - $prefix_data = shift; #Data hash as parameter - $ret = 'ok'; + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; return $ret; } sub perform_TABLE { - $prefix_data = shift; #Data hash as parameter - $ret = 'ok'; + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; return $ret; } +sub create_link{ + # WIP + my ($c,$route, $panel, $index) = shift; + my $link = "$route?trt=$panel&Selected=$index"; + return $link; +} + 1; diff --git a/Targets/Nfsshare-Custom.pm.new b/Targets/Nfsshare-Custom.pm.new index 11c228c..1293875 100644 --- a/Targets/Nfsshare-Custom.pm.new +++ b/Targets/Nfsshare-Custom.pm.new @@ -2,7 +2,7 @@ # Routines to be editted by the developer to provide validation for parameters # and provison of the control data for table(s) # -# Generated by SME2Gen version:0.6 Chameleon version:4.5.4 On Python:3.10.12 at 2024-05-05 09:26 +# Generated by SME2Gen version:0.7 Chameleon version:4.5.4 On Python:3.10.12 at 2024-05-06 10:02 # use esmith::util; @@ -23,14 +23,16 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); # Validation routines - parameters for each panel sub validate_PARAMS { - $prefix_data = shift; #Data hash as parameter - $ret = 'ok'; + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; return $ret; } sub validate_TABLE { - $prefix_data = shift; #Data hash as parameter - $ret = 'ok'; + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; return $ret; } @@ -39,22 +41,26 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); sub get_ibays { my $c = shift; - @ret = {} + my @ret = {}; return \@ret } # Return hash with values from row in which link clicked on table - sub validate_get_selected_PARAMS { - $selected = shift; #Parameter is name of selected row. - %ret = {}; + sub get_selected_PARAMS { + my $c = shift; + my $selected = shift; #Parameter is name of selected row. + my $is_new_record = shift; #Indicates new record required (defaults) + my %ret = {}; return $ret; } - sub validate_get_selected_TABLE { - $selected = shift; #Parameter is name of selected row. - %ret = {}; + sub get_selected_TABLE { + my $c = shift; + my $selected = shift; #Parameter is name of selected row. + my $is_new_record = shift; #Indicates new record required (defaults) + my %ret = {}; return $ret; } @@ -62,14 +68,16 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db"); #after sucessful modify or create or whatever and submit then perfom (if the params validate) sub perform_PARAMS { - $prefix_data = shift; #Data hash as parameter - $ret = 'ok'; + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; return $ret; } sub perform_TABLE { - $prefix_data = shift; #Data hash as parameter - $ret = 'ok'; + my $c = shift; + my $prefix_data = shift; #Data hash as parameter + my $ret = 'ok'; return $ret; } diff --git a/Targets/Nfsshare.html.ep b/Targets/Nfsshare.html.ep index 372925c..a7db0ba 100644 --- a/Targets/Nfsshare.html.ep +++ b/Targets/Nfsshare.html.ep @@ -1,6 +1,6 @@ % layout 'default', title => "Sme server 2 - NFS data share", share_dir => './'; %# -%# Generated by SME2Gen version:0.6 Chameleon version:4.5.4 On Python:3.10.12 at 2024-05-05 09:26 +%# Generated by SME2Gen version:0.7 Chameleon version:4.5.4 On Python:3.10.12 at 2024-05-06 10:02 %# % content_for 'module' => begin