Compare commits

...

134 commits

Author SHA1 Message Date
Joeri de Bruin
5fc1c6bdae entrypoint script now upgrades 2026-02-25 18:22:25 +01:00
Joeri de Bruin
c6e7012f56 entrypoint script now upgrades 2026-02-25 18:22:11 +01:00
Joeri de Bruin
e07af2eb65 added upgrade scripts for 7.10.33 including upgrade to mysql 8.x 2026-02-25 17:28:31 +01:00
Joeri de Bruin
45a78c182f add log files for starting docker-compose 2026-02-25 13:02:28 +01:00
Joeri de Bruin
b83c2bffaa add log files for starting docker-compose 2026-02-25 12:58:12 +01:00
Joeri de Bruin
29a9831f53 add log files for starting docker-compose 2026-02-25 12:58:03 +01:00
e8f3bf6365 added custom module newsletter 2026-02-24 08:14:00 +01:00
c73e252bb5 added README.mf 2026-02-09 08:42:26 +01:00
743cdb196c Merge branch 'master' into Upgrade-to-modern-Perl
Make WebGUI 7.10 master again as we do not want to go to 8
2026-02-06 13:55:31 +01:00
3cc88f8150 Update to current Perl 2026-02-06 13:40:47 +01:00
colin
ebd46d86d4 Document change 2019-03-14 14:45:04 -07:00
Colin Kuskie
0aa1e4b878 Fix munged URLs in redirects for assets with isSecure set. 2019-03-14 14:38:44 -07:00
Colin Kuskie
fc9cf6b5ad Ready for 7.10.32 design cycle 2018-03-15 23:44:20 +00:00
Colin Kuskie
ae380069a6 Preparing for 7.10.31 release, again 2018-03-15 22:08:53 +00:00
root
653f8a02c1 Fix create and previousVersion SQL versions 2018-03-15 18:04:07 +00:00
Colin Kuskie
3c2e3dc642 Preparing for 7.10.31 development 2018-03-15 16:41:32 +00:00
Colin Kuskie
2ddfc83ee3 Preparing for 7.10.30 release 2018-03-15 04:24:17 +00:00
colin
ecb65bd724 Migrate to reCAPTCHA v2 2018-02-27 15:28:35 -08:00
colin
d760289918 Allow WebGUI::Cache and all consumers to fetch SSL URLs, but not verify the certificates. 2017-07-19 20:06:46 -07:00
colin
c75ef5e044 fixed: Warnings about API changes in POE::Component::IKC::ClientLite 2017-05-09 13:37:55 -07:00
colin
94f1f3506c Force tasks for a project to be ordered by when they were created instead of randomly. 2016-05-02 10:48:08 -07:00
colin
4f845b8a11 Preparing for WebGUI 7.10.30 release 2016-01-06 00:59:37 +00:00
colin
96edebb446 Fix number of skipped tests 2016-01-06 00:47:24 +00:00
colin
a117901df5 Clone the tinyMCE config to prevent referenced data from changing during init. Fixes #12461 2015-12-08 10:39:38 -08:00
colin
ec12a284eb Document the bugfix 2015-09-01 09:18:27 -07:00
Colin Kuskie
3268d32358 Asset Report NULL operators do not accept values. 2015-09-01 09:10:38 -07:00
Ernesto Hernández-Novich
501d5f3757 =item cannot be immediately followed by a number
Since Perl 5.20 a POD =item cannot start with single
number, as is the case in syncToCdn POD explanation of
return codes. Using pod2* reports syntax errors like

line 228: Expected text after =item, not a number

Wrapped the numbers with POD's zero-effect markup Z<>
to fix the issue.
2015-07-04 11:34:33 -04:30
Colin Kuskie
cc5f0a30ad Push out head tags for the custom color selector. 2015-03-10 14:05:18 -07:00
Colin Kuskie
6028535303 Also provide the correct mime type to speed up the parsing. 2015-02-18 13:43:40 -05:00
Colin Kuskie
df56936e59 Do not generate the Not Found page if JS or CSS was requested. Cut #1 2015-02-11 17:18:10 -08:00
Colin Kuskie
4649297b9f Fix typo in the account module skeleton 2014-11-19 09:41:11 -08:00
Colin Kuskie
c3f3dc0124 Ready for 7.10.30 development 2014-11-17 23:15:19 -05:00
Colin Kuskie
7cbc8f57ec Preparing for 7.10.29 release 2014-11-17 21:02:28 -05:00
Colin Kuskie
6d2199a083 Fix style declaration in minicart template for validation. Fixed #12456 2014-11-10 18:58:58 -05:00
Colin Kuskie
9e5c83dddb Update USPS International driver to V2 API and fix insurance. 2014-11-10 14:48:02 -05:00
Colin Kuskie
a5c6520a56 Update USPS ShipDriver to V4. Fixes bug #12455 2014-10-29 18:53:47 -04:00
Colin Kuskie
2f2887369e Fix bug #12454, loss of from field data when emailing groups 2014-10-16 16:33:09 -04:00
Colin Kuskie
b6196d9a77 Always return a good status from a Workflow Activity 2014-06-26 20:36:59 -07:00
Colin Kuskie
3666077fb1 WRE dependencies are tracked in the WRE itself, not in WebGUI.
This reverts commit a1c7db7388.
2013-03-21 16:14:37 -07:00
Colin Kuskie
92e6592df1 Ready for 7.10.29 development. 2013-03-20 21:38:23 -07:00
Colin Kuskie
1d49faa328 Preparing for release of 7.10.28 2013-03-20 15:38:18 -07:00
Colin Kuskie
52843ad7ca Fix a bug where cropping an image swaps the X and Y positions. Fixes bug #12413 2013-03-20 15:37:42 -07:00
Scott Walters
a1c7db7388 add String::Random which is used by the WRE 2012-11-28 19:10:03 -05:00
Colin Kuskie
21f9af32d2 Remove Clone from Spectre, too! 2012-11-16 09:34:21 -08:00
Colin Kuskie
2ec38b1407 When Group->new is called with a group that doesn't exist, it returns a faked Group object. Calling delete on this object fails for some Cache types. 2012-11-01 17:52:51 -07:00
Colin Kuskie
981ab43984 Ready for 7.10.28 development. 2012-10-29 20:07:20 -07:00
Colin Kuskie
6697bcbdee Repreparing for 7.10.27 release 2012-10-29 19:00:19 -07:00
Colin Kuskie
893521309b Preparing for 7.10.27 release. 2012-10-29 18:45:17 -07:00
Scott Walters
84a8b39d89 remove duplicate changelog entry 2012-10-27 02:02:52 -04:00
Scott Walters
fab70d71c7 gracefully handle Collaborations having no lastPostId in the MessageBoard asset 2012-10-27 02:02:27 -04:00
Scott Walters
9a45ff4b91 on invalid proceed method in call to editSave, warn and recover rather than run time error 2012-10-27 02:02:26 -04:00
Colin Kuskie
59ce3b3fd6 Upgrade YUI to 2.9.0 2012-10-24 10:40:52 -07:00
Colin Kuskie
be37f12ab1 Clone stopped working in several tests in 5.14.2. Remove it in favor of Storable::dclone.
Clone handles being passed scalar data, but dclone does not.
2012-10-23 10:00:53 -07:00
Colin Kuskie
1b4f7c33fa Fix a typo in a template help variable. 2012-10-22 18:48:08 -07:00
Colin Kuskie
fcbaa46c63 Fix a typo in the userImport POD. 2012-10-05 08:58:46 -07:00
Colin Kuskie
e046e5a8ce Fix rendering of the carousel inside of a Story. Fixes bug #12386 2012-09-20 14:00:57 -07:00
Colin Kuskie
50c7634800 Paste assets in the clipboard which are archived. 2012-09-19 16:39:12 -07:00
Colin Kuskie
8aaa37e5e1 Fix a bug in the EMS related to showing badge data when the badge data does not have related badge groups. 2012-09-18 15:22:33 -07:00
Colin Kuskie
ca78e1db4e Spectre is touchy about things that die in perl. Fix the UpdateAssetSubscribers workflow activity to catch if the group in the asset does not exist. 2012-09-16 20:51:18 -07:00
Colin Kuskie
2aeca17867 Add code to the upgrade skeleton to prevent empty version numbers from being used. 2012-09-14 10:22:23 -07:00
Colin Kuskie
61210fb776 Fix a problem similar to the Trash/utf-8 in the Clipboard. 2012-09-12 10:40:14 -07:00
Colin Kuskie
ef6eabfa9e Handle UTF-8 characters in asset titles in the trash. Fixes bug #12385. 2012-09-12 09:20:27 -07:00
Colin Kuskie
2d83f3c0d1 Add the same kind of performance data for Shortcuts, as AssetProxy macros. 2012-09-11 16:42:43 -07:00
Colin Kuskie
b37f9d581d Fix multiple issues with how Thingy handles default values, and values that are false. Fixes bug #12362 2012-09-05 09:50:36 -07:00
Colin Kuskie
56e8240006 Changelog notice for TinyMCE upgrade. 2012-08-30 16:02:25 -07:00
Colin Kuskie
3cfc42d38f Update TinyMCE to 3.5.6 2012-08-30 16:00:42 -07:00
Colin Kuskie
4f74c4cd3e Fix metaData revisionDates that were left as 0 from upgrades. Thanks to Dale Trexe for the script which inspired this upgrade sub. Fixes bug #12339. 2012-08-30 11:46:43 -07:00
Colin Kuskie
93f583d069 getLastPost in Thread.pm should not cast its data, but allow the asset to determine its own type. 2012-08-27 18:26:05 -07:00
Colin Kuskie
55893c0050 Fix Crud's pPFFP and commit the results this time so that I don't lose it and have to explain why I'm redoing 4 hours of painstaking form work with testing. Fixes bug #12382. 2012-08-23 15:00:09 -07:00
Colin Kuskie
4d3056299c Fix a POD typo in the userImport script. Fixes bug #12379 2012-08-21 12:59:34 -07:00
Colin Kuskie
e60c92693b Ready for 7.10.27 development. 2012-08-20 22:52:37 -07:00
Colin Kuskie
548ac8747b Preparing for 7.10.26 release 2012-08-20 21:54:49 -07:00
Colin Kuskie
7f8349e708 Update test to make it more robust as USPS International adds more shipping options. 2012-08-20 17:41:04 -07:00
Colin Kuskie
bac73de9b3 Alphabetize the list of authors in the credits again. 2012-08-18 12:53:29 -07:00
Colin Kuskie
83227bd8b7 Quote the search query in the paginator. Fixes bug #12378. 2012-08-18 12:50:24 -07:00
Colin Kuskie
4c31d182f8 Allow template diagnostics to work when a session asset is not set. Add a way to get the raw, encoded URL from the request object. 2012-08-15 08:39:54 -07:00
Colin Kuskie
358bc1557a Ready for 7.10.26 development (forgot to do this earlier) 2012-08-15 08:30:13 -07:00
Colin Kuskie
f417ddf0b1 Remove dead return code. 2012-08-13 16:17:18 -07:00
Colin Kuskie
212ebfdb23 Quiet log noise from LDAP group/WebGUI user membership mismatches. 2012-08-09 12:16:52 -07:00
Colin Kuskie
c0d0418191 Preparing for 7.10.25 release 2012-07-30 18:47:05 -07:00
Colin Kuskie
263b581a58 Handle the case of not being able to instanciate messages when deleting a whole list of them. 2012-07-26 16:00:28 -07:00
Colin Kuskie
79c843434c Fix the unlikely case of empty photo data in a Story asset when purging. 2012-07-26 15:11:40 -07:00
Colin Kuskie
c120a8b28d Only transfer data that's being used, to reduce loading and speed things up. 2012-07-20 10:52:56 -07:00
Colin Kuskie
7c03fc78b0 Allow a single asset to be passed into findBrokenAssets via --assetId 2012-07-20 10:48:34 -07:00
Colin Kuskie
ca2c06381a Fix gateway issues in several modules, including auth for password recovery. Fixes bug #12375 2012-07-19 09:39:12 -07:00
Colin Kuskie
6ca603e7dd Let the AssetReport asset search over all wobjects. 2012-07-17 11:28:11 -07:00
Colin Kuskie
d7b0468848 No indirect object syntax. 2012-07-16 08:59:25 -07:00
Colin Kuskie
f25e3948fe These secondary canView checks are not needed, since the whole thing is guarded by the canView at the top of www_manageRevisions. 2012-07-11 14:35:02 -07:00
Colin Kuskie
a3f5b3ae6c Handle the case when a friend approve message no longer exist. 2012-07-10 16:12:29 -07:00
Mark Leighton Fisher
7a6ee77a06 Fixed WebGUI::Asset::Wobject::Search::view() so HTML highlighting not broken by search phrase with unmatched char pairs
Fixed WebGUI::Asset::Wobject::Search::view() so HTML highlighting will not
be broken by a search phrase with unmatched char pairs like '()', '{}',
and '[]' (the HTML highlighter uses a regex internally for matching words
in the search phrase). Also fixed so ':' in the search phrase does not
confuse the HTML highlighter.
2012-07-02 17:03:58 -04:00
Colin Kuskie
dc4f813a5f Fixes to make WebGUI compatible with newer perls. 2012-06-29 13:24:13 -07:00
Scott Walters
0422807b32 Revert "group() function Survey::ExpressionEngine that returns 1/0 depending on whether the current user is in a group" -- wrong branch.
This reverts commit eaa29c5f44.

