From: Rob H. <for...@us...> - 2002-10-19 04:59:09
|
Update of /cvsroot/sandweb/sandweb/doc/API In directory usw-pr-cvs1:/tmp/cvs-serv1034 Modified Files: Browse.txt Log Message: documented all public methods. put a couple FIXMEs in there, needs more encapsulation in one method and to eliminate redundant commands between the constructor and one of the methods. Index: Browse.txt =================================================================== RCS file: /cvsroot/sandweb/sandweb/doc/API/Browse.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -U2 -r1.1 -r1.2 --- Browse.txt 17 Oct 2002 07:30:47 -0000 1.1 +++ Browse.txt 19 Oct 2002 04:59:07 -0000 1.2 @@ -17,151 +17,64 @@ SYNOPSIS + my $browse = SandWeb::Browse->new( + 'username' => $username, + 'module_name' => $module_name, + 'repo_name' => $repo_name, + 'vcs_commands' => \@vcs_commands, + 'sort' => $sort, + 'users_dir' => $users_dir, + 'log_obj' => $log, + ); DESCRIPTION + This method is a constructor. PARAMETERS - parameter (type: string) (required) + username (type: string) (required) + + The current user's full username. Default: none. -RETURN CODES - - 1 = The operation completed successfully. - - 0 = This means that the method got an error proccessing your request. - Perhaps an invalid parameter? - - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -get_browser --------------------------------------------------------------------------------- - -METHOD - methodname - -SYNOPSIS - - -DESCRIPTION - - -PARAMETERS + module_name (type: string) (required) - parameter (type: string) (required) + The name of the VCS module that the user is wants to browse. Default: none. -RETURN CODES - - 1 = The operation completed successfully. - - 0 = This means that the method got an error proccessing your request. - Perhaps an invalid parameter? - - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -get_tool_bar --------------------------------------------------------------------------------- + repo_name (type: string) (required) -METHOD - methodname - -SYNOPSIS - - -DESCRIPTION - - -PARAMETERS - - parameter (type: string) (required) + The name of the repository that contains the module that the + user wants to browse. Default: none. -RETURN CODES - - 1 = The operation completed successfully. - - 0 = This means that the method got an error proccessing your request. - Perhaps an invalid parameter? - - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -get_current_location --------------------------------------------------------------------------------- + vcs_commands (type: array) (required) -METHOD - methodname - -SYNOPSIS - - -DESCRIPTION - - -PARAMETERS - - parameter (type: string) (required) + Contains all valid VCS commands for the current module ( for use + by the tool bar ). Default: none. -RETURN CODES - - 1 = The operation completed successfully. - - 0 = This means that the method got an error proccessing your request. - Perhaps an invalid parameter? - - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -_get_username --------------------------------------------------------------------------------- - -METHOD - methodname - -SYNOPSIS + sort (type: string) (required) + The sorting order for the files. -DESCRIPTION - - -PARAMETERS - - parameter (type: string) (required) + FIXME - this should only be for the get_browse method, not the + constructor. Default: none. -RETURN CODES - - 1 = The operation completed successfully. - - 0 = This means that the method got an error proccessing your request. - Perhaps an invalid parameter? - - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -_get_users_dir --------------------------------------------------------------------------------- + users_dir (type: string) (required) -METHOD - methodname - -SYNOPSIS - - -DESCRIPTION + The path to the user's home directory. + + Default: none. + log_obj (type: string) (required) -PARAMETERS - - parameter (type: string) (required) + Contains a reference to an instantiated log object. Default: none. @@ -174,50 +87,57 @@ Perhaps an invalid parameter? - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -_get_repo_name -------------------------------------------------------------------------------- METHOD - methodname + + get_browser SYNOPSIS + my %browser = $browse->get_browser( + 'location' => $location, + 'progname' => $progname, + 'repo_type' => $repo_type, + 'repo_name' => $repo_name, + 'sort' => $sort, + ); DESCRIPTION + This returns HTML depicting the directories and files that + the user wishes to browse, with traverse deeper into the + heirarchy. PARAMETERS - parameter (type: string) (required) + location (type: string) (required) + + The location that the user wants to start browsing from, relative + to the homedir/reponame/module. Default: none. -RETURN CODES - - 1 = The operation completed successfully. - - 0 = This means that the method got an error proccessing your request. - Perhaps an invalid parameter? - - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -_get_module_name --------------------------------------------------------------------------------- + progname (type: string) (required) -METHOD - methodname + The name of the CGI ( sandweb.cgi for example ). + + Default: none. -SYNOPSIS + repo_type (type: string) (required) + The type of repository ( e.g. CVS, RCS, SVN, etc. ). + + Default: none. -DESCRIPTION + repo_name (type: string) (required) + The name of the current repository. + + Default: none. -PARAMETERS + sort (type: string) (required) - parameter (type: string) (required) + This is the sort order for files/directories ( alphabetically or + reverse alphabetically ). Default: none. @@ -230,50 +150,38 @@ Perhaps an invalid parameter? - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -_get_template_dir -------------------------------------------------------------------------------- METHOD - methodname + + get_tool_bar SYNOPSIS + my %toolbar = $browse->get_tool_bar( + 'location' => $location, + 'progname' => $progname, + ); DESCRIPTION + Returns an HTML template depicting the Browse toolbar, + which allows you to create/remove files/directories and + run VCS commands. + + FIXME - the calling application shouldn't have to run + this template object through a loop and insert the VCS + commands, this should happen inside the Browse object. PARAMETERS - parameter (type: string) (required) + location (type: string) (required) + + The current browsing location. Default: none. -RETURN CODES + progname (type: string) (required) - 1 = The operation completed successfully. - - 0 = This means that the method got an error proccessing your request. - Perhaps an invalid parameter? - - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -_get_vcs_commands --------------------------------------------------------------------------------- - -METHOD - methodname - -SYNOPSIS - - -DESCRIPTION - - -PARAMETERS - - parameter (type: string) (required) + The name of the CGI ( e.g. sandweb.cgi ) Default: none. @@ -281,38 +189,32 @@ RETURN CODES - 1 = The operation completed successfully. + Returns a hash reference to an HTML::Template object. 0 = This means that the method got an error proccessing your request. Perhaps an invalid parameter? - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - -_get_log_obj -------------------------------------------------------------------------------- METHOD - methodname + + get_current_location SYNOPSIS + my $current_location = $browse->get_current_location(); + DESCRIPTION + Returns the current location of the browse object. PARAMETERS - parameter (type: string) (required) - - Default: none. + None. RETURN CODES - 1 = The operation completed successfully. + Returns the current location of the browse object as a string. 0 = This means that the method got an error proccessing your request. Perhaps an invalid parameter? - - -1 = This return value means that there was not sufficient permision to - read the files specified, or they did not exist. - |