Merge branch 'master' of github.com:plainblack/webgui

This commit is contained in:
David Delikat 2012-02-10 16:43:43 +00:00
commit 57bef51545
2510 changed files with 58390 additions and 85572 deletions

1
.proverc Normal file
View file

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

47
README Normal file
View file

@ -0,0 +1,47 @@
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, and uploadsPath (eg to /data/domains/www.example.com/public/uploads/)
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/
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)

21
TODO Normal file
View file

@ -0,0 +1,21 @@
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'

161
WebGUI-Session-Plack.pm Normal file
View file

@ -0,0 +1,161 @@
package WebGUI::Session::Plack;
# This file is deprecated - keeping it here for reference until everything has been ported
use strict;
use warnings;
use Carp;
=head1 DESCRIPTION
This class is used instead of WebGUI::Session::Request when wg is started via plackup
=cut
sub new {
my ( $class, %p ) = @_;
# 'require' rather than 'use' so that non-plebgui doesn't freak out
require Plack::Request;
my $request = Plack::Request->new( $p{env} );
my $response = $request->new_response(200);
bless {
%p,
pnotes => {},
request => $request,
response => $response,
server => WebGUI::Session::Plack::Server->new( env => $p{env} ),
headers_out => Plack::Util::headers( [] ), # use Plack::Util to manage response headers
body => [],
sendfile => undef,
}, $class;
}
our $AUTOLOAD;
sub AUTOLOAD {
my $what = $AUTOLOAD;
$what =~ s/.*:://;
carp "!!plack->$what(@_)" unless $what eq 'DESTROY';
}
# Emulate/delegate/fake Apache2::* subs
sub uri { shift->{request}->path_info }
sub param { shift->{request}->param(@_) }
sub params { shift->{request}->prameters->mixed(@_) }
sub headers_in { shift->{request}->headers(@_) }
sub headers_out { shift->{headers_out} }
sub protocol { shift->{request}->protocol(@_) }
sub status { shift->{response}->status(@_) }
sub sendfile { $_[0]->{sendfile} = $_[1] }
sub server { shift->{server} }
sub method { shift->{request}->method }
sub upload { shift->{request}->upload(@_) }
sub dir_config { shift->{server}->dir_config(@_) }
sub status_line { }
sub auth_type { } # should we support this?
sub handler {'perl-script'} # or not..?
sub content_type {
my ( $self, $ct ) = @_;
$self->{headers_out}->set( 'Content-Type' => $ct );
}
# TODO: I suppose this should do some sort of IO::Handle thing
sub print {
my $self = shift;
push @{ $self->{body} }, @_;
}
sub pnotes {
my ( $self, $key ) = ( shift, shift );
return wantarray ? %{ $self->{pnotes} } : $self->{pnotes} unless defined $key;
return $self->{pnotes}{$key} = $_[0] if @_;
return $self->{pnotes}{$key};
}
sub user {
my ( $self, $user ) = @_;
if ( defined $user ) {
$self->{user} = $user;
}
$self->{user};
}
sub push_handlers {
my $self = shift;
my ( $x, $sub ) = @_;
# log it
# carp "push_handlers($x)";
# run it
# returns something like Apache2::Const::OK, which we just ignore because we're not modperl
my $ret = $sub->($self);
return;
}
sub finalize {
my $self = shift;
my $response = $self->{response};
if ( $self->{sendfile} && open my $fh, '<', $self->{sendfile} ) {
$response->body($fh);
}
else {
$response->body( $self->{body} );
}
$response->headers( $self->{headers_out}->headers );
return $response->finalize;
}
sub no_cache {
my ( $self, $doit ) = @_;
if ($doit) {
$self->{headers_out}->set( 'Pragma' => 'no-cache', 'Cache-control' => 'no-cache' );
}
else {
$self->{headers_out}->remove( 'Pragma', 'Cache-control' );
}
}
################################################
package WebGUI::Session::Plack::Server;
use strict;
use warnings;
use Carp;
sub new {
my $class = shift;
bless {@_}, $class;
}
our $AUTOLOAD;
sub AUTOLOAD {
my $what = $AUTOLOAD;
$what =~ s/.*:://;
carp "!!server->$what(@_)" unless $what eq 'DESTROY';
}
sub dir_config {
my ( $self, $c ) = @_;
# Translate the legacy WebguiRoot and WebguiConfig PerlSetVar's into known values
return WebGUI->root if $c eq 'WebguiRoot';
return WebGUI->config_file if $c eq 'WebguiConfig';
# Otherwise, we might want to provide some sort of support (which Apache is still around)
return $self->{env}->{"wg.DIR_CONFIG.$c"};
}
################################################
package Plack::Request::Upload;
sub link { shift->link_to(@_) }
1;

