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 ($) {
83 my $permissions = setField $view->owner_mode
84 . setField $view->group_mode
85 . setField $view->other_mode;
86 my $active = ($view->active) ? 'YES' : 'NO';
87 my $gpath = $view->gpath;
89 $gpath = font {-class => 'unknown'}, '<no-gpath>'
90 if $gpath eq '<no-gpath>';
98 display th {class => 'label'}, 'Tag:';
99 display td {class => 'data', colspan => 3}, setField $view->tag;
100 display th {class => 'label'}, 'Server:';
101 display td {class => 'data'}, a {
102 href => 'systemdetails.cgi?system=' . $view->shost
104 display th {class => 'label'}, 'Region:';
105 display td {class => 'data'}, $view->region;
109 display th {class => 'label'}, 'Properties:';
110 display td {class => 'data', colspan => 3}, $view->properties;
111 display th {class => 'label'}, 'Text Mode:';
112 display td {class => 'data'}, $view->text_mode;
113 display th {class => 'label'}, 'Permission:';
114 display td {class => 'data'}, $permissions;
118 display th {class => 'label'}, 'Owner:';
119 display td {class => 'data', colspan => 3}, $view->owner;
120 display th {class => 'label'}, 'Active:';
121 display td {class => 'data', colspan => 3}, $active;
125 display th {class => 'label'}, 'Created by:';
126 display td {class => 'data', colspan => 3}, $view->created_by;
127 display th {class => 'label'}, 'on:';
128 display td {class => 'data', colspan => 3}, $view->created_date;
132 display th {class => 'label'}, 'CS Updated by:';
133 display td {class => 'data', colspan => 3}, $view->cs_updated_by;
134 display th {class => 'label'}, 'on:';
135 display td {class => 'data', colspan => 3}, $view->cs_updated_date;
139 display th {class => 'label'}, 'Global Path:';
140 display td {class => 'data', colspan => 7}, $gpath;
144 display th {class => 'label'}, 'Access Path:';
145 display td {class => 'data', colspan => 7}, $view->access_path;
149 display th {class => 'label'}, 'UUID:';
150 display td {class => 'data', colspan => 7}, $view->uuid;
154 display th {class => 'labelCentered', colspan => 10}, 'View Storage Pools';
158 display th {class => 'label'}, 'Database:';
159 display td {class => 'data', colspan => 3, align => 'center'}, a {href =>
160 "plot.cgi?type=view&storage=private&tag=" . $view->tag
162 src => "plotstorage.cgi?type=view&storage=private&tiny=1&tag=" . $view->tag,
165 display th {class => 'label'}, 'Private:';
166 display td {class => 'data', colspan => 5, align => 'center'}, a {href =>
167 "plot.cgi?type=view&storage=db&tag=" . $view->tag
169 src => "plotstorage.cgi?type=view&storage=db&tiny=1&tag=" . $view->tag,
175 display th {class => 'label'}, 'Admin:';
176 display td {class => 'data', colspan => 3, align => 'center'}, a {href =>
177 "plot.cgi?type=view&storage=admin&tag=" . $view->tag
179 src => "plotstorage.cgi?type=view&storage=admin&tiny=1&tag=" . $view->tag,
182 display th {class => 'label'}, 'Total Space:';
183 display td {class => 'data', colspan => 5, align => 'center'}, a {href =>
184 "plot.cgi?type=view&storage=total&tag=" . $view->tag
186 src => "plotstorage.cgi?type=view&storage=total&tiny=1&tag=" . $view->tag,
197 display start_form (action => 'viewdetails.cgi');
201 my ($defaultRegion, @regions) = ('', ('Clearcase not installed'));
205 -values => [@regions],
206 -default => $defaultRegion,
207 -onchange => 'submit();',
219 sub DisplayViews ($) {
222 my $views = Clearcase::Views->new ($region);
223 my @views = $views->views;
226 push @views, 'No Views';
229 display start_form (action => 'viewdetails.cgi');
235 -values => [$Clearcase::CC->regions],
237 -onchange => 'submit();',
245 -onchange => 'submit();',
260 'usage' => sub { Usage },
261 'verbose' => sub { set_verbose },
262 'debug' => sub { set_debug },
265 ) or Usage "Invalid parameter";
268 verbose "$FindBin::Script v$VERSION";
276 unless ($opts{tag}) {
277 unless ($opts{region}) {
280 DisplayViews $opts{region};
286 my $view = Clearcase::View->new ($opts{tag}, $opts{region});
294 =head1 CONFIGURATION AND ENVIRONMENT
296 DEBUG: If set then $debug is set to this level.
298 VERBOSE: If set then $verbose is set to this level.
300 TRACE: If set then $trace is set to this level.
308 L<CGI::Carp|CGI::Carp>
312 L<Getopt::Long|Getopt::Long>
314 =head2 ClearSCM Perl Modules
330 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/ClearadmWeb.pm">ClearadmWeb</a><br>
331 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a><br>
332 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/View.pm">Clearcase::View</a><br>
333 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/Views.pm">Clearcase::Views</a><br>
334 <a href="http://clearscm.com/php/scm_man.php?file=lib/Display.pm">Display</a><br>
335 <a href="http://clearscm.com/php/scm_man.php?file=lib/Utils.pm">Utils</a><br>
340 =head1 BUGS AND LIMITATIONS
342 There are no known bugs in this script
344 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
346 =head1 LICENSE AND COPYRIGHT
348 Copyright (c) 2010, ClearSCM, Inc. All rights reserved.