ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/SimpleURLDoc.pm
Revision: 1.6.8.1
Committed: Thu Mar 13 12:54:50 2008 UTC (17 years, 1 month ago) by muzaffar
Content type: text/plain
Branch: SCRAM_V2_0
CVS Tags: V2_2_2, V2_2_2_pre4, V2_2_2_pre3, V2_2_2_pre2, V2_2_2_pre1, V2_2_2-pre1, V2_2_1, forV2_2_1, V2_2_0, sm100112, V2_1_4, V2_1_3, V2_1_2, V2_1_1, V2_1_0, V2_0_6, V2_0_5, V2_0_4, V2_0_4_relcand2, V2_0_4_relcand1, V2_0_3, V2_0_3_relcand3, V2_0_3_relcand2, V2_0_3_relcand1, V2_0_2, V2_0_2_relcand1, V2_0_1, V2_0_1_relcand4, V2_0_1_relcand3, V2_0_1_relcand2, V2_0_1_relcand1, V2_0_0_relcand4, V2_0_0, V2_0_0_relcand3, V2_0_0_relcand2, V2_0_0_relcand1
Changes since 1.6: +24 -71 lines
Log Message:
scram v2.0 for multiple arch support and big lib stuff

File Contents

# Content
1 package ActiveDoc::SimpleURLDoc;
2 use ActiveDoc::SimpleDoc;
3 require 5.001;
4 @ISA=qw(ActiveDoc::SimpleDoc);
5
6 sub new()
7 {
8 my $class=shift;
9 my $self={};
10 bless $self, $class;
11 return $self;
12 }
13
14 sub fullpath ()
15 {
16 my $self=shift;
17 my $src=shift;
18 $src=~s/^\s*file://;
19 my $base=$self->{urlbase};
20 if ($base ne "") {$src="${base}/${src}";}
21 return $src;
22 }
23
24 sub urldownload()
25 {
26 my $self=shift;
27 my $src=$self->fullpath(shift);
28 my $des=shift;
29 $des=~s/^\s*file://;
30 use Utilities::AddDir;
31 if (-f $src)
32 {
33 use File::Basename;
34 use File::Copy;
35 Utilities::AddDir::adddir(dirname($des));
36 copy($src,$des);
37 }
38 elsif (-d $src)
39 {
40 Utilities::AddDir::copydir($src,$des);
41 }
42 }
43
44 # ------------------------ Tag Routines -------------------------------
45 sub base()
46 {
47 my $self=shift;
48 my (%attributes)=@_;
49 if (!exists $self->{configurl}){$self->{configurl}=[];}
50 my $url=$attributes{'url'};
51 $url=~s/^\s*file://;
52 push @{$self->{configurl}},$url;
53 $self->{urlbase}=$url;
54 }
55
56 sub base_()
57 {
58 my $self=shift;
59 $self->{urlbase}=pop @{$self->{configurl}};
60 }
61
62 1;