gecko-dev/webtools/bugzilla3/tests/Main
ian%hixie.ch ee423a9430 * Created service- and serviceInstance- specific constructors so that a single module can have distinct constructors depending on how it is invoked. These constructors are called serviceInit() and serviceInstanceInit(), and both chain to the existing init() constructor (so no change are required by this).
* Changed FileStrings so that it doesn't have to be updated every time the file string format changes. The format is now one line per piece of metadata, then a blank line, then the string data. If additional metadata is added later then this will automatically support it.
* Renamed the dataSource.strings service to dataSource.strings.customised, and renamed its get() method to getCustomisedString().
* Changed the semantics of dataSource.strings.customised so that it no longer looks for a default string if it can't find a customised one (and thus removed getDefaultString).
* Abstracted the Generic output module even more. It now consists of output.generic (a service instance with its own constructor) and dataSource.strings (a pure service), the latter of which is a wrapper around dataSource.strings.customised and dataSource.strings.defaults.
* Updated Coses to work with the new dataSource.strings insterface.
* Removed the test app DataSource::ConsoleStrings and DataSource::HTTPStrings files, since they were redundant with the default output files.
* Removed all the default strings in the CosesEditor and Login components since they are pretty pointless.
* Factored out the call to dump() in the GenericOutputs module.
* Changed setString in the MySQL string data source so that it will now add a blank string (it used to delete the string if it was blank, but that meant that it was not possible to customise strings away).
* Added a piece of metadata to strings: their version number.
* Updated the customised string data source stubs to mention the version data now stored with all strings
* Added a getAllStringVersions method to the customised strings data source which returns all the string names and their version numbers.
* Made the customised strings data source check the version number of every string in its database during setupInstall to make sure that they are all up to date, version-wise. If any are out of date, the user is notified.
* Added support for the new version column to the MySQL version of the customised string data source.
* Updated the increasingly misnamed CosesEditor to support the versioned strings stuff.
* Factored out some code in the CosesEditor.
* Added version information to all default strings. All default strings are now at version 1.
* Fixed a typo in a FileStrings dump statement.
* Fixed the calls to setProgress in the MySQL user and strings data sources and in the user field factory to use the correct syntax (a parsable dotted string instead of unlocalisable plain English).
* Updated the Generic output module's documentation to match what now happens.
2001-11-22 15:46:42 +00:00

90 lines
3.4 KiB
Perl
Executable File

#!/usr/bin/perl -w
# -*- Mode: perl; tab-width: 4; indent-tabs-mode: nil; -*-
#
# This file is MPL/GPL dual-licensed under the following terms:
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is PLIF 1.0.
# The Initial Developer of the Original Code is Ian Hickson.
#
# Alternatively, the contents of this file may be used under the terms
# of the GNU General Public License Version 2 or later (the "GPL"), in
# which case the provisions of the GPL are applicable instead of those
# above. If you wish to allow use of your version of this file only
# under the terms of the GPL and not to allow others to use your
# version of this file under the MPL, indicate your decision by
# deleting the provisions above and replace them with the notice and
# other provisions required by the GPL. If you do not delete the
# provisions above, a recipient may use your version of this file
# under either the MPL or the GPL.
use strict; # enable stricter Perl syntax rules
use diagnostics; # enable fuller diagnostics
use lib "."; # this is required to use the app's modules
use lib "../../PLIF"; # this is required to use PLIF
use vars qw(@ISA);
@ISA = qw(PLIF::Application);
require PLIF::Application; # engage!
1;
# register all the components of this app
sub registerServices {
my $self = shift;
$self->SUPER::registerServices(@_);
# somehow add in all the components
$self->register(qw(
PLIF::Input::CGI
PLIF::Input::CommandLine
PLIF::Input::Default
PLIF::Database::DBI
PLIF::DatabaseHelper::DBI
PLIF::DataSource::FileStrings
PLIF::DataSource::DebugStrings
PLIF::DataSource::Strings::MySQL
PLIF::DataSource::User::MySQL
PLIF::Output::Generic
PLIF::Output::Generic::StdOut
PLIF::Service::Coses
PLIF::Service::XML
PLIF::Service::GenericOutputs
PLIF::Service::User
PLIF::Service::Passwords
PLIF::Service::UserField::String
PLIF::Service::UserFieldFactory
PLIF::Service::Components::AdminCommands
PLIF::Service::Components::Login
PLIF::Service::Components::CosesEditor
PLIF::Service::ContactMethod::Email
PLIF::Service::ContactMethod::AIM
Output
Configuration
));
}
sub unknownCommand {
my $self = shift;
$self->output->hello({});
}
sub cmdLogin {
my $self = shift;
my $user = $self->getService('user.login')->hasRight($self, 'hello');
if (defined($user)) {
my %strings = @{$self->getCollectingServiceList('dispatcher.output')->strings};
$self->output->hello(\%strings);
} # else, user has been notified
}
sub name {
return 'Main Test';
}