27 |
|
# copy(location) : make a copy of the current area at the |
28 |
|
# specified location - return an object |
29 |
|
# representing the area |
30 |
+ |
# linkarea(oref) : link area with another |
31 |
|
|
32 |
|
package Configuration::ConfigArea; |
33 |
|
use ActiveDoc::ActiveDoc; |
44 |
|
$self->newparse("download"); |
45 |
|
$self->newparse("setup"); |
46 |
|
$self->addtag("init","project",\&Project_Start,$self, |
47 |
< |
\&Project_text,$self,"", $self ); |
47 |
> |
\&Project_text,$self,"", $self ); |
48 |
|
$self->addurltags("download"); |
49 |
|
$self->addtag("download","use",\&Use_download_Start,$self, |
50 |
|
"", $self, "",$self); |
52 |
|
$self->addtag("setup","use",\&Use_Start,$self, "", $self, "",$self); |
53 |
|
} |
54 |
|
|
55 |
+ |
|
56 |
|
sub defaultdirname { |
57 |
|
my $self=shift; |
58 |
|
my $name=$self->name(); |
66 |
|
sub setup { |
67 |
|
my $self=shift; |
68 |
|
|
69 |
< |
# --- find out the location |
70 |
< |
my $location=$self->requestoption("area_location", |
71 |
< |
"Please Enter the location of the directory"); |
72 |
< |
if ( $location!~/^\// ) { |
69 |
> |
# --- find out the location - default is cwd |
70 |
> |
my $location=$self->option("area_location"); |
71 |
> |
if ( ! defined $location ) { |
72 |
> |
$location=cwd(); |
73 |
> |
} |
74 |
> |
elsif ( $location!~/^\// ) { |
75 |
|
$location=cwd()."/".$location; |
76 |
|
} |
77 |
|
|
152 |
|
|
153 |
|
AddDir::adddir(dirname($destination)); |
154 |
|
|
155 |
< |
my @cpcmd=(qw(cp -r), "$self->location()", "$destination"); |
156 |
< |
print "@cpcmd"; |
155 |
> |
$temp=$self->location(); |
156 |
> |
my @cpcmd=(qw(cp -r), "$temp", "$destination"); |
157 |
> |
print "@cpcmd"."\n"; |
158 |
|
# File::Copy::copy("$self->location()", "$destination") or |
159 |
< |
system(@cpcmd) or |
159 |
> |
system(@cpcmd) == 0 or |
160 |
|
$self->error("Cannot copy ".$self->location(). |
161 |
|
" to $destination ".$!); |
162 |
|
|
255 |
|
# Set up the document |
256 |
|
$docref->setup(); |
257 |
|
# $self->config()->storepolicy("local"); |
253 |
– |
$docref->save(); |
258 |
|
} |
259 |
|
|
260 |
|
# -------------- Tags --------------------------------- |