rewrote internationalization and help system

This commit is contained in:
JT Smith 2004-06-25 19:21:35 +00:00
parent e0d4792587
commit 7bb6ac31c1
57 changed files with 11072 additions and 731 deletions

View file

@ -18,15 +18,20 @@
benefits and detriments. This allows you to increase scalability and
performance at a cost of either memory or disk space or both. The gains
here are primarily enjoyed by large heavy traffic sites that use lots of
templates.
complex templates.
- Added convenience methods to Wobject superclass for internationalization,
wobject ID, and namespace.
- Added an object-oriented interface to the internationalization system. The
old procedural interface still works as well.
- Added on the wire compression to HTTP transport for WSClient wobject. This
will have no effect on clients/servers that can't support compression.
- A small patch from Roy Johnson to deal with different types of WSDLs in th
WS Client.
- A small patch from Roy Johnson to deal with different types of WSDLs in the
WSClient.
- Moved to a compiled internationalization and help system. At a cost of 3
megabytes of RAM, it provides a boost in performance of over 35%. More
importantly though, it cuts the number of database queries in half on an
average page, which leads to much greater scalability. See
docs/migration.txt for API changes.
- Added the ability to select session v. global caches to WSClient.

View file

@ -16,6 +16,19 @@ save you many hours of grief.
* See docs/migration.txt for changes in the template system.
* See docs/migration.txt for changes in the Internationalization
and help systems.
* If you're using any third-party plug-ins, you'll need to get
updated versions to work with 6.1.
* If you're using a language other than English on your current site,
you'll need to obtain a language pack from either the user
contributions or one of the WebGUI Worldwide sites.
* Each user's language has been reset to the default language for
the site as specified in the profile settings.
6.0.2
--------------------------------------------------------------------

View file

@ -125,4 +125,19 @@ In 6.1 we completely rewrote the underlying template framework to add template
caching. Any plug-ins that use WebGUI::Template, must be updated to reflect
the new API.
5.7 Internationalization and Help Change
In 6.1 we moved the internationalization out of the database and into compiled
perl modules. This helps tremendously in performance. It also allows for
text-based tags to be used instead of integers for international ids. If
you've written any plug-ins that use the internationalization system, you'll
need to migrate them to the new system. We've created a tool that will
auto-generate the new help and internationalization files from an existing 6.0
database. You can get it from the "tools" module in CVS or in the user
contributions area on plainblack.com. The utility is called:
gen61i18nfrom60data.pl
We also made the International API object oriented. The old procedural version
is still intact as well. See WebGUI::International for API changes.

View file

@ -0,0 +1,77 @@
#!/usr/bin/perl
use lib "../../lib";
use Getopt::Long;
use Parse::PlainConfig;
use strict;
use WebGUI::Session;
use WebGUI::SQL;
my $configFile;
my $quiet;
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
#--------------------------------------------
print "\tRemoving unneeded files and directories.\n" unless ($quiet);
unlink("../../lib/WebGUI/Operation/International.pm");
unlink("../../lib/WebGUI/Wobject/Item.pm");
unlink("../../lib/WebGUI/Wobject/LinkList.pm");
unlink("../../lib/WebGUI/Wobject/FAQ.pm");
unlink("../../lib/WebGUI/Wobject/ExtraColumn.pm");
unlink("../../lib/WebGUI/Macro/m_currentMenuHorizontal.pm");
unlink("../../lib/WebGUI/Macro/M_currentMenuVertical.pm");
unlink("../../lib/WebGUI/Macro/s_specificMenuHorizontal.pm");
unlink("../../lib/WebGUI/Macro/S_specificMenuVertical.pm");
unlink("../../lib/WebGUI/Macro/t_topMenuHorizontal.pm");
unlink("../../lib/WebGUI/Macro/T_topMenuVertical.pm");
unlink("../../lib/WebGUI/Macro/p_previousMenuHorizontal.pm");
unlink("../../lib/WebGUI/Macro/P_previousMenuVertical.pm");
unlink("../../lib/WebGUI/Macro/C_crumbTrail.pm");
unlink("../../lib/WebGUI/Macro/FlexMenu.pm");
unlink("../../lib/WebGUI/Macro/PreviousDropMenu.pm");
unlink("../../lib/WebGUI/Macro/Synopsis.pm");
unlink("../../lib/WebGUI/Macro/rootmenuHorizontal.pm");
unlink("../../lib/WebGUI/Macro/RootTab.pm");
unlink("../../lib/WebGUI/Macro/SpecificDropMenu.pm");
unlink("../../lib/WebGUI/Macro/TopDropMenu.pm");
unlink("../../lib/WebGUI/Macro/Question_search.pm");
print "\tResetting user languages.\n" unless ($quiet);
my ($defaultLangId) = WebGUI::SQL->quickArray("select dataDefault from userProfileField where fieldName='language'");
$defaultLangId =~ s/\[//;
$defaultLangId =~ s/\]//;
my $langs = {
1 => "English",
2 => "German",
3 => "Dutch",
4 => "Spanish",
5 => "Portuguese",
6 => "Swedish",
7 => "Chinese-Simplified",
8 => "Italian",
9 => "Chinese-Traditional",
10 => "Danish",
11 => "Arabic",
12 => "Norwegian",
13 => "Finnish",
14 => "Japanese",
15 => "Croatian",
16 => "Polish",
21 => "Russian"
};
WebGUI::SQL->write("update userProfileField set dataDefault='[\'".$langs->{$defaultLangId}."\']' where fieldName='language'");
WebGUI::SQL->write("update userProfileData set language='".$langs->{$defaultLangId}."' where fieldName='language' and fieldData<>1");
WebGUI::SQL->write("update userProfileData set language='English' where fieldName='language' and fieldData=1");
WebGUI::Session::close();