Conflicts:

	docs/changelog/7.x.x.txt
2012-06-19 19:31:50 -04:00
Scott Walters
3fe8f9a080 fix nasty data sync bug in WebGUI::User::friends that was causing the friendsGroup assigned to a user t
o immediately be lost and replaced a different one in a call to WebGUI::Friends->add, which creates sep
erate instances of users
2012-06-19 18:04:12 -04:00
Scott Walters
eaa29c5f44 group() function Survey::ExpressionEngine that returns 1/0 depending on whether the current user is in a group 2012-06-19 16:22:30 -04:00
Scott Walters
851844c917 lots of stuff expects the request object to have a hostname method. give it one. 2012-06-19 16:20:56 -04:00
Scott Walters
225df67d1f PseudoRequest shouldn't clobber Apache2::Cookies if the package already exists; mock requests are sometimes useful under mod_perl and this is a bit of a gotcha 2012-06-19 16:17:26 -04:00
Colin Kuskie
db3058c0b7 Removing exclude of files that don't exist anymore. 2012-06-11 10:20:05 -07:00
Colin Kuskie
ffcee041be Allow WebGUI::Fork's to be built for asset specific methods, and not only those found in WebGUI::Asset's namespace. 2012-06-08 08:43:52 -07:00
Colin Kuskie
6e8801600d Don't assume that users actually entered a URL to proxy in an HTTP Proxy asset. This would be reasonable. 2012-06-07 09:40:17 -07:00
Arjan Widlak
2cb7c5b85b Correction on test introduced in fix of bug 12365 commit 7ab4726600 2012-06-05 15:04:18 +02:00
Arjan Widlak
5dfe488ac8 typo in pod 2012-06-05 12:42:24 +02:00
Arjan Widlak
7ab4726600 - fixed #12365: editing a metadata category may cause a fatal error 2012-06-05 12:34:50 +02:00
Colin Kuskie
8370cb15c8 Prevent a bunch of warnings about workflows that have not yet been run when getting the status report from Spectre. 2012-06-01 16:21:46 -07:00
Colin Kuskie
49ee896aa2 For sites with shared hosting, setting the time between workflows to be larger than 1 can slow or stop processing or workflows. 2012-05-30 21:59:20 -07:00
Colin Kuskie
2aa8de8a86 Don't pull data from the version tag table that isn't used. 2012-05-29 19:51:26 -07:00
Colin Kuskie
fd4b75b2b2 Make sure that the session actually contains a slave connection before trying to use it. Fixes bug #12305 2012-05-28 14:28:01 -07:00
Colin Kuskie
45d7c5505f Do not show Tickets in the schedule screen when they are either in the Trash or in the Clipboard. Fixes bug #12345. 2012-05-26 20:59:14 -07:00
Colin Kuskie
ee783e7374 Make exporting assets as HTML work when an export with mobile styling has been selected. Fixes bug #12364 2012-05-26 20:40:38 -07:00
Colin Kuskie
70c9939169 Make sure that viewing permissions are obeyed in the method, and that the DataForm just doesn't hide the link. Fixes bug #12353. 2012-04-17 19:02:12 -07:00
Colin Kuskie
2c225f30f5 Do not attempt to change the status on an inbox message which doesn't exist. Fixes bug #12349. 2012-04-02 18:33:38 -07:00
Colin Kuskie
07bd545538 Remove cookie jar files left by the HttpProxy asset. Finishes the fix for bug #12327. 2012-04-02 18:32:13 -07:00
Colin Kuskie
604887ff66 Fix an I/O wrapping problem with checking for broken file assets and storage locations. 2012-04-02 11:09:53 -07:00
Scott Walters
d4f63b2bce fixed #12346: toVersion in upgrade_7.9.34-7.10.22.pl was "0.0.0" 2012-03-22 00:13:50 -04:00
Colin Kuskie
fcd933489b Fix the duplicating of events with related links that have restrictive permissions. Fixes bug #12010. 2012-03-20 11:59:13 -07:00
Colin Kuskie
1eb5579f67 Update test for change in USPS International service options. 2012-03-17 17:42:58 -07:00
Colin Kuskie
275fcd0bb8 Do not return content from cacheByHTTP if the request errors, otherwise callers can process bad content, like SC assets expecting RSS feeds and getting 404 error pages. 2012-03-13 21:29:32 -07:00
Colin Kuskie
4f85ad56e6 Do not build a massive array of users when giving each user an address book from their profile. Instead, get one userId at a time. 2012-03-11 16:04:31 -07:00
Colin Kuskie
9a09ec0447 sslEnabled in the config file trumps encryptLogin in the settings. 2012-03-11 16:04:31 -07:00
Chris Liu
b39a7d5f0f Fixed bug 12297 - keywords.form help text 2012-03-09 14:23:47 -06:00
Colin Kuskie
d55f8ee897 Document the bugfix for Crud form handling. 2012-03-06 22:40:48 -08:00
Colin Kuskie
4a8c63ec0a Make sure that lastUpdated in updated in the database as well as in the object. 2012-03-05 17:56:46 -08:00
Colin Kuskie
92f4a5f1af Document a template variable that already existed to fulfill RFE #9730. 2012-02-29 23:51:57 -08:00
Colin Kuskie
d2f157ddea Provide a fallback for contents of .wgaccess files. Fixes bug #12328 2012-02-24 22:27:44 -08:00
Colin Kuskie
99fa73ab34 Document bugfix. 2012-02-24 22:23:13 -08:00
david nicol
ff28ef9dc1 #13787 issue -- and general core repair 2012-02-24 22:22:36 -08:00
Colin Kuskie
3b544ee4fb Fix a problem with fixing parents. Better handling of potential problems in File assets with no storage location. 2012-02-17 17:26:43 -08:00
Colin Kuskie
aa76dc52cd Document the bug fix for the flat discount asset. 2012-02-15 16:37:07 -08:00
Colin Kuskie
e86b7bb180 Fix the FlatDiscount, so that it actually discounts all the time. 2012-02-15 16:36:55 -08:00
Colin Kuskie
82554add6b Make sure that HttpProxy cleans up after itself when purging assets or revisions. 2012-02-14 15:30:07 -08:00
Colin Kuskie
80ec20b8f2 Fix a typo in a used module name. 2012-02-14 15:29:44 -08:00
Colin Kuskie
2dbd38f519 Make a safe copy of the config file before modifying it. Fixes bug #12322. 2012-02-04 14:52:16 -08:00
Colin Kuskie
78159c9795 Fix typo introduced into Group.pm 2012-01-31 15:37:08 -08:00
Colin Kuskie
20e49b51d6 Try to trap errors while loading classes. Fixes bug #12321. 2012-01-26 16:04:02 -08:00
Colin Kuskie
3a3227cd6d Fix a typo in the documentation for the list of assets in the Admin Console. Thanks to ckotil for pointing it out. 2012-01-19 14:35:38 -08:00
3595 changed files with 239073 additions and 212230 deletions

3
.gitignore vendored
View file