52
app.psgi Normal file
View file

@ -0,0 +1,52 @@
=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;
};

BIN
asset_status.ods Normal file

Binary file not shown.

19
benchmark.pl Executable file
View file

@ -0,0 +1,19 @@
# 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;
};

View file

@ -1,5 +1,20 @@
7.10.25
7.10.24
- fixed #12318: asset error causes asset manager to fail
- fixed #12308: error message used scalar as reference
- fixed #12256: Calendar Search doesn't show admin controls
- fixed #12268: Point of sale form missing from cart screen.
- fixed #12201: AssetReport - no selects.
- fixed #12269: Login / Loginbox with encryptlogin
- fixed #12271: Calendar List View does not always show labels
- fixed Passive Analytics, UI, Progress Bar, server load.
- fixed #12303: Survey custom multiple choice question types
- fixed #12304: Surven packages do not include custom question types
- fixed #12309: Some child assets ignore visitor cache timeouts
- fixed possible values and default values on EMS submission.
- fixed #12312: Shop account plugin has unrendered macro
- fixed #12315: Remove yui tests from git repo.
7.10.23
- fixed #12225: Stock asset, multiple instances on a page

6
docs/changelog/8.x.x.txt Normal file
View file

@ -0,0 +1,6 @@
8.0.0
- 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.

View file

@ -99,3 +99,5 @@ 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,6 +7,37 @@ 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
--------------------------------------------------------------------
* 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.
* Many scripts in the sbin directory have been replaced by the webgui.pl
master script.
* upgrade.pl -> webgui.pl upgrade
* 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.
7.10.24
--------------------------------------------------------------------
* WebGUI now depends on Business::OnlinePayment::AuthorizeNet. This version
@ -104,6 +135,7 @@ 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.
@ -140,6 +172,7 @@ 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.
@ -147,6 +180,7 @@ 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
@ -182,7 +216,6 @@ 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
@ -288,7 +321,6 @@ save you many hours of grief.
prefix from the filename.
7.8.0
--------------------------------------------------------------------

View file

@ -2,69 +2,103 @@
# Quick And Dirty Install Instructions #
##################################################################
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
The following is a rough overview of how to install WebGUI *8*.
QnD INSTALL INSTRUCTIONS:
http://wiki.webgui.org/installation-options has instructions for
WebGUI 7.
1. Install Perl 5.8 or higher.
== INSTALL ==
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 Perl (5.12.1 or better) if you don't have one already
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 a recent MySQL and set up a user account
<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>
* Install ImageMagick (http://www.imagemagick.org/, compile and install the
source or binary package)
3. Install MySQL 5.0.10 or higher.
* Get WebGUI from GitHub and check out the WebGUI8 branch:
4. Install Image Magick 6.0 or higher.
$ git clone https://github.com/plainblack/webgui.git
$ git checkout WebGUI8 --track
5. Extract WebGUI into your webroot.
* Setup your configuration files
6. Start MySQL.
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).
7. Run the following Database commands. (You should modify the
commands to match your database, username, and password.)
Set uploadsPath in the .conf file to eg
/data/domains/www.example.com/public/uploads/.
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
Edit "etc/spectre.conf" to define port and worker settings for spectre.
8. Edit "etc/WebGUI.conf" to match your DB settings and log directory.
Set WEBGUI_CONFIG to point at your new configuration file:
9. Edit "etc/spectre.conf" to define port and worker settings for spectre
$ export WEBGUI_CONFIG='/data/WebGUI/etc/www.example.com.conf'
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.
* Automatically install new Perl module dependencies:
perl testEnvironment.pl
$ sbin/testEnvironment.pl as root to install Perl modules
If it returns all "OK" then you're done.
* Create a MySQL user account for the domain WebGUI is to host
and share/create.sql into that database
11. Start Apache.
$ 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
12. Start Spectre.
* 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:
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-2011 Plain Black Corporation. All rights
WebGUI is Copyright 2001-2012 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-2009 Plain Black Corporation.
# 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

429
docs/migration.txt Normal file
View file

@ -0,0 +1,429 @@
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.

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,16 @@
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

