You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(28) |
Nov
(58) |
Dec
(85) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(125) |
Feb
(222) |
Mar
(274) |
Apr
(51) |
May
(22) |
Jun
(50) |
Jul
(15) |
Aug
(33) |
Sep
(11) |
Oct
(29) |
Nov
(17) |
Dec
(1) |
2003 |
Jan
(100) |
Feb
(21) |
Mar
(7) |
Apr
(45) |
May
|
Jun
(43) |
Jul
(27) |
Aug
(24) |
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
(1) |
Feb
|
Mar
(13) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(7) |
Sep
|
Oct
|
Nov
|
Dec
(4) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Rob H. <for...@us...> - 2001-11-24 19:14:24
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv22833/bin Modified Files: sandweb.cgi Log Message: typo: get_file_type was entered as get_filetype Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.73 retrieving revision 1.74 diff -U2 -r1.73 -r1.74 --- sandweb.cgi 2001/11/24 13:20:42 1.73 +++ sandweb.cgi 2001/11/24 19:05:33 1.74 @@ -360,5 +360,5 @@ } } - unless ( $file->get_filetype() eq "Binary" ) { + unless ( $file->get_file_type() eq "Binary" ) { $error = "This does not appear to be a text file."; } |
From: Rob H. <for...@us...> - 2001-11-24 13:20:54
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv19885/templates Modified Files: browse.html edit_file.html Log Message: edit works now fixed location bugs in Browse.pm Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.28 retrieving revision 1.29 diff -U2 -r1.28 -r1.29 --- browse.html 2001/11/24 11:58:00 1.28 +++ browse.html 2001/11/24 13:20:43 1.29 @@ -72,5 +72,5 @@ <a name="<TMPL_VAR NAME=ENTRY>"> </input> - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=info"> + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=info&location=<TMPL_VAR NAME=LOCATION>"> <img src="/icons/<TMPL_VAR NAME=FILETYPE>.gif" alt="" border=0 width=20 height=22> @@ -80,7 +80,7 @@ <td align="center" width="20%">   - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=view">View</a> + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=view&location=<TMPL_VAR NAME=LOCATION>">View</a> | - <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=edit">Edit</a> + <a href="<TMPL_VAR NAME=PROGNAME>?<TMPL_VAR NAME=LINK>&command=edit&location=<TMPL_VAR NAME=LOCATION>">Edit</a> </td> <td width="10%" align="center"> Index: edit_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/edit_file.html,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- edit_file.html 2001/11/22 08:29:00 1.2 +++ edit_file.html 2001/11/24 13:20:43 1.3 @@ -2,7 +2,12 @@ <TMPL_VAR NAME=FILENAME> <form submit="<TMPL_VAR NAME=PROGNAME>"> - <input type="submit" name="file_action" value="Save" /> + <input name="action" value="file" type="hidden" /> + <input name="command" value="edited_file" type="hidden" /> + <input name="location" value="<TMPL_VAR NAME=LOCATION>" type="hidden" /> + <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> + <input name="filename" value="<TMPL_VAR NAME=FILENAME>" type="hidden" /> + <input type="submit" name="save" value="Save" /> <pre> - <textarea cols="80" rows="24"> + <textarea name="data" cols="80" rows="24"> <TMPL_VAR NAME=CONTENT> </textarea> |
From: Rob H. <for...@us...> - 2001-11-24 13:20:46
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv19885/bin Modified Files: sandweb.cgi Log Message: edit works now fixed location bugs in Browse.pm Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.72 retrieving revision 1.73 diff -U2 -r1.72 -r1.73 --- sandweb.cgi 2001/11/24 11:58:00 1.72 +++ sandweb.cgi 2001/11/24 13:20:42 1.73 @@ -351,5 +351,5 @@ print $return{'output'}; print '</pre>'; - exit 1; + exit 0; } elsif ( $command eq 'view' ) { @@ -360,5 +360,5 @@ } } - unless ( $file->get_file_type() eq "Text" ) { + unless ( $file->get_filetype() eq "Binary" ) { $error = "This does not appear to be a text file."; } @@ -391,5 +391,5 @@ } } - unless ( $file->get_file_type() eq "Text" ) { + if ( $file->get_file_type() eq "Binary" ) { $error = "This does not appear to be a text file."; } @@ -402,4 +402,7 @@ PROGNAME => $progname, CONTENT => "@tmp", + FILENAME => $filename, + LOCATION => $location, + FULLPATH => "$users_dir/$username/$location", ); @@ -415,4 +418,17 @@ exit 0; } + elsif ( $command eq 'edited_file' ) { + my $data = param('data'), + my $filename = $file->get_filename(); + + open ( FILE, "> $users_dir/$username$filename" ); + print FILE "$data"; + close FILE; + + browse_menu( + cookie => $cookie, + path => $location, + ); + } elsif ( $command eq 'create_file' ) { my $content = $ui->create_file( @@ -501,5 +517,9 @@ } else { - $error = "Invalid selection."; + $error = "Invalid selection: $command"; + browse_menu( + cookie => $cookie, + path => $location, + ); } } @@ -544,5 +564,5 @@ print "$return{'output'}\n"; print '</pre>'; - exit 1; + exit 0; } |
From: Rob H. <for...@us...> - 2001-11-24 13:20:46
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv19885/lib/SandWeb Modified Files: Browse.pm Log Message: edit works now fixed location bugs in Browse.pm Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -U2 -r1.18 -r1.19 --- Browse.pm 2001/11/22 01:40:25 1.18 +++ Browse.pm 2001/11/24 13:20:43 1.19 @@ -150,4 +150,5 @@ } } + $row_data{LOCATION} = $location; $row_data{PROGNAME} = $progname; push(@loop_data, \%row_data); |
From: Rob H. <for...@us...> - 2001-11-24 11:58:04
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv6742/templates Modified Files: browse.html checkout.html upload.html Log Message: fixed the location bug in create_file and create_folder. They both work as expected now; amount of code added was tiny. They need better error checking; right now, if creation fails, the user isn't notified ( blech ). Besides that, it's pretty sweet. The UI is pretty simple, and it's easy to add new files and folders and work with them. Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.27 retrieving revision 1.28 diff -U2 -r1.27 -r1.28 --- browse.html 2001/11/24 11:34:45 1.27 +++ browse.html 2001/11/24 11:58:00 1.28 @@ -18,11 +18,11 @@ </td> <td width="60%" colspan="3" align="center"> - <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=create_file">Create File</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=create_file&location=<TMPL_VAR NAME=LOCATION>">Create File</a>   |   - <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=create_folder">Create Folder</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=create_folder&location=<TMPL_VAR NAME=LOCATION>">Create Folder</a>   |   - <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=upload">Upload</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=upload&location=<TMPL_VAR NAME=LOCATION>">Upload</a>   |   - <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=checkout">Checkout</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=checkout&location=<TMPL_VAR NAME=LOCATION>">Checkout</a> <br /> </td> Index: checkout.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/checkout.html,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- checkout.html 2001/11/24 11:34:45 1.2 +++ checkout.html 2001/11/24 11:58:00 1.3 @@ -5,4 +5,5 @@ <input type="hidden" name="command" value="checkout" /> <input type="hidden" name="location" value="<TMPL_VAR NAME=LOCATION>" /> + <input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> <input type="text" name="filename" /> <input type="submit" name="checkout" value="Done" /> Index: upload.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/upload.html,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- upload.html 2001/08/07 16:47:55 1.2 +++ upload.html 2001/11/24 11:58:00 1.3 @@ -3,4 +3,5 @@ <input name="action" value="upload" type="hidden" /> <input name="location" value="<TMPL_VAR NAME=LOCATION>" type="hidden" /> +<input name="fullpath" value="<TMPL_VAR NAME=FULLPATH>" type="hidden" /> Enter a file to upload:<br /> <TMPL_VAR NAME=ERROR> |
From: Rob H. <for...@us...> - 2001-11-24 11:58:03
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv6742/bin Modified Files: sandweb.cgi Log Message: fixed the location bug in create_file and create_folder. They both work as expected now; amount of code added was tiny. They need better error checking; right now, if creation fails, the user isn't notified ( blech ). Besides that, it's pretty sweet. The UI is pretty simple, and it's easy to add new files and folders and work with them. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.71 retrieving revision 1.72 diff -U2 -r1.71 -r1.72 --- sandweb.cgi 2001/11/24 11:34:45 1.71 +++ sandweb.cgi 2001/11/24 11:58:00 1.72 @@ -126,5 +126,8 @@ elsif ( param('action') eq 'browse_menu' ) { # called sandbox viewer - browse_menu( cookie => $cookie ); + browse_menu( + cookie => $cookie, + path => param('path'), + ); } elsif ( param('action') eq 'file' ) { @@ -134,4 +137,5 @@ filename => param('filename'), command => param('command'), + location => param('location'), ); } @@ -275,5 +279,5 @@ my $repo_type = $repository->get_repo_type(); - my $path = url_param('path') || ''; + my $path = $args{'path'} || ''; # use the browse object to show user's sandbox @@ -312,4 +316,5 @@ my $command = $args{'command'}; my $filename = $args{'filename'}; + my $location = $args{'location'}; my $username = $auth->get_userinfo('username'); my $template_dir = $config->{'paths'}->{'template_dir'}; @@ -318,10 +323,9 @@ my $root = $userprefs->{'repository'}->{'root'}; my $sandbox = $userprefs->{'paths'}->{'users_dir'}; - my $location = "$users_dir/$username"; my $repository = SandWeb::Repository->new( root => $root, repo_type => $repo_type, - sandbox => $location, + sandbox => "$users_dir/$username", ); @@ -333,9 +337,9 @@ my $file = SandWeb::File->new( 'filename' => $filename, - 'location' => $location, + 'location' => "$users_dir/$username/$location", ); if ( $command eq 'info' ) { if ($filename) { - if (! -f "$location/$filename" ) { + if (! -f "$users_dir/$username/$filename" ) { set_error = "File does not exist!"; browse_menu(); @@ -351,5 +355,5 @@ elsif ( $command eq 'view' ) { if ($filename) { - if (! -f "$location/$filename" ) { + if (! -f "$users_dir/$username/$filename" ) { set_error = "File does not exist!"; browse_menu(); @@ -360,5 +364,5 @@ } my @tmp; - open (FILE, "$location/$filename"); + open (FILE, "$users_dir/$username/$filename"); foreach my $line (<FILE>) { push @tmp, $line; @@ -382,5 +386,5 @@ elsif ( $command eq 'edit' ) { if ($filename) { - if (! -f "$location/$filename" ) { + if (! -f "$users_dir/$username/$filename" ) { set_error = "File does not exist!"; browse_menu(); @@ -391,5 +395,5 @@ } my @tmp; - open (FILE, "$location/$filename"); + open (FILE, "$users_dir/$username/$filename"); foreach my $line (<FILE>) { push @tmp, $line; @@ -415,4 +419,5 @@ PROGNAME => $progname, LOCATION => $location, + FULLPATH => "$users_dir/$username/$location", ); @@ -433,4 +438,5 @@ PROGNAME => $progname, LOCATION => $location, + FULLPATH => "$users_dir/$username/$location", ); @@ -448,9 +454,15 @@ elsif ( $command eq 'created_file' ) { $file->create_file(); - browse_menu(); + browse_menu( + cookie => $cookie, + path => $location, + ); } elsif ( $command eq 'created_folder' ) { $file->create_folder(); - browse_menu(); + browse_menu( + cookie => $cookie, + path => $location, + ); } elsif ( $command eq 'upload' ) { @@ -458,4 +470,5 @@ LOCATION => $location, PROGNAME => $progname, + FULLPATH => "$users_dir/$username/$location", ); print header( -cookie => $cookie ); @@ -474,4 +487,5 @@ LOCATION => $location, PROGNAME => $progname, + FULLPATH => "$users_dir/$username/$location", ); print header( -cookie => $cookie ); |
From: Rob H. <for...@us...> - 2001-11-24 11:34:48
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv3300/templates Modified Files: browse.html checkout.html Log Message: hooked create_file, create_folder and checkout to their respective backends. there seems to be a bug with location that makes create_file and create_folder not very useful. checkout is basically a stub. Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.26 retrieving revision 1.27 diff -U2 -r1.26 -r1.27 --- browse.html 2001/11/22 09:35:39 1.26 +++ browse.html 2001/11/24 11:34:45 1.27 @@ -24,5 +24,5 @@ <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=upload">Upload</a>   |   - <a href="<TMPL_VAR NAME=PROGNAME>?action=vcsaction&command=checkout">Checkout</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=checkout">Checkout</a> <br /> </td> Index: checkout.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/checkout.html,v retrieving revision 1.1 retrieving revision 1.2 diff -U2 -r1.1 -r1.2 --- checkout.html 2001/08/15 22:06:47 1.1 +++ checkout.html 2001/11/24 11:34:45 1.2 @@ -1,8 +1,9 @@ <center> Please enter module name to checkout to <TMPL_VAR NAME=LOCATION>: - <form submit="<TMPL_VAR NAME=FILENAME>" type="get"> - <input type="hidden" name="action" value="checkout" /> + <form submit="<TMPL_VAR NAME=PROGNAME>"> + <input type="hidden" name="action" value="vcsaction" /> + <input type="hidden" name="command" value="checkout" /> <input type="hidden" name="location" value="<TMPL_VAR NAME=LOCATION>" /> - <input type="text" name="module" /> + <input type="text" name="filename" /> <input type="submit" name="checkout" value="Done" /> <TMPL_VAR NAME=ERROR> |
From: Rob H. <for...@us...> - 2001-11-24 11:34:48
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv3300/bin Modified Files: sandweb.cgi Log Message: hooked create_file, create_folder and checkout to their respective backends. there seems to be a bug with location that makes create_file and create_folder not very useful. checkout is basically a stub. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.70 retrieving revision 1.71 diff -U2 -r1.70 -r1.71 --- sandweb.cgi 2001/11/24 09:46:03 1.70 +++ sandweb.cgi 2001/11/24 11:34:45 1.71 @@ -330,10 +330,4 @@ my $file_type; - if ($filename) { - if (! -f "$location/$filename" ) { - set_error = "File does not exist!"; - browse_menu(); - } - } my $file = SandWeb::File->new( @@ -342,4 +336,10 @@ ); if ( $command eq 'info' ) { + if ($filename) { + if (! -f "$location/$filename" ) { + set_error = "File does not exist!"; + browse_menu(); + } + } print header; print '<pre>'; @@ -350,4 +350,10 @@ } elsif ( $command eq 'view' ) { + if ($filename) { + if (! -f "$location/$filename" ) { + set_error = "File does not exist!"; + browse_menu(); + } + } unless ( $file->get_file_type() eq "Text" ) { $error = "This does not appear to be a text file."; @@ -375,4 +381,10 @@ } elsif ( $command eq 'edit' ) { + if ($filename) { + if (! -f "$location/$filename" ) { + set_error = "File does not exist!"; + browse_menu(); + } + } unless ( $file->get_file_type() eq "Text" ) { $error = "This does not appear to be a text file."; @@ -434,4 +446,12 @@ exit 0; } + elsif ( $command eq 'created_file' ) { + $file->create_file(); + browse_menu(); + } + elsif ( $command eq 'created_folder' ) { + $file->create_folder(); + browse_menu(); + } elsif ( $command eq 'upload' ) { my $content = $ui->upload_file( @@ -450,8 +470,28 @@ exit 0; } + elsif ( $command eq 'checkout' ) { + my $content = $ui->get_checkout( + LOCATION => $location, + PROGNAME => $progname, + ); + print header( -cookie => $cookie ); + $ui->print_screen( + TITLE=> 'SandWeb : Checkout', + MENU_TITLE => 'SandWeb', + SUBMENU_TITLE => 'checkout file', + FOOTER => '', + CONTENT => $content, + ERROR => $error, + ); + exit 0; + } else { $error = "Invalid selection."; } } + +# all VCS actions are caught by this subroutine, and dealt +# with accordingly. The Repository object is created and used. +# sub vcsaction { |
From: Rob H. <for...@us...> - 2001-11-24 11:09:34
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv31763/lib/SandWeb Modified Files: File.pm Log Message: added methods for : create_file, create_folder, remove_file, remove_folder, rename, copy tested all functions and added documentation. browse_menu UI is going to need some rethinking; there's no way a checked file can get passed right now, since all file operations are HREFs rather than part of an HTML form. I'm going to leave this unhooked from the frontend (browse_menu) for now. I put stubs in place on the frontend; just simple templates. Stubs are good. Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -U2 -r1.12 -r1.13 --- File.pm 2001/11/22 08:44:32 1.12 +++ File.pm 2001/11/24 11:09:31 1.13 @@ -88,3 +88,76 @@ } +sub create_file { + my $self = shift; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + + open (FILE, ">$location/$filename"); + my $return = close FILE; + + return $return; +} + +sub create_folder { + my $self = shift; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + + my $return = mkdir( "$location/$filename" ); + + return $return; +} + +sub remove_file { + my $self = shift; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + + my $return = unlink("$location/$filename" ); + + return $return; +} + +sub remove_folder { + my $self = shift; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + + my $return = rmdir("$location/$filename" ); + + return $return; +} + +sub copy { + my $self = shift; + my %args = @_; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + my $tofile = $args{'tofile'}; + + open ( FROM_FILE, "< $location/$filename" ); + my @fromfile = (<FROM_FILE>); + close FROM_FILE; + + open ( TO_FILE, "> $tofile" ); + foreach my $line (@fromfile) { + print TO_FILE "$line"; + } + close TO_FILE; + + return $return; +} + +sub rename { + my $self = shift; + my %args = @_; + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + my $tofile = $args{'tofile'}; + + my $return = rename( "$location/$filename", "$tofile" ); + + return $return; +} + 1; |
From: Rob H. <for...@us...> - 2001-11-24 11:09:34
|
Update of /cvsroot/sandweb/sandweb/doc/API In directory usw-pr-cvs1:/tmp/cvs-serv31763/doc/API Modified Files: File.txt Log Message: added methods for : create_file, create_folder, remove_file, remove_folder, rename, copy tested all functions and added documentation. browse_menu UI is going to need some rethinking; there's no way a checked file can get passed right now, since all file operations are HREFs rather than part of an HTML form. I'm going to leave this unhooked from the frontend (browse_menu) for now. I put stubs in place on the frontend; just simple templates. Stubs are good. Index: File.txt =================================================================== RCS file: /cvsroot/sandweb/sandweb/doc/API/File.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -U2 -r1.3 -r1.4 --- File.txt 2001/11/22 08:46:56 1.3 +++ File.txt 2001/11/24 11:09:31 1.4 @@ -265,2 +265,167 @@ read the files specified, or they did not exist. +-------------------------------------------------------------------------------- + +METHOD + create_file + +SYNOPSIS + + my $return = $file->create_file(); + +DESCRIPTION + + Creates a file, using the filename passed to the constructor. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + create_folder + +SYNOPSIS + + my $return = $file->create_folder(); + +DESCRIPTION + + Creates a folder ( also known as a directory ) using the + filename passed to the constructor. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + copy + +SYNOPSIS + + my $return = $file->copy( tofile => "alternate_name.c" ); + +DESCRIPTION + + Creates an exact copy of the file. + +PARAMETERS + + tocopy (type: string) (required) + Contains the full path and filename of the copy. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + rename + +SYNOPSIS + + my $return = $file->rename( tofile => "alternate_name.c" ); + +DESCRIPTION + + Renames an existing file. This is the same thing as a move, + as far as the file system and operating system are concerned. + +PARAMETERS + + tocopy (type: string) (required) + Contains the full path and filename of the new file. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + remove_file + +SYNOPSIS + + my $return = $file->remove_file(); + +DESCRIPTION + + Removes the file specified in the constructor. + +PARAMETERS + + none. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + remove_folder + +SYNOPSIS + + my $return = $file->remove_folder(); + +DESCRIPTION + + Removes the folder specified in the constructor. + +PARAMETERS + + none. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. |
From: Rob H. <for...@us...> - 2001-11-24 09:46:06
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv18978/bin Modified Files: sandweb.cgi Log Message: added vcsaction subroutine to main cgi, Repository calls are passed transparently through this. Repository actions that need special treatment ( like tag, because it requires user interaction ) can be caught and dealt with in vcsaction. These changes are by no means complete; it's more along the lines of stub code. More work needs to be done in the preferences area before I can carry this much further. However, I think it's compartmentalized into objects and subroutines pretty nicely now; should make a good foundation for future work. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.69 retrieving revision 1.70 diff -U2 -r1.69 -r1.70 --- sandweb.cgi 2001/11/22 09:35:38 1.69 +++ sandweb.cgi 2001/11/24 09:46:03 1.70 @@ -136,4 +136,13 @@ ); } + elsif ( param('action') eq 'vcsaction' ) { + # called VCS action + vcsaction( + cookie => $cookie, + filename => param('filename'), + command => param('command'), + location => param('location'), + ); + } else { # called an invalid page @@ -302,4 +311,5 @@ my $command = $args{'command'}; + my $filename = $args{'filename'}; my $username = $auth->get_userinfo('username'); my $template_dir = $config->{'paths'}->{'template_dir'}; @@ -316,5 +326,4 @@ ); - my $filename = $args{'filename'}; my $group; my $permissions; @@ -445,4 +454,43 @@ } } + +sub vcsaction { + my %args = @_; + + my $cookie = $args{'cookie'}; + unless ($cookie) { + &login_menu(); + exit 0; + } + if (! load_prefs()) { + # no existing user config, forward to prefs menu + preferences_menu( cookie => $cookie ); + } + + my $command = $args{'command'}; + my $filename = $args{'filename'}; + my $location = $args{'location'}; + my $username = $auth->get_userinfo('username'); + my $template_dir = $config->{'paths'}->{'template_dir'}; + my $users_dir = $config->{'paths'}->{'users_dir'}; + my $repo_type = $userprefs->{'repository'}->{'VCS'}; + my $root = $userprefs->{'repository'}->{'root'}; + my $sandbox = $userprefs->{'paths'}->{'users_dir'}; + + my $repository = SandWeb::Repository->new( + root => $root, + repo_type => $repo_type, + sandbox => "$users_dir/$username", + ); + + my %return = $repository->$command( file => "$location/$filename" ); + + print header; + print '<pre>'; + print "$return{'output'}\n"; + print '</pre>'; + exit 1; +} + # user prefs, this is the preferences menu for configuring the users prefs.cfg |
From: Rob H. <for...@us...> - 2001-11-22 09:35:43
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv31478/lib/SandWeb Modified Files: UI.pm Log Message: added templates for create_file, create_folder and upload for these to work, there need to be 1) methods in File class to carry out these actions and 2) more "if" statements in the file subroutine of sandweb.cgi to catch the create command Index: UI.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/UI.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -U2 -r1.20 -r1.21 --- UI.pm 2001/11/22 00:57:16 1.20 +++ UI.pm 2001/11/22 09:35:38 1.21 @@ -251,5 +251,51 @@ } -sub get_upload { +sub create_file { + my $self = shift; + my %args = @_; + + my $template_dir = $self->_get_template_dir(); + my $filename = $args{'filename'}; + my $location = $args{'location'}; + my $log = $self->_logobj(); + + # this will eventually be $conf->defaults() + my %defaults = ( + # CGI_PATH => $self->_get_cgi_path(), + # CGI_EXEC => $self->_get_cgi_exec(), + LOCATION => $location, + ); + + # generate content data + my $tmp = HTML::Template->new(filename => "$template_dir/create_file.html"); + $tmp->param( %defaults, %args ); + my @contents = $tmp->output; + return join('', @contents); +} + +sub create_folder{ + my $self = shift; + my %args = @_; + + my $template_dir = $self->_get_template_dir(); + my $filename = $args{'filename'}; + my $location = $args{'location'}; + my $log = $self->_logobj(); + + # this will eventually be $conf->defaults() + my %defaults = ( + # CGI_PATH => $self->_get_cgi_path(), + # CGI_EXEC => $self->_get_cgi_exec(), + LOCATION => $location, + ); + + # generate content data + my $tmp = HTML::Template->new(filename => "$template_dir/create_folder.html"); + $tmp->param( %defaults, %args ); + my @contents = $tmp->output; + return join('', @contents); +} + +sub upload_file { my $self = shift; my %args = @_; |
From: Rob H. <for...@us...> - 2001-11-22 09:35:42
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv31478/bin Modified Files: sandweb.cgi Log Message: added templates for create_file, create_folder and upload for these to work, there need to be 1) methods in File class to carry out these actions and 2) more "if" statements in the file subroutine of sandweb.cgi to catch the create command Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.68 retrieving revision 1.69 diff -U2 -r1.68 -r1.69 --- sandweb.cgi 2001/11/22 08:28:59 1.68 +++ sandweb.cgi 2001/11/22 09:35:38 1.69 @@ -9,4 +9,5 @@ use SandWeb::Repository; use SandWeb::Browse; +use SandWeb::File; # Debugging @@ -283,6 +284,10 @@ } +# file operations such as file/folder creation, viewing and editing +# happen in this subroutine. A file object is created and used. +# sub file { my %args = @_; + my $cookie = $args{'cookie'}; unless ($cookie) { @@ -316,10 +321,11 @@ my $file_type; - if (! -f "$location/$filename" ) { - set_error = "File does not exist!"; - browse_menu(); + if ($filename) { + if (! -f "$location/$filename" ) { + set_error = "File does not exist!"; + browse_menu(); + } } - use SandWeb::File; my $file = SandWeb::File->new( 'filename' => $filename, @@ -378,4 +384,55 @@ MENU_TITLE => 'SandWeb', SUBMENU_TITLE => 'edit file', + FOOTER => '', + CONTENT => $content, + ERROR => $error, + ); + exit 0; + } + elsif ( $command eq 'create_file' ) { + my $content = $ui->create_file( + PROGNAME => $progname, + LOCATION => $location, + ); + + print header( -cookie => $cookie ); + $ui->print_screen( + TITLE=> 'SandWeb : Create File', + MENU_TITLE => 'SandWeb', + SUBMENU_TITLE => 'create file', + FOOTER => '', + CONTENT => $content, + ERROR => $error, + ); + exit 0; + } + elsif ( $command eq 'create_folder' ) { + + my $content = $ui->create_folder( + PROGNAME => $progname, + LOCATION => $location, + ); + + print header( -cookie => $cookie ); + $ui->print_screen( + TITLE=> 'SandWeb : Create Folder', + MENU_TITLE => 'SandWeb', + SUBMENU_TITLE => 'create folder', + FOOTER => '', + CONTENT => $content, + ERROR => $error, + ); + exit 0; + } + elsif ( $command eq 'upload' ) { + my $content = $ui->upload_file( + LOCATION => $location, + PROGNAME => $progname, + ); + print header( -cookie => $cookie ); + $ui->print_screen( + TITLE=> 'SandWeb : Upload File', + MENU_TITLE => 'SandWeb', + SUBMENU_TITLE => 'upload file', FOOTER => '', CONTENT => $content, |
From: Rob H. <for...@us...> - 2001-11-22 09:35:42
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv31478/templates Modified Files: browse.html Log Message: added templates for create_file, create_folder and upload for these to work, there need to be 1) methods in File class to carry out these actions and 2) more "if" statements in the file subroutine of sandweb.cgi to catch the create command Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.25 retrieving revision 1.26 diff -U2 -r1.25 -r1.26 --- browse.html 2001/11/22 01:40:25 1.25 +++ browse.html 2001/11/22 09:35:39 1.26 @@ -18,11 +18,11 @@ </td> <td width="60%" colspan="3" align="center"> - <a href="<TMPL_VAR NAME=PROGNAME>">Create File</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=create_file">Create File</a>   |   - <a href="<TMPL_VAR NAME=PROGNAME>">Create Folder</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=create_folder">Create Folder</a>   |   - <a href="<TMPL_VAR NAME=PROGNAME>">Upload</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=file&filename=0&command=upload">Upload</a>   |   - <a href="<TMPL_VAR NAME=PROGNAME>">Checkout</a> + <a href="<TMPL_VAR NAME=PROGNAME>?action=vcsaction&command=checkout">Checkout</a> <br /> </td> |
From: Rob H. <for...@us...> - 2001-11-22 08:46:59
|
Update of /cvsroot/sandweb/sandweb/doc/API In directory usw-pr-cvs1:/tmp/cvs-serv21286 Modified Files: File.txt Log Message: updated documentation to reflect reality Index: File.txt =================================================================== RCS file: /cvsroot/sandweb/sandweb/doc/API/File.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- File.txt 2001/11/22 08:29:00 1.2 +++ File.txt 2001/11/22 08:46:56 1.3 @@ -240,14 +240,14 @@ METHOD - get_mtime + get_age SYNOPSIS - my $mtime = $file->get_mtime(); + my $age = $file->get_age(); DESCRIPTION Returns the date of the last modification to this - file, in UNIX time ( seconds since 01-01-1970 UTC ). + file, in local time ( day month date time year ). PARAMETERS |
From: Rob H. <for...@us...> - 2001-11-22 08:44:35
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv20770 Modified Files: File.pm Log Message: mtime is now returned in localtime rather than in UNIX time Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -U2 -r1.11 -r1.12 --- File.pm 2001/11/22 08:29:00 1.11 +++ File.pm 2001/11/22 08:44:32 1.12 @@ -82,5 +82,6 @@ sub get_age { my $self = shift; - my $time = $self->{'mtime'}; + my $mtime = $self->{'mtime'}; + my $time = localtime $mtime; return $time; |
From: Rob H. <for...@us...> - 2001-11-22 08:29:03
|
Update of /cvsroot/sandweb/sandweb/doc/API In directory usw-pr-cvs1:/tmp/cvs-serv16902/doc/API Modified Files: File.txt Log Message: * fixed weird formatting of view and edit templates * updated File.txt documentation. I decided to document the location/file behavior as it *should* work; the problem I was seeing before is actually sandweb.cgi's problem. It needs an extra routine to support the correct behavior ( the filename needs to be extracted from the absolute or relative path ). Index: File.txt =================================================================== RCS file: /cvsroot/sandweb/sandweb/doc/API/File.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -U2 -r1.1 -r1.2 --- File.txt 2001/11/15 20:46:40 1.1 +++ File.txt 2001/11/22 08:29:00 1.2 @@ -29,6 +29,6 @@ filename (type: string) (required) - This contains the path to the filename from the - user's sandbox ( including the filename itself ). + This contains the full name of the file, as far as the + file system is concerned. Default: none. @@ -109,6 +109,5 @@ DESCRIPTION - Returns the path from the user's sandbox and - the full name of the file. + Returns the full name of the file. PARAMETERS @@ -138,6 +137,5 @@ Returns the full ( absolute or relative ) path - to the user's sandbox, as far as the file system - is concerned. + to the file. PARAMETERS @@ -197,4 +195,59 @@ this is. Type returned one of : Binary, Text, Directory or Unknown. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_size + +SYNOPSIS + + my $file_size = $file->get_size(); + +DESCRIPTION + + Returns the size of the file, in bytes. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_mtime + +SYNOPSIS + + my $mtime = $file->get_mtime(); + +DESCRIPTION + + Returns the date of the last modification to this + file, in UNIX time ( seconds since 01-01-1970 UTC ). PARAMETERS |
From: Rob H. <for...@us...> - 2001-11-22 08:29:02
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv16902/templates Modified Files: edit_file.html view_file.html Log Message: * fixed weird formatting of view and edit templates * updated File.txt documentation. I decided to document the location/file behavior as it *should* work; the problem I was seeing before is actually sandweb.cgi's problem. It needs an extra routine to support the correct behavior ( the filename needs to be extracted from the absolute or relative path ). Index: edit_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/edit_file.html,v retrieving revision 1.1 retrieving revision 1.2 diff -U2 -r1.1 -r1.2 --- edit_file.html 2001/11/22 00:57:16 1.1 +++ edit_file.html 2001/11/22 08:29:00 1.2 @@ -5,5 +5,5 @@ <pre> <textarea cols="80" rows="24"> - <TMPL_VAR NAME=CONTENT> + <TMPL_VAR NAME=CONTENT> </textarea> </pre> Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.3 retrieving revision 1.4 diff -U2 -r1.3 -r1.4 --- view_file.html 2001/11/22 00:57:16 1.3 +++ view_file.html 2001/11/22 08:29:00 1.4 @@ -4,5 +4,5 @@ <input type="submit" name="view_method" value="Download" /> <pre> - <TMPL_VAR NAME=CONTENT> + <TMPL_VAR NAME=CONTENT> </pre> </form> |
From: Rob H. <for...@us...> - 2001-11-22 08:29:02
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv16902/lib/SandWeb Modified Files: File.pm Log Message: * fixed weird formatting of view and edit templates * updated File.txt documentation. I decided to document the location/file behavior as it *should* work; the problem I was seeing before is actually sandweb.cgi's problem. It needs an extra routine to support the correct behavior ( the filename needs to be extracted from the absolute or relative path ). Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -U2 -r1.10 -r1.11 --- File.pm 2001/11/22 01:53:11 1.10 +++ File.pm 2001/11/22 08:29:00 1.11 @@ -76,10 +76,13 @@ sub get_size { my $self = shift; - return $self->{'size'}; + + return $self->{'size'}; } sub get_age { my $self = shift; - return $self->{'mtime'}; + my $time = $self->{'mtime'}; + + return $time; } |
From: Rob H. <for...@us...> - 2001-11-22 08:29:02
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv16902/bin Modified Files: sandweb.cgi Log Message: * fixed weird formatting of view and edit templates * updated File.txt documentation. I decided to document the location/file behavior as it *should* work; the problem I was seeing before is actually sandweb.cgi's problem. It needs an extra routine to support the correct behavior ( the filename needs to be extracted from the absolute or relative path ). Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.67 retrieving revision 1.68 diff -U2 -r1.67 -r1.68 --- sandweb.cgi 2001/11/22 01:07:37 1.67 +++ sandweb.cgi 2001/11/22 08:28:59 1.68 @@ -338,5 +338,5 @@ $error = "This does not appear to be a text file."; } - my @tmp = (); + my @tmp; open (FILE, "$location/$filename"); foreach my $line (<FILE>) { @@ -363,5 +363,5 @@ $error = "This does not appear to be a text file."; } - my @tmp = (); + my @tmp; open (FILE, "$location/$filename"); foreach my $line (<FILE>) { |
From: Rob H. <for...@us...> - 2001-11-22 01:53:14
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv9142 Modified Files: File.pm Log Message: removed all the code duplication. object orientation kicks ass :) Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -U2 -r1.9 -r1.10 --- File.pm 2001/11/22 01:40:25 1.9 +++ File.pm 2001/11/22 01:53:11 1.10 @@ -9,7 +9,18 @@ my %args = @_; + my $filename = $args{'filename'}; + my $location = $args{'location'}; + my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, + $atime,$mtime,$ctime,$blksize,$blocks) + = stat("$location/$filename"); + my $self = bless { - 'filename' => $args{'filename'}, - 'location' => $args{'location'}, + 'filename' => $filename, + 'location' => $location, + 'mode' => $mode, + 'uid' => $uid, + 'gid' => $gid, + 'size' => $size, + 'mtime' => $mtime, }, $class; @@ -19,23 +30,10 @@ sub get_owner { my $self = shift; - my $location = $self->{'location'}; - my $filename = $self->{'filename'}; - - ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks) - = stat("$location/$filename"); - - my $owner = $uid; - return $owner; + return $self->{'owner'}; } sub get_group { my $self = shift; - ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks) - = stat("$location/$filename"); - - my $group = $gid; - return $group; + return $self->{'group'}; } @@ -52,8 +50,5 @@ sub get_permissions { my $self = shift; - ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks) - = stat("$location/$filename"); - + my $mode = $self->{'mode'}; return $mode & 0777; } @@ -61,5 +56,4 @@ sub get_file_type { my $self = shift; - my $location = $self->{'location'}; my $filename = $self->{'filename'}; @@ -82,26 +76,10 @@ sub get_size { my $self = shift; - - my $location = $self->{'location'}; - my $filename = $self->{'filename'}; - - ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks) - = stat("$location/$filename"); - - return $size; + return $self->{'size'}; } sub get_age { my $self = shift; - - my $location = $self->{'location'}; - my $filename = $self->{'filename'}; - - ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks) - = stat("$location/$filename"); - - return $mtime; + return $self->{'mtime'}; } |
From: Rob H. <for...@us...> - 2001-11-22 01:40:29
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv6012/templates Modified Files: browse.html Log Message: Browse now instantiates a file object so it can pull the size ( in bytes ) and age ( the mtime, in "UNIX time" which is seconds since the epoch ) File needs some reworking to eliminate redundancy, I will do the byte->kilobyte and "UNIX time"->"Standard Time" calculations when I do this reworking. Index: browse.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/browse.html,v retrieving revision 1.24 retrieving revision 1.25 diff -U2 -r1.24 -r1.25 --- browse.html 2001/11/21 19:48:44 1.24 +++ browse.html 2001/11/22 01:40:25 1.25 @@ -59,8 +59,8 @@ </td> <td width="10%" align="left" bgcolor="#CCCCCC"> - <A href="<b><TMPL_VAR NAME=PROGNAME>?sortby=rev#dirlist>">Rev.</a></b> + <A href="<b><TMPL_VAR NAME=PROGNAME></b>">Size</a> </td> <td width="30%" align="left" bgcolor="#88FF88"> - <A href="<b><TMPL_VAR NAME=PROGNAME>?sortby=date#dirlist>">Age.</a></b> + <A href="<b><TMPL_VAR NAME=PROGNAME></b>">Age</a> </td> </tr> @@ -85,8 +85,10 @@ </td> <td width="10%" align="center"> -   <br /> +   + <TMPL_VAR NAME=FILESIZE> </td> <td> -   <br /> +   + <TMPL_VAR NAME=FILEAGE> </td> </tr> |
From: Rob H. <for...@us...> - 2001-11-22 01:40:29
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv6012/lib/SandWeb Modified Files: Browse.pm File.pm Log Message: Browse now instantiates a file object so it can pull the size ( in bytes ) and age ( the mtime, in "UNIX time" which is seconds since the epoch ) File needs some reworking to eliminate redundancy, I will do the byte->kilobyte and "UNIX time"->"Standard Time" calculations when I do this reworking. Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -U2 -r1.17 -r1.18 --- Browse.pm 2001/11/15 20:11:42 1.17 +++ Browse.pm 2001/11/22 01:40:25 1.18 @@ -7,4 +7,5 @@ use lib '../lib'; use SandWeb::UI; +use SandWeb::File; use HTML::Template; @@ -104,4 +105,10 @@ $row_data{ENTRY} = shift @return; $filename = $row_data{ENTRY}; + my $file = SandWeb::File->new( + location => "$sandbox/$path", + filename => "$filename", + ); + $row_data{FILESIZE} = $file->get_size(); + $row_data{FILEAGE} = $file->get_age(); if (-d "$sandbox/$path/$filename") { if ($repo_type eq "CVS") { Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -U2 -r1.8 -r1.9 --- File.pm 2001/11/15 19:46:20 1.8 +++ File.pm 2001/11/22 01:40:25 1.9 @@ -80,3 +80,29 @@ } +sub get_size { + my $self = shift; + + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, + $atime,$mtime,$ctime,$blksize,$blocks) + = stat("$location/$filename"); + + return $size; +} + +sub get_age { + my $self = shift; + + my $location = $self->{'location'}; + my $filename = $self->{'filename'}; + + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, + $atime,$mtime,$ctime,$blksize,$blocks) + = stat("$location/$filename"); + + return $mtime; +} + 1; |
From: Rob H. <for...@us...> - 2001-11-22 01:07:42
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv31260 Modified Files: sandweb.cgi Log Message: fixed problem with info browse. Now it runs cvs log on the file that you click on; next step is to parse that data and return it through a nice template. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.66 retrieving revision 1.67 diff -U2 -r1.66 -r1.67 --- sandweb.cgi 2001/11/22 00:57:15 1.66 +++ sandweb.cgi 2001/11/22 01:07:37 1.67 @@ -303,13 +303,12 @@ my $root = $userprefs->{'repository'}->{'root'}; my $sandbox = $userprefs->{'paths'}->{'users_dir'}; + my $location = "$users_dir/$username"; my $repository = SandWeb::Repository->new( root => $root, repo_type => $repo_type, - sandbox => $sandbox, + sandbox => $location, ); - my $location = "$users_dir/$username"; - my $filename = $args{'filename'}; my $group; @@ -330,5 +329,5 @@ print header; print '<pre>'; - my %return = $repository->status( file => "$location/$filename" ); + my %return = $repository->log( file => "$filename" ); print $return{'output'}; print '</pre>'; |
From: Rob H. <for...@us...> - 2001-11-22 00:57:20
|
Update of /cvsroot/sandweb/sandweb/templates In directory usw-pr-cvs1:/tmp/cvs-serv28223/templates Modified Files: view_file.html Added Files: edit_file.html Log Message: implemented view and edit more correctly, now they let you view or edit a non-Text file but you get a warning. Sweet. --- NEW FILE --- <p> <TMPL_VAR NAME=FILENAME> <form submit="<TMPL_VAR NAME=PROGNAME>"> <input type="submit" name="file_action" value="Save" /> <pre> <textarea cols="80" rows="24"> <TMPL_VAR NAME=CONTENT> </textarea> </pre> </form> <TMPL_VAR NAME=ERROR> <TMPL_VAR NAME=OUTPUT> </p> Index: view_file.html =================================================================== RCS file: /cvsroot/sandweb/sandweb/templates/view_file.html,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- view_file.html 2001/08/13 04:47:46 1.2 +++ view_file.html 2001/11/22 00:57:16 1.3 @@ -2,6 +2,8 @@ <TMPL_VAR NAME=FILENAME> <form submit="<TMPL_VAR NAME=PROGNAME>"> - <input type="submit" name="view_method" value="View in Browser" /> <input type="submit" name="view_method" value="Download" /> + <pre> + <TMPL_VAR NAME=CONTENT> + </pre> </form> <TMPL_VAR NAME=ERROR> |