satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf | 5
satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf | 67 --
satellite/fedora/setup-symlinks.sh | 134 -----
web/modules/rhn/RHN/DB/Message.pm | 248 ----------
web/modules/rhn/RHN/DB/Message/ServerMessage.pm | 154 ------
web/modules/rhn/RHN/DB/Message/TextMessage.pm | 152 ------
web/modules/rhn/RHN/SearchTypes.pm | 9
web/modules/rhn/RHN/ServerMessage.pm | 24
web/spacewalk-web.spec | 2
9 files changed, 795 deletions(-)
New commits:
commit 9b70aa7d51b3cf7bb8b73cc3b680f7c599555355
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 14:27:37 2009 +0100
satellite/fedora seems not to be used in Satellite 5.3 / Spacewalk 0.7.
diff --git a/satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf
b/satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf
deleted file mode 100644
index 4da2bb6..0000000
--- a/satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-ServerRoot "/etc/rhn/satellite-httpd"
-
-Include conf/rhnweb.conf
-Include conf/rhn_server.conf
-
diff --git a/satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf
b/satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf
deleted file mode 100644
index 74ccd16..0000000
--- a/satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf
+++ /dev/null
@@ -1,67 +0,0 @@
-<IfModule !perl_module>
-LoadModule perl_module modules/mod_perl.so
-</IfModule>
-
-PerlTaintCheck Off
-
-PerlFixupHandler Apache2::SizeLimit
-
-PerlRequire /etc/rhn/satellite-httpd/conf/startup.pl
-
-# these will be set via /etc/sysconfig/satellite-httpd
-PerlPassEnv ORACLE_HOME
-PerlPassEnv NLS_LANG
-
-PerlOptions +GlobalRequest
-
-ErrorDocument 403 /errors/permission.pxt
-ErrorDocument 404 /errors/404.pxt
-ErrorDocument 413 /errors/413.pxt
-ErrorDocument 500 /errors/500.pxt
-
-AddType text/pxt .pxt
-<Files *.pxt>
- SetHandler perl-script
- PerlHandler PXT::ApacheHandler
-</Files>
-
-<Files *.pxi>
- Order allow,deny
- Deny from all
- Satisfy All
-</Files>
-
-LoadModule jk_module modules/mod_jk.so
-
-# <IfDefine HAVE_JK>
- JkWorkersFile /etc/rhn/satellite-httpd/conf/workers.properties
- JkLogLevel info
- JkLogFile /var/log/httpd/mod_jk.log
- JkMount /rhn/* ajp13
- JkMount /rhn ajp13
- JkMount /*.do ajp13
- JkMount /*.jsp ajp13
- JkHTTPSIndicator HTTPS
-# </IfDefine>
-
-RedirectMatch ^/renew/.*
http://rhn.redhat.com
-RedirectMatch ^/index\.html$ /rhn/Login.do
-
-# Turn rewrite engine on so we can use it for
-# kickstart requests.
-RewriteEngine on
-
-# Disable TRACE and TRACK
-RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
-RewriteRule .* - [F]
-
-# This rule handles incoming kickstart file requests from
-# machines actually performing a kickstart. This rule
-# processes the incoming URL and converts it into something
-# slightly more Struts friendly.
-RewriteRule ^/kickstart/ks([-a-zA-Z0-9\._/\%\ ]*)$
/rhn/kickstart/DownloadFile.do?ksurl=$1 [P]
-RewriteRule ^/download/([-a-zA-Z0-9\._/\%\ ]*)$ /rhn/common/DownloadFile.do?url=$1 [P]
-RewriteRule ^/rpc/api /rhn/rpc/api [P]
-
-# For rhn-custom-info
-RewriteRule ^/WEBRPC /rhn/rpc/api [P]
diff --git a/satellite/fedora/setup-symlinks.sh b/satellite/fedora/setup-symlinks.sh
deleted file mode 100755
index 024e40f..0000000
--- a/satellite/fedora/setup-symlinks.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/bash
-
-let errors=0
-
-makedir()
-{
- echo ""
- if [ -d $1 ]
- then
- echo "directory ( $1 ) already exists"
- else
- echo "making directory ( $1 ) ..."
- mkdir -p $1
- fi
-}
-
-symlink()
-{
- echo ""
- if [ ! -e $1 ]
- then
- echo "( $1 ) NOT-LINKED, file not found"
- let errors+=1
- return
- fi
- DIR=`pwd`
- if [ -z $2 ]
- then
- NAME=`basename $1`
- else
- NAME=$2
- fi
- if [ -L $NAME ]
- then
- echo "( $DIR/$NAME ) already linked, unlinking..."
- rm -f $NAME
- else
- if [ -e $NAME ]
- then
- echo "( $DIR/$NAME ) already exists, saving ..."
- mv $NAME $NAME.save
- fi
- fi
- echo "linking ( $DIR/$NAME ) as:"
- echo " ( $1 ) ..."
- ln -s $1 $NAME
-}
-
-if [ -z $GITDIR ] ; then
- echo "Please set GITDIR to the root of your GIT checkout"
- exit 1
-fi
-
-makedir /etc/rhn
-makedir /etc/rhn/search
-makedir /etc/rhn/default
-makedir /etc/rhn/satellite-httpd
-makedir /etc/rhn/satellite-httpd/conf
-makedir /etc/rhn/satellite-httpd/conf.d
-makedir /etc/rhn/satellite-httpd/conf/rhn
-makedir /etc/sysconfig/rhn
-makedir /var/www/lib
-
-cd /etc
-symlink $GITDIR/satellite/config/etc/webapp-keyring.gpg
-
-cd /etc/rhn
-symlink $GITDIR/web/conf/rhn.conf
-
-cd /etc/rhn/default
-symlink $GITDIR/web/conf/rhn_web.conf
-symlink $GITDIR/java/conf/default/rhn_hibernate.conf
-
-cd /etc/rhn/satellite-httpd
-symlink /var/log/httpd logs
-symlink /usr/lib/httpd/modules
-symlink /var/run
-
-cd /etc/rhn/satellite-httpd/conf
-symlink $GITDIR/backend/httpd-conf/rhn_server.conf
-symlink $GITDIR/satellite/fedora/config/etc/rhn/satellite-httpd/conf/rhnweb.conf
-symlink $GITDIR/satellite/config/etc/rhn/satellite-httpd/conf/satidmap.pl
-symlink $GITDIR/satellite/config/etc/rhn/satellite-httpd/conf/startup.pl
-symlink $GITDIR/satellite/config/etc/rhn/satellite-httpd/conf/workers.properties
-
-cd /etc/rhn/satellite-httpd/conf.d
-symlink $GITDIR/satellite/fedora/config/etc/rhn/satellite-httpd/conf.d/satellite.conf
-
-cd /etc/httpd/conf.d
-symlink /etc/rhn/satellite-httpd/conf.d/satellite.conf
-
-#Note...not symlinking here since we'll be modifying this file and
-#don't want to checkin the change.
-cp $GITDIR/satellite/config/etc/sysconfig/satellite-httpd /etc/sysconfig
-sudo sed -i 's/@@serverDOTnls_lang@(a)/english.UTF8/g'
/etc/sysconfig/satellite-httpd
-
-cd /var/www
-symlink $GITDIR/web/html
-
-cd /var/www/html
-symlink $GITDIR/branding/css
-symlink $GITDIR/branding/img
-symlink $GITDIR/branding/templates
-
-cd /var/www/html/nav
-symlink $GITDIR/branding/styles
-
-cd /var/www/lib
-symlink $GITDIR/web/modules/cypress/Cypress
-symlink $GITDIR/web/modules/dobby/Dobby
-symlink $GITDIR/web/modules/grail/Grail
-symlink $GITDIR/web/modules/rhn/RHN
-symlink $GITDIR/web/modules/pxt/PXT
-symlink $GITDIR/web/modules/
-symlink $GITDIR/web/modules/sniglets/Sniglets
-
-
-cd /var/lib/tomcat5/webapps
-symlink $GITDIR/java/rhnwebapp rhn
-
-cd /etc/tomcat5/Catalina/localhost
-symlink $GITDIR/java/conf/rhn.xml
-
-cd /etc/rhn/search
-symlink $GITDIR/search-server/src/config/search/rhn_search.conf
-
-cd $GITDIR/java
-symlink conf/eclipse/.project
-
-echo ""
-echo "Finished: errors = $errors"
-echo ""
-
-exit $errors
commit f694d433ba01c6ccccc214f23ee5ecc7db5ce6f0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 14:00:16 2009 +0100
Removals of previous use of register_type makes it dead code.
diff --git a/web/modules/rhn/RHN/SearchTypes.pm b/web/modules/rhn/RHN/SearchTypes.pm
index 3b2d0f8..10d5988 100644
--- a/web/modules/rhn/RHN/SearchTypes.pm
+++ b/web/modules/rhn/RHN/SearchTypes.pm
@@ -31,15 +31,6 @@ sub find_type {
return $ret;
}
-sub register_type {
- my $class = shift;
- my $label = shift;
- my $type = shift;
- die "invalid search type $type" unless
$type->isa("RHN::SearchType");
-
- $search_types{$label} = $type;
-}
-
package RHN::SearchType;
use Params::Validate qw/validate/;
commit fb3b025a9f81205295ab2ae9d7ba579ed9ebe8f8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 22 13:58:08 2009 +0100
Removal of RHN::Message also allows the other *Message packages to be removed.
diff --git a/web/modules/rhn/RHN/DB/Message.pm b/web/modules/rhn/RHN/DB/Message.pm
deleted file mode 100644
index 3d52d65..0000000
--- a/web/modules/rhn/RHN/DB/Message.pm
+++ /dev/null
@@ -1,248 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-#
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-
-package RHN::DB::Message;
-
-use RHN::DB;
-use RHN::DB::TableClass;
-
-use Carp;
-
-my @message_fields = qw/ID MESSAGE_TYPE PRIORITY CREATED:longdate MODIFIED:longdate/;
-
-my $m = new RHN::DB::TableClass("rhnMessage", "M", "",
@message_fields);
-
-#class methods
-
-sub lookup_message {
- my $class = shift;
- my $id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = $m->select_query("M.id = ?");
- $sth = $dbh->prepare($query);
- $sth->execute($id);
-
- my @columns = $sth->fetchrow;
- $sth->finish;
-
- my $ret;
- if ($columns[0]) {
- $ret = $class->_blank_message();
- foreach ($m->method_names) {
- $ret->{"__${_}__"} = shift @columns;
- }
-
- delete $ret->{":modified:"};
- }
-
- return $ret;
-}
-
-sub _blank_message {
- my $class = shift;
-
- my $self = bless { }, $class;
-
- return $self;
-}
-
-sub create_message {
- my $class = shift;
-
- my $mes = $class->_blank_message;
- $mes->{__id__} = -1;
-
- return $mes;
-}
-
-# build some accessors
-foreach my $field ($m->method_names) {
- my $sub = q {
- sub [[field]] {
- my $self = shift;
- if (@_ and "[[field]]" ne "id") {
- $self->{":modified:"}->{[[field]]} = 1;
- $self->{__[[field]]__} = shift;
- }
- return $self->{__[[field]]__};
- }
- };
-
- $sub =~ s/\[\[field\]\]/$field/g;
- eval $sub;
-
- if ($@) {
- die $@;
- }
-}
-
-sub commit {
- my $self = shift;
- my $mode = 'update';
-
- if ($self->id == -1) {
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare("SELECT rhn_m_id_seq.nextval FROM DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- die "No new message id from seq rhn_m_id_seq (possible error: " .
$sth->errstr . ")" unless $id;
- $sth->finish;
-
- $self->{":modified:"}->{id} = 1;
- $self->{__id__} = $id;
- $mode = 'insert';
- }
-
- die "$self->commit called on message without valid id" unless $self->id
and $self->id > 0;
-
- my @modified = keys %{$self->{":modified:"}};
- my %modified = map { $_ => 1 } @modified;
-
- return unless @modified;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- if ($mode eq 'update') {
- $query = $m->update_query($m->methods_to_columns(@modified));
- $query .= "M.ID = ?";
- }
- else {
- $query = $m->insert_query($m->methods_to_columns(@modified));
- }
-
- my $sth = $dbh->prepare($query);
- $sth->execute((map { $self->$_() } grep { $modified{$_} } $m->method_names),
($mode eq 'update') ? ($self->id) : ());
-
- $dbh->commit;
- delete $self->{":modified:"};
-}
-
-sub tc {
- return $m;
-}
-
-sub user_messages {
- my $class = shift;
- my %attr = @_;
-
- my ($uid, $lower, $upper, $total_ref, $mode, $mode_params, $all_ids) = map {
$attr{"-" . $_} } qw/uid lower upper total_rows mode mode_params all_ids/;
-
- $lower ||= 1;
- $upper ||= 100000;
-
- die "user_messages called without uid" unless defined $uid;
-
- my $query;
-
- if ($mode eq 'all') {
-
- $query =<<EOQ;
-SELECT DISTINCT M.id, M.modified
- FROM rhnMessage M, rhnUserMessage UM, rhnUserMessageStatus UMS
- WHERE UM.user_id = ?
- AND M.id = UM.message_id
-ORDER BY M.modified DESC
-EOQ
-}
- elsif ($mode eq 'status') {
-
- $query =<<EOQ;
-SELECT DISTINCT M.id, M.modified
- FROM rhnMessage M, rhnUserMessage UM, rhnUserMessageStatus UMS
- WHERE UM.user_id = ?
- AND M.id = UM.message_id
- AND UM.status = UMS.id
- AND UMS.label = ?
-ORDER BY M.modified DESC
-EOQ
-}
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare($query);
- $sth->execute(@{$mode_params});
-
- my @ids;
- my $i = 0;
-
- while (my ($id) = $sth->fetchrow) {
- push @{$all_ids}, $id if $all_ids;
-
- $i++;
- if ($i >= $lower and $i <= $upper) {
- push @ids, $id;
- }
- }
-
- $$total_ref = $i;
-
- if (@ids) {
- $sth = $dbh->prepare(sprintf(<<EOQ, join(", ", ('?') x
(scalar @ids))));
- SELECT distinct M.id, M.message_type, M.priority, UMS.label,
- (SELECT SM.server_id FROM rhnServerMessage SM WHERE SM.message_id = M.id),
- (SELECT S.name FROM rhnServer S, rhnServerMessage SM WHERE SM.message_id = M.id
AND S.id = SM.server_id),
- (SELECT SE.details FROM rhnServerEvent SE, rhnServerMessage SM WHERE
SM.message_id = M.id AND SE.id = SM.server_event),
- (SELECT TM.message_body FROM rhnTextMessage TM WHERE TM.message_id = M.id),
- TO_CHAR(M.created, 'YYYY-MM-DD HH24:MI:SS'), TO_CHAR(M.modified,
'YYYY-MM-DD HH24:MI:SS')
- FROM rhnMessage M, rhnUserMessage UM, rhnUserMessageStatus UMS
- WHERE M.id IN (%s)
- AND UM.message_id = M.id
- AND UMS.id = UM.status
-ORDER BY TO_CHAR(M.modified, 'YYYY-MM-DD HH24:MI:SS') DESC
-EOQ
-
- $sth->execute(@ids);
-
- my @ret;
-
- while (my @row = $sth->fetchrow) {
- push @ret, [ @row ];
- }
- return @ret;
- }
- return ();
-}
-
-sub update_status_from_set {
- my $class = shift;
- my $status = shift;
- my $set = shift;
-
-
- my $dbh = RHN::DB->connect;
- my $query = <<EOQ;
-UPDATE rhnUserMessage UM
- SET UM.status = (SELECT UMS.id FROM rhnUserMessageStatus UMS WHERE UMS.label = ?)
- WHERE UM.message_id IN(SELECT element FROM rhnSet S WHERE S.user_id = ? AND S.label =
?)
-EOQ
-
- my $sth = $dbh->prepare($query);
-
- $sth->execute($status, $set->uid, $set->label);
-
- $dbh->commit;
-
- return 1;
-}
-
-1;
diff --git a/web/modules/rhn/RHN/DB/Message/ServerMessage.pm
b/web/modules/rhn/RHN/DB/Message/ServerMessage.pm
deleted file mode 100644
index e7ac5f8..0000000
--- a/web/modules/rhn/RHN/DB/Message/ServerMessage.pm
+++ /dev/null
@@ -1,154 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-#
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-
-package RHN::DB::Message::ServerMessage;
-
-use RHN::DB;
-use RHN::DB::TableClass;
-use RHN::DB::Message;
-
-use Data::Dumper;
-
-use Carp;
-
-our @ISA = qw/RHN::DB::Message/;
-
-my @server_message_fields = qw/MESSAGE_ID SERVER_ID SERVER_EVENT/;
-my @user_message_fields = qw/MESSAGE_ID USER_ID STATUS/;
-
-my $s = new RHN::DB::TableClass("rhnServerMessage", "SM",
"", @server_message_fields);
-my $u = new RHN::DB::TableClass("rhnUserMessage", "UM",
"user", @user_message_fields);
-
-my $sm = RHN::DB::Message->tc->create_join([ $s, $u ], { "rhnMessage"
=> { "rhnServerMessage" => [ "ID", "MESSAGE_ID" ],
- "rhnUserMessage" => [ "ID",
"MESSAGE_ID" ] } });
-
-#class methods
-
-sub lookup_message {
- my $class = shift;
- my $id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = $sm->select_query("M.id = ?");
- $sth = $dbh->prepare($query);
- $sth->execute($id);
-
- my @columns = $sth->fetchrow;
- $sth->finish;
-
- my $ret;
- if ($columns[0]) {
- $ret = $class->_blank_message();
- foreach ($sm->method_names) {
- $ret->{"__${_}__"} = shift @columns;
- }
-
- delete $ret->{":modified:"};
- }
- return $ret;
-}
-
-sub _blank_message {
- my $class = shift;
-
- my $self = bless { }, $class;
-
- return $self;
-}
-
-sub create_message {
- my $class = shift;
-
- my $mes = $class->_blank_message;
- $mes->{__id__} = -1;
-
- return $mes;
-}
-
-# build some accessors
-foreach my $field ($sm->method_names) {
- my $sub = q {
- sub [[field]] {
- my $self = shift;
- if (@_ and "[[field]]" ne "id") {
- $self->{":modified:"}->{[[field]]} = 1;
- $self->{__[[field]]__} = shift;
- }
- return $self->{__[[field]]__};
- }
- };
-
- $sub =~ s/\[\[field\]\]/$field/g;
- eval $sub;
-
- if ($@) {
- die $@;
- }
-}
-
-sub commit {
- my $self = shift;
- my $mode = 'update';
-
- if ($self->id == -1) {
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare("SELECT rhn_m_id_seq.nextval FROM DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- die "No new message id from seq rhn_m_id_seq (possible error: " .
$sth->errstr . ")" unless $id;
- $sth->finish;
-
- $self->{":modified:"}->{id} = 1;
- $self->{__id__} = $id;
- $self->{":modified:"}->{message_id} = 1;
- $self->{__message_id__} = $id;
- $mode = 'insert';
- }
-
- die "$self->commit called on message without valid id" unless $self->id
and $self->id > 0;
-
- my @modified = keys %{$self->{":modified:"}};
- my %modified = map { $_ => 1 } @modified;
-
- return unless @modified;
-
- my $dbh = RHN::DB->connect;
-
- my @queries;
- if ($mode eq 'update') {
- @queries = $sm->update_queries($sm->methods_to_columns(@modified));
- }
- else {
- @queries = $sm->insert_queries($sm->methods_to_columns(@modified));
- }
-
- foreach my $query (@queries) {
- my $sth = $dbh->prepare($query->[0]);
- my @vars = ((map { $self->$_() } grep { exists $modified{$_} } @{$query->[1]}),
$modified{id} ? () : $self->id);
- $sth->execute(@vars);
- }
-
- $dbh->commit;
- delete $self->{":modified:"};
-}
-
-1;
diff --git a/web/modules/rhn/RHN/DB/Message/TextMessage.pm
b/web/modules/rhn/RHN/DB/Message/TextMessage.pm
deleted file mode 100644
index 1184003..0000000
--- a/web/modules/rhn/RHN/DB/Message/TextMessage.pm
+++ /dev/null
@@ -1,152 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-#
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-
-package RHN::DB::Message::TextMessage;
-
-use RHN::DB;
-use RHN::DB::TableClass;
-use RHN::DB::Message;
-
-use Carp;
-
-our @ISA = qw/RHN::DB::Message/;
-
-my @text_message_fields = qw/MESSAGE_ID MESSAGE_BODY/;
-my @user_message_fields = qw/MESSAGE_ID USER_ID STATUS/;
-
-my $t = new RHN::DB::TableClass("rhnTextMessage", "TM", "",
@text_message_fields);
-my $u = new RHN::DB::TableClass("rhnUserMessage", "UM",
"user", @user_message_fields);
-
-my $tm = RHN::DB::Message->tc->create_join([ $t, $u ], { "rhnMessage"
=> { "rhnTextMessage" => [ "ID", "MESSAGE_ID" ],
- "rhnUserMessage" => [ "ID", "MESSAGE_ID" ] }
});
-
-#class methods
-
-sub lookup_message {
- my $class = shift;
- my $id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = $tm->select_query("M.id = ?");
- $sth = $dbh->prepare($query);
- $sth->execute($id);
-
- my @columns = $sth->fetchrow;
- $sth->finish;
-
- my $ret;
- if ($columns[0]) {
- $ret = $class->_blank_message();
- foreach ($tm->method_names) {
- $ret->{"__${_}__"} = shift @columns;
- }
-
- delete $ret->{":modified:"};
- }
- return $ret;
-}
-
-sub _blank_message {
- my $class = shift;
-
- my $self = bless { }, $class;
-
- return $self;
-}
-
-sub create_message {
- my $class = shift;
-
- my $mes = $class->_blank_message;
- $mes->{__id__} = -1;
-
- return $mes;
-}
-
-# build some accessors
-foreach my $field ($tm->method_names) {
- my $sub = q {
- sub [[field]] {
- my $self = shift;
- if (@_ and "[[field]]" ne "id") {
- $self->{":modified:"}->{[[field]]} = 1;
- $self->{__[[field]]__} = shift;
- }
- return $self->{__[[field]]__};
- }
- };
-
- $sub =~ s/\[\[field\]\]/$field/g;
- eval $sub;
-
- if ($@) {
- die $@;
- }
-}
-
-sub commit {
- my $self = shift;
- my $mode = 'update';
-
- if ($self->id == -1) {
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare("SELECT rhn_m_id_seq.nextval FROM DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- die "No new message id from seq rhn_m_id_seq (possible error: " .
$sth->errstr . ")" unless $id;
- $sth->finish;
-
- $self->{":modified:"}->{id} = 1;
- $self->{__id__} = $id;
- $self->{":modified:"}->{message_id} = 1;
- $self->{__message_id__} = $id;
- $mode = 'insert';
- }
-
- die "$self->commit called on message without valid id" unless $self->id
and $self->id > 0;
-
- my @modified = keys %{$self->{":modified:"}};
- my %modified = map { $_ => 1 } @modified;
-
- return unless @modified;
-
- my $dbh = RHN::DB->connect;
-
- my @queries;
- if ($mode eq 'update') {
- @queries = $tm->update_queries($tm->methods_to_columns(@modified));
- }
- else {
- @queries = $tm->insert_queries($tm->methods_to_columns(@modified));
- }
-
- foreach my $query (@queries) {
- my $sth = $dbh->prepare($query->[0]);
- my @vars = ((map { $self->$_() } grep { exists $modified{$_} } @{$query->[1]}),
$modified{id} ? () : $self->id);
- $sth->execute(@vars);
- }
-
- $dbh->commit;
- delete $self->{":modified:"};
-}
-
-1;
diff --git a/web/modules/rhn/RHN/ServerMessage.pm b/web/modules/rhn/RHN/ServerMessage.pm
deleted file mode 100644
index 3ff7f56..0000000
--- a/web/modules/rhn/RHN/ServerMessage.pm
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-#
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-package RHN::ServerMessage;
-
-use strict;
-use RHN::DB::Message::ServerMessage;
-
-our @ISA = qw/RHN::DB::Message::ServerMessage/;
-
-
-1;
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index be145c2..0e7db68 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -208,7 +208,6 @@ rm -rf $RPM_BUILD_ROOT
%{perl_vendorlib}/RHN/Server.pm
%{perl_vendorlib}/RHN/ServerActions.pm
%{perl_vendorlib}/RHN/ServerGroup.pm
-%{perl_vendorlib}/RHN/ServerMessage.pm
%{perl_vendorlib}/RHN/ServerNotes.pm
%{perl_vendorlib}/RHN/Session.pm
%{perl_vendorlib}/RHN/Set.pm
@@ -218,7 +217,6 @@ rm -rf $RPM_BUILD_ROOT
%{perl_vendorlib}/RHN/TSDB.pm
%{perl_vendorlib}/RHN/Tag.pm
%{perl_vendorlib}/RHN/TemplateString.pm
-%{perl_vendorlib}/RHN/TextMessage.pm
%{perl_vendorlib}/RHN/TinyURL.pm
%{perl_vendorlib}/RHN/Token.pm
%{perl_vendorlib}/RHN/TokenGen/