@ -1 +1,2 @@
/*.kpf
.DS_Store
/*.kpf

9
.gitmodules vendored Normal file
View file

@ -0,0 +1,9 @@
[submodule "custom/webgui_newsletter"]
path = custom/webgui_newsletter
url = ssh://forgejo@git.oqapi.nl/UnitedKnowledge/webgui_newsletter.git
[submodule "custom/webgui_specialstate"]
path = custom/webgui_specialstate
url = ssh://forgejo@git.oqapi.nl/UnitedKnowledge/webgui_specialstate.git
[submodule "custom/customlib_honeypot"]
path = custom/customlib_honeypot
url = ssh://forgejo@git.oqapi.nl/UnitedKnowledge/customlib_honeypot.git

View file

@ -1 +0,0 @@
--recurse

169
Dockerfile Normal file
View file

@ -0,0 +1,169 @@
FROM debian:latest
ENV DEBIAN_FRONTEND noninteractive
RUN apt update && apt -y install perl cpanminus libaspell-dev make libdbd-mysql-perl libdigest-perl-md5-perl libxml-simple-perl \
libmodule-install-perl gcc libperl-dev default-libmysqlclient-dev libpng-dev build-essential libgd-dev mariadb-client imagemagick \
libpng-dev libjpeg-dev libtiff-dev libapache2-mod-perl2 libapache2-mod-perl2-dev libapache2-request-perl libimage-magick-perl vim \
apache2 apache2-utils
RUN cpanm --notest --force \
Algorithm::Permute \
App::Cmd \
Archive::Any \
Archive::Tar \
Archive::Zip \
Business::OnlinePayment \
Business::OnlinePayment::AuthorizeNet \
Business::PayPal::API \
Business::Tax::VAT::Validation \
CHI \
CSS::Minifier::XS \
CSS::Packer \
Cache::FastMmap \
Capture::Tiny \
Class::C3 \
Class::InsideOut \
Clone \
Color::Calc \
Compress::Zlib \
Config::JSON \
DBI \
Data::ICal \
DateTime \
DateTime::Event::ICal \
DateTime::Format::HTTP \
DateTime::Format::Mail \
DateTime::Format::Strptime \
DBD::mysql@4.051 \
Devel::StackTrace \
Devel::StackTrace::WithLexicals \
Digest::MD5 \
Digest::SHA \
Email::Valid \
Exception::Class \
Facebook::Graph \
File::Path \
Finance::Quote \
GD \
GD::Graph \
Geo::Coder::Googlev3 \
HTML::Form \
HTML::Highlight \
HTML::Packer \
HTML::Parser \
HTML::TagCloud \
HTML::TagFilter \
HTML::Template \
HTML::Template::Expr \
HTTP::BrowserDetect \
HTTP::Exception \
HTTP::Headers \
HTTP::Request \
IO::File::WithPath \
IO::Interactive::Tiny \
IO::Socket::SSL \
IO::Zlib \
Image::ExifTool \
Imager \
Imager::File::PNG \
JSON \
JSON::Any \
JSON::PP \
JavaScript::Minifier::XS \
JavaScript::Packer \
Kwargs \
LWP \
LWP::Protocol::https \
List::MoreUtils \
Locales \
Log::Log4perl \
MIME::Tools \
Module::Find \
Monkey::Patch \
Moose \
MooseX::NonMoose \
MooseX::Storage \
MooseX::Storage::Format::JSON \
Net::CIDR::Lite \
Net::DNS \
Net::LDAP \
Net::POP3 \
Net::SMTP \
Net::Twitter \
Number::Format \
POE \
POE::Component::Client::HTTP \
POE::Component::IKC::Server \
POE::Component::IKC \
Package::Stash \
Params::Validate \
Path::Class \
PerlIO::eol \
Plack \
Plack::Middleware::Debug \
Plack::Middleware::Status \
Plack::Request \
Plack::Response \
Pod::Coverage \
Readonly \
Scope::Guard \
Search::QueryParser \
Storable \
Template \
Test::Class \
Test::Deep \
Test::Differences \
Test::Exception \
Test::Harness \
Test::Log::Dispatch \
Test::LongString \
Test::MockObject \
Test::MockTime \
Test::More \
Test::Tester \
Test::WWW::Mechanize::PSGI \
Text::Aspell \
Text::Balanced \
Text::CSV_XS \
Tie::CPHash \
Tie::IxHash \
Time::HiRes \
Try::Tiny \
URI::Escape \
UUID::Tiny \
Weather::Com::Finder \
XML::FeedPP \
XML::FeedPP::MediaRSS \
XML::Simple \
common::sense \
namespace::autoclean
#RUN cpanm --notest --force \
# DBD::mysql@4.051
ADD lib /data/WebGUI/lib
ADD sbin /data/WebGUI/sbin
ADD share /data/WebGUI/share
ADD www/extras /data/WebGUI/www/extras
ADD www/maintenance.html /data/WebGUI/www/maintenance.html
ADD www/uploads /data/WebGUI/uploads
ADD etc /data/WebGUI/etc
ADD distribution/webgui/entrypoint /entrypoint
ADD distribution/webgui/www.example.com.conf /etc/apache2/sites-available/000-default.conf
ADD distribution/webgui/webgui.conf /etc/apache2/mods-enabled/webgui.conf
ADD distribution/webgui/modperl.pl /etc/apache2/modperl.pl
RUN useradd --home=/data/WebGUI webgui; chown -R webgui: /data/WebGUI; chmod 755 /entrypoint; \
# apt remove -y cpanminus make gcc libperl-dev ; rm -rf /root/.cpanm; \
echo "ServerName localhost" >> /etc/apache2/apache2.conf;
#USER webgui
WORKDIR /data/WebGUI
CMD [ "/entrypoint" ]

50
README
View file

@ -1,50 +0,0 @@
This is the PSGI branch of WebGUI8
To try this out:
0) Start from WebGUI 7.10.23 or the example .conf and create.sql that comes with WebGUI 8.
1) Run testEnvironment.pl to install all new requirements.
2) Get a new wgd from http://haarg.org/wgd
3) Copy etc/WebGUI.conf.original to www.whatever.com.conf; edit it and set dbuser, dbpass,
dsn, uploadsPath (eg to /data/domains/www.example.com/public/uploads/), extrasPath,
maintenancePage and siteName
4) Set WEBGUI_CONFIG to point at your new config file
5) $ export PERL5LIB='/data/WebGUI/lib'
6) $ wgd reset --upgrade
7) $ cd /data/WebGUI (or whereever you unpacked it)
8) $ rsync -r -a (or cp -a) /data/WebGUI/www/extras /data/domains/www.example.com/public/
(from whereever you unpacked it to whereever you pointed extrasPath to; note 'extras'
goes inside 'public', both under where extrasPath points to)
To start it:
8) $ plackup app.psgi
See docs/install.txt for more detailed installation instructions.
Currently, the best performance is achieved via:
plackup -E none -s Starman --workers 10 --disable-keepalive
You can benchmark your server via:
ab -t 3 -c 10 -k http://dev.localhost.localdomain:5000/ | grep Req
I'm currently getting 370 requests/second, whereas I'm getting 430/second on the non-PSGI WebGUI8 branch.
= ARCHITECTURE =
* The root level app.psgi file loads all the config files found and
loads the site specific psgi file for each, linking them to the
proper host names.
* The site psgi file uses the WEBGUI_CONFIG environment variable to find the config.
* It instantiates the $wg WebGUI object (one per app).
* $wg creates and stores the WebGUI::Config (one per app)
* $wg creates the $app PSGI app code ref (one per app)
* WebGUI::Middleware::Session is wrapped around $app at the outer-most layer so that it can open and
close the $session WebGUI::Session. Any other wG middleware that needs $session should go in between
it and $app ($session created one per request)
* $session creates the $request WebGUI::Session::Request and $response WebGUI::Session::Response
objects (one per request)

287
README.md Normal file
View file

@ -0,0 +1,287 @@
# WebGUI Content Management System
WebGUI is a powerful, open-source content management system and web framework built with Perl. It provides a comprehensive platform for building dynamic websites, managing content, and handling user interactions with a focus on flexibility and extensibility.
## About
- **Version**: 7.10.32
- **Status**: Stable
- **License**: GNU General Public License v2
- **Copyright**: 2001-2009 Plain Black Corporation, and contributors
- **Website**: http://www.plainblack.com
## Features
- **Modular Architecture**: Pluggable asset and component system
- **User Management**: Comprehensive user authentication and group management
- **Content Management**: Flexible asset-based content system
- **Workflow Engine**: Built-in workflow automation
- **Search Capabilities**: Full-text search and indexing
- **API-Driven**: RESTful API support
- **Internationalization**: Multi-language support
- **Commerce Ready**: E-commerce functionality with payment processing
- **Session Management**: Robust session handling and security
- **Caching**: Multiple caching strategies (CHI, FastMmap)
- **Database Abstraction**: Works with MySQL/MariaDB
## System Requirements
### Required Software
- **Perl**: 5.8 or higher
- **Apache**: 2.0+ with mod_perl 2.0 and mod_apreq2
- **MySQL/MariaDB**: 5.0.10 or higher
- **ImageMagick**: 6.0 or higher
### Recommended Modules
A comprehensive list of Perl dependencies is installed via `cpanm` (see Dockerfile for details).
## Quick Start Installation
### 1. Prepare Environment
```bash
# Install Perl 5.8+
# Install Apache 2.0 with mod_perl and mod_apreq2
# Install MySQL/MariaDB 5.0.10+
# Install ImageMagick 6.0+
```
### 2. Configure Apache
Add to your Apache configuration:
```apache
LoadModule apreq_module modules/mod_apreq2.so
LoadModule perl_module modules/mod_perl.so
PerlSetVar WebguiRoot /data/WebGUI
PerlCleanupHandler Apache2::SizeLimit
PerlRequire /data/WebGUI/sbin/preload.perl
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /data/domains/example.com/www
SetHandler perl-script
PerlInitHandler WebGUI
PerlSetVar WebguiConfig www.example.com.conf
</VirtualHost>
```
### 3. Database Setup
```bash
# Create database and user
mysql -e "create database WebGUI"
mysql -e "grant all privileges on WebGUI.* to webgui@localhost identified by 'your_password'"
mysql -e "flush privileges"
# Load schema
mysql -uwebgui -pyour_password WebGUI < docs/create.sql
```
### 4. Configuration
Edit `etc/WebGUI.conf` to match your database and environment settings:
```conf
# Database connection
<database>
driver=MySQL
DSN=DBI:mysql:WebGUI:localhost:3306
username=webgui
password=your_password
</database>
# Logging
<logging>
configFile=/data/WebGUI/etc/log.conf
</logging>
```
### 5. Start Services
```bash
# Start MySQL/MariaDB
mysql.server start
# Start Apache
apachectl start
```
## Docker Deployment
WebGUI includes Docker support for easy containerized deployment:
# Build Docker image
```bash
docker build -t webgui:latest .
```
# Run with docker-compose (see distribution/docker-compose.yml)
```bash
cd distribution
docker-compose up -d
```
The Docker setup includes:
- Debian-based container with all dependencies
- Apache 2 with mod_perl
- MariaDB client
- ImageMagick for image processing
- Nginx reverse proxy configuration (distribution/nginx/)
## Project Structure
```
├── lib/ # Perl modules (main codebase)
│ ├── WebGUI.pm # Core handler
│ ├── WebGUI/ # WebGUI framework modules
│ ├── WGDev/ # Development utilities
│ └── Spectre/ # Job scheduler
├── sbin/ # System utilities and scripts
├── t/ # Test suite
├── etc/ # Configuration files
├── docs/ # Documentation
├── distribution/ # Docker and deployment configs
├── www/ # Web content (uploads, extras)
└── share/ # Shared resources (nginx config, SQL)
```
### Key Directories
| Directory | Purpose |
|-----------|---------|
| `lib/WebGUI/` | Core WebGUI framework modules |
| `lib/WebGUI/Asset/` | Content asset classes |
| `lib/WebGUI/Form/` | Form field types |
| `lib/WebGUI/Operation/` | Admin operations |
| `sbin/` | Command-line utilities for administration |
| `t/` | Automated test suite |
| `etc/` | Configuration files |
| `docs/` | Installation and reference documentation |
## Development & Testing
### Running Tests
```bash
# Run the complete test suite
perl t/00_compile.t
perl t/Account.t
perl t/Config.t
# ... and many more
# Run specific test
perl t/MyTest.t
```
### Available Utilities
- `sbin/wgd` - WebGUI development tool
- `sbin/spectre.pl` - Job scheduler daemon
- `sbin/upgrade.pl` - Database upgrade utility
- `sbin/testEnvironment.pl` - Environment validation
- `sbin/findBrokenAssets.pl` - Asset consistency checker
## Configuration Files
### Main Configuration
- `etc/WebGUI.conf` - Primary configuration file
- `etc/WebGUI.conf.original` - Original configuration backup
### Logging
- `etc/log.conf` - Logging configuration
- `etc/log.conf.original` - Original logging backup
### Virtual Host Configuration
- `etc/www.example.com.conf` - Example virtual host config
- `distribution/webgui/www.example.com.conf` - Docker example
## Database Schema
The database schema is initialized using:
- `docs/create.sql` - Initial database schema
- `docs/upgrades/` - Version upgrade migration scripts
## Documentation
Detailed documentation is available in the `docs/` directory:
- `install.txt` - Installation instructions
- `changelog/` - Version history and changes
- `credits.txt` - List of contributors
- `legal.txt` - Legal information
- `license.txt` - GPL v2 license text
- `templates.txt` - Template documentation
For more information, visit: [http://wiki.webgui.org](http://wiki.webgui.org)
## Key Components
### Asset System
WebGUI uses an asset-based system for content management where all content types (pages, images, documents, etc.) are assets with configurable properties and workflows.
### Workflow Engine
Automated workflow management for content approval, publishing, and state transitions.
### Session Management
Robust session handling with security features and configuration options for user tracking.
### Commerce
Built-in e-commerce capabilities including:
- Product catalogs
- Shopping carts
- Payment processing (PayPal, Authorize.net)
- Tax calculation
### Search
Full-text search capabilities with indexing for quick content discovery.
## License
WebGUI is released under the **GNU General Public License v2**. See `docs/license.txt` for full license text.
## Credits
WebGUI was created and is maintained by Plain Black Corporation, with contributions from many developers and organizations worldwide. See `docs/credits.txt` for a complete list of contributors.
## Support & Community
- **Main Website**: http://www.plainblack.com
- **Email**: info@plainblack.com
- **Wiki**: http://wiki.webgui.org
- **Installation Guide**: http://wiki.webgui.org/installation-options
## Contributing
Contributions are welcome! Please ensure:
- All tests pass (`perl t/*.t`)
- Code follows Perl best practices
- Changes include appropriate documentation
- Pod comments are included for public APIs
## Troubleshooting
### Database Connection Issues
- Verify MySQL is running: `mysql -uwebgui -p -e "SELECT 1"`
- Check credentials in `etc/WebGUI.conf`
- Verify database user has appropriate privileges
### Apache/mod_perl Issues
- Check Apache error log: `/var/log/apache2/error.log`
- Verify mod_perl and mod_apreq2 are loaded
- Ensure WebguiRoot path is correct
### Missing Dependencies
- Use the Dockerfile as a reference for all dependencies
- Install via cpanm: `cpanm Module::Name`
- Run: `perl sbin/testEnvironment.pl`
## Additional Resources
- Plain Black home: http://www.plainblack.com
- WebGUI Wiki: http://wiki.webgui.org
- Test suite: `t/` directory with comprehensive test coverage
- Configuration examples: `etc/` and `distribution/` directories

21
TODO
View file

@ -1,21 +0,0 @@
TODO
* Deprecate WebGUI::Session::HTTP - replace with WebGUI::Request/Response
* Investigate moving Cookie handling into middleware
* Reinstate WebGUI::authen with something equivalent
* Refactor assets to use streaming response
* Fix WebGUI::Form::param
DONE
* $session->request is now a Plack::Request object
* serverObject gone from WebGUI::Session::open()
* WebGUI::authen API changed
* urlHandler API changed - no longer gets server, config
* Streaming response body
* Mostly decoupled WebGUI from Log4perl
* Exception handling and error doc mapping
* Plack::Middleware::Debug panels
* Replaces all URL Handlers with Middleware
NB
* Periodically do a big stress-test and check for leaks, mysql overload etc..
ab -t 100 -c 10 -k http://dev.localhost.localdomain:5000 | grep 'Req'

View file

@ -1,52 +0,0 @@
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2012 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict;
use Plack::Builder;
use Plack::Util;
use WebGUI::Paths -inc;
use WebGUI::Config;
use WebGUI::Fork;
if ($ENV{PLACK_ENV} ne 'development') {
WebGUI::Paths->preloadAll;
}
WebGUI::Fork->init();
builder {
my $first_app;
WebGUI::Paths->siteConfigs or die "no configuration files found";
for my $config_file (WebGUI::Paths->siteConfigs) {
my $config = WebGUI::Config->new($config_file) or die "failed to log configuration file: $config_file: $!";
my $psgi = $config->get('psgiFile') || WebGUI::Paths->defaultPSGI;
my $app = do {
# default psgi file uses environment variable to find config file
local $ENV{WEBGUI_CONFIG} = $config_file;
Plack::Util::load_psgi($psgi);
} or die;
$first_app ||= $app;
my $gateway = $config->get('gateway');
$gateway =~ s{^/?}{/};
for my $sitename ( @{ $config->get('sitename') } ) {
mount "http://$sitename$gateway" => $app;
}
}
# use the first config found as a fallback
mount '/' => $first_app;
};

View file

@ -1,19 +0,0 @@
# Little script used to run benchmarks against dev.localhost.localdomain
#
# To profile, run "perl -d:NYTProf benchmark.pl"
use lib '/data/WebGUI/lib';
use WebGUI;
use Plack::Test;
use Plack::Builder;
use HTTP::Request::Common;
my $wg = WebGUI->new( root => '/data/WebGUI', site => 'dev.localhost.localdomain.conf' );
my $app = builder {
enable '+WebGUI::Middleware::Session', config => $wg->config;
$wg;
};
test_psgi $app, sub {
my $cb = shift;
$cb->( GET "/" ) for 1..1000;
};

@ -0,0 +1 @@
Subproject commit e0eea4fe9c80865a6bde24cae6ab33dcc8089daf

@ -0,0 +1 @@
Subproject commit abaa483aa34e10c1473968dc6f0373cfb7527a31

@ -0,0 +1 @@
Subproject commit ade1aab77063c56cf6ddcc7a69956179e7c3dbe5

View file

@ -0,0 +1,41 @@
# This file is ideal for development and testing.
# --- DO NOT USE FOR PRODUCTION ---
# however, you can use it as a guide to create a proper production environment.
services:
db:
image: mariadb
container_name: db
environment:
- MYSQL_ROOT_PASSWORD=123qwe
- MYSQL_USER=webgui
- MYSQL_PASSWORD=123qwe
- MYSQL_DATABASE=www_example_com
volumes:
- ./share/create.sql:/docker-entrypoint-initdb.d/1.sql
ports:
- 3306
webgui:
image: webgui
container_name: webgui
depends_on:
- db
volumes:
- ../.:/data/WebGUI
expose:
- "80"
nginx-proxy:
image: nginx:latest
container_name: nginx_proxy
depends_on:
- webgui
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "80:80"
#TODO: add ssl later
#- "443:443"
# TODO: serve staatic files directly from nginx
#- ./www:/var/www/html:ro

View file

@ -0,0 +1,20 @@
worker_processes auto;
events {}
http {
upstream backend {
server webgui:80;
}
server {
listen 80;
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,38 @@
#!/bin/bash
# script that runs when the docker container starts
echo "Starting WebGUI entrypoint script with:"
perl -Ilib sbin/wgd ls
echo "Starting WebGUI entrypoint script..."
for configfile in `perl -Ilib sbin/wgd for-each`;do
echo "Processing config file: $configfile"
# wait for the db to come up and get our version so we know if we need to run upgrades
connection_info=`perl -Ilib sbin/wgd db --config-file=$configfile --webgui-root=/data/WebGUI --print | sed "s/'//g" `
while true; do
db_version=`mysql --skip-column-names -e 'select webguiVersion from webguiVersion order by dateApplied desc limit 1;' $connection_info ` && break
echo "waiting for the database to come up..."
sleep 10
done
code_version=`perl -Ilib -e 'use WebGUI; print $WebGUI::VERSION;'`
echo "code version $code_version"
echo "database version $db_version for $configfile with configfile $configfile"
if [ "$db_version" != "$code_version" ];then
echo "Upgrading Webgui from $db_version to $code_version..."
#first we alter the userSession table to make sure that the userId has a default value This is required for the upgrade process to work correctly.
`mysql -e 'alter table userSession MODIFY COLUMN userId char(22) NOT NULL DEFAULT "0";' $connection_info `
perl -Ilib sbin/wgd reset --upgrade --verbose --config-file=$configfile --webgui-root=/data/WebGUI/
## perl -Ilib sbin/wgd db --config-file=www.example.com --webgui-root=/data/WebGUI
fi
done
perl -I/data/WebGUI/lib sbin/spectre.pl --daemon
apachectl -DFOREGROUND

View file

@ -0,0 +1,6 @@
#use Apache2::SizeLimit;
#$Apache2::SizeLimit::MAX_PROCESS_SIZE = 600000;
#$Apache2::SizeLimit::MAX_UNSHARED_SIZE = 600000;
#$Apache2::SizeLimit::CHECK_EVERY_N_REQUESTS = 10;
1;

View file

@ -0,0 +1,4 @@
PerlSetVar WebguiRoot /data/WebGUI
#PerlCleanupHandler Apache2::SizeLimit
PerlRequire /data/WebGUI/sbin/preload.perl
PerlRequire /etc/apache2/modperl.pl

View file

@ -0,0 +1,16 @@
<VirtualHost 0.0.0.0:80>
ServerName www.example.com
ServerAlias webgui localhost example.com unitedknowledge.vps2.unitedknowledge.net www.unitedknowledge.eu unitedknowledge.eu www.united-knowledge.eu united-knowledge.eu www.unitedknowledge.net unitedknowledge.net
DocumentRoot /data/WebGUI/www
SetEnvIf SSLPROXY "1" \
SSLPROXY
SetHandler perl-script
PerlInitHandler WebGUI
CustomLog /var/log/apache2/www.example.com.access.log combined
ErrorLog /var/log/apache2/www.example.com.error.log
PerlSetVar WebguiConfig www.example.com.conf
<Directory "/data/WebGUI/www">
Require all granted
</Directory>
</VirtualHost>

View file

@ -1,4 +1,80 @@
7.10.33
- fixed: Columns defined with 'NOT NULL' must have a default value in MySQL 8.x
7.10.32
- fixed: Bad asset redirect from AssetTrash www_delete if encryptPage is set
7.10.31
- fixed: Warnings about API changes in POE::Component::IKC::ClientLite
- fixed: Allow WebGUI::Cache and all consumers to fetch SSL URLs, but not verify the certificates.
- fixed: Migrate to reCAPTCHA v2
7.10.30
- fixed: Do not generate the Not Found page when JS or CSS is requested. In admin mode, this is bypassed so that admins can see which pages are really missing and can easily add them.
- fixed: Allow IS NULL/IS NOT NULL queries in the Asset Report.
- fixed #12461: Carousel fails to initial the rich editor in multiple tabs
7.10.29
- fixed #12454: Email to Group ignores the From field
- fixed #12455: USPS Ship driver fails
- fixed #12456: style type not declared in the minicart template
7.10.28
- fixed: Clearing the caches for groups that don't exist, but have created group objects.
- fixed #12398: WebGUI still uses Clone (missed Spectre code)
- fixed #12413: Cropping problem or bug?
7.10.27
- fixed #12379: userImport documentation error
- fixed #12382: WebGUI::Crud does not work with all form types
- fixed: Threads with no posts return the wrong lastReply data.
- fixed #12339: Upgrade to 7.10 causes metadata values to "disappear" (Dale Trexel)
- Upgraded TinyMCE to 3.5.6
- fixed #12362: Thingy default Y/N field overly default
- fixed #12385: UTF-8 characters in Asset title break the Trash
- fixed ... and the same problem in the Clipboard
- fixed: UpdateAssetSubscribers workflow activity ERRORs if the group cannot be found.
- fixed: EMS has issues showing badges WITHOUT related badge groups.
- fixed: It's okay to paste assets which are archived, because if you don't they stay in the clipboard forever.
- fixed #12386: Story Manager - Carousel rendering broken in Story
- fixed #12386: Story Manager - Carousel rendering broken in Story
- fixed #12384: Click and drag reordering does not work in IE9
- fixed: MessageBoard tolerates Collaboration children not yet having a value for lastPostId
- on invalid proceed method in call to editSave, warn and recover rather than run time error
7.10.26
- fixed: Template diagnostics when called without a session asset.
- fixed: #12378 Wiki search does not work with some metacharacters
7.10.25
- fixed: #12373: Asset::Wobject::Search::view() so HTML highlite not broken by search phrase with unmatched char pairs
- fixed: if user1 adds user2 as a friend, user2 doesn't see user1 as a friend
- fixed: data sync bug in WebGUI::User::friends
- added: give WebGUI::PseudoRequest a hostname method
- fixed: don't clobber the request handler if WebGUI::Test was loaded inside of mod_perl
- fixed #12365: editing a metadata may cause a fatal error (Arjan Widlak / United Knowledge)
- fixed #12346: toVersion in upgrade_7.9.34-7.10.22.pl was "0.0.0"
- fixed #12010 related link duplication where links have group view restrictions
- fixed #12297: keywords.form missing from Post template help
- fixed #12321: Error while deleting a group.
- fixed #12322: Cache/CHI stomps on the config file
- fixed #12327: HttpProxy does not clean up cookie jar storage locations
- fixed #12329: FlatDiscount Sku forces you to enter in negative numbers for price
- fixed #12334: Company name with : in it breaks email sender identity
- fixed #12328: invalid wgaccess file in uploads
- RFE: 9730 (actually missing documentation)
- fixed: Crud updateFromFormPost
- fixed: encryptLogin and sslEnabled both need to be true
- fixed: Cache's setByHTTP method returns content, even when it gets an error in the request. This gives the SC asset fits.
- fixed #12349: Friends invitation error
- fixed #12353: Dataform List mode
- fixed #12364: Site export loses session info
- fixed #12345: tickets in trash still show up
- fixed #12305: dbSlave breaks WebGUI when not able to connect
- fixed: Http Proxy assets with no URL to proxy cannot be deleted.
- fixed: Friends request messages that no longer exist throw a warning.
- fixed: Asset Report asset can search for all wobjects in addition to all assets.
- fixed #12375: Gateway URL ignored for password recovery
7.10.24
- fixed #12318: asset error causes asset manager to fail

View file

@ -1,14 +0,0 @@
8.0.1
- #11849 - Use a different image library -- partially implemented; WebGUI::Image still uses Image::Magick
8.0.0
- #10012 - larger meta data values for multi-value fields
- #12310 - fixed rendering and submit button on user edit/add form
- Replaced the existing caching mechanism with memcached, which results in a 400% improvement to cache speed. See migration.txt for API changes and gotcha.txt for prereq changes.
- Added "hot sessions" so sessions interact with the database less.
- Added Facebook Auth and FacebookLogin macro.
- Removed the WebGUI statistics program and code.
- Prevent Env Macro from being used to access objects in the environment - Thanks to Haarg
- added: Redirect on Logout setting
- RFE: 9730 (actually missing documentation)

2399
docs/create.sql Normal file

File diff suppressed because it is too large Load diff

View file

@ -34,6 +34,7 @@ Contributing Developers..............C.J. Adams-Collier / <cjac@colliertech.org>
Greg Fast / Brunswick
Chris Gebhardt / OpenServe
Andy Grundman
Chris Hanson / Plain Black
Tessa Harmon / Knowmad Technologies
Chris Jackson
Roy Johnson / Plain Black
@ -49,6 +50,7 @@ Contributing Developers..............C.J. Adams-Collier / <cjac@colliertech.org>
Colin Kuskie / perlDreamer Consulting LLC
Christophe Marcant
Kristi McCombs / Plain Black
Vince Liao (Global NOC at IU)
Tony Mountifield
Kaleb Murphy / Plain Black
Chris Nehren / Plain Black
@ -84,7 +86,6 @@ Contributing Developers..............C.J. Adams-Collier / <cjac@colliertech.org>
Bernd Kalbfuß-Zimmermann
Tabitha Zipperer / Plain Black
Rory Zweistra / Oqapi
Chris Hanson / Plain Black
The following are people/companies who didn't directly contribute
to WebGUI, but whose work has made WebGUI possible:
@ -99,5 +100,3 @@ TinyMCE..............................MoxieCode
Yahoo User Interface (YUI)...........Yahoo!
http://www.yahoo.com
FamFamFam Silk Icon set..............FamFamFam
http://famfamfam.com/lab/icons/silk/

View file

@ -7,43 +7,21 @@ upgrading from one version to the next, or even between multiple
versions. Be sure to heed the warnings contained herein as they will
save you many hours of grief.
8.0.0
7.10.27
--------------------------------------------------------------------
* WebGUI 8 is not API compatible with WebGUI 7. If you have custom
code, chances are you'll need to update it to make it work with
WebGUI 8. Please read docs/migration.txt for information about
changes to the WebGUI API.
* Due to instability in the Clone module, WebGUI is now using Storable's
dclone instead. Storable is a core Perl module, so you do not need
to install anything new.
* Many scripts in the sbin directory have been replaced by the webgui.pl
master script.
* upgrade.pl -> webgui.pl upgrade
* YUI has been upgraded to 2.9.0 in this release.
* The rotation, deletion and reordering of Photos in a Gallery Album
has been removed because the way it was implemented in WebGUI 7
is incompatible with WebGUI 8.
* As part of the migration to Template::Toolkit, we will be changing template
variables from using dots to underscores. All templates using that namespace were
automatically upgraded to use the new variables.
In this version, these templates were updated:
Account Macro template
Admin Toggle Macro template
* The new Admin Console required changes to layout templates. Old templates
will continue to work, but show two sets of editing and drag controls.
* WebGUI 8 does not support HTTP Basic Authentication any longer.
* Support for server-side spell checking in the Rich Editor TinyMCE has been removed.
* The field metaData_values.value has been changed from 'char(255)' to varchar(1024).
This may be incompatible with some MySQL operations. Please check any custom modules
that access this field.
* Template::Toolkit is no longer an optional dependency. Please install it before attempting
to upgrade to 8.0.
7.10.25
--------------------------------------------------------------------
* Custom WebGUI plugins written using WebGUI::Crud with hand built forms
should be reviewed. A serious bug in how Crud handles forms has been fixed,
and the side-effect of the bug is now that forms processed by updateFromFormPost
must include ALL fields, otherwise the data in fields which are missing from the
form will be lost.
7.10.24
--------------------------------------------------------------------
@ -142,7 +120,6 @@ save you many hours of grief.
is in WebGUI again. Licencing information was overlooked. An
upgrade to 7.10.1 will break the Matrix. This is fixed now.
7.10.1
--------------------------------------------------------------------
* WebGUI now depends on PerlIO::eol, for doing line ending translation.
@ -179,7 +156,6 @@ save you many hours of grief.
--------------------------------------------------------------------
* The javascript check for email addresses has been removed.
7.9.5
--------------------------------------------------------------------
* Starting in WebGUI 7.9.4, the CHI and Cache::FastMmap modules are required.
@ -187,7 +163,6 @@ save you many hours of grief.
* Starting in WebGUI 7.9.5, you cannot enter in a URL that is a has more than 2 dashes,
"-", in a row. They will be collapsed down into 1 dash.
7.9.4
--------------------------------------------------------------------
* Shop and Cart changes
@ -223,6 +198,7 @@ save you many hours of grief.
in components of the core for a while, since the release of the new Survey.
Test::Deep version 0.095 or higher is now required.
7.9.2
--------------------------------------------------------------------
* new dependency: DateTime::Event::ICal 0.10 or higher
@ -328,6 +304,7 @@ save you many hours of grief.
prefix from the filename.
7.8.0
--------------------------------------------------------------------

View file

@ -2,103 +2,69 @@
# Quick And Dirty Install Instructions #
##################################################################
The following is a rough overview of how to install WebGUI *8*.
The following is a rough overview of how to install WebGUI. For
more detailed instructions read the WebGUI installation
documentation.
http://wiki.webgui.org/installation-options
http://wiki.webgui.org/installation-options has instructions for
WebGUI 7.
QnD INSTALL INSTRUCTIONS:
== INSTALL ==
1. Install Perl 5.8 or higher.
* Install a recent Perl (5.12.1 or better) if you don't have one already
2. Install Apache 2.0 with mod_perl 2.0 and set up your config. Add the
following directives to mod_perl (See WebGUI Done Right for more detail.)
* Install a recent MySQL and set up a user account
LoadModule apreq_module modules/mod_apreq2.so
LoadModule perl_module modules/mod_perl.so
PerlSetVar WebguiRoot /data/WebGUI
PerlCleanupHandler Apache2::SizeLimit
PerlRequire /data/WebGUI/sbin/preload.perl
* Install ImageMagick (http://www.imagemagick.org/, compile and install the
source or binary package)
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /data/domains/example.com/www/public
SetHandler perl-script
PerlInitHandler WebGUI
PerlSetVar WebguiConfig www.example.com.conf
</VirtualHost>
* Get WebGUI from GitHub and check out the WebGUI8 branch:
3. Install MySQL 5.0.10 or higher.
$ git clone https://github.com/plainblack/webgui.git
$ git checkout WebGUI8 --track
4. Install Image Magick 6.0 or higher.
* Setup your configuration files
5. Extract WebGUI into your webroot.
Copy WebGUI.conf.original to something named after the site's URL and
ending in .conf, such as www.example.com.conf, and edit it, making sure
to insert your site's URL and the database connection information
(dbuser, dbpass, dsn).
6. Start MySQL.
Set uploadsPath in the .conf file to eg
/data/domains/www.example.com/public/uploads/.
7. Run the following Database commands. (You should modify the
commands to match your database, username, and password.)
Edit "etc/spectre.conf" to define port and worker settings for spectre.
mysql -e "create database WebGUI"
mysql -e "grant all privileges on WebGUI.* to webgui@localhost identified by 'password'"
mysql -e "flush privileges"
mysql -uwebgui -ppassword WebGUI < docs/create.sql
Set WEBGUI_CONFIG to point at your new configuration file:
8. Edit "etc/WebGUI.conf" to match your DB settings and log directory.
$ export WEBGUI_CONFIG='/data/WebGUI/etc/www.example.com.conf'
9. Edit "etc/spectre.conf" to define port and worker settings for spectre
* Automatically install new Perl module dependencies:
10. Run the following command from your WebGUI/sbin directory to install
the required perl modules and determine whether you've configured
your system correctly.
$ sbin/testEnvironment.pl as root to install Perl modules
perl testEnvironment.pl
* Create a MySQL user account for the domain WebGUI is to host
and share/create.sql into that database
If it returns all "OK" then you're done.
$ mysql --password --user=root -e "create database www_example_com"
$ mysql --password --user=root -e "grant all privileges on www_example_com.*
to webgui@localhost identified by 'XXXXpasswordhereXXXX'"
$ mysql --password --user=webgui < share/create.sql
11. Start Apache.
* wgd reset --uploads
* Continue with the UPGRADE instructions below
== UPGRADE ==
* Run sbin/testEnvironment.pl. WebGUI 8 adds new dependencies.
* Update wgd:
WebGUI has a new upgrades system for wgd to support. The old system silently
ignores the new upgrade scripts.
Get wgd from http://haarg.org/wgd, put in /data/wre/prereqs/bin/ (if you're
using the WRE), /usr/local/bin, or ~/bin.
Do chmod ugo+x wgd to make it executable.
* Run Upgrades:
$ wgd reset --upgrade
This is needed even for new WebGUI 8 installs. The create.sql and
WebGUI.conf.original are both from 7.10.x.
* Copy new "extras" (images, CSS, JavaScript) over:
$ rsync -r -a (or cp -a) /data/WebGUI/www/extras \
/data/domains/www.example.com/public/
* Add WebGUI's libraries to Perl's library path:
$ export PERL5LIB='/data/WebGUI/lib:/data/WebGUI/t/lib'
Previously, this would break Apache if it were set; now it's required for the
stuff plackup loads to find the rest of WebGUI.
* Launch WebGUI 8:
$ plackup app.psgi
... then connect your browser to the URL it advertises.
You'll be guided through a few quick questions to setup an admin account.
(Or, if you aren't but wanted to be, run wgd reset --starter to enable it.)
* Start Spectre:
12. Start Spectre.
cd /data/WebGUI/sbin
perl spectre.pl --daemon
13. Browse to your site. You'll be guided through a few quick questions
to setup an admin account.

View file

@ -2,7 +2,7 @@
# WebGUI Legal Information #
####################################################################
WebGUI is Copyright 2001-2012 Plain Black Corporation. All rights
WebGUI is Copyright 2001-2011 Plain Black Corporation. All rights
reserved.
WebGUI Content Engine, WebGUI Runtime Environment, and Plain Black
@ -27,7 +27,7 @@ each file, or this file, or the license file. The notice at the top
of each file looks like the following:
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2012 Plain Black Corporation.
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using

38
docs/maintenance.html Normal file
View file

@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Site Down For Maintenance</title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">
<style type="text/css">
.text {
position: absolute;
z-index: 10;
font-family: georgia, verdana, helvetica, arial, sans-serif;
font-weight: bold;
color: white;
top: 40%;
width: 95%;
text-align: center;
text-shadow: black 2px 2px 2px; /* safari */
filter:progid:DXImageTransform.Microsoft.dropshadow(offX=1, offY=1, color='black', positive='true') /* ie */
}
.header {
font-size: 30px;
}
.body {
background-color: #6974DE;
}
</style>
</head>
<body>
<div class="text">
<div class="header">Maintenance</div>
<p> This site is currently undergoing maintenance. Please check back again shortly. </p>
</div>
<img src="/extras/background.jpg" border="0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5;" />
</body>
</html>