@ -1,123 +0,0 @@
#!/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
);
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

@ -1,223 +0,0 @@
#!/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

@ -1,124 +0,0 @@
#!/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

@ -1,123 +0,0 @@
#!/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

@ -1,189 +0,0 @@
#!/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

@ -1,165 +0,0 @@
#!/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

@ -1,191 +0,0 @@
#!/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

@ -1,160 +0,0 @@
#!/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

@ -1,135 +0,0 @@
#!/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

@ -1,139 +0,0 @@
#!/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

@ -1,172 +0,0 @@
#!/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

@ -1,177 +0,0 @@
#!/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

@ -1,147 +0,0 @@
#!/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

@ -1,172 +0,0 @@
#!/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

@ -1,146 +0,0 @@
#!/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

@ -1,198 +0,0 @@
#!/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->buildArrayRef( q{
select userId from users where userId not in ('1','3')
} );
foreach my $userId (@$users) {
#check to see if there is user profile information available
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

@ -1,141 +0,0 @@
#!/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

@ -1,123 +0,0 @@
#!/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
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

@ -1,190 +0,0 @@
#!/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 List::Util qw(first);
my $toVersion = '7.10.4';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
changeTemplateHelpUrl($session);
addForkTable($session);
installForkCleanup($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 changeTemplateHelpUrl {
my $session = shift;
print "\tChange the URL for the template that displays help variables... " unless $quiet;
# and here's our code
my $template = WebGUI::Asset->newByDynamicClass($session, 'PBtmplHelp000000000001');
if ($template) {
$template->update({url => 'root/import/adminconsole/help'});
my $rs = $template->session->db->read("select revisionDate from assetData where assetId=? and revisionDate<>?",[$template->getId, $template->get("revisionDate")]);
while (my ($version) = $rs->array) {
my $old = WebGUI::Asset->new($session, $template->getId, $template->get("className"), $version);
$old->purgeRevision if defined $old;
}
}
else {
print "\n\tNO TEMPLATE FOR DISPLAYING TEMPLATE VARIABLES...";
}
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Creates a new table for tracking background processes
sub addForkTable {
my $session = shift;
my $db = $session->db;
my $sth = $db->dbh->table_info('', '', 'Fork', 'TABLE');
return if ($sth->fetch);
print "\tAdding Fork table..." unless $quiet;
my $sql = q{
CREATE TABLE Fork (
id CHAR(22),
userId CHAR(22),
groupId CHAR(22),
status LONGTEXT,
error TEXT,
startTime BIGINT(20),
endTime BIGINT(20),
finished BOOLEAN DEFAULT FALSE,
latch BOOLEAN DEFAULT FALSE,
PRIMARY KEY(id)
);
};
$db->write($sql);
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# install a workflow to clean up old background processes
sub installForkCleanup {
my $session = shift;
print "\tInstalling Fork Cleanup workflow..." unless $quiet;
my $class = 'WebGUI::Workflow::Activity::RemoveOldForks';
$session->config->addToArray('workflowActivities/None', $class);
my $wf = WebGUI::Workflow->new($session, 'pbworkflow000000000001');
my $a = first { ref $_ eq $class } @{ $wf->getActivities };
unless ($a) {
$a = $wf->addActivity($class);
$a->set(title => 'Remove Old Forks');
};
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

@ -1,123 +0,0 @@
#!/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.5';
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

@ -1,144 +0,0 @@
#!/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::Workflow;
my $toVersion = '7.10.6';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addCollaborationSubscriptionWorkflow($session);
finish($session); # this line required
#----------------------------------------------------------------------------
sub addCollaborationSubscriptionWorkflow {
my $session = shift;
print "\tAdd Collaboration System subscriber validation workflow... " unless $quiet;
# and here's our code
$session->config->addToArray('workflowActivities/WebGUI::Asset', qw/WebGUI::Workflow::Activity::UpdateAssetSubscribers/);
my $workflow = WebGUI::Workflow->create($session,
{
mode => 'parallel',
enabled => 1,
title => 'Update CS Subscription members',
description => "This workflow will be run whenever the viewing permissions are changed on an Asset. It will update the members of the subscription group, and remove members who can no longer view the Asset.",
type => 'WebGUI::Asset',
},
'xR-_GRRbjBojgLsFx3dEMA'
);
$workflow->addActivity('WebGUI::Workflow::Activity::UpdateAssetSubscribers');
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

@ -1,163 +0,0 @@
#!/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.7';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addEmailIndexToProfile( $session );
addIndecesToUserLoginLog($session);
addSSOOptionToConfigs($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 an index to the userProfileData table for email lookups
sub addSSOOptionToConfigs {
my $session = shift;
print "\tAdding SSO flag to config file to enable the feature... " unless $quiet;
$session->config->set('enableSimpleSSO', 0);
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add an index to the userProfileData table for email lookups
sub addEmailIndexToProfile {
my $session = shift;
print "\tAdding index to email column on userProfileData table... " unless $quiet;
# and here's our code
$session->db->write( "ALTER TABLE userProfileData ADD INDEX email ( email )" );
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addIndecesToUserLoginLog {
my $session = shift;
print "\tAdd indeces to userLoginLog to speed cleanup... " unless $quiet;
# and here's our code
my $sth = $session->db->read('SHOW CREATE TABLE userLoginLog');
my ($field,$stmt) = $sth->array;
$sth->finish;
unless ($stmt =~ m/KEY `userId`/i) {
$session->db->write("ALTER TABLE userLoginLog ADD INDEX userId (userId)");
}
unless ($stmt =~ m/KEY `timeStamp`/i) {
$session->db->write("ALTER TABLE userLoginLog ADD INDEX timeStamp (timeStamp)");
}
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

@ -1,123 +0,0 @@
#!/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.8';
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

@ -1,123 +0,0 @@
#!/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.9';
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

@ -1,170 +0,0 @@
#!/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.10';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
convertCsMailInterval($session);
addVersioningToMetadata($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 convertCsMailInterval {
my $session = shift;
print "\tConvert the getMailInterval from seconds to enumeration... " unless $quiet;
# and here's our code
$session->db->write('alter table Collaboration modify column getMailInterval char(64)');
my $get_row = $session->db->read('select assetId, revisionDate, getMailInterval from Collaboration');
my $change_row = $session->db->prepare('update Collaboration set getMailInterval=? where assetId=? and revisionDate=?');
while (my ($assetId, $revisionDate, $seconds ) = $get_row->array) {
my $interval;
if ($seconds <= 60) { $interval = 'every minute'; }
elsif ($seconds <= 120) { $interval = 'every other minute'; }
elsif ($seconds <= 300) { $interval = 'every 5 minutes'; }
elsif ($seconds <= 600) { $interval = 'every 10 minutes'; }
elsif ($seconds <= 900) { $interval = 'every 15 minutes'; }
elsif ($seconds <= 1200) { $interval = 'every 20 minutes'; }
elsif ($seconds <= 1800) { $interval = 'every 30 minutes'; }
elsif ($seconds <= 3600) { $interval = 'every hour'; }
elsif ($seconds <= 7200) { $interval = 'every other hour'; }
else { $interval = 'once per day'; }
$change_row->execute([$interval, $assetId, $revisionDate]);
}
$get_row->finish;
$change_row->finish;
print "DONE!\n" unless $quiet;
}
sub addVersioningToMetadata {
my $session = shift;
print "\tAltering metadata tables for versioning..." unless $quiet;
my $db = $session->db;
$db->write(q{
alter table metaData_values
add column revisionDate bigint,
drop primary key,
add primary key (fieldId, assetId, revisionDate);
});
$db->write(q{
create table metaData_classes (
className char(255),
fieldId char(22)
);
});
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

@ -1,140 +0,0 @@
#!/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.0';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addAddonsToAdminConsole($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
sub addAddonsToAdminConsole {
my $session = shift;
print "\tAdd the Addons icon to the Admin Console... " unless $quiet;
# and here's our code
$session->config->addToHash('adminConsole',
addons => {
icon => "addons.png",
uiLevel => 1,
group => "12",
url => "http://www.webgui.org/addons",
title => "Addons"
});
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

@ -1,561 +0,0 @@
#!/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
i18nForAddonsTitle($session);
addForkTable($session);
installForkCleanup($session);
addVersioningToMetadata($session);
installNewDashboardTables($session);
addStockDataCacheColumn($session);
addWeatherDataCacheColumn($session);
addLastModifiedByMacro($session);
addAutoPlayToCarousel( $session );
addProcessorDropdownToSnippet( $session );
addRichEditToCarousel($session);
alterAssetIndexTable($session);
reindexAllThingys($session);
use WebGUI::Asset::MapPoint;
WebGUI::AssetAspect::Installable::upgrade("WebGUI::Asset::MapPoint",$session);
addRenderThingDataMacro($session);
addAssetPropertyMacro($session);
createThingyDBColumns($session);
addAssetManagerSortPreferences($session);
addTicketLimitToBadgeGroup( $session );
addFormFieldMacroToConfig();
addWaitForConfirmationWorkflow($session);
addCreateUsersEnabledSetting($session);
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;
#}
#----------------------------------------------------------------------------
# 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;
}
#----------------------------------------------------------------------------
# Creates a new table for tracking background processes
sub addForkTable {
my $session = shift;
my $db = $session->db;
my $sth = $db->dbh->table_info('', '', 'Fork', 'TABLE');
return if ($sth->fetch);
print "\tAdding Fork table..." unless $quiet;
my $sql = q{
CREATE TABLE Fork (
id CHAR(22),
userId CHAR(22),
groupId CHAR(22),
status LONGTEXT,
error TEXT,
startTime BIGINT(20),
endTime BIGINT(20),
finished BOOLEAN DEFAULT FALSE,
latch BOOLEAN DEFAULT FALSE,
PRIMARY KEY(id)
);
};
$db->write($sql);
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# install a workflow to clean up old background processes
sub installForkCleanup {
my $session = shift;
print "\tInstalling Fork Cleanup workflow..." unless $quiet;
my $class = 'WebGUI::Workflow::Activity::RemoveOldForks';
$session->config->addToArray('workflowActivities/None', $class);
my $wf = WebGUI::Workflow->new($session, 'pbworkflow000000000001');
use List::Util qw/first/;
my $a = first { ref $_ eq $class } @{ $wf->getActivities };
unless ($a) {
$a = $wf->addActivity($class);
$a->set(title => 'Remove Old Forks');
};
print "DONE!\n" unless $quiet;
}
sub addVersioningToMetadata {
my $session = shift;
print "\tAltering metadata tables for versioning..." unless $quiet;
my $db = $session->db;
$db->write(q{
alter table metaData_values
add column revisionDate bigint,
drop primary key,
add primary key (fieldId, assetId, revisionDate);
});
$db->write(q{
create table metaData_classes (
className char(255),
fieldId char(22)
);
});
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;
}
#----------------------------------------------------------------------------
# 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";
}
#----------------------------------------------------------------------------
# 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;
}
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;
use WebGUI::Asset::Wobject::Thingy;
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;
}
#----------------------------------------------------------------------------
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;
}
}
#----------------------------------------------------------------------------
# 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;
}
#----------------------------------------------------------------------------
sub addAssetManagerSortPreferences {
my $cn = 'assetManagerSortColumn';
my $on = 'assetManagerSortDirection';
use WebGUI::ProfileField;
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;
}
}
#----------------------------------------------------------------------------
# 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');
if(! grep { /ticketsPerBadge/ } keys %{$columns}) {
$session->db->write(q{
ALTER TABLE EMSBadgeGroup ADD COLUMN `ticketsPerBadge` INTEGER
});
}
print "DONE!\n" unless $quiet;
}
sub addFormFieldMacroToConfig {
print "\tAdd FormField macro to config... " unless $quiet;
$session->config->addToHash( 'macros', FormField => 'FormField' );
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
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;
}
#----------------------------------------------------------------------------
# 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->buildArrayRef( q{
select userId from users where userId not in ('1','3')
} );
use WebGUI::User;
use WebGUI::Shop::AddressBook;
foreach my $userId (@$users) {
#check to see if there is user profile information available
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;
print "\tUpdating packages.\n" unless ($quiet);
addPackage( $session, 'packages-7.9.34-7.10.22/merged.wgpkg' );
}
#vim:ft=perl

24
eg/README Normal file
View file

@ -0,0 +1,24 @@
# Some ways to achieve the same thing from the command line:
# plackup -MWebGUI -e 'WebGUI->new'
# plackup -MWebGUI -e 'WebGUI->new("dev.localhost.localdomain.conf")'
# plackup -MWebGUI -e 'WebGUI->new(root => "/data/WebGUI", site => "dev.localhost.localdomain.conf")'
#
# Or from a .psgi file:
# my $app = WebGUI->new( root => '/data/WebGUI', site => 'dev.localhost.localdomain.conf' )->psgi_app;
# Extras
my $extrasURL = $wg->config->get('extrasURL');
my $extrasPath = $wg->config->get('extrasPath');
enable 'Plack::Middleware::Static',
path => sub { s{^$extrasURL/}{} },
root => "$extrasPath/";
# Uploads
my $uploadsURL = $wg->config->get('uploadsURL');
my $uploadsPath = $wg->config->get('uploadsPath');
enable 'Plack::Middleware::Static',
path => sub { s{^$uploadsURL/}{} },
root => "$uploadsPath/";

27
eg/apache.conf Normal file
View file

@ -0,0 +1,27 @@
<VirtualHost *:80>
PerlOptions +Parent
PerlSwitches -I/data/WebGUI/lib
# CGI
#AddHandler cgi-script cgi
#ScriptAlias / /data/WebGUI/etc/dev.localhost.localdomain.cgi/
#<Directory /data/WebGUI/etc>
# Options +ExecCGI
#</Directory>
# Apache2
#SetHandler perl-script
#PerlHandler Plack::Server::Apache2
#PerlSetVar psgi_app /data/WebGUI/etc/dev.localhost.localdomain.psgi
# FastCGI
FastCgiServer /data/WebGUI/etc/dev.localhost.localdomain.fcgi
ScriptAlias / /data/WebGUI/etc/dev.localhost.localdomain.fcgi/
# mod_psgi
#<Location />
# SetHandler psgi
# PSGIApp /data/WebGUI/etc/dev.localhost.localdomain.psgi
#</Location>
</VirtualHost>

View file

@ -0,0 +1,5 @@
#!/usr/bin/perl
use Plack::Server::CGI;
my $app = Plack::Util::load_psgi("/data/WebGUI/etc/dev.localhost.localdomain.psgi");
Plack::Server::CGI->new->run($app);

View file

@ -0,0 +1,5 @@
#!/usr/bin/perl
use Plack::Server::FCGI;
my $app = Plack::Util::load_psgi("../app.psgi");
Plack::Server::FCGI->new->run($app);

View file

@ -0,0 +1,7 @@
LOAD PSGI
CREATE SERVICE psgi
SET role = web_server
SET listen = 127.0.0.1:80
SET plugins = psgi
PSGI_APP = dev.localhost.localdomain.psgi
ENABLE psgi

20
eg/urlmap.psgi Normal file
View file

@ -0,0 +1,20 @@
use lib '/data/WebGUI/lib';
use WebGUI;
my $wg1 = WebGUI->new;
my $wg2 = WebGUI->new;
use Plack::Builder;
my $app = builder {
mount "http://dev.localhost.localdomain:5000/" => $wg1;
mount "/wg1" => $wg1;
mount "/wg2" => $wg2;
mount "/" => sub { [ 200, [ 'Content-Type' => 'text/html' ], [ <<END_HTML ] ] };
<p>WebGUI + URLMap</p>
<ul>
<li><a href="http://dev.localhost.localdomain:5000">Virtual Host (wG instance #1)</a></li>
<li><a href=/wg1>Nested (wG instance #1)</a></li>
<li><a href=/wg2>Nested (wG instance #2)</a></li>
</ul>
END_HTML
};

2
etc/.gitignore vendored
View file

@ -1 +1,3 @@
/*.conf
/preload.custom
/preload.exclude

View file

@ -88,24 +88,42 @@
#"webServerPort" : 80,
# What kind of cache do you wish to use? Available types are
# WebGUI::Cache::FileCache and WebGUI::Cache::Database.
# We highly recommend the database cache if you are running
# sites with more than a few hundred pages, or if you're
# running in a multi-server environment. The file cache is better
# for very small sites.
# The cache key defines the configuration of the caching mechanism.
# Required keys:
# driver -> one of "Memory", "DBI", "FastMmap", "Memcached"
# FastMmap is recommended for single-server sites
# Memcached is recommended for multi-server sites
#
# Optional keys:
# expires_variance -> Define a percentage of variance in a cache item's
# expiration. This prevents "cache miss stampedes" where
# many things will attempt to refresh the cache at once.
# Set as a decimal percentage: "0.10" = 10% variance
# l1_cache -> Define a Level 1 cache, a faster cache to use for commonly-
# accessed stuff. Uses the same format and keys as the top level.
# ex:
# "l1_cache" : {
# "driver" : "Memory"
# },
# mirror_cache -> Define a write-only mirror. Used to warm up a new cache
# before switching over to it. Defined exactly like an l1_cache
#
"cache" : {
"driver" : "FastMmap",
"expires_variance" : "0.10",
"root_dir" : "/tmp/WebGUICache"
},
"cacheType" : "WebGUI::Cache::FileCache",
# Sessions that are "hot", those that are not only not expired,
# but that are currently active on the site are kept in memory
# to make them exceptionally fast. The hotSessionFlushToDb
# directive allows you to say how often (in seconds) those
# sessions should be pushed down to the database. On most sites
# 10 minutes is a good duration. If you have an exceptionally
# short session timeout (in the settings) then you may wish to
# set it lower.
# Tell WebGUI where to store cached files. Defaults to the
# /tmp or c:\temp folder depending upon your operating system.
# "fileCacheRoot" : "/path/to/cache",
# Set this to 1 to disable WebGUI's caching subsystems. This is
# mainly useful for developers.
"disableCache" : 0,
"hotSessionFlushToDb" : 600,
# The database connection string. It usually takes the form of
# DBI:<driver>:<db>;host:<hostname>
@ -190,7 +208,7 @@
# List the authentication plug-ins you wish to be available on
# this site.
"authMethods" : [ "LDAP", "WebGUI", "Twitter" ],
"authMethods" : [ "LDAP", "WebGUI", "Twitter", "Facebook"],
# List the merchant gateways you have installed and wish to be
# available on this site.
@ -217,7 +235,8 @@
# Specify the list of template parsers available in the system.
"templateParsers" : [
"WebGUI::Asset::Template::HTMLTemplate"
"WebGUI::Asset::Template::HTMLTemplate",
"WebGUI::Asset::Template::TemplateToolkit"
],
# Enable the Survey Expression Engine, which allows goto expressions in
@ -259,13 +278,6 @@
"url" : "^PageUrl(\"\",func=manageClipboard);",
"title" : "^International(948,WebGUI);"
},
"statistics" : {
"icon" : "statistics.gif",
"uiLevel" : 1,
"url" : "^PageUrl(\"\",op=viewStatistics);",
"title" : "^International(437,WebGUI);",
"groupSetting" : "groupIdAdminStatistics"
},
"users" : {
"icon" : "users.gif",
"uiLevel" : 5,
@ -488,7 +500,7 @@
}
},
# Specify a the list of assets you want to appear in your
# Specify the list of assets you want to appear in your
# "New Content" menu categories. See "assetCategories" for details
# about categories. Each listing has a key of class name, and then
# has several properties, which are:
@ -589,9 +601,6 @@
"WebGUI::Asset::Wobject::StockData" : {
"category" : "intranet"
},
"WebGUI::Asset::FilePile" : {
"category" : "basic"
},
"WebGUI::Asset::Wobject::Collaboration" : {
"category" : "community"
},
@ -812,7 +821,6 @@
"#" : "Hash_userId",
"/" : "Slash_gatewayUrl",
"a" : "a_account",
"AdminBar" : "AdminBar",
"AdminText" : "AdminText",
"AdminToggle" : "AdminToggle",
"AdSpace" : "AdSpace",
@ -827,9 +835,9 @@
"c" : "c_companyName",
"D" : "D_date",
"DeactivateAccount": "DeactivateAccount",
"EditableToggle" : "EditableToggle",
"e" : "e_companyEmail",
"Extras" : "Extras",
"FacebookLogin" : "FacebookLogin",
"FetchMimeType" : "FetchMimeType",
"FilePump" : "FilePump",
"FileUrl" : "FileUrl",
@ -840,6 +848,7 @@
"H" : "H_homeLink",
"If" : "If",
"International" : "International",
"i18n" : "International",
"LastModified" : "LastModified",
"LastModifiedBy" : "LastModifiedBy",
"L" : "L_loginBox",
@ -858,6 +867,7 @@
"SpectreCheck" : "SpectreCheck",
"TwitterLogin" : "TwitterLogin",
"Thumbnail" : "Thumbnail",
"TwitterLogin" : "TwitterLogin",
"User" : "User",
"UsersOnline" : "UsersOnline",
"u" : "u_companyUrl",
@ -897,8 +907,6 @@
"WebGUI::Workflow::Activity::ArchiveOldStories",
"WebGUI::Workflow::Activity::ArchiveOldThreads",
"WebGUI::Workflow::Activity::CalendarUpdateFeeds",
"WebGUI::Workflow::Activity::CleanDatabaseCache",
"WebGUI::Workflow::Activity::CleanFileCache",
"WebGUI::Workflow::Activity::CleanLoginHistory",
"WebGUI::Workflow::Activity::CleanTempStorage",
"WebGUI::Workflow::Activity::CreateCronJob",
@ -958,23 +966,6 @@
"WebGUI::Image::Graph::XYGraph::Line"
],
# Here you can define the dictionaries that are available through the tinyMCE spellchecker. You should set
# id to the name the dictionary is known by ASpell (eg. en or en_US or nl), use the name parameter to set
# the name the dictionary is displayed with in tinyMCE. To set the default dictionary please set the 'default'
# parameter.
#"availableDictionaries" : [
# {
# "id" : "en_US",
# "name" : "English",
# "default" : "1"
# },
# {
# "id" : "nl",
# "name" : "Dutch"
# }
#],
# Optional script to run upon successful login. The script can contain macros
# ex: /data/WebGUI/sbin/doLogin.pl --configFile=dev.localhost.localdomain.conf --loginPage=^PageUrl();
@ -985,22 +976,6 @@
"runOnLogout" : "",
# URL handlers are used to associate functionality with a URL via a regular expression.
"urlHandlers" : [
{ "^/extras" : "WebGUI::URL::PassThru" },
# { "^/icons" : "WebGUI::URL::PassThru" },
# { "^/documentation/pdf" : "WebGUI::URL::PassThru" },
# { "^/my-custom-application$" : "WebGUI::URL::PassThru" },
# { "^/server-status$" : "WebGUI::URL::PassThru" },
# { "^/perl-status$" : "WebGUI::URL::PassThru" },
{ "^/uploads/dictionaries" : "WebGUI::URL::Unauthorized" },
{ "^/uploads" : "WebGUI::URL::Uploads" },
{ "^/\\*give-credit-where-credit-is-due\\*$" : "WebGUI::URL::Credits" },
{ "^/abcdefghijklmnopqrstuvwxyz$" : "WebGUI::URL::Snoop" },
{ ".*" : "WebGUI::URL::Content" }
],
# Content handlers are used to produce content from the content URL handler.
# Note, these handlers are processed in the order listed. Do not change
# unless you know what you're doing.
@ -1009,7 +984,7 @@
"WebGUI::Content::Prefetch",
"WebGUI::Content::Maintenance",
"WebGUI::Content::Referral",
"WebGUI::Content::AssetManager",
"WebGUI::Content::Admin",
"WebGUI::Content::AssetDiscovery",
"WebGUI::Content::PassiveAnalytics",
"WebGUI::Content::SetLanguage",
@ -1020,6 +995,7 @@
"WebGUI::Content::Wizard",
"WebGUI::Content::Operation",
"WebGUI::Content::Setup",
"WebGUI::Content::FacebookAuth",
"WebGUI::Content::Shop",
"WebGUI::Content::SiteIndex",
"WebGUI::Content::Asset",
@ -1083,42 +1059,15 @@
# "extrasExclude": ["tinymce", "^blah$"]
# },
#A list of UserAgents of recognized mobile platforms. If useMobileStyle is set in the
#Admin settings, then the mobile style will be used for these browsers.
"mobileUserAgents" : [
"AvantGo",
"DoCoMo",
"Vodafone",
"EudoraWeb",
"Minimo",
"UP\\.Browser",
"PLink",
"Plucker",
"NetFront",
"^WM5 PIE$",
"Xiino",
"iPhone",
"Opera Mobi",
"BlackBerry",
"Opera Mini",
"HP iPAQ",
"IEMobile",
"Profile/MIDP",
"Smartphone",
"Symbian ?OS",
"J2ME/MIDP",
"PalmSource",
"PalmOS",
"Windows CE",
"Opera Mini"
],
# For the siteIndex content plugin. Whether or not the auto-generated siteIndex should
# show hidden pages
"siteIndex" : {
"showHiddenPages" : 0
},
#The complete path to the maintenance page.
"maintenancePage" : "/data/WebGUI/www/maintenance.html",
# An array of SPAM words. Used in the Post and WikiPage to block spam by sending the asset directly
# to the trash.
"spamStopWords" : [

View file

@ -2,7 +2,6 @@
# that you don't want to be loaded by modperl. This will decrease the overall
# size of your modperl instances, which will increase performance, and reduce
# memory use.
WebGUI::Cache::Database
WebGUI::Auth::LDAP
WebGUI::Asset::Wobject::WSClient
WebGUI::Asset::File::ZipArchive

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