5 =head1 NAME $RCSfile: viewdetails.cgi,v $
15 Andrew DeFaria <Andrew@ClearSCM.com>
23 Mon Oct 25 11:10:47 PDT 2008
27 $Date: 2011/01/14 16:51:58 $
33 Usage viewdetails.cgi: [-u|sage] [-r|egion <region>] -vi|ew <viewname>
37 -u|sage: Displays usage
38 -r|egion <region>: Region to use when looking for the view
39 -vi|ew<viewname>: Name of view to display details for
42 -d|ebug: Output debug messages
46 This script display the details for the given view
55 use CGI qw (:standard :cgi-lib *table start_Tr end_Tr);
56 use CGI::Carp 'fatalsToBrowser';
58 use lib "$FindBin::Bin/lib", "$FindBin::Bin/../lib";
69 my $subtitle = 'View Details';
71 if ($Clearcase::CC->region) {
72 $opts{region} ||= $Clearcase::CC->region;
74 $opts{region} ||= 'Clearcase not installed';
77 my $VERSION = '$Revision: 1.11 $';
78 ($VERSION) = ($VERSION =~ /\$Revision: (.*) /);
80 sub DisplayTable ($) {
84 my $tag = setField $view->tag;
85 my $server = setField $view->shost;
86 my $region = setField $view->region;
87 my $properties = setField $view->properties;
88 my $text_mode = setField $view->text_mode;
89 my $permissions = setField $view->owner_mode
90 . setField $view->group_mode
91 . setField $view->other_mode;
92 my $owner = setField $view->owner;
93 my $active = ($view->active) ? 'YES' : 'NO';
94 my $created_by = setField $view->created_by;
95 my $created_date = setField $view->created_date;
96 my $cs_updated_by = setField $view->cs_updated_by;
97 my $cs_updated_date = setField $view->cs_updated_date;
98 my $gpath = setField $view->gpath;
99 my $access_path = setField $view->access_path;
100 my $uuid = setField $view->uuid;
102 $gpath = font {-class => 'unknown'}, '<no-gpath>'
103 if $gpath eq '<no-gpath>';
105 display start_table {
111 display th {class => 'label'}, 'Tag:';
112 display td {class => 'data', colspan => 3}, $tag;
113 display th {class => 'label'}, 'Server:';
114 display td {class => 'data'}, a {
115 href => "serverdetails.cgi?server=$server"
117 display th {class => 'label'}, 'Region:';
118 display td {class => 'data'}, $region;
122 display th {class => 'label'}, 'Properties:';
123 display td {class => 'data', colspan => 3}, $properties;
124 display th {class => 'label'}, 'Text Mode:';
125 display td {class => 'data'}, $text_mode;
126 display th {class => 'label'}, 'Permission:';
127 display td {class => 'data'}, $permissions;
131 display th {class => 'label'}, 'Owner:';
132 display td {class => 'data', colspan => 3}, $owner;
133 display th {class => 'label'}, 'Active:';
134 display td {class => 'data', colspan => 3}, $active;
138 display th {class => 'label'}, 'Created by:';
139 display td {class => 'data', colspan => 3}, $created_by;
140 display th {class => 'label'}, 'on:';
141 display td {class => 'data', colspan => 3}, $created_date;
145 display th {class => 'label'}, 'CS Updated by:';
146 display td {class => 'data', colspan => 3}, $cs_updated_by;
147 display th {class => 'label'}, 'on:';
148 display td {class => 'data', colspan => 3}, $cs_updated_date;
152 display th {class => 'label'}, 'Global Path:';
153 display td {class => 'data', colspan => 7}, $gpath;
157 display th {class => 'label'}, 'Access Path:';
158 display td {class => 'data', colspan => 7}, $access_path;
162 display th {class => 'label'}, 'UUID:';
163 display td {class => 'data', colspan => 7}, $uuid;
172 display start_form (action => 'viewdetails.cgi');
176 my ($defaultRegion, @regions) = ('', ('Clearcase not installed'));
180 -values => [@regions],
181 -default => $defaultRegion,
182 -onchange => 'submit();',
194 sub DisplayViews ($) {
197 my $views = Clearcase::Views->new ($region);
198 my @views = $views->views;
201 push @views, 'No Views';
204 display start_form (action => 'viewdetails.cgi');
210 -values => [$Clearcase::CC->regions],
212 -onchange => 'submit();',
220 -onchange => 'submit();',
235 'usage' => sub { Usage },
236 'verbose' => sub { set_verbose },
237 'debug' => sub { set_debug },
240 ) or Usage "Invalid parameter";
243 verbose "$FindBin::Script v$VERSION";
251 unless ($opts{tag}) {
252 unless ($opts{region}) {
255 DisplayViews $opts{region};
261 my $view = Clearcase::View->new ($opts{tag}, $opts{region});
269 =head1 CONFIGURATION AND ENVIRONMENT
271 DEBUG: If set then $debug is set to this level.
273 VERBOSE: If set then $verbose is set to this level.
275 TRACE: If set then $trace is set to this level.
283 L<CGI::Carp|CGI::Carp>
287 L<Getopt::Long|Getopt::Long>
289 =head2 ClearSCM Perl Modules
305 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/ClearadmWeb.pm">ClearadmWeb</a><br>
306 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a><br>
307 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/View.pm">Clearcase::View</a><br>
308 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/Views.pm">Clearcase::Views</a><br>
309 <a href="http://clearscm.com/php/scm_man.php?file=lib/Display.pm">Display</a><br>
310 <a href="http://clearscm.com/php/scm_man.php?file=lib/Utils.pm">Utils</a><br>
315 =head1 BUGS AND LIMITATIONS
317 There are no known bugs in this script
319 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
321 =head1 LICENSE AND COPYRIGHT
323 Copyright (c) 2010, ClearSCM, Inc. All rights reserved.