View file

@ -1,6 +1,7 @@
insert into webguiVersion values ('6.1.0','upgrade',unix_timestamp());
alter table DW_SOAPClient add sharedCache tinyint unsigned not null default '0';alter table DW_SOAPClient add cacheTTL smallint(5) unsigned NOT NULL default '60';
update international set message='A Web Services Client allows a user to query data from any SOAP server to which they have access. This wobject is in development status and should not be made accessible to un-trusted site administratores.<p></p>\n\n<b>SOAP URI/WSDL</b><br>\nFrom the SOAP::Lite manpage, \"URIs are just identifiers. They may look like URLs, but they are not guaranteed to point to anywhere and shouldn\'t be used as such pointers. URIs assume to be unique within the space of all XML documents, so consider them as unique identifiers and nothing else.\" If you specify a URI, you probably also need a proxy below. Alternatively, you can specify a WSDL file in place of a URI. This file refers to a real location at which a SOAP service description can be downloaded and used. For our purposes, the file must end in \".wsdl\" to be properly recognized. If you use a WSDL file, you probably don\'t need to specify a proxy.<p></p>\n\n<b>SOAP Proxy</b><br>\nThe SOAP proxy is the full name of the server and/or script that is listening for SOAP calls. For example:\n<code>http://mydomain.com/cgi-bin/soaplistener.pl</code><p></p>\n\n<b>SOAP Method/Call</b><br>\nThe SOAP method is the name of the function to be invoked by the SOAP server. Include any extra parameters in the SOAP Call Parameters field below.<p></p>\n\n<b>SOAP Call Parameters</b><br>\nIf your SOAP call requires any additional parameters, include them here as a valid perl hash, array or scalar. For example: <code>\'userid\' => \'12\', companyid => \'^FormParam(\"companyid\"); Whether you need to use scalar, hash or array is entirely dependent on what your SOAP service expects as input. Likewise, what you get back is entirely dependent on what the service deems to return.\'</code>.<p></p>\n\n<b>Execute by default?</b><br>\nLeave this set to yes unless your page is calling itself with additional parameters. You will probably know if/when you need to turn off default execution. To force execution when it has been disabled by default, pass a form variable \"targetWobjects\" specifying the name of the SOAP call to force execution.<p></p>\n\n<b>Template</b><br>\nChoose a layout for this SOAP client.<p></p>\n\n<b>Preprocess macros on query?</b><br>\nIf you\'re using WebGUI macros in your query you\'ll want to check this box.<p></p>\n\n<b>Pagination After</b><br>\nHow many rows should be displayed before splitting the results into separate pages? In other words, how many rows should be displayed per page?<p></p>\n\n<b>Pagination Variable</b><br>\nBecause a SOAP call can return complex data structures, you\'ll need to specify which named variable is to be paginated. If none is specified, no pagination will occur.<p></p>\n\n<b>Debug?</b><br>\nIf you want to display debugging and error messages on the page, check this box.<p></p>\n\n<b>Decode utf8?</b><br />\nThis option will only display if you have Data::Structure::Util installed. SOAP calls return utf8 strings even if they may not have utf8 characters within them. This converts utf8 characters to that there aren\'t collisions with any character sets specified in the page header. Deocing is turned off by default, but try turning it on if you see goofy gibberish, especially with the display of copyright symbols and the like.<p></p>\n\n<b>Cache</b><br />\nBy default, SOAP calls are cached uniquely for each user session. By selecting "Global" call returns can be shared between users.<p></p>\n\n<b>Cache expires</b>Number of seconds a SOAP return will be cached. Set to 1 to essentially skip caching.' where namespace='DWSOAPClient' and languageId=1 and internationalId=71;
insert into international values (27,'DW_SOAPClient',1,'Cache expires',unix_timestamp(now()),NULL);
insert into international values (28,'DW_SOAPClient',1,'Cache',unix_timestamp(now()),NULL);insert into international values (29,'DW_SOAPClient',1,'Session',1088120988,NULL);
insert into international values (19,'DW_SOAPClient',1,'Global',unix_timestamp(now()),NULL);
drop table language;
drop table international;
drop table help;
alter table WSClient add sharedCache tinyint unsigned not null default '0';
alter table WSClient add cacheTTL smallint(5) unsigned NOT NULL default '60';