Thread: [Codestriker-commits] CVS update: codestriker/lib/Codestriker/Http UrlBuilder.pm
Brought to you by:
sits
|
From: <si...@us...> - 2006-06-11 08:49:43
|
User: sits Date: 06/06/11 01:49:42 Modified: lib/Codestriker/Http UrlBuilder.pm Log: I can't remember our reasoning for making our CGI & -> & perhaps something to do with an html lint program complaining? In any case, it does seem unnecessary, and produces ugly URLs, as indicated by a user at: http://sourceforge.net/tracker/index.php?func=detail&aid=1460144&group_id=41136&atid=429860 If there is a valid reason, let me know and we can revert it. Index: UrlBuilder.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- UrlBuilder.pm 24 Jan 2006 23:53:03 -0000 1.28 +++ UrlBuilder.pm 11 Jun 2006 08:49:42 -0000 1.29 @@ -55,13 +55,13 @@ $updated, $brmode, $fview) = @_; return ($prefix ne "" ? $prefix : $self->{query}->url()) . - "?topic=$topic&action=view" . + "?topic=$topic&action=view" . ($updated ? "&updated=$updated" : "") . - ((defined $tabwidth && $tabwidth ne "") ? "&tabwidth=$tabwidth" : "") . - ((defined $mode && $mode ne "") ? "&mode=$mode" : "") . - ((defined $brmode && $brmode ne "") ? "&brmode=$brmode" : "") . - ((defined $fview && $fview ne "") ? "&fview=$fview" : "") . - ((defined $email && $email ne "") ? "&email=$email" : "") . + ((defined $tabwidth && $tabwidth ne "") ? "&tabwidth=$tabwidth" : "") . + ((defined $mode && $mode ne "") ? "&mode=$mode" : "") . + ((defined $brmode && $brmode ne "") ? "&brmode=$brmode" : "") . + ((defined $fview && $fview ne "") ? "&fview=$fview" : "") . + ((defined $email && $email ne "") ? "&email=$email" : "") . ($line != -1 ? "#${line}" : ""); } @@ -78,14 +78,14 @@ # Create the URL for downloading the topic text. sub download_url ($$) { my ($self, $topic) = @_; - return $self->{query}->url() . "?action=download&topic=$topic"; + return $self->{query}->url() . "?action=download&topic=$topic"; } # Create the URL for creating a topic. sub create_topic_url ($$) { my ($self, $obsoletes) = @_; return $self->{query}->url() . "?action=create" . - (defined $obsoletes ? "&obsoletes=$obsoletes" : ""); + (defined $obsoletes ? "&obsoletes=$obsoletes" : ""); } # Create the URL for editing a topic. @@ -93,17 +93,17 @@ my ($self, $filenumber, $line, $new, $topic, $context, $anchor, $prefix) = @_; return ($prefix ne "" ? $prefix : $self->{url_prefix}) . - "?fn=$filenumber&line=$line&new=$new&topic=$topic&action=edit" . - ((defined $anchor && $anchor ne "") ? "&a=$anchor" : "") . - ((defined $context && $context ne "") ? "&context=$context" : ""); + "?fn=$filenumber&line=$line&new=$new&topic=$topic&action=edit" . + ((defined $anchor && $anchor ne "") ? "&a=$anchor" : "") . + ((defined $context && $context ne "") ? "&context=$context" : ""); } # Create the URL for viewing a new file. sub view_file_url ($$$$$$$) { my ($self, $topic, $filenumber, $new, $line, $mode, $parallel) = @_; if (!(defined $mode)) { $mode = $Codestriker::default_topic_create_mode; } - return $self->{url_prefix} . "?action=view_file&fn=$filenumber&" . - "topic=$topic&new=$new&mode=$mode&parallel=$parallel#$filenumber|$line|$new"; + return $self->{url_prefix} . "?action=view_file&fn=$filenumber&" . + "topic=$topic&new=$new&mode=$mode¶llel=$parallel#$filenumber|$line|$new"; } # Create the URL for the search page. @@ -148,19 +148,19 @@ my $sproject = defined $project_array_ref ? (join ',', @$project_array_ref) : ""; return $self->{query}->url() . "?action=$action" . - ($sauthor ne "" ? "&sauthor=$sauthor" : "") . - ($sreviewer ne "" ? "&sreviewer=$sreviewer" : "") . - ($scc ne "" ? "&scc=$scc" : "") . - ($sbugid ne "" ? "&sbugid=$sbugid" : "") . - ($stext ne "" ? "&stext=" . CGI::escape($stext) : "") . - ($stitle ne "" ? "&stitle=$stitle" : "") . - ($sdescription ne "" ? "&sdescription=$sdescription" : "") . - ($scomments ne "" ? "&scomments=$scomments" : "") . - ($sbody ne "" ? "&sbody=$sbody" : "") . - ($sfilename ne "" ? "&sfilename=$sfilename" : "") . - ($sstate ne "" ? "&sstate=$sstate" : "") . - ($sproject ne "" ? "&sproject=$sproject" : "") . - (defined $content && $content ne "" ? "&content=$content" : ""); + ($sauthor ne "" ? "&sauthor=$sauthor" : "") . + ($sreviewer ne "" ? "&sreviewer=$sreviewer" : "") . + ($scc ne "" ? "&scc=$scc" : "") . + ($sbugid ne "" ? "&sbugid=$sbugid" : "") . + ($stext ne "" ? "&stext=" . CGI::escape($stext) : "") . + ($stitle ne "" ? "&stitle=$stitle" : "") . + ($sdescription ne "" ? "&sdescription=$sdescription" : "") . + ($scomments ne "" ? "&scomments=$scomments" : "") . + ($sbody ne "" ? "&sbody=$sbody" : "") . + ($sfilename ne "" ? "&sfilename=$sfilename" : "") . + ($sstate ne "" ? "&sstate=$sstate" : "") . + ($sproject ne "" ? "&sproject=$sproject" : "") . + (defined $content && $content ne "" ? "&content=$content" : ""); } @@ -168,7 +168,7 @@ sub edit_project_url ($$) { my ($self, $projectid) = @_; - return $self->{query}->url() . "?action=edit_project&projectid=$projectid"; + return $self->{query}->url() . "?action=edit_project&projectid=$projectid"; } # Construct a URL for listing all projects. @@ -189,7 +189,7 @@ sub view_comments_url ($$) { my ($self, $topic) = @_; - return $self->{query}->url() . "?action=list_comments&topic=$topic"; + return $self->{query}->url() . "?action=list_comments&topic=$topic"; } # Create the URL for viewing the topic properties. @@ -197,14 +197,14 @@ my ($self, $topic) = @_; return $self->{query}->url() . - "?action=view_topic_properties&topic=$topic"; + "?action=view_topic_properties&topic=$topic"; } # Create the URL for viewing the topic metrics. sub view_topicinfo_url ($$) { my ($self, $topic) = @_; - return $self->{query}->url() . "?action=viewinfo&topic=$topic"; + return $self->{query}->url() . "?action=viewinfo&topic=$topic"; } sub metric_report_url { |
|
From: <si...@us...> - 2008-08-06 01:58:01
|
User: sits
Date: 08/08/05 18:58:00
Modified: lib/Codestriker/Http UrlBuilder.pm
Log:
Keep the URLs shorter for default parameters which aren't defined.
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- UrlBuilder.pm 5 Aug 2008 10:35:34 -0000 1.33
+++ UrlBuilder.pm 6 Aug 2008 01:58:00 -0000 1.34
@@ -22,15 +22,6 @@
my $self = {};
$self->{query} = $query;
- # Determine default settings.
- $self->{default_topic_create_mode} =
- defined $Codestriker::default_topic_create_mode ?
- $Codestriker::default_topic_create_mode : $Codestriker::COLOURED_MODE;
-
- $self->{default_file_to_view} =
- defined $Codestriker::default_file_to_view ?
- $Codestriker::default_file_to_view : -1;
-
# Determine what prefix is required when using relative URLs.
# Unfortunately, Netcsape 4.x does things differently to everyone
# else.
@@ -67,8 +58,8 @@
"?topic=$args{topicid}&action=view" .
(defined $args{updated} ? "&updated=$args{updated}" : "") .
(defined $args{tabwidth} ? "&tabwidth=$args{tabwidth}" : "") .
- "&mode=" . (defined $args{mode} ? $args{mode} : $self->{default_topic_create_mode}) .
- "&fview=" . (defined $args{fview} ? $args{fview} : $self->{default_file_to_view}) .
+ (defined $args{mode} ? "&mode=$args{mode}" : "") .
+ (defined $args{fview} ? "&fview=$args{fview}" : "") .
(defined $args{email} ? "&email=$args{email}" : "") .
(defined $args{filenumber} ? "#" . "$args{filenumber}|$args{line}|$args{new}" : "");
}
|
|
From: <si...@us...> - 2008-08-07 07:14:44
|
User: sits
Date: 08/08/07 00:14:42
Modified: lib/Codestriker/Http UrlBuilder.pm
Log:
Make the action parameter appear first, as it does for other URLs.
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- UrlBuilder.pm 6 Aug 2008 01:58:00 -0000 1.34
+++ UrlBuilder.pm 7 Aug 2008 07:14:42 -0000 1.35
@@ -55,7 +55,7 @@
my ($self, %args) = @_;
return (defined $args{prefix} ? $args{prefix} : $self->{query}->url()) .
- "?topic=$args{topicid}&action=view" .
+ "?action=view&topic=$args{topicid}" .
(defined $args{updated} ? "&updated=$args{updated}" : "") .
(defined $args{tabwidth} ? "&tabwidth=$args{tabwidth}" : "") .
(defined $args{mode} ? "&mode=$args{mode}" : "") .
|
|
From: <si...@us...> - 2008-08-13 11:31:13
|
User: sits
Date: 08/08/13 04:31:13
Modified: lib/Codestriker/Http UrlBuilder.pm
Log:
More URL refactoring.
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- UrlBuilder.pm 13 Aug 2008 11:30:47 -0000 1.38
+++ UrlBuilder.pm 13 Aug 2008 11:31:12 -0000 1.39
@@ -31,6 +31,24 @@
use strict;
use CGI;
+use Codestriker::Http::Method;
+use Codestriker::Http::Method::ListTopicsMethod;
+use Codestriker::Http::Method::CreateTopicMethod;
+use Codestriker::Http::Method::ViewTopicTextMethod;
+use Codestriker::Http::Method::ViewTopicCommentsMethod;
+use Codestriker::Http::Method::ViewTopicFileMethod;
+use Codestriker::Http::Method::ViewTopicMetricsMethod;
+use Codestriker::Http::Method::ViewTopicPropertiesMethod;
+use Codestriker::Http::Method::AddCommentMethod;
+use Codestriker::Http::Method::AddTopicMethod;
+use Codestriker::Http::Method::CreateProjectMethod;
+use Codestriker::Http::Method::DownloadMetricsMethod;
+use Codestriker::Http::Method::EditProjectMethod;
+use Codestriker::Http::Method::ListProjectsMethod;
+use Codestriker::Http::Method::SearchTopicsMethod;
+use Codestriker::Http::Method::StaticResourcesMethod;
+use Codestriker::Http::Method::ViewMetricsMethod;
+
# Constructor for this class.
sub new {
my ($type, $query, $cgi_style) = @_;
|