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";
70 my $subtitle = 'View Details';
72 $opts{region} ||= $Clearcase::CC->region;
74 my $VERSION = '$Revision: 1.12 $';
75 ($VERSION) = ($VERSION =~ /\$Revision: (.*) /);
77 sub DisplayTable ($) {
80 my $permissions = setField $view->owner_mode
81 . setField $view->group_mode
82 . setField $view->other_mode;
83 my $active = ($view->active) ? 'YES' : 'NO';
84 my $gpath = $view->gpath;
86 $gpath = font {-class => 'unknown'}, '<no-gpath>'
87 if $gpath eq '<no-gpath>';
94 my $clearadm = Clearadm->new;
96 my %clearadmview = $clearadm->GetView($view->tag, $view->region);
99 display th {class => 'label'}, 'Tag:';
100 display td {class => 'data', colspan => 3}, setField $view->tag;
101 display th {class => 'label'}, 'Server:';
102 display td {class => 'data'}, a {
103 href => 'systemdetails.cgi?system=' . $view->shost
105 display th {class => 'label'}, 'Region:';
106 display td {class => 'data'}, $view->region;
110 display th {class => 'label'}, 'Properties:';
111 display td {class => 'data', colspan => 3}, $view->properties;
112 display th {class => 'label'}, 'Text Mode:';
113 display td {class => 'data'}, $view->text_mode;
114 display th {class => 'label'}, 'Permission:';
115 display td {class => 'data'}, $permissions;
119 display th {class => 'label'}, 'Owner:';
120 display td {class => 'data', colspan => 3}, $view->owner;
121 display th {class => 'label'}, 'Active:';
122 display td {class => 'data', colspan => 3}, $active;
126 display th {class => 'label'}, 'Created by:';
127 display td {class => 'data', colspan => 3}, $view->created_by;
128 display th {class => 'label'}, 'on:';
129 display td {class => 'data', colspan => 3}, $view->created_date;
133 display th {class => 'label'}, 'CS Updated by:';
134 display td {class => 'data', colspan => 3}, $view->cs_updated_by;
135 display th {class => 'label'}, 'on:';
136 display td {class => 'data', colspan => 3}, $view->cs_updated_date;
140 display th {class => 'label'}, 'Global Path:';
141 display td {class => 'data', colspan => 7}, $gpath;
145 display th {class => 'label'}, 'Access Path:';
146 display td {class => 'data', colspan => 7}, $view->access_path;
150 display th {class => 'label'}, 'UUID:';
151 display td {class => 'data', colspan => 7}, $view->uuid;
155 display th {class => 'labelCentered', colspan => 10}, 'View Storage Pools';
158 my $image = $clearadmview{dbsmall}
159 ? "data:image/png;base64,$clearadmview{dbsmall}"
160 : "plotstorage.cgi?type=view&storage=db&tiny=1&tag=" . $view->tag;
163 display th {class => 'label'}, 'Database:';
164 display td {class => 'data', colspan => 3, align => 'center'}, a {href =>
165 "plot.cgi?type=view&storage=db&scaling=Day&points=7®ion=" . $view->region . '&tag=' . $view->tag
171 $image = $clearadmview{privatesmall}
172 ? "data:image/png;base64,$clearadmview{privatesmall}"
173 : "plotstorage.cgi?type=view&storage=private&tiny=1&tag=" . $view->tag;
175 display th {class => 'label'}, 'Private:';
176 display td {class => 'data', colspan => 5, align => 'center'}, a {href =>
177 "plot.cgi?type=view&storage=private&scaling=Day&points=7®ion=" . $view->region . '&tag=' . $view->tag
184 $image = $clearadmview{adminsmall}
185 ? "data:image/png;base64,$clearadmview{adminsmall}"
186 : "plotstorage.cgi?type=view&storage=admin&tiny=1&tag=" . $view->tag;
189 display th {class => 'label'}, 'Admin:';
190 display td {class => 'data', colspan => 3, align => 'center'}, a {href =>
191 "plot.cgi?type=view&storage=admin&scaling=Day&points=7®ion=" . $view->region . '&tag=' . $view->tag
197 $image = $clearadmview{totalsmall}
198 ? "data:image/png;base64,$clearadmview{totalsmall}"
199 : "plotstorage.cgi?type=view&storage=total&tiny=1&tag=" . $view->tag;
201 display th {class => 'label'}, 'Total Space:';
202 display td {class => 'data', colspan => 5, align => 'center'}, a {href =>
203 "plot.cgi?type=view&storage=total&scaling=Day&points=7®ion=" . $view->region . '&tag=' . $view->tag
215 sub DisplayRegion() {
216 display start_form (action => 'viewdetails.cgi');
222 -values => [$Clearcase::CC->regions],
223 -default => $Clearcase::CC->region,
224 -onchange => 'submit();',
236 sub DisplayViews($) {
239 my $views = Clearcase::Views->new ($region);
240 my @views = $views->views;
243 push @views, 'No Views';
246 display start_form(action => 'viewdetails.cgi');
252 -values => [$Clearcase::CC->regions],
254 -onchange => 'submit();',
262 -onchange => 'submit();',
277 'usage' => sub { Usage },
278 'verbose' => sub { set_verbose },
279 'debug' => sub { set_debug },
282 ) or Usage "Invalid parameter";
285 verbose "$FindBin::Script v$VERSION";
293 unless ($opts{tag}) {
294 unless ($opts{region}) {
297 DisplayViews $opts{region};
303 DisplayTable(Clearcase::View->new($opts{tag}, $opts{region}));
309 =head1 CONFIGURATION AND ENVIRONMENT
311 DEBUG: If set then $debug is set to this level.
313 VERBOSE: If set then $verbose is set to this level.
315 TRACE: If set then $trace is set to this level.
323 L<CGI::Carp|CGI::Carp>
327 L<Getopt::Long|Getopt::Long>
329 =head2 ClearSCM Perl Modules
346 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/Clearadm.pm">Clearadm</a><br>
347 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/ClearadmWeb.pm">ClearadmWeb</a><br>
348 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a><br>
349 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/View.pm">Clearcase::View</a><br>
350 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/Views.pm">Clearcase::Views</a><br>
351 <a href="http://clearscm.com/php/scm_man.php?file=lib/Display.pm">Display</a><br>
352 <a href="http://clearscm.com/php/scm_man.php?file=lib/Utils.pm">Utils</a><br>
357 =head1 BUGS AND LIMITATIONS
359 There are no known bugs in this script
361 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
363 =head1 LICENSE AND COPYRIGHT
365 Copyright (c) 2010, ClearSCM, Inc. All rights reserved.