/[cvs]/nfo/perl/libs/Data/Rap.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Rap.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Tue Feb 18 15:34:26 2003 UTC revision 1.4 by joko, Thu Mar 27 15:31:01 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## -------------------------------------------------------------------------  ## -------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.4  2003/03/27 15:31:01  joko
6    ##  fixes to modules regarding new namespace(s) below Data::Mungle::*
7    ##
8    ##  Revision 1.3  2003/02/20 18:44:26  joko
9    ##  renamed modules
10    ##  + sub find_rules: attempts to find 'rap.xml'
11    ##  + updated documentation: added SYNOPSIS
12    ##
13    ##  Revision 1.2  2003/02/18 16:02:04  joko
14    ##  +- renamed module
15    ##
16  ##  Revision 1.1  2003/02/18 15:34:26  joko  ##  Revision 1.1  2003/02/18 15:34:26  joko
17  ##  + initial commit  ##  + initial commit
18  ##  ##
# Line 29  Line 40 
40    And: lots of work, i believe....    And: lots of work, i believe....
41        
42    Okay:    Okay:
43    Look at DesignPattern:: and Data::Transform::Deep & Co. (lowlevel stuff)    Look at DesignPattern:: and Data::Mungle::Transform::Deep & Co. (lowlevel stuff)
44    or OEF::, Data::Storage and Data::Transfer::Sync (highlevel stuff).    or OEF::, Data::Storage and Data::Transfer::Sync (highlevel stuff).
45    
46    And then:    And then:
47    
48    
49    =head1 SYNOPSIS
50    
51      my $rap = Data::Rap->new( target => 'sync-core' );
52      $rap->start();
53    
54      print Dumper($rap);
55      
56      print Dumper($rap->get_property('/'));
57    
58      print Dumper($rap->get_property('.'));
59      print Dumper($rap->get_property('global'));
60      print Dumper($rap->get_property('app'));
61      print Dumper($rap->get_property('app.config'));
62      print Dumper($rap->get_property('app.config.preboot'));
63      print Dumper($rap->get_property('app.config.databases.oefcore'));
64    
65    
66  =head1 Overview  =head1 Overview
67    
68  =head2 Rap - Request And Process  =head2 Rap - Request And Process
# Line 52  Line 80 
80         - OEF::Component::Task         - OEF::Component::Task
81      - make "old" shortcut programs like "feed.pl", "tell.pl" and such obsolete      - make "old" shortcut programs like "feed.pl", "tell.pl" and such obsolete
82      - add more targets in order to make "setup.pl" & Co. obsolete as well      - add more targets in order to make "setup.pl" & Co. obsolete as well
83      - some new concepts (perly):
84        - namespaces
85        - plugins
86        - contexts
87    
88    
89  =head3 It's using these fine modules from CPAN  =head3 It's using these fine modules from CPAN
# Line 70  Line 102 
102    
103  =head3 Rap does networking  =head3 Rap does networking
104    
105    - It's a client. (cli program, standalone)    x It's a client. (cli program, standalone)
106    - It's a server/daemon as well. (cli interacts with daemon via tcp-socket)        (->Command-Frontends: rap.pl)
107      o It's a server/daemon as well. (cli interacts with daemonized engine via tcp-socket)
108          (->Command-Frontends: rap.pl --remote|--host=<hostname>)
109    
110        
111  =head3 Rap is open for enhancements and/or integration into/with other stuff  =head3 Rap is open for enhancements and/or integration into/with other stuff
112    
113  =head4 Command-Frontends (local and/or remote)  =head4 Command-Frontends (local and/or remote)
114    
115      x rap.pl
116    o Commands can be sent via psh (The Perl Shell) or similar frontends (via rap.pl or Rap.pm)    o Commands can be sent via psh (The Perl Shell) or similar frontends (via rap.pl or Rap.pm)
117    o Commands can be issued from a php-frontend (via RPC using Rap::)    o Commands can be issued from a php-frontend (via RPC using Rap::)
118    
# Line 117  use warnings; Line 152  use warnings;
152    
153  use base qw(  use base qw(
154    DesignPattern::Object    DesignPattern::Object
   DesignPattern::Object::Logger  
155    DesignPattern::Bridge    DesignPattern::Bridge
156      DesignPattern::Logger
157      DesignPattern::Exception
158  );  );
159    
160    
161  use Data::Dumper;  use Data::Dumper;
162    use Cwd;
163    use File::Spec::Functions qw( splitpath splitdir catpath catdir );
164    
165    
166  sub constructor {  sub constructor {
167    my $self = shift;    my $self = shift;
168    $self->load([qw( Metadata Engine Property Command )]);    
169      # patch
170        $self->{__rap}->{filename} = $self->{filename};
171        delete $self->{filename};
172      
173      # check
174        if (!$self->{__rap}->{filename}) {
175          $self->{__rap}->{filename} = $self->find_rules();
176        }
177      
178      $self->load([qw( Metadata Engine Command Context Property )]);
179    #$self->load("Command");    #$self->load("Command");
180    #$self->load("Metadata");    #$self->load("Metadata");
181    #$self->load("Engine");    #$self->load("Engine");
# Line 146  sub start { Line 194  sub start {
194      $self->log("target: $target", 'info');      $self->log("target: $target", 'info');
195      $self->performTarget($target);      $self->performTarget($target);
196    } else {    } else {
197      my $meta_raw = $self->readXmlOverview();      my $meta_raw = $self->getTargetList();
198      #print Dumper($meta_raw);  
199        foreach my $entry (@$meta_raw) {
200          print "  - rap.pl $entry->{name}", "\n";
201          print $entry->{description}, "\n" if $entry->{description};
202        }
203    
204        return;
205    
206        print Dumper($meta_raw);
207        exit;
208        
209      foreach my $key (keys %{$meta_raw->{target}}) {      foreach my $key (keys %{$meta_raw->{target}}) {
210        my $target = $meta_raw->{target}->{$key};        my $target = $meta_raw->{target}->{$key};
211        print "  - rap.pl $key", "\n";        print "  - rap.pl $key", "\n";
# Line 165  sub start { Line 223  sub start {
223        
224  }  }
225    
226    sub find_rules {
227      my $self = shift;
228      my $cwd = cwd();
229    
230      (my $volume, my $directory, my $file) = splitpath( $cwd );
231      my @dir = splitdir($directory);
232      pop @dir;
233      #pop @dir;
234      my $base = catpath($volume, catdir(@dir));
235    
236      my $rap_xml = "$base/etc/rap.xml";
237      return $rap_xml;
238    }
239    
240    
241  1;  1;
242  __END__  __END__

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed