[aMail-checkins] CVS: new_project/docs/devel/Storage EMail.html,1.1,1.2 Storage.html,1.1,1.2
Brought to you by:
bit-man
|
From: Victor A. R. <bi...@us...> - 2002-08-26 22:53:26
|
Update of /cvsroot/amail/new_project/docs/devel/Storage
In directory usw-pr-cvs1:/tmp/cvs-serv24488/docs/devel/Storage
Modified Files:
EMail.html Storage.html
Log Message:
Use of TRex::Storage (alpha 1) for folder creation.
Index: EMail.html
===================================================================
RCS file: /cvsroot/amail/new_project/docs/devel/Storage/EMail.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** EMail.html 23 Aug 2002 18:02:00 -0000 1.1
--- EMail.html 26 Aug 2002 22:53:22 -0000 1.2
***************
*** 2,6 ****
<HTML>
<HEAD>
! <TITLE>Developer's arena - aMail::Storage::EMail</TITLE>
<LINK REV="made" HREF="mailto:pro...@po...">
</HEAD>
--- 2,6 ----
<HTML>
<HEAD>
! <TITLE>Developer's arena - TRex::Storage::EMail</TITLE>
<LINK REV="made" HREF="mailto:pro...@po...">
</HEAD>
***************
*** 16,20 ****
<TD ALIGN="center">
<H1>Developer's arena</H1>
! <H1>aMail::Storage::EMail</H1>
</TD>
</TR>
--- 16,20 ----
<TD ALIGN="center">
<H1>Developer's arena</H1>
! <H1>TRex::Storage::EMail</H1>
</TD>
</TR>
***************
*** 170,174 ****
<TD ALIGN="center">
<H1>Developer's arena</H1>
! <H1>aMail::Storage::EMail</H1>
</TD>
</TR>
--- 170,174 ----
<TD ALIGN="center">
<H1>Developer's arena</H1>
! <H1>TRex::Storage::EMail</H1>
</TD>
</TR>
Index: Storage.html
===================================================================
RCS file: /cvsroot/amail/new_project/docs/devel/Storage/Storage.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Storage.html 23 Aug 2002 18:02:00 -0000 1.1
--- Storage.html 26 Aug 2002 22:53:22 -0000 1.2
***************
*** 2,6 ****
<HTML>
<HEAD>
! <TITLE>Developer's arena - aMail::Storage</TITLE>
<LINK REV="made" HREF="mailto:pro...@po...">
</HEAD>
--- 2,6 ----
<HTML>
<HEAD>
! <TITLE>Developer's arena - TRex::Storage</TITLE>
<LINK REV="made" HREF="mailto:pro...@po...">
</HEAD>
***************
*** 16,20 ****
<TD ALIGN="center">
<H1>Developer's arena</H1>
! <H1>aMail::Storage</H1>
</TD>
</TR>
--- 16,20 ----
<TD ALIGN="center">
<H1>Developer's arena</H1>
! <H1>TRex::Storage</H1>
</TD>
</TR>
***************
*** 37,41 ****
--- 37,43 ----
<LI><A HREF="#new($)"><CODE>new($)</CODE></A></LI>
<LI><A HREF="#authmethods()"><CODE>authMethods()</CODE></A></LI>
+ <LI><A HREF="#notexistsauthmethod">notExistsAuthMethod</A></LI>
<LI><A HREF="#open(%)"><CODE>open(%)</CODE></A></LI>
+ <LI><A HREF="#insert(%)"><CODE>insert(%)</CODE></A></LI>
</UL>
***************
*** 128,132 ****
die "Crashhhh new() !!!\n" if ( ! defined $handler );</PRE>
<P>
! <H2><A NAME="authmethods()"><CODE>authMethods()</CODE></A></H2>
<P>Each class ID can be implemented using different technologies (relational
database, LDAP repository, etc.), and using distinct authentication schemas.</P>
--- 130,134 ----
die "Crashhhh new() !!!\n" if ( ! defined $handler );</PRE>
<P>
! <H2><A NAME="authmethods()"><A HREF="#item_authMethods"><CODE>authMethods()</CODE></A></A></H2>
<P>Each class ID can be implemented using different technologies (relational
database, LDAP repository, etc.), and using distinct authentication schemas.</P>
***************
*** 153,156 ****
--- 155,200 ----
my @authMethods = authMethods();</PRE>
<P>
+ <H2><A NAME="notexistsauthmethod">notExistsAuthMethod</A></H2>
+ <P>Checks if the passed authentication method exists in the array obtained
+ via <A HREF="#item_authMethods"><CODE>authMethods()</CODE></A> call.</P>
+ <P>The parameters are passed in a hash, and the key values are :</P>
+ <UL>
+ <LI><STRONG><A NAME="item_AUTH_METHOD_%3A_Authenticated_method_to_search_for">AUTH_METHOD : Authenticated method to search for</A></STRONG><BR>
+
+ <LI><STRONG><A NAME="item_authMethods">AUTH_ARRAY : a reference to the authentication array obtained via <CODE>authMethods()</CODE> call.</A></STRONG><BR>
+
+ </UL>
+ <P>The return values are 1 (one) on failure and o (zero) on success.</P>
+ <P>Usage :</P>
+ <PRE>
+ use aMail::Storage;</PRE>
+ <PRE>
+ my $method = "AMAIL";
+ </PRE>
+ <PRE>
+
+ ### ... handler obtained via new() ...
+ ### ... auth methods obtained via authMethods() ..</PRE>
+ <PRE>
+
+ die "$method auth. schema not supported"
+ if notExistsAuthMethod( { AUTH_METHOD => $method,
+ AUTH_ARRAY => \@authMethods });</PRE>
+ <PRE>
+
+ =cut</PRE>
+ <P>sub notExistsAuthMethod {
+ my $input = shift;
+ my $authMethods = $$input{'AUTH_ARRAY'};</P>
+ <PRE>
+ for( my $i=0; $i < scalar @$authMethods; $i++ ) {
+ return 0 if ( $$authMethods[$i] eq $$input{'AUTH_METHOD'} );
+ };
+ </PRE>
+ <PRE>
+
+ return 1; ### Sorry, not found :-(
+ }</PRE>
+ <P>
<H2><A NAME="open(%)"><CODE>open(%)</CODE></A></H2>
<P>Opens a connection to the desired storage class.</P>
***************
*** 183,186 ****
--- 227,310 ----
AUTH_PARAMETERS => { aMail_ID => 'bit-man',
SID => '331868645' } } );</PRE>
+ <P>
+ <H2><A NAME="insert(%)"><CODE>insert(%)</CODE></A></H2>
+ <P>Inserts an object in the data store.</P>
+ <P>The parameters are passed in a hash, and the key values corresopnd
+ to the desired parameters to be passed:</P>
+ <UL>
+ <LI><STRONG>AUTH_METHOD : Authenticated method (described previously)</STRONG><BR>
+
+ <LI><STRONG>AUTH_PARAMETERS : hash containing the authentication credentials.
+ In case of NULL is an empty hash, if USER_PWD the keys USER and PASSWORD
+ must be passed, and if AMAIL the keys aMail_ID and SID will be used.</STRONG><BR>
+
+ The the code returned is the corresponding to each storage class.
+ <P></P></UL>
+ <P>Usage :</P>
+ <PRE>
+ use aMail::Storage;</PRE>
+ <PRE>
+ my $folder = "myFolder";
+ </PRE>
+ <PRE>
+
+ ### ... handler obtained via new() ...
+ ### ... auth methods obtained via authMethods() ..
+ ### ... authentication via open() ...</PRE>
+ <PRE>
+
+ die "Can't insert folder $folder"
+ unless ! $handler->insert( { OBJECT => 'FOLDER',
+ NAME => $folder ] );</PRE>
+ <PRE>
+
+ =cut</PRE>
+ <P>sub <CODE>insert()</CODE> {
+ my $self = shift;
+ my $input = shift;
+ </P>
+ <PRE>
+
+ my @param;
+ push @param, $self->{'aMail_ID'};
+ push @param, $self->{'SID'};</PRE>
+ <PRE>
+
+ $_ = $$input{'OBJECT'};</PRE>
+ <PRE>
+ /$FOLDER/ && ($self->{'CLID'} eq 'EMail') && do {
+ print "Folder creation\n";
+ return $self->{'SOAPhandler'}->folderCreate( $$input{'NAME'},
+ $self->{'authMethod'}, @param )->result;
+ };
+ </PRE>
+ <PRE>
+
+ return 999; ## Sorry, invalid operation
+ }</PRE>
+ <P>##
+ ## Miscellaneous functions (some internal, some exported)
+ ##</P>
+ <P>############# ConnectToWebService ##########################################
+ sub <CODE>ConnectToWebService($)</CODE> {
+ my $module = shift;
+ my $HOST = 'localhost';
+ my $PORT = 12345;</P>
+ <PRE>
+ print "Class ID: $module \n";
+ </PRE>
+ <PRE>
+
+ my $handler = SOAP::Lite
+ -> uri('aMail/Storage/' . $module)
+ -> proxy('<A HREF="http://">http://</A>'.$HOST .':'. $PORT .'/')
+ -> on_fault(sub { my($soap, $res) = @_;
+ die ref $res ? $res->faultstring : $soap->transport->status, "\n";
+ });</PRE>
+ <PRE>
+
+ return $handler;
+ }
+ 1;</PRE>
<HR>
***************
*** 193,197 ****
<TD ALIGN="center">
<H1>Developer's arena</H1>
! <H1>aMail::Storage</H1>
</TD>
</TR>
--- 317,321 ----
<TD ALIGN="center">
<H1>Developer's arena</H1>
! <H1>TRex::Storage</H1>
</TD>
</TR>
|