/[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.5 by jonen, Fri Mar 28 16:52:41 2003 UTC revision 1.6 by joko, Sat Mar 29 07:08:56 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## -------------------------------------------------------------------------  ## -------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.6  2003/03/29 07:08:56  joko
6    ##  rap goes global:
7    ##    + distinguish between running in global- or project-mode
8    ##    + some comments in pod
9    ##
10  ##  Revision 1.5  2003/03/28 16:52:41  jonen  ##  Revision 1.5  2003/03/28 16:52:41  jonen
11  ##  now using env-var 'RAPBIN'  ##  now using env-var 'RAPBIN'
12  ##  ##
# Line 34  Line 39 
39    A Process is a Task.    A Process is a Task.
40    There are just details.    There are just details.
41    
42    
43  =head2 ahh...  =head2 ahh...
44    
45    CPAN already *has got* all the tools starting an attempt to do this.    rap means 'Request And Process'.
46      rap is contained in 'wrapped'.
47      dot is the 'Database Of Targets', by default '/etc/rap.xml'. (rename to 'dot.xml'?)
48    
49    
50      CPAN already *has got* all required tools starting an attempt to do this.
51        
52    Having enough experience with Perl now, this attempt should work out well.....    Will this work out?
53    But still, Hmmm......    But still, Hmmm......
54    And: lots of work, i believe....    And: lots of work, i believe....
55      Let's start...
56        
57    Okay:    Okay:
58    Look at DesignPattern:: and Data::Mungle::Transform::Deep & Co. (lowlevel stuff)    Look at DesignPattern:: and Data::Mungle::Transform::Deep & Co. (lowlevel stuff)
# Line 70  Line 82 
82    
83  =head2 Rap - Request And Process  =head2 Rap - Request And Process
84    
85    =head3 Rap's Features
86      - have targets (like make) declared in xml (like ant)
87      - run these targets...
88        - ... from a multitude of possible human interaction devices (HIDs), e.g.
89          - cli (console mode)
90          - gui
91          - web
92          - speech
93          - scribe
94        - ... from a different location (non-local - for remote administration purposes)
95          - the remote wrapper is 'rapd' - the rap-daemon....
96          - rapd can run in command-mode (like apache, sendmail and related)
97            and/or web-service mode (commands are wrapped into request-/response-
98            xml-payload-communication)
99      - rap is self contained on various levels
100        - runtime-layer
101          - pass arguments between targets
102          - core targets are declared in xml (rap-lingo) as well
103            these exist by now: (look at Data/Rap/targets/default.xml)
104            - core.os.win32
105            - core.os.linux
106            - core.rap.mode
107            - core.rap.daemon
108        - declaration-layer
109          - the xml-file in rap-lingo can contain descriptions associated with each target
110          - rap can make report on its guis about these
111          - rap can use this declaration as an api for the rap-daemon 'rapd'
112        - rap itself can run in "global"- or "project"-mode
113          - FIXME: write something about this (by now: read the source, luke.....)
114          
115    
116    =head3 Rap's Future
117      - rapd
118        - rapd can also run in apache mode for non-root purposes
119        - many rapd's can talk to each other - first example application would be:
120          - one rapd is running as apache-mod-perl-handler (non-root)
121          - one rapd is running locally as root
122          - remark: the way to go (by now) is via org.netfrag.glib's DataSource-libraries,
123            which wrap the innards of rpc-communication via xml (XMLRPC) (lingo: php)
124            an example application is caesar.rapweb and (maybe) caesar.ums
125    
126  =head3 Rap's aims are directed to get some of this together  =head3 Rap's aims are directed to get some of this together
127    
# Line 183  sub constructor { Line 235  sub constructor {
235    #$self->load("Metadata");    #$self->load("Metadata");
236    #$self->load("Engine");    #$self->load("Engine");
237    
   # check for another environment-variable: 'RAPBIN'  
   chdir $ENV{RAPBIN} if $ENV{RAPBIN};  
     
238  }  }
239    
240  sub start {  sub start {
# Line 232  sub start { Line 281  sub start {
281  sub find_rules {  sub find_rules {
282    my $self = shift;    my $self = shift;
283    
284    my $basedir;    my $rapfile = 'etc/rap.xml';
285      my $rapfile_found = '';
286      
287      my $basedir = '';
288      
289      # directly from env-var?
290    if (my $rapdir = $ENV{RAPDIR}) {    if (my $rapdir = $ENV{RAPDIR}) {
291      $basedir = $rapdir;      $basedir = $rapdir;
292    } else {      
293      # relative?
294      } else {
295      my $cwd = cwd();      my $cwd = cwd();
296    
297      (my $volume, my $directory, my $file) = splitpath( $cwd );      (my $volume, my $directory, my $file) = splitpath( $cwd );
298    
299      my @dir = splitdir($directory);      my @dir = splitdir($directory);
300      pop @dir;      pop @dir;
301      #pop @dir;      #pop @dir;
302      $basedir = catpath($volume, catdir(@dir));      $basedir = catpath($volume, catdir(@dir));
303        
304      }
305    
306      #print "basedir: '$basedir'", "\n";
307    
308      # check for $basedir/PROJECT
309      if (! -d "$basedir/PROJECT") {
310        $basedir = '';
311      }
312    
313      if ($basedir) {
314        # TODO: review this! handle relative ./etc/rap.xml here!!!
315        $rapfile_found = "$basedir/$rapfile";
316      
317      } else {
318        #if (! -e $rapfile_found) { $rapfile_found = "/$rapfile"; }
319        $rapfile_found = "/$rapfile";
320    }    }
321        
322      #print "rapfile_found: $rapfile_found", "\n";
323    
324    
325      # if rapfile doesn't exists, try to fall back to absolute (global) mode (/etc/rap.xml)
326      #if (! -e $rapfile_found) { $rapfile_found = catpath($volume, "/", $rapfile); }
327      #if (! -e $rapfile_found) { $rapfile_found = "/$rapfile"; }
328    
329      $self->log( "Using rapfile $rapfile_found.", 'info' );
330    
331    my $rap_xml = "$basedir/etc/rap.xml";    return $rapfile_found;
   return $rap_xml;  
332  }  }
333    
334    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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