View file

@ -1,429 +0,0 @@
WebGUI 8 Migration Guide
------------------------
The information contained herein documents the API changes that have occurred
in the WebGUI 8 development effort and how to migrate your code to accomodate
the new APIs.
WebGUI::Auth
==========================
The API for new() has changed: new( $session, $userId );
editUserSettingsForm deprecated. Use editSettingsForm
editUserSettingsFormSave is deprecated. Use editSettingsFormSave
editUserForm and editSettingsForm now return WebGUI::FormBuilder objects instead of raw HTML.
deleteParams is deprecated. use delete()
deleteSingleParam is deprecated. use delete("param")
saveParams is deprecated. use update()
getParams is deprecated. use get()
init() is deprecated. Use www_view()
isAdmin, isVisitor, isRegistered are all deprecated. use user->is* instead
setCallable and isCallable are deprecated. use www_ prefix instead.
WebGUI::User
==========================
updateProfileFields is deprecated. Use update
profileField is deprecated. Use get() and update()
authInstance is deprecated. Instead instantiate the auth method and give it a
user or userId
WebGUI::Macro::AdminBar
==========================
There is no Admin Bar for normal pages. Only the admin mode can see the admin bar.
WebGUI::Macro::AdminToggle
==========================
The Admin Toggle can only enter admin mode, it cannot leave it, so there is no "Turn Off" text. The second
parameter is now the template ID.
WebGUI::Config
==============
WebGUI::Config->new has a new API. Its WebGUI root parameter has been
eliminated. It now only accepts a config file as either an absolute path, or
a path relative to WebGUI's etc directory.
my $config = WebGUI::Config->new($filename);
WebGUI::Session
===============
WebGUI::Session->open has a new API. Its WebGUI root parameter has been
eliminated. The config file it is given can be either an absolute path, or a
path relative to WebGUI's etc directory.
my $session = WebGUI::Session->open($configFile);
perldoc WebGUI::Session for more details about the arguments.
WebGUI::Session::Env
====================
WebGUI::Session::Env has been moved into WebGUI::Session::Request. A listing
of replacements and equivalents follows:
$session->env->getIp => $session->request->address
WebGUI::Session::ErrorHandler
=============================
ErrorHandler has been changed to "log" in all circumstances. $session->errorHandler no longer exists,
use $session->log. WebGUI::Session::ErrorHandler no longer exists, use WebGUI::Session::Log
WebGUI::Utility
===============
This module has been removed. It had many functions that weren't used, and others have better replacements.
formatBytes -> Number::Format::format_bytes
commify -> Number::Format::format_number
emailRegex -> Email::Valid->address()
isBetween -> <= / >=
makeArrayTabSafe -> Text::CSV_XS methods
scalarEquals -> eq
randint -> int( rand( $x ) )
isInSubnet -> Net::CIDR::Lite->new(@filters)->find($ip)
round -> sprintf '%.0f', $x
isIn -> smart match
sortHash -> sort with map
All other subs were unused and were just removed.
WebGUI::Cache
=============
WebGUI::Cache has been completely rewritten. If you were using the cache API
in the past, you'll need to update your code to reflect the changes. NOTE: you
can get a cached reference to the cache object from WebGUI::Session, which
will be substantially faster than instantiating the object yourself.
my $cache = $session->cache;
WebGUI::Asset
=============
The Asset API has been changed in small, but
significant ways. You'll need to make a few changes to your asset subclasses
to support these changes.
Definition
----------
You must migrate your asset to use the new
WebGUI::Definition::Asset class instead of the definition() method. This
executes several orders of magnitude faster, but is different in a few ways.
1) You define your definition using property and define calls, as well as
standard Moose syntax.
2) You no longer have a reference to $session, so you'll need to make sub
routine refs to to method calls. However, you cannot use sub refs on any
attributes or the following property elements: tableName.
3) You no longer have the "customDrawMethod" element. You must make custom
form controls.
4) You no longer have filters. Instead, each property has a method called
propertyName (so a property called 'title' would be title()). You can override
that to achieve the same result. You can see examples of this in Asset.pm,
look at the url and title properties.
5) Because you don't have a reference to $session, you can't internationalize
right in the definition. So property elements like "label" and "hoverHelp" are
just i18n identifiers and will automatically be run through
internationalization on calling the getFormProperties() method. To specify an
i18n identifier, place the label and namespace in an arrayref, like this:
label => ['i18n key', 'namespace'],
6) Definition's are now rigid. This means that every property needs to be
defined in the definition, and it must at least have a "fieldType" element. If
the field is to be displayed (ie: it doesn't have a noFormPost=>1 element)
then it must also at minimum have label elements. In addition, you must
specify assetName, tableName, and properties defines at minimum. Anything less
is invalid.
7) The properties attribute must be an array reference of properties. No more
Tie::IxHash.
8) The autoGenerateForms has been removed. All edit forms are autogenerated in
WebGUI 8.
9) You no longer have the "visible" element. It was a duplicate of
"noFormPost", so use "noFormPost" instead.
10) You no longer have the "displayOnly" element. Make a custom form control
instead.
11) Defaults for properties are set by the default key in the property. This
sets form defaults as well. This means that newly created Assets always have
sane defaults. Unless specifically overridden, any property can be set to
undef. This takes care of the long standing problem with sticky titles and
other fields.
12) You no longer have the "allowEmpty" element. However, you can now specify
an initial value in the "value" element, and set "default" to undef if you
want to have an initial value but allow the field to become empty or undef.
Here's an example.
use WebGUI::Definition::Asset;
extends 'WebGUI::Asset';
define assetName => 'Gadget';
define tableName => 'gadget';
define uiLevel => 5;
define icon => 'gadget.gif';
property urlToJavascript => (
fieldType => 'url',
label => ['URL to Javascript Class','Asset_Gadget'],
hoverHelp => ['URL to Javascript Class help','Asset_Gadget'],
);
property foo => (
fieldType => 'text',
noFormPost => 1,
);
property bar => (
fieldType => 'codearea',
uiLevel => 9,
label => ['Bar','Asset_Gadget'],
hoverHelp => ['Bar help','Asset_Gadget'],
builder => '_bar_builder', ##Set default using Moose's builder and lazy method
lazy => 1,
);
sub _bar_builder {
my $self = shift;
return $self->callSomeMethod;
}
property baz => (
fieldType => 'checkboxList',
label => ['Baz','Asset_Gadget'],
hoverHelp => ['Baz help','Asset_Gadget'],
default => 1,
options => \&_baz_options, ##method called when getFormProperties called, automatically lazy
);
sub _baz_options {
my ($self, $property_meta_object, $property_name) = @_;
my $session = $self->session;
my $i18n = WebGUI::International->new($session, 'Asset_Gadget');
tie my %options, 'Tie::IxHash';
%options = (
one => $i18n->get('one'),
two => $i18n->get('two'),
three => $i18n->get('three'),
);
return \%options;
}
Asset Instanciators
-------------------
Moose does not allow a dynamic class to be passed into ->new. Trying to
access an asset from the database like this:
WebGUI::Asset->new($session, $assetId, 'WebGUI::Asset::Template');
will give you back an object with class WebGUI::Asset, with some of the data from the Template.
You have two options to deal with this:
1) Brute force method
my $class = WebGUI::Asset->loadModule($asset_module_name);
my $asset = $class->new($session, $assetId);
2) Use newById
newById replaces the older, and longer, newByDynamicClass method.
my $asset = WebGUI::Asset->newById($session, $assetId);
->new itself will either lookup an asset in the database and return you an object, or build you
an object without storing the data into the database, depending on how it's called.
WebGUI::Asset::SomeClass->new($session, $assetId, $revisionDate) will try to look up the requested object
of type SomeClass, populated with information from the database.
WebGUI::Asset::SomeClass->new($propertyHashRef) will return you an object of type SomeClass populated
with the properties you have passed in. Missing properties will have default set from the definition.
Asset & Moose
-------------
The update method for Asset's now comes from WebGUI::Definition::Role::Object. Since the Asset base
class does not have an update method, you cannot use Moose's "override" method modifier to add
behavior to it. You must use "around" instead. Note, in most cases, you should never need
to do this, because it is much more modular to use modifiers on individual asset properties.
Exceptions
----------
All Asset instanciators, new, newById, newByUrl, newPending, newByPropertyHashRef throw exceptions instead
of returning undef to indicate an error. You should wrap any call to an instanciator in an eval, and catch
any exceptions that are thrown and deal with them.
my $asset = eval { WebGUI::Asset->newById($session, $assetId); };
if (my $exception = Exception::Class->caught() ) {
##Log or handle the exception. Exceptions can also be rethrown to be passed farther up the call chain.
}
Removed Methods
---------------
assetDbProperties - Simply instanciate the asset if you want it's properties.
assetExists - Simply instanciate the asset if you want to know if it exists.
getValue - Use get() or the individual property accessors instead.
fixTitle - The title() method does what this used to do as the title is set.
fixUrlFromParent - This functionality is built into fixUrl, so that all fixes happen and can't cause breakages.
fixId - Never assign the asset anything other than a GUID.
Asset API
----------
->get will still work, but will be slightly slower since inside it calls the direct Moose accessor. Similarly,
getId is slightly slower than ->assetId.
processPropertiesFromFormPost
-----------------------------
Absurdly long and non-descriptive name, changed to processEditForm
Admin Controls
--------------------
The admin controls are now added to the asset with javascript. This javascript
is located in www/extras/admin/toolbar.js
Turn Admin On
--------------------
There is no Turn Admin On. In order to maintain some backwards compatibility,
if you are a member of the Turn Admin On group, "Admin On" will be set when you
log in.
www_add/www_edit
--------------------
www_add is now its own page, it is no longer handled by www_edit. www_addSave
is also its own page, it is no longer handled by www_addSave.
If you had previously overrode www_edit to provide a template, you must move
that code into an overridden getEditTemplate. See WebGUI::Asset::Event,
WebGUI::Asset::Post, WebGUI::Asset::Wobject::GalleryAlbum for examples.
Lineage
--------------------
Assets created for use during www_add do NOT have a lineage. Calling
getLineage on them will return assets from below the root asset, and not
the child. See WebGUI::Asset::Wobject::GalleryAlbum::getFileIds.
WebGUI::Shop::Vendor
====================
Object properties are no longer written to the database when an object is
created from scratch. The write method needs to be called.
WebGUI::Shop::AddressBook
=========================
Since create is now really new, there is no way to create an address book for
an arbitrary userId. To work around this, update the address book with the
new userId after it has been created.
WebGUI::Shop::PayDriver
=======================
getEditForm now returns a WebGUI::FormBuilder object
WebGUI::Shop::ShipDriver
========================
getEditForm now returns a WebGUI::FormBuilder object
WebGUI::Shop::TaxDriver
=======================
getConfigurationScreen is now called getEditForm and should return a WebGUI::FormBuilder object
WebGUI::Shop::Address
=====================
Object properties are no longer written to the database when an object is
created from scratch. The write method needs to be called.
WebGUI::Shop::Transaction
=========================
Object properties are no longer written to the database when an object is
created from scratch. The write method needs to be called.
WebGUI::Shop::TransactionItem
=============================
Object properties are no longer written to the database when an object is
created from scratch. The write method needs to be called.
WebGUI::Shop::CartItem
=============================
Object properties are no longer written to the database when an object is
created from scratch. The write method needs to be called.
Inventory adjust is also no longer done when an object is created from
scratch. You will need to call onAdjustQuantityInCart manually.
WebGUI::URL
==========================
In WebGUI 8, URL handlers are now done as Plack middleware. See
WebGUI::Middleware::Snoop and WebGUI::Middleware::WGAccess for examples.
WebGUI::Session::Var
==========================
WebGUI::Session::Var was removed, and all of its code merged into
WebGUI::Session. Any call that used to be made to $session->var should now go
directly to $session.
WebGUI::Session::Http
==========================
getStatus and setStatus have been removed. To set or get the status of an HTTP response
generated by WebGUI, access the WebGUI::Response object in the session:
OLD: $session->http->getStatus();
NEW: $session->response->status();
OLD: $session->http->setStatus(200);
NEW: $session->response->status(200);
getMimeType and setMimeType have been removed. To set or get the content type of an HTTP response
generated by WebGUI, access the WebGUI::Response object in the session:
OLD: $session->http->getMimeType();
NEW: $session->response->content_type();
OLD: $session->http->setMimeType('application/json');
NEW: $session->response->content_type('application/json');
getFilename and setFilename have been removed. To set the filename that should be
uploaded to the user, access the WebGUI::Response object in the session. First, set
the header for the Content-Dispostion, then set the content type.
OLD: $session->http->setFilename($filename);
NEW: $session->response->header( 'Content-Disposition' => qq{attachment; filename="}.$filename.'"');
$session->response->content_type('application/octet-stream');
getRedirectLocation and setRedirectLocation have been removed. These methods were not
used outside of WebGUI::Session::Http, but were designed for object encapsulation
inside the object. If you need to directly set or access the redirect location,
use the location mutator in the WebGUI::Response object in the session.
OLD: $session->http->setRedirectLocation($url);
NEW: $session->response->location($url);
OLD: $session->http->getRedirectLocation();
NEW: $session->response->location();
ifModifiedSince was moved from WebGUI::Session::Http to WebGUI::Session::Request.
OLD: $session->http->ifModifiedSince;
NEW: $session->request->ifModifiedSince;
WebGUI::Workflow::Activity
==========================
getEditForm now returns a WebGUI::FormBuilder object
Show Performance Indicators
==========================
This setting is removed, as the Plack debug console shows this for us.
WebGUI::Asset::Wobject::Survey
==========================
The surveyJSON method conflicted with the new Moose accessor. In WebGUI 8,
the old surveyJSON is called getSurveyJSON.

2543
docs/previousVersion.sql Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,16 +1,6 @@
This is a running list of template changes made during upgrades. If you have copied the default
templates, you will need to apply these changes manually to your copies.
8.0
* Account Macro template variables renamed:
account.url => account_url
account.text => account_text
* AdminToggle Macro template variables renamed:
toggle.url => toggle_url
toggle.text => toggle_text
7.10.22
* Thingy CSS file - root/import/thingy-templates/thingy.css
Add CSS to make sure that overflows are visible, to handle style that hide overflow by default.

View file

@ -0,0 +1,126 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = "0.0.0"; # make this match what version you're going to
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
if ($toVersion eq "0.0.0") {
die "toVersion=$toVersion, aborting upgrade\n";
}
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,223 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.1';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
uniqueProductLocations($session);
removeBadSpanishFile($session);
i18nForAddonsTitle($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
sub uniqueProductLocations {
my $session = shift;
print "\tMake sure each Product revision has its own storage location... " unless $quiet;
use WebGUI::Asset::Sku::Product;
my $get_product = WebGUI::Asset::Sku::Product->getIsa($session);
# and here's our code
PRODUCT: while (1) {
my $product = eval { $get_product->(); };
next PRODUCT if Exception::Class->caught();
last PRODUCT unless $product;
next PRODUCT unless $product->getRevisionCount > 1;
my $products = $product->getRevisions;
##We already have the first revision, so remove it.
shift @{ $products };
foreach my $property (qw/image1 image2 image3 brochure manual warranty/) {
##Check each property. If there's a duplicate, then make copy of the storage location and update the older version.
foreach my $revision (@{ $products }) {
if ($revision->get($property) eq $product->get($property)) {
$product->_duplicateFile($revision, $property,);
}
}
}
}
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# This internationalizes the link text of the addons link in the adminconsole
sub i18nForAddonsTitle {
my $session = shift;
print "\tInternationalize the text of the addons link in the adminconsole... " unless $quiet;
$session->config->set('adminConsole/addons',
{
icon => "addons.png",
uiLevel => 1,
group => "12",
url => "http://www.webgui.org/addons",
title => "^International(Addons title,WebGUI);"
}
);
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub removeBadSpanishFile {
my $session = shift;
print "\tRemove a bad Spanish translation file... " unless $quiet;
use File::Spec;
unlink File::Spec->catfile($webguiRoot, qw/lib WebGUi i18n Spanish .pm/);
# and here's our code
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Repack all templates since the packed columns may have been wiped out due to the bug.
sub repackTemplates {
my $session = shift;
print "\tRepacking all templates, this may take a while..." unless $quiet;
my $sth = $session->db->read( "SELECT assetId, revisionDate FROM template" );
while ( my ($assetId, $revisionDate) = $sth->array ) {
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate );
next unless $asset;
$asset->update({
template => $asset->get('template'),
});
}
print "DONE!\n" unless $quiet;
print "\tRepacking head tags in all assets, this may take a while..." unless $quiet;
$sth = $session->db->read( "SELECT assetId, revisionDate FROM assetData where usePackedHeadTags=1" );
while ( my ($assetId, $revisionDate) = $sth->array ) {
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate );
next unless $asset;
$asset->update({
extraHeadTags => $asset->get('extraHeadTags'),
});
}
print "DONE!\n" unless $quiet;
print "\tRepacking all snippets, this may take a while..." unless $quiet;
$sth = $session->db->read( "SELECT assetId, revisionDate FROM snippet" );
while ( my ($assetId, $revisionDate) = $sth->array ) {
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate );
next unless $asset;
$asset->update({
snippet => $asset->get('snippet'),
});
}
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
repackTemplates( $session );
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,124 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::Inbox;
my $toVersion = '7.10.2';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,123 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.11';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,189 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.12';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
installNewDashboardTables($session);
addStockDataCacheColumn($session);
addWeatherDataCacheColumn($session);
addLastModifiedByMacro($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
# Describe what our function does
sub addLastModifiedByMacro {
my $session = shift;
print "\tAdd LastModifiedBy macro to the config file... " unless $quiet;
# and here's our code
$session->config->addToHash('macros', 'LastModifiedBy', 'LastModifiedBy');
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub installNewDashboardTables {
my $session = shift;
print "\tInstall new Dashboard tables... " unless $quiet;
$session->db->write(<<EOSQL);
CREATE TABLE IF NOT EXISTS Dashboard_dashlets (
dashboardAssetId CHAR(22) BINARY,
dashletAssetId CHAR(22) BINARY,
isStatic BOOLEAN,
isRequired BOOLEAN,
PRIMARY KEY (dashboardAssetId, dashletAssetId)
) TYPE=MyISAM CHARSET=utf8;
EOSQL
$session->db->write(<<EOSQL);
CREATE TABLE IF NOT EXISTS Dashboard_userPrefs (
dashboardAssetId CHAR(22) BINARY,
dashletAssetId CHAR(22) BINARY,
userId CHAR(22) BINARY,
isMinimized BOOLEAN,
properties LONGTEXT,
PRIMARY KEY (dashboardAssetId, dashletAssetId, userId)
) TYPE=MyISAM CHARSET=utf8;
EOSQL
# and here's our code
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addStockDataCacheColumn {
my $session = shift;
print "\tAdd cache column for the StockData asset... " unless $quiet;
$session->db->write(<<EOSQL);
ALTER TABLE StockData ADD COLUMN cacheTimeout BIGINT
EOSQL
# and here's our code
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addWeatherDataCacheColumn {
my $session = shift;
print "\tAdd cache column for the WeatherData asset... " unless $quiet;
$session->db->write(<<EOSQL);
ALTER TABLE WeatherData ADD COLUMN cacheTimeout BIGINT
EOSQL
# and here's our code
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,165 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.13';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addAutoPlayToCarousel( $session );
addProcessorDropdownToSnippet( $session );
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
# Add AutoPlay fields to the Carousel
sub addAutoPlayToCarousel {
my $session = shift;
print "\tAdding Auto Play to Carousel... " unless $quiet;
$session->db->write(
"ALTER TABLE Carousel ADD COLUMN autoPlay INT, ADD COLUMN autoPlayInterval INT"
);
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addProcessorDropdownToSnippet {
my $session = shift;
my $db = $session->db;
print "\tUpdating the Snippet table to add templateProcessor option..."
unless $quiet;
my $rows = $db->buildArrayRefOfHashRefs(q{
select assetId, revisionDate from snippet where processAsTemplate = 1
});
$db->write(q{
alter table snippet
drop column processAsTemplate,
add column templateParser char(255)
});
my $default = $session->config->get('defaultTemplateParser');
for my $row (@$rows) {
$db->write(q{
update snippet
set templateParser = ?
where assetId = ? and revisionDate = ?
}, [ $default, $row->{assetId}, $row->{revisionDate} ]);
}
print "Done!\n";
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,191 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::Asset::Wobject::Calendar;
my $toVersion = '7.10.14';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addOrganizationsToTransaction($session);
removeDuplicateUndergroundStyleTemplates($session);
addRichEditToCarousel($session);
fixBadCalendarFeedStatus($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
# Describe what our function does
sub fixBadCalendarFeedStatus {
my $session = shift;
print "\tFix the name of the iCal status field in all Calendar assets... " unless $quiet;
# and here's our code
my $fetch_calendar = WebGUI::Asset::Wobject::Calendar->getIsa($session);
my $sth = $session->db->read('select assetId, revisionDate from Calendar');
CALENDAR: while (my ($assetId, $revisionDate) = $sth->array) {
my $calendar = eval {WebGUI::Asset->new($session, $assetId, 'WebGUI::Asset::Wobject::Calendar', $revisionDate)};
next CALENDAR if !$calendar;
FEED: foreach my $feed ( @{ $calendar->getFeeds } ) {
my $status = delete $feed->{status};
if (!exists $feed->{lastResult}) {
$feed->{lastResult} = $status;
}
if (!exists $feed->{lastUpdated}) {
$feed->{lastUpdated} = 'never';
}
$calendar->setFeed($feed->{feedId}, $feed);
}
}
$sth->finish;
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addOrganizationsToTransaction {
my $session = shift;
print "\tAdd organization fields to the addresses stored in the Transaction and TransactionItem... " unless $quiet;
# and here's our code
$session->db->write('ALTER TABLE transaction ADD COLUMN shippingOrganization CHAR(35)');
$session->db->write('ALTER TABLE transaction ADD COLUMN paymentOrganization CHAR(35)');
$session->db->write('ALTER TABLE transactionItem ADD COLUMN shippingOrganization CHAR(35)');
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub removeDuplicateUndergroundStyleTemplates {
my $session = shift;
print "\tRemove duplicate Underground Style templatess that were mistakenly added during the 7.10.13 upgrade... " unless $quiet;
# and here's our code
ASSETID: foreach my $assetId(qw/IeFioyemW2Ov-hFGFwD75A niYg8Da1sULTQnevZ8wYpw/) {
my $asset = WebGUI::Asset->newByDynamicClass($session, $assetId);
next ASSETID unless $asset;
$asset->purge; ##Kill it, crush it, grind its bits into dust.
}
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addRichEditToCarousel {
my $session = shift;
print "\tAdd RichEdit option to the Carousel... " unless $quiet;
# and here's our code
$session->db->write('ALTER TABLE Carousel ADD COLUMN richEditor CHAR(22) BINARY');
$session->db->write(q!update Carousel set richEditor='PBrichedit000000000001'!);
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,160 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::AssetAspect::Installable;
use WebGUI::Asset::MapPoint;
use WebGUI::Asset::Wobject::Thingy;
my $toVersion = '7.10.15';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
alterAssetIndexTable($session);
reindexAllThingys($session);
WebGUI::AssetAspect::Installable::upgrade("WebGUI::Asset::MapPoint",$session);
addRenderThingDataMacro($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
sub addRenderThingDataMacro {
my $session = shift;
print "\tAdd the new RenderThingData macro to the site config... " unless $quiet;
$session->config->addToHash('macros', 'RenderThingData', 'RenderThingData');
print "DONE!\n" unless $quiet;
}
sub alterAssetIndexTable {
my $session = shift;
print "\tExtend the assetIndex table so we can search things other than assets... " unless $quiet;
$session->db->write(<<EOSQL);
alter table assetIndex
drop primary key,
add column subId char(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
add primary key (assetId, url)
EOSQL
print "DONE!\n" unless $quiet;
}
sub reindexAllThingys {
my $session = shift;
print "\tReindex all Thingys... " unless $quiet;
my $get_thingy = WebGUI::Asset::Wobject::Thingy->getIsa($session);
THINGY: while (1) {
my $thingy = eval { $get_thingy->() };
next THINGY if Exception::Class->caught();
last THINGY unless $thingy;
$thingy->indexContent;
}
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,135 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.16';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addAssetPropertyMacro($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
sub addAssetPropertyMacro {
my $session = shift;
my $c = $session->config;
my $hash = $c->get('macros');
unless (grep { $_ eq 'AssetProperty' } values %$hash) {
print "\tAdding AssetProperty macro... " unless $quiet;
$c->set('macros/AssetProperty' => 'AssetProperty');
print "DONE!\n" unless $quiet;
}
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,139 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.17';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
createThingyDBColumns($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
# Creates new column in tables for Thingy_fields and Thingy_things
sub createThingyDBColumns {
my $session = shift;
print "\tAdding db. columns Thingy_fields.isUnique and Thingy_things.maxEntriesTotal.." unless $quiet;
# and here's our code
my %tfHash = $session->db->quickHash("show columns from Thingy_fields where Field='isUnique'");
my %ttHash = $session->db->quickHash("show columns from Thingy_things where Field='maxEntriesTotal'");
unless ( $tfHash{'Field'}) { $session->db->write("alter table Thingy_fields add isUnique int(1) default 0"); }
unless ( $ttHash{'Field'}) { $session->db->write("alter table Thingy_things add maxEntriesTotal int default null"); }
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,172 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.18';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addAssetManagerSortPreferences($session);
finish($session); # this line required
#----------------------------------------------------------------------------
sub addAssetManagerSortPreferences {
my $cn = 'assetManagerSortColumn';
my $on = 'assetManagerSortDirection';
unless (WebGUI::ProfileField->new($session, $cn)) {
print 'Adding Asset Manager Sort Column profile field...'
unless $quiet;
WebGUI::ProfileField->create($session, $cn => {
label =>
"WebGUI::International::get('$cn label', 'Account_Profile')",
protected => 1,
fieldType => 'selectBox',
dataDefault => 'lineage',
possibleValues => <<'VALUES',
{
lineage => WebGUI::International::get('rank', 'Asset'),
title => WebGUI::International::get(99, 'Asset'),
className => WebGUI::International::get('type', 'Asset'),
revisionDate => WebGUI::International::get('revision date', 'Asset'),
assetSize => WebGUI::International::get('size', 'Asset'),
lockedBy => WebGUI::International::get('locked', 'Asset'),
}
VALUES
}, 4);
print "Done!\n" unless $quiet;
}
unless (WebGUI::ProfileField->new($session, $on)) {
print 'Adding Asset Manager Sort Direction profile field...'
unless $quiet;
WebGUI::ProfileField->create($session, $on => {
label =>
"WebGUI::International::get('$on label', 'Account_Profile')",
protected => 1,
fieldType => 'selectBox',
dataDefault => 'asc',
possibleValues => <<'VALUES',
{
asc => WebGUI::International::get('ascending', 'Account_Profile'),
desc => WebGUI::International::get('descending', 'Account_Profile'),
}
VALUES
}, 4);
print "Done!\n" unless $quiet;
}
}
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,177 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::Asset::Wobject::Calendar;
use Exception::Class;
my $toVersion = '7.10.19';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addTicketLimitToBadgeGroup( $session );
fixBrokenCalendarFeedUrls ( $session );
removeUndergroundUserStyleTemplate ( $session );
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# Fix calendar feed urls that had adminId attached to them until they blew up
sub fixBrokenCalendarFeedUrls {
my $session = shift;
print "\tChecking all calendar feed URLs for adminId brokenness... " unless $quiet;
my $getCalendar = WebGUI::Asset::Wobject::Calendar->getIsa($session);
CALENDAR: while (1) {
my $calendar = eval { $getCalendar->(); };
next CALENDAR if Exception::Class->caught;
last CALENDAR unless $calendar;
FEED: foreach my $feed (@{ $calendar->getFeeds }) {
$feed->{url} =~ s/adminId=[^;]{22};?//g;
$feed->{url} =~ s/\?$//;
$calendar->setFeed($feed->{feedId}, $feed);
}
}
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add a ticket limit to badges in a badge group
sub removeUndergroundUserStyleTemplate {
my $session = shift;
print "\tRemove Underground User Style template... " unless $quiet;
if ($session->setting->get('userFunctionStyleId') eq 'zfDnOJgeiybz9vnmoEXRXA') {
$session->setting->set('userFunctionStyleId', 'Qk24uXao2yowR6zxbVJ0xA');
}
my $underground_user = WebGUI::Asset->newByDynamicClass($session, 'zfDnOJgeiybz9vnmoEXRXA');
if ($underground_user) {
$underground_user->purge;
}
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add a ticket limit to badges in a badge group
sub addTicketLimitToBadgeGroup {
my $session = shift;
print "\tAdd ticket limit to badge groups... " unless $quiet;
# Make sure it hasn't been done already...
my $columns = $session->db->buildHashRef('describe EMSBadgeGroup');
use List::MoreUtils qw(any);
if(!any { $_ eq 'ticketsPerBadge' } keys %{$columns}) {
$session->db->write(q{
ALTER TABLE EMSBadgeGroup ADD COLUMN `ticketsPerBadge` INTEGER
});
}
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,147 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.20';
my $quiet; # this line required
my $session = start(); # this line required
addFormFieldMacroToConfig();
# upgrade functions go here
fixSpacesInTaxInfo ( $session );
sub addFormFieldMacroToConfig {
print "\tAdd FormField macro to config... " unless $quiet;
$session->config->addToHash( 'macros', FormField => 'FormField' );
print "DONE!\n" unless $quiet;
}
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
# Fix calendar feed urls that had adminId attached to them until they blew up
sub fixSpacesInTaxInfo {
my $session = shift;
print "\tRemoving spaces around commas in generic tax rate information... " unless $quiet;
use WebGUI::Shop::TaxDriver::Generic;
my $taxer = WebGUI::Shop::TaxDriver::Generic->new($session);
my $taxIterator = $taxer->getItems;
while (my $taxInfo = $taxIterator->hashRef) {
my $taxId = $taxInfo->{taxId};
$taxer->add($taxInfo); ##Automatically removes spaces now.
$taxer->delete({taxId => $taxId});
}
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,172 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.3';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
pruneInboxMessagesFromDeletedUsers($session);
addTemplateToNotifyAboutVersionTag($session);
addPasswordRecoveryEmailTemplate($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
sub pruneInboxMessagesFromDeletedUsers {
my $session = shift;
print "\tPruning inbox messages from deleted users. This may take a while... " unless $quiet;
my $sth = $session->db->prepare(<<EOSQL);
select messageId, inbox.userId
from inbox_messageState
join inbox using (messageId)
left outer join users on inbox.userId=users.userId
where users.userId IS NULL
EOSQL
$sth->execute([]);
use WebGUI::Inbox;
my $inbox = WebGUI::Inbox->new($session);
while (my ($messageId, $userId) = $sth->array) {
my $message = $inbox->getMessage($messageId, $userId);
if ($message) {
$message->delete;
}
}
print "...DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addTemplateToNotifyAboutVersionTag {
my $session = shift;
print "\tAdd template to Notify About Version Tag workflow activities." unless $quiet;
use WebGUI::Workflow::Activity;
use WebGUI::Workflow::Activity::NotifyAboutVersionTag;
my $templateId = WebGUI::Workflow::Activity::NotifyAboutVersionTag->definition($session)->[0]->{properties}->{templateId}->{defaultValue};
my $activityList = $session->db->read(q|select activityId from WorkflowActivity|);
while (my ($activityId) = $activityList->array) {
my $activity = WebGUI::Workflow::Activity->new($session, $activityId);
next unless $activity;
next unless $activity->isa('WebGUI::Workflow::Activity::NotifyAboutVersionTag')
|| $activity->isa('WebGUI::Workflow::Activity::RequestApprovalForVersionTag')
;
$activity->set('templateId', $templateId);
}
print "...DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addPasswordRecoveryEmailTemplate {
my $session = shift;
print "\tAdd a template for the password recovery email." unless $quiet;
$session->setting->add('webguiPasswordRecoveryEmailTemplate', 'sK_0zVw4kwdJ1sqREIsSzA');
print "...DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,146 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.21';
my $quiet; # this line required
my $session = start(); # this line required
addWaitForConfirmationWorkflow($session);
addCreateUsersEnabledSetting($session);
finish($session); # this line required
#----------------------------------------------------------------------------
sub addWaitForConfirmationWorkflow {
my $session = shift;
my $c = $session->config;
my $exists = $c->get('workflowActivities/WebGUI::User');
my $class = 'WebGUI::Workflow::Activity::WaitForUserConfirmation';
unless (grep { $_ eq $class } @$exists) {
print "Adding WaitForUserConfirmation workflow..." unless $quiet;
$c->addToArray('workflowActivities/WebGUI::User' => $class);
print "Done!\n" unless $quiet;
}
}
#----------------------------------------------------------------------------
sub addCreateUsersEnabledSetting {
my $session = shift;
my $s = $session->setting;
my $name = 'enableUsersAfterAnonymousRegistration';
return if $s->has($name);
print "Adding $name setting..." unless $quiet;
$s->add($name => 1);
print "Done!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,200 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.22';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addAuthorizePaymentDriver($session);
createAddressField($session);
addLinkedProfileAddress($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
# Add the Authorize.net payment driver to each config file
sub addAuthorizePaymentDriver {
my $session = shift;
print "\tAdd the Authorize.net payment driver... " unless $quiet;
# and here's our code
$session->config->addToArray('paymentDrivers', 'WebGUI::Shop::PayDriver::CreditCard::AuthorizeNet');
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addLinkedProfileAddress {
my $session = shift;
print "\tAdding linked profile addresses for existing users... " unless $quiet;
my $users = $session->db->read( q{ select userId from users } );
use WebGUI::User;
use WebGUI::Shop::AddressBook;
while (my ($userId) = $users->array()) {
#check to see if there is user profile information available
next if $userId eq '1' or $userId eq '3';
last unless $userId;
my $u = WebGUI::User->new($session,$userId);
#skip if user does not have any homeAddress fields filled in
next unless (
$u->profileField("homeAddress")
|| $u->profileField("homeCity")
|| $u->profileField("homeState")
|| $u->profileField("homeZip")
|| $u->profileField("homeCountry")
|| $u->profileField("homePhone")
);
#Get the address book for the user (one is created if it does not exist)
my $addressBook = WebGUI::Shop::AddressBook->newByUserId($session,$userId);
#Add the profile address for the user
$addressBook->addAddress({
label => "Profile Address",
firstName => $u->profileField("firstName"),
lastName => $u->profileField("lastName"),
address1 => $u->profileField("homeAddress"),
city => $u->profileField("homeCity"),
state => $u->profileField("homeState"),
country => $u->profileField("homeCountry"),
code => $u->profileField("homeZip"),
phoneNumber => $u->profileField("homePhone"),
email => $u->profileField("email"),
isProfile => 1,
});
}
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub createAddressField {
my $session = shift;
#skip if field exists
my $columns = $session->db->buildArrayRef("show columns from address where Field='isProfile'");
return if(scalar(@$columns));
print "\tAdding profile link to Address... " unless $quiet;
$session->db->write( q{
alter table address add isProfile tinyint default 0
} );
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,141 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.23';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
fixBadTemplateAttachments($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
sub fixBadTemplateAttachments {
my $session = shift;
print "\tRemove template attachements in search templates that refer to an old, deleted CSS snippet... " unless $quiet;
# and here's our code
use WebGUI::Asset::Template;
my $get_template = WebGUI::Asset::Template->getIsa($session);
TEMPLATE: while (1) {
my $template = eval {$get_template->()};
next TEMPLATE if Exception::Class->caught;
last TEMPLATE unless $template;
next TEMPLATE unless $template->get('namespace') eq 'Search';
$template->removeAttachments(['^/(webgui.css);']);
}
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,183 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.24';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addPALastLogTable($session);
addForkRedirect($session);
extendBucketName($session);
fixSurveyQuestionTypes($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
sub addPALastLogTable {
my $session = shift;
print "\tAdd a table to keep track of additional Passive Analytics data... " unless $quiet;
# and here's our code
$session->db->write(<<EOSQL);
CREATE TABLE IF NOT EXISTS `PA_lastLog` (
`userId` char(22) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`assetId` char(22) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`sessionId` char(22) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`timeStamp` bigint(20) DEFAULT NULL,
`url` char(255) NOT NULL,
PRIMARY KEY (userId, sessionId)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
EOSQL
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addForkRedirect {
my $session = shift;
print "\tAdd a column to Fork to keep track of late generated redirect URLs... " unless $quiet;
# and here's our code
$session->db->write(<<EOSQL);
ALTER TABLE Fork add column redirect CHAR(255);
EOSQL
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub extendBucketName {
my $session = shift;
print "\tExtend the size of the bucket name in the bucketLog table for Passive Analytics... " unless $quiet;
# and here's our code
$session->db->write(<<EOSQL);
ALTER TABLE bucketLog CHANGE COLUMN Bucket Bucket CHAR(255)
EOSQL
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub fixSurveyQuestionTypes {
my $session = shift;
print "\tFix bad custom Question Types in the Survey... " unless $quiet;
# and here's our code
$session->db->write(<<EOSQL);
update Survey_questionTypes set answers="{}" where answers like 'HASH%';
EOSQL
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

View file

@ -0,0 +1,139 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.25';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
installCleanCookieJars($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
sub installCleanCookieJars {
my $session = shift;
print "\tInstall the new CleanCookieJars workflow activity... " unless $quiet;
# and here's our code
$session->config->addToArray('workflowActivities/None', 'WebGUI::Workflow::Activity::CleanCookieJars');
my $workflow = WebGUI::Workflow->new($session, 'pbworkflow000000000001');
my $cleaner = $workflow->addActivity('WebGUI::Workflow::Activity::CleanCookieJars');
$cleaner->set('title', 'Clean HttpProxy Cookie jars');
$cleaner->set('description', 'Removes cookie jar files from the HttpProxy asset that are older than 1 day');
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl

Some files were not shown because too many files have changed in this diff Show more