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 |
11 |
|
## now using env-var 'RAPBIN' |
12 |
|
## |
13 |
|
## Revision 1.4 2003/03/27 15:31:01 joko |
14 |
|
## fixes to modules regarding new namespace(s) below Data::Mungle::* |
15 |
|
## |
16 |
## Revision 1.3 2003/02/20 18:44:26 joko |
## Revision 1.3 2003/02/20 18:44:26 joko |
17 |
## renamed modules |
## renamed modules |
18 |
## + sub find_rules: attempts to find 'rap.xml' |
## + sub find_rules: attempts to find 'rap.xml' |
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::Transform::Deep & Co. (lowlevel stuff) |
Look at DesignPattern:: and Data::Mungle::Transform::Deep & Co. (lowlevel stuff) |
59 |
or OEF::, Data::Storage and Data::Transfer::Sync (highlevel stuff). |
or OEF::, Data::Storage and Data::Transfer::Sync (highlevel stuff). |
60 |
|
|
61 |
And then: |
And then: |
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 |
|
|
234 |
#$self->load("Command"); |
#$self->load("Command"); |
235 |
#$self->load("Metadata"); |
#$self->load("Metadata"); |
236 |
#$self->load("Engine"); |
#$self->load("Engine"); |
237 |
|
|
238 |
} |
} |
239 |
|
|
240 |
sub start { |
sub start { |
280 |
|
|
281 |
sub find_rules { |
sub find_rules { |
282 |
my $self = shift; |
my $self = shift; |
|
my $cwd = cwd(); |
|
283 |
|
|
284 |
(my $volume, my $directory, my $file) = splitpath( $cwd ); |
my $rapfile = 'etc/rap.xml'; |
285 |
my @dir = splitdir($directory); |
my $rapfile_found = ''; |
286 |
pop @dir; |
|
287 |
#pop @dir; |
my $basedir = ''; |
288 |
my $base = catpath($volume, catdir(@dir)); |
|
289 |
|
# directly from env-var? |
290 |
|
if (my $rapdir = $ENV{RAPDIR}) { |
291 |
|
$basedir = $rapdir; |
292 |
|
|
293 |
|
# relative? |
294 |
|
} else { |
295 |
|
my $cwd = cwd(); |
296 |
|
|
297 |
|
(my $volume, my $directory, my $file) = splitpath( $cwd ); |
298 |
|
|
299 |
|
my @dir = splitdir($directory); |
300 |
|
pop @dir; |
301 |
|
#pop @dir; |
302 |
|
$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 = "$base/etc/rap.xml"; |
return $rapfile_found; |
|
return $rap_xml; |
|
332 |
} |
} |
333 |
|
|
334 |
|
|