34 |
'debug' => \$Opt{debug}, |
'debug' => \$Opt{debug}, |
35 |
'dis-file-suffix=s' => \$Opt{dis_suffix}, |
'dis-file-suffix=s' => \$Opt{dis_suffix}, |
36 |
'daem-file-suffix=s' => \$Opt{daem_suffix}, |
'daem-file-suffix=s' => \$Opt{daem_suffix}, |
37 |
|
'dafs-file-suffix=s' => \$Opt{dafs_suffix}, |
38 |
'dafx-file-suffix=s' => \$Opt{dafx_suffix}, |
'dafx-file-suffix=s' => \$Opt{dafx_suffix}, |
39 |
'help' => \$Opt{help}, |
'help' => \$Opt{help}, |
40 |
'search-path|I=s' => sub { |
'search-path|I=s' => sub { |
83 |
$Opt{dis_suffix} = '.dis' unless defined $Opt{dis_suffix}; |
$Opt{dis_suffix} = '.dis' unless defined $Opt{dis_suffix}; |
84 |
$Opt{daem_suffix} = '.dafm' unless defined $Opt{daem_suffix}; |
$Opt{daem_suffix} = '.dafm' unless defined $Opt{daem_suffix}; |
85 |
$Opt{dafx_suffix} = '.dafx' unless defined $Opt{dafx_suffix}; |
$Opt{dafx_suffix} = '.dafx' unless defined $Opt{dafx_suffix}; |
86 |
|
$Opt{dafs_suffix} = '.dafs' unless defined $Opt{dafs_suffix}; |
87 |
$Message::DOM::DOMFeature::DEBUG = 1 if $Opt{debug}; |
$Message::DOM::DOMFeature::DEBUG = 1 if $Opt{debug}; |
88 |
require Error; |
require Error; |
89 |
$Error::Debug = 1 if $Opt{debug}; |
$Error::Debug = 1 if $Opt{debug}; |
297 |
status_msg_ qq<Generating Perl module from <$mod_uri> for <$mod_for>...>; |
status_msg_ qq<Generating Perl module from <$mod_uri> for <$mod_for>...>; |
298 |
local $Message::Util::DIS::Perl::Implementation |
local $Message::Util::DIS::Perl::Implementation |
299 |
= $impl->get_feature (ExpandedURI q<Util:PerlCode> => '1.0'); |
= $impl->get_feature (ExpandedURI q<Util:PerlCode> => '1.0'); |
300 |
my $pl = $mod->pl_generate_perl_module_file; |
my $pl = $mod->pl_generate_perl_module_file |
301 |
|
($impl->get_feature (ExpandedURI q<Util:PerlCode> => '1.0')); |
302 |
status_msg qq<done>; |
status_msg qq<done>; |
303 |
|
|
304 |
my $output; |
my $output; |
545 |
my ($db, $mod, $type) = @_; |
my ($db, $mod, $type) = @_; |
546 |
my $ns = $mod->namespace_uri; |
my $ns = $mod->namespace_uri; |
547 |
my $ln = $mod->local_name; |
my $ln = $mod->local_name; |
548 |
my $suffix = $type eq ExpandedURI q<dp:ModuleIndexFile> |
my $suffix = { |
549 |
? $Opt{dafx_suffix} : $Opt{daem_suffix}; |
ExpandedURI q<dp:ModuleIndexFile> => $Opt{dafx_suffix}, |
550 |
|
ExpandedURI q<dp:ModuleResourceFile> => $Opt{daem_suffix}, |
551 |
|
ExpandedURI q<dp:ModuleNodeStorageFile> => $Opt{dafs_suffix}, |
552 |
|
}->{$type} or die "Unsupported type: <$type>"; |
553 |
verbose_msg qq<Database module <$ns$ln> is requested>; |
verbose_msg qq<Database module <$ns$ln> is requested>; |
554 |
my $name = dac_search_file_path_stem ($ns, $ln, $suffix); |
my $name = dac_search_file_path_stem ($ns, $ln, $suffix); |
555 |
if (defined $name) { |
if (defined $name) { |
596 |
my $mod = shift; |
my $mod = shift; |
597 |
my $pc = $impl->get_feature (ExpandedURI q<Util:PerlCode> => '1.0'); |
my $pc = $impl->get_feature (ExpandedURI q<Util:PerlCode> => '1.0'); |
598 |
local $Message::Util::DIS::Perl::Implementation = $pc; |
local $Message::Util::DIS::Perl::Implementation = $pc; |
599 |
my $pl = $pc->create_perl_file; |
my $pl = $pc->create_pc_file; |
600 |
|
my $factory = $pl->owner_document; |
601 |
my $pack = $pl->get_last_package ("Manakai::Test", make_new_package => 1); |
my $pack = $pl->get_last_package ("Manakai::Test", make_new_package => 1); |
602 |
$pack->add_use_perl_module_name ("Message::Util::DIS::Test"); |
$pack->add_use_perl_module_name ("Message::Util::DIS::Test"); |
603 |
$pack->add_use_perl_module_name ("Message::Util::Error"); |
$pack->add_use_perl_module_name ("Message::Util::Error"); |
658 |
|
|
659 |
$pack->append_code ('try {'); |
$pack->append_code ('try {'); |
660 |
|
|
661 |
my $test_pc = $res->pl_code_fragment; |
my $test_pc = $res->pl_code_fragment ($factory); |
662 |
if (not defined $test_pc) { |
if (not defined $test_pc) { |
663 |
die "Perl test code not defined for <".$res->uri.">"; |
die "Perl test code not defined for <".$res->uri.">"; |
664 |
} |
} |
734 |
$_->append_new_pc_literal (\@test); |
$_->append_new_pc_literal (\@test); |
735 |
} |
} |
736 |
|
|
737 |
my $plc = $res->pl_code_fragment; |
my $plc = $res->pl_code_fragment ($factory); |
738 |
unless ($plc) { |
unless ($plc) { |
739 |
die "Resource <".$res->uri."> does not have Perl test code"; |
die "Resource <".$res->uri."> does not have Perl test code"; |
740 |
} |
} |