WSClient no longer has to resort to trickery since we require perl 5.8

This commit is contained in:
JT Smith 2005-12-05 19:23:17 +00:00
parent cdbfdd8092
commit 18a13f0385
4 changed files with 15 additions and 40 deletions

View file

@ -1,6 +1,8 @@
6.8.1 6.8.1
- Upgraded TinyMCE to 2.0.1, which allows the rich editor to work with - Upgraded TinyMCE to 2.0.1, which allows the rich editor to work with
Firefox 1.5. Firefox 1.5.
- Now that we're requiring Perl 5.8, don't need to do the hackery for WS
Client to work any longer.
6.8.0 6.8.0
- Switched Date::Manip to DateTime for better performance and more - Switched Date::Manip to DateTime for better performance and more

View file

@ -7,6 +7,12 @@ upgrading from one version to the next, or even between multiple
versions. Be sure to heed the warnings contained herein as they will versions. Be sure to heed the warnings contained herein as they will
save you many hours of grief. save you many hours of grief.
6.8.0
--------------------------------------------------------------------
* Before upgrading you must install the following new Perl modules:
Data::Structure::Util
6.8.0 6.8.0
-------------------------------------------------------------------- --------------------------------------------------------------------
* Before upgrading you must install the following new Perl modules: * Before upgrading you must install the following new Perl modules:
@ -78,6 +84,8 @@ save you many hours of grief.
which will increase performance, and add to our functionality which will increase performance, and add to our functionality
for the future. for the future.
* WebGUI now requires Perl 5.8 to operate.
* The Macro API has been changed. If you have any third-party macros * The Macro API has been changed. If you have any third-party macros
installed make sure to update them prior to upgrading. See installed make sure to update them prior to upgrading. See
docs/migration.txt for details. docs/migration.txt for details.

View file

@ -1,6 +1,7 @@
package WebGUI::Asset::Wobject::WSClient; package WebGUI::Asset::Wobject::WSClient;
use strict; use strict;
use Data::Structure::Util;
use Data::Dumper; use Data::Dumper;
use Digest::MD5; use Digest::MD5;
use SOAP::Lite; use SOAP::Lite;
@ -15,30 +16,6 @@ use WebGUI::Privilege;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Asset::Wobject; use WebGUI::Asset::Wobject;
my ($hasUnblessAcme, $hasUnblessData, $hasUtf8, $utf8FieldType);
# we really would like to be able to unbless references and strip utf8 data,
# but that requires non-standard and possibly difficult to install modules
BEGIN {
# check for Data::Structure::Util, which requires perl 5.8.0 :-P
eval { require Data::Structure::Util; };
if ($@) {
$utf8FieldType = 'hidden';
# try Acme::Damn as partial fallback
eval { require Acme::Damn; };
$hasUnblessAcme = 1 if !$@;
} else {
$utf8FieldType = 'yesNo';
$hasUnblessData = 1;
$hasUtf8 = 1 if $] >= 5.008;
}
}
our @ISA = qw(WebGUI::Asset::Wobject); our @ISA = qw(WebGUI::Asset::Wobject);
@ -113,7 +90,7 @@ my $httpHeaderFieldType;
defaultValue => $session{'config'}{'soapuri'} defaultValue => $session{'config'}{'soapuri'}
}, },
decodeUtf8 => { decodeUtf8 => {
fieldType => $utf8FieldType, fieldType => "yesNo",
defaultValue => 0, defaultValue => 0,
}, },
httpHeader => { httpHeader => {
@ -214,20 +191,12 @@ sub getEditForm {
-hoverHelp => WebGUI::International::get('9 description', "Asset_WSClient"), -hoverHelp => WebGUI::International::get('9 description', "Asset_WSClient"),
-value => $self->get('debugMode'), -value => $self->get('debugMode'),
); );
if ($utf8FieldType eq 'yesNo') {
$tabform->getTab("properties")->yesNo ( $tabform->getTab("properties")->yesNo (
-name => 'decodeUtf8', -name => 'decodeUtf8',
-label => WebGUI::International::get(15, "Asset_WSClient"), -label => WebGUI::International::get(15, "Asset_WSClient"),
-hoverHelp => WebGUI::International::get('15 description', "Asset_WSClient"), -hoverHelp => WebGUI::International::get('15 description', "Asset_WSClient"),
-value => $self->get('decodeUtf8'), -value => $self->get('decodeUtf8'),
); );
} else {
$tabform->getTab("properties")->hidden (
-name => 'decodeUtf8',
-label => WebGUI::International::get(15, "Asset_WSClient"),
-value => $self->get('decodeUtf8'),
);
}
my $cacheopts = { my $cacheopts = {
0 => WebGUI::International::get(29, "Asset_WSClient"), 0 => WebGUI::International::get(29, "Asset_WSClient"),
1 => WebGUI::International::get(19, "Asset_WSClient"), 1 => WebGUI::International::get(19, "Asset_WSClient"),
@ -403,13 +372,8 @@ sub view {
} elsif (ref $return eq 'HASH') { } elsif (ref $return eq 'HASH') {
@result = $return; @result = $return;
# blessed object, to be stripped with Acme::Damn
} elsif ($hasUnblessAcme && ref $return) {
WebGUI::ErrorHandler::warn("Acme::Damn::unbless($return)");
@result = Acme::Damn::unbless($return);
# blessed object, to be stripped with Data::Structure::Util # blessed object, to be stripped with Data::Structure::Util
} elsif ($hasUnblessData && ref $return) { } elsif ( ref $return) {
WebGUI::ErrorHandler::warn("Data::Structure::Util::unbless($return)"); WebGUI::ErrorHandler::warn("Data::Structure::Util::unbless($return)");
@result = Data::Structure::Util::unbless($return); @result = Data::Structure::Util::unbless($return);
@ -442,7 +406,7 @@ sub view {
# Do we need to decode utf8 data? Will only decode if modules were # Do we need to decode utf8 data? Will only decode if modules were
# loaded and the wobject requests it # loaded and the wobject requests it
if ($self->{'decodeUtf8'} && $hasUtf8) { if ($self->{'decodeUtf8'}) {
if (Data::Structure::Util::has_utf8(\@result)) { if (Data::Structure::Util::has_utf8(\@result)) {
@result = @{Data::Structure::Util::utf8_off(\@result)}; @result = @{Data::Structure::Util::utf8_off(\@result)};
} }

View file

@ -77,6 +77,7 @@ checkModule("Finance::Quote",1.08);
#checkModule("POE",0.3202); #checkModule("POE",0.3202);
#checkModule("POE::Component::IKC::Server",0.18); #checkModule("POE::Component::IKC::Server",0.18);
#checkModule("POE::Component::JobQueue",0.5402); #checkModule("POE::Component::JobQueue",0.5402);
checkModule("Data::Structure::Util",0.11);
checkModule("Apache2::Request",2.06); checkModule("Apache2::Request",2.06);
################################### ###################################