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 if ($Clearcase::CC->region) {
73 $opts{region} ||= $Clearcase::CC->region;
75 $opts{region} ||= 'Clearcase not installed';
78 my $VERSION = '$Revision: 1.11 $';
79 ($VERSION) = ($VERSION =~ /\$Revision: (.*) /);
81 sub DisplayTable ($) {
84 my $permissions = setField $view->owner_mode
85 . setField $view->group_mode
86 . setField $view->other_mode;
87 my $active = ($view->active) ? 'YES' : 'NO';
88 my $gpath = $view->gpath;
90 $gpath = font {-class => 'unknown'}, '<no-gpath>'
91 if $gpath eq '<no-gpath>';
98 my $clearadm = Clearadm->new;
100 my %clearadmview = $clearadm->GetView($view->tag, $view->region);
103 display th {class => 'label'}, 'Tag:';
104 display td {class => 'data', colspan => 3}, setField $view->tag;
105 display th {class => 'label'}, 'Server:';
106 display td {class => 'data'}, a {
107 href => 'systemdetails.cgi?system=' . $view->shost
109 display th {class => 'label'}, 'Region:';
110 display td {class => 'data'}, $view->region;
114 display th {class => 'label'}, 'Properties:';
115 display td {class => 'data', colspan => 3}, $view->properties;
116 display th {class => 'label'}, 'Text Mode:';
117 display td {class => 'data'}, $view->text_mode;
118 display th {class => 'label'}, 'Permission:';
119 display td {class => 'data'}, $permissions;
123 display th {class => 'label'}, 'Owner:';
124 display td {class => 'data', colspan => 3}, $view->owner;
125 display th {class => 'label'}, 'Active:';
126 display td {class => 'data', colspan => 3}, $active;
130 display th {class => 'label'}, 'Created by:';
131 display td {class => 'data', colspan => 3}, $view->created_by;
132 display th {class => 'label'}, 'on:';
133 display td {class => 'data', colspan => 3}, $view->created_date;
137 display th {class => 'label'}, 'CS Updated by:';
138 display td {class => 'data', colspan => 3}, $view->cs_updated_by;
139 display th {class => 'label'}, 'on:';
140 display td {class => 'data', colspan => 3}, $view->cs_updated_date;
144 display th {class => 'label'}, 'Global Path:';
145 display td {class => 'data', colspan => 7}, $gpath;
149 display th {class => 'label'}, 'Access Path:';
150 display td {class => 'data', colspan => 7}, $view->access_path;
154 display th {class => 'label'}, 'UUID:';
155 display td {class => 'data', colspan => 7}, $view->uuid;
159 display th {class => 'labelCentered', colspan => 10}, 'View Storage Pools';
162 my $image = $clearadmview{dbsmall}
163 ? "data:image/png;base64,$clearadmview{dbsmall}"
164 : "plotstorage.cgi?type=view&storage=db&tiny=1&tag=" . $view->tag;
167 display th {class => 'label'}, 'Database:';
168 display td {class => 'data', colspan => 3, align => 'center'}, a {href =>
169 "plot.cgi?type=view&storage=db&scaling=Day&points=7®ion=" . $view->region . '&tag=' . $view->tag
175 $image = $clearadmview{privatesmall}
176 ? "data:image/png;base64,$clearadmview{privatesmall}"
177 : "plotstorage.cgi?type=view&storage=private&tiny=1&tag=" . $view->tag;
179 display th {class => 'label'}, 'Private:';
180 display td {class => 'data', colspan => 5, align => 'center'}, a {href =>
181 "plot.cgi?type=view&storage=private&scaling=Day&points=7®ion=" . $view->region . '&tag=' . $view->tag
188 $image = $clearadmview{adminsmall}
189 ? "data:image/png;base64,$clearadmview{adminsmall}"
190 : "plotstorage.cgi?type=view&storage=admin&tiny=1&tag=" . $view->tag;
193 display th {class => 'label'}, 'Admin:';
194 display td {class => 'data', colspan => 3, align => 'center'}, a {href =>
195 "plot.cgi?type=view&storage=admin&scaling=Day&points=7®ion=" . $view->region . '&tag=' . $view->tag
201 $image = $clearadmview{totalsmall}
202 ? "data:image/png;base64,$clearadmview{totalsmall}"
203 : "plotstorage.cgi?type=view&storage=total&tiny=1&tag=" . $view->tag;
205 display th {class => 'label'}, 'Total Space:';
206 display td {class => 'data', colspan => 5, align => 'center'}, a {href =>
207 "plot.cgi?type=view&storage=total&scaling=Day&points=7®ion=" . $view->region . '&tag=' . $view->tag
220 display start_form (action => 'viewdetails.cgi');
224 my ($defaultRegion, @regions) = ('', ('Clearcase not installed'));
228 -values => [@regions],
229 -default => $defaultRegion,
230 -onchange => 'submit();',
242 sub DisplayViews ($) {
245 my $views = Clearcase::Views->new ($region);
246 my @views = $views->views;
249 push @views, 'No Views';
252 display start_form (action => 'viewdetails.cgi');
258 -values => [$Clearcase::CC->regions],
260 -onchange => 'submit();',
268 -onchange => 'submit();',
283 'usage' => sub { Usage },
284 'verbose' => sub { set_verbose },
285 'debug' => sub { set_debug },
288 ) or Usage "Invalid parameter";
291 verbose "$FindBin::Script v$VERSION";
299 unless ($opts{tag}) {
300 unless ($opts{region}) {
303 DisplayViews $opts{region};
309 DisplayTable(Clearcase::View->new($opts{tag}, $opts{region}));
315 =head1 CONFIGURATION AND ENVIRONMENT
317 DEBUG: If set then $debug is set to this level.
319 VERBOSE: If set then $verbose is set to this level.
321 TRACE: If set then $trace is set to this level.
329 L<CGI::Carp|CGI::Carp>
333 L<Getopt::Long|Getopt::Long>
335 =head2 ClearSCM Perl Modules
352 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/Clearadm.pm">Clearadm</a><br>
353 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/ClearadmWeb.pm">ClearadmWeb</a><br>
354 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a><br>
355 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/View.pm">Clearcase::View</a><br>
356 <a href="http://clearscm.com/php/scm_man.php?file=lib/Clearcase/Views.pm">Clearcase::Views</a><br>
357 <a href="http://clearscm.com/php/scm_man.php?file=lib/Display.pm">Display</a><br>
358 <a href="http://clearscm.com/php/scm_man.php?file=lib/Utils.pm">Utils</a><br>
363 =head1 BUGS AND LIMITATIONS
365 There are no known bugs in this script
367 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
369 =head1 LICENSE AND COPYRIGHT
371 Copyright (c) 2010, ClearSCM, Inc. All rights reserved.