Tadashi Okoshi
slash****@users*****
2006年 6月 29日 (木) 03:12:49 JST
Index: affelio/lib/Affelio/Managing/NewsAggregator.pm
diff -u affelio/lib/Affelio/Managing/NewsAggregator.pm:1.26 affelio/lib/Affelio/Managing/NewsAggregator.pm:1.27
--- affelio/lib/Affelio/Managing/NewsAggregator.pm:1.26 Tue Jun 6 12:01:20 2006
+++ affelio/lib/Affelio/Managing/NewsAggregator.pm Thu Jun 29 03:12:49 2006
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: NewsAggregator.pm,v 1.26 2006/06/06 03:01:20 slash5234 Exp $
+# $Id: NewsAggregator.pm,v 1.27 2006/06/28 18:12:49 slash5234 Exp $
package Affelio::Managing::NewsAggregator;
{
@@ -187,9 +187,9 @@
#Invoke SNS/Handshaker_c
my $ret="";
try{
- require Affelio::SNS::Handshaker_c;
+ require Affelio::VSNS::Handshaker_c;
- $ret = Affelio::SNS::Handshaker_c::get_news(
+ $ret = Affelio::VSNS::Handshaker_c::get_news(
dest_uri => $af_id,
xwsse_mesg => $xwsse_mesg);
Index: affelio/lib/Affelio/Managing/RelationManager.pm
diff -u /dev/null affelio/lib/Affelio/Managing/RelationManager.pm:1.1
--- /dev/null Thu Jun 29 03:12:49 2006
+++ affelio/lib/Affelio/Managing/RelationManager.pm Thu Jun 29 03:12:49 2006
@@ -0,0 +1,123 @@
+# Copyright (C) 2005 FishGrove Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# $Id: RelationManager.pm,v 1.1 2006/06/28 18:12:49 slash5234 Exp $
+
+package Affelio::Managing::RelationManager;
+{
+ use strict;
+ use lib("../../../extlib");
+ use Error qw(:try);
+ use DBI;
+ use lib("../../");
+ use Affelio;
+ use Affelio::misc::CGIError;
+ use Affelio::misc::Debug qw(debug_print);
+ use Affelio::VSNS::Handshaker_c qw(delete_AFLink);
+ use Affelio::misc::WSSE qw(make_XWSSE);
+ use Affelio::exception::CommunicationException;
+ use Affelio::exception::NetworkException;
+
+ ########################################################################
+ #Constructor
+ ########################################################################
+ sub new{
+ my $class = shift;
+ my $af = shift;
+
+ debug_print("RelationManager::new: start.");
+
+ my $self = {af => $af
+ };
+ bless $self, $class;
+
+ debug_print("RelationManager::new: end.");
+ return $self;
+ }
+
+ ########################################################################
+ #remove_relation
+ ########################################################################
+ sub remove_relation{
+ my $self = shift;
+ my %param = @_;
+ my $in_uid = $param{uid};
+ my $in_flag = $param{flag};
+
+ debug_print("RelationManager::remove: start. uid=[$in_uid]");
+ my $afid = $self->{af}->getFM->get_attribute_by_uid($in_uid, "af_id");
+
+ ###############################################
+ #(0) Invoke peer's delete_AFLink method
+ if($in_flag ne "no_XMLRPC"){
+ #retrieve password
+ my $pw = $self->{af}->getFM->get_attribute_by_uid($in_uid, "password");
+
+ #generate X-WSSE message
+ my $xwsse_mesg = Affelio::misc::WSSE::make_XWSSE($self->{af}->{site__user_afid}, $pw);
+ debug_print("RelationManager::remove: wsse=[$xwsse_mesg]");
+
+ try{
+ Affelio::VSNS::Handshaker_c::delete_AFLink(dest_uri => $afid, xwsse_mesg => $xwsse_mesg);
+ }catch Affelio::exception::NetworkException with{
+ }catch Affelio::exception::CommunicationException with{
+ };
+
+ debug_print("RelationManager::remove: after XMLRPC finished.");
+ }
+
+ ###############################################
+ #(1) Remove entry(uid) from AFuser_CORE_friends
+
+ ###############################################
+ #(2) Remove uid from friends of others in AFuser_CORE_friends
+
+ ###############################################
+ #(3) Remove entry(uid) from AFuser_CORE_friendsfriends
+
+ ###############################################
+ #(4) Remove uid from friends of others in AFuser_CORE_friendsfriends
+ $self->{af}->getFM->remove_friend($in_uid);
+
+ ###############################################
+ #(5) Remove uid from groups
+ $self->{af}->getGM->remove_person_from_all($in_uid);
+
+ ###############################################
+ #(6) add uid to erasedfriends
+
+ debug_print("RelationManager::remove: end.");
+ }
+
+ ########################################################################
+ #remove_all_relation
+ ########################################################################
+ sub remove_all_relation{
+ my $self = shift;
+ debug_print("RelationManager::remove_all: start.");
+
+ my $links = $self->{af}->getFM->get_all_friend_list(type => "ANY");
+ while( my @row = $links->fetchrow_array ){
+ $self->remove_relation(uid => $row[0]);
+ }
+
+ debug_print("RelationManager::remove_all: end.");
+ }
+
+ ########################################################################
+
+}#package
+1;