NAME View.pm
Object oriented interface to a Clearcase View
VERSION
- Author
-
Andrew DeFaria <Andrew@DeFaria.com>
- Revision
-
$Revision: 1.18 $
- Created
-
Thu Dec 29 12:07:59 PST 2005
- Modified
-
$Date: 2011/11/16 19:46:13 $
SYNOPSIS
Provides access to information about a Clearcase View. Note that some information about a view is not populated into the view object at object instantiation. This is because members such as labels can be very long and time consuming to acquire. When the caller request such fields they are expanded.
# Create View object
my $view = new Clearcase::View (tag => 'test');
# Access member variables...
print "View:\t\t \t" . $view->tag . "\n";
print "Accessed by:\t\t" . $view->accessed_by . "\n";
print "Accessed date:\t\t" . $view->accessed_date . "\n";
print "Access path:\t\t" . $view->access_path . "\n";
print "Active:\t\t\t" . $view->active . "\n";
print "Additional groups:\t";
for ($view->additional_groups) {
print "$_ ";
} # for
print "\n";
print "Created by:\t\t" . $view->created_by . "\n";
print "Created date:\t\t" . $view->created_date . "\n";
print "CS updated by:\t\t" . $view->cs_updated_by . "\n";
print "CS updated date:\t" . $view->cs_updated_date . "\n";
print "Global path:\t\t" . $view->gpath . "\n";
print "Group:\t\t\t" . $view->group . "\n";
print "Group mode:\t\t" . $view->group_mode . "\n";
print "Host:\t\t\t" . $view->host . "\n";
print "Mode:\t\t\t" . $view->mode . "\n";
print "Modified by:\t\t" . $view->modified_by . "\n";
print "Modified date:\t\t" . $view->modified_date . "\n";
print "Other mode:\t\t" . $view->other_mode . "\n";
print "Owner:\t\t\t" . $view->owner . "\n";
print "Owner mode:\t\t" . $view->owner_mode . "\n";
print "Properties:\t\t" . $view->properties . "\n";
print "Region:\t\t\t" . $view->region . "\n";
print "Server host:\t\t" . $view->shost . "\n";
print "Text mode:\t\t" . $view->text_mode . "\n";
print "UUID:\t\t\t" . $view->uuid . "\n";
print "Type:\t\t\t";
if ($view->snapshot) {
print 'snapshot';
} else {
print 'dynamic';
} # if
if ($view->ucm) {
print ',ucm';
} # if
print "\n";
# View manipulation
my $new_view = new Clearcase::View ($ENV{USER} . '_testview');
$new_view->create;
# Start new view
$new_view->start;
# Set to view
$new_view->set;
# Stop view
$new_view->stop;
# Stop view server process
$new_view->kill;
# Remove view
if ($new_view->exists) {
$new_view->remove;
} # if
DESCRIPTION
This module implements an object oriented interface to a Clearcase view.
ROUTINES
The following routines are exported:
new (tag)
Construct a new Clearcase View object. Note that not all members are initially populated because doing so would be time consuming. Such member variables will be expanded when accessed.
Parameters:
- tag
-
View tag to be instantiated. You can use either an object oriented call (i.e. my $view = new Clearcase::View (tag => 'my_new_view')) or the normal call (i.e. my $vob = new Clearcase::View ('my_new_view')). You can also instantiate a new view by supplying a tag and then later calling the create method.
Returns:
accessed_by
Returns the user name of the last user to access the view.
Parameters:
- none
Returns:
accessed_date
Returns the date the view was last accessed.
Parameters:
- none
Returns:
access_path
Returns the access path of the view.
Parameters:
- none
Returns:
active
Returns true if the view is active
Parameters:
- none
Returns:
- boolean
additional_groups
Returns the additional groups that have permission to access this view.
Parameters:
- none
Returns:
created_by
Returns the user name who created the view
Parameters:
- none
Returns:
created_date
Returns the date the view was created.
Parameters:
- none
Returns:
- date
cs_updated_date
Returns the user name of the last user to access the view.
Parameters:
- none
Returns:
- date
dynamic
Returns the date the config spec for this view was updated.
Parameters:
- none
Returns:
- date
dynamic
Returns true if the view is a dynamic view - false otherwise.
Parameters:
- none
Returns:
- boolean
gpath
Returns the global path to the view
Parameters:
- none
Returns:
group
Returns the group of the user who created the view.
Parameters:
- none
Returns:
group_mode
Returns the group mode of the view.
Parameters:
- none
Returns:
host
Returns the host that the view resides on
Parameters:
- none
Returns:
- host
mode
Returns the numeric mode representing the view's access mode
Parameters:
- none
Returns:
modified_by
Returns the user name of the last user to modify the view.
Parameters:
- none
Returns:
modified_date
Returns the date the view was last modified.
Parameters:
- none
Returns:
- date
other_mode
Returns the mode for other for the view.
Parameters:
- none
Returns:
owner
Returns the user name of the owner of the view.
Parameters:
- none
Returns:
owner_mode
Returns the mode for the owner for the view.
Parameters:
- none
Returns:
properties
Returns the properties of the view.
Parameters:
- none
Returns:
- properties
region
Returns the region of the view
Parameters:
- none
Returns:
- region
shost
Returns the server host of the view
Parameters:
- none
Returns:
snapshot
Returns true if the view is a snapshot view - false otherwise.
Parameters:
- none
Returns:
- boolean
webview
Returns true if the view is a webview - false otherwise.
Parameters:
- none
Returns:
- boolean
tag
Returns the tag for this view.
Parameters:
- none
Returns:
- tag
text_mode
Returns the text_mode of the view
Parameters:
- none
Returns:
type
Returns the type of the view.
Parameters:
- none
Returns:
- type
ucm
Returns true if the view is a UCM view.
Parameters:
- none
Returns:
- boolean
uuid
Returns the uuid for the view.
Parameters:
- none
Returns:
- uuid
exists
Returns true if the view exists - false otherwise.
Parameters:
- none
Returns:
- boolean
create
Creates a view
Parameters:
- host
-
Host to create the view on. Default is to use -stgloc -auto.
- vws
-
View working storage directory to use. Default is to use -stgloc -auto.
Returns:
createUCM
Create a UCM view
Parameters:
- streamName
-
Name of stream to attach new view to
- pvob
-
Name of project vob
Returns:
- status
-
Integer status
- output
-
Array of output
remove
Removes the view.
Parameters:
- none
Returns:
start
Starts the view.
Parameters:
- none
Returns:
stop
Stops the view.
Parameters:
- none
Returns:
kill
Stops the view at the view_server process if nobody else is accessing the view.
Parameters:
- none
Returns:
set
Starts the view then changes directory the to view's root.
Parameters:
- none
Returns:
updateViewInfo ($view)
Updates the view info from cleartool lsview
Parameters:
Returns:
- nothing
updateViewInfo ($view)
Updates the view info from cleartool lsview
Parameters:
Returns:
- nothing
viewPrivateStorage
Returns the view private storage size for this view.
Parameters:
- none
Returns:
viewPrivateStoragePct
Returns the view private storage percent for this view.
Parameters:
- none
Returns:
viewDatabase
Returns the view database size for this view.
Parameters:
- none
Returns:
viewDatabasePct
Returns the view database percent for this view.
Parameters:
- none
Returns:
viewAdmin
Returns the view admin size for this view.
Parameters:
- none
Returns:
viewAdminPct
Returns the view admin percent for this view.
Parameters:
- none
Returns:
viewSpace
Returns the view total size for this view.
Parameters:
- none
Returns:
viewSpacePct
Returns the view database percent for this view.
Parameters:
- none
Returns:
DEPENDENCIES
Modules
INCOMPATABILITIES
None
BUGS AND LIMITATIONS
There are no known bugs in this module.
Please report problems to Andrew DeFaria <Andrew@DeFaria.com>.
COPYRIGHT AND LICENSE
Copyright (C) 2020 by Andrew@DeFaria.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.38.0 or, at your option, any later version of Perl 5 you may have available.