This is a README for P4DB, a CGI based p4 depot browser written by Fredric Fredricson (fredric@mydata.se)
The graphic "Branch Relationships" page is written by Todd Short
(see Todd's readme file).
More credits at the end.
The README is intended for administrators and others that want to install, maintain, and possibly contribute to, P4DB.
P4DB is designed to provide a user friendly and intuitive
interface to the p4 depot. Information is presented using a web
browser and most pages combine output from two or more p4
commands.
The driving force behind the development has been my needs as a
manager for a software team, the needs for our project leaders to
document changes in the code line and the need for our programmers
to analyze changes in the code line (and most important, of
course, the need for me as a frustrated software engineer promoted
to my level of incompetence to get my hands on a nice little
programming project).
The browser is written in perl and developed on a Linux/Apache system and has been tested mainly with Firefox although some of our users use MS Explorer and no problems has been reported.
P4DB is inspired by a depot browser, perfbrowse.perl, made available by Perforce at http://www.perforce.com/perforce/loadsupp.html#browse Perfbrowse.perl is written in perl and the author is unknown to me.
The idea is also stolen so I can't claim that one.
I liked perfbrowse.perl very much but wanted just a little more
functionality. I started to add functionality and it quickly got
out of hand. Soon I had a huuuge perl script that I could no
longer maintain. Once I realized that I can write a perl script
that is about 2-4 times the size of the script that I can maintain
I decided to rewrite it all from the start as a set of small,
maintainable, perl scripts. I leave to others to judge if I
succeeded in my mission.
(Maybe I should mention that it took much more time than I
anticipated).
P4DB version 4.0 requires:
There is no real "list of supported platforms" simply because there is no real support for P4DB. I just write it, test it a little, and release it.
Http server:
P4DB is developed on a Linux box running Fedora Core 3 and Apache,
runs in production on RedHat 7.2/Apache, and has been reported
to run on SUN/Solaris and NT/IIS platforms as well. The NT
platform require MKS toolkit or similar and some tweaking,
though.
Browser:
All development work is done using FireFox version 1.0 (preview)
but I usually perform some basic testing with MS-Explorer and sometimes
Netscape.
P4DB should work with a recent browser with reasonable
support for CSS (Cascaded Style Sheets) and
javascript.
P4DB is not designed for character mode browsers such
as Lynx.
And, by the way, the P4DB use cookies. Without cookies enabled you will
not even be able to log in to P4DB.
NOTE: This installation description assumes that the reader is familiar with http servers, cgi scripts and, to a small degree, perl.
Other than the obvious, that is somewhere in a http servers CGI path, I recommend you to set up a http server on your p4 server and run P4DB on that server. The main reasons are that it improves response time and reduce network load.
If you use Linux and downloaded the tarball (that is, not the zip-file) you can follow the instructions below. If not, go to "Installation without install.pl"
This is the theory, at least. I have not tested it on many systems
If install.pl don't work for you here is what it does that you need to do manually:
The basic configuration file is named P4DB.conf. The file is not included in the package but a sample configuration file called P4DB.conf.txt is.
Copy the file P4DB.conf.txt to P4DB.conf and modify it. The instructions are included in the file.
Each p4 user that should be able to use P4DB must have at least read access from the machine that P4DB runs on to the parts of the depot he/she should have access to through P4DB. P4 groups may come in handy here.
Security Note 1:
P4DB asks for a p4 user to access
the depot. It is wise to give users read priviliges
only on the P4DB host. This protects the depot from
errors in P4DB that might affect the depot status.
Security Note 2:
P4DB does not provide any strong access
protection or other security. It is not possible to modify
the depot using P4DB so poorly trained or inexperienced
operators should not be able to damage the depot.
Security Note 3:
During the login procedure the p4 user name and password are
transmitted unencrypted over the network.
If this is not acceptable you should use the SSL (Secure Sockets Layer)
and TLS (Transport Layer Security) protocols.
Unfortunately I am not an expert in these matters and can not
give you any help here other than point you to the
mod_ssl module documentation
in Apache.
I also recommend that you read the Warranty-paragraph.
P4DB will let users view some file types using applications like MS-Word for Word-file etc. This can be configured in a file viewConfig.pm. Default will let you view HTML, gif, jpeg, MS-Word, MS-Powerpoint, and Acrobat (PDF) formats. See file viewConfig.pm for details.
P4DB 3.1 is a frame-less version of 3.0. The frame stuff was not appreciated by the users at all. The main problem was that it made it difficult to take the URL and slap it in an email to another developer to point something out, something the users do frequently.
Another thing that really killed the frame based solution was the (wonderful!) tabs in Netscape 7 and other Mozilla-based browsers. No doubt the next version of MS-Explorer will have some similar feature if they have the slightest clue in Redmond. With frames the "open in new tab"-feature became somewhat awkward.
Apart from the above the follwing things have changed:
P4DB is, again, completley rewritten (well.. almost) only this time I did not add much functionality other than a completley different user interface that I hope will be more efficient.
NOTE! Configuration file for 2.1 not compatible with 3.0.
Here are a few of the changes:
Configuration file for 2.0 not compatible with 2.01
The difference is so huge that I do not care to list it. P4DB 2.0 can simply do much more than earlier versions.
There is no license for P4DB.
You are free to use it for any purpose.
I might decide to apply GPL to it some
time in the future but I doubt that I will bother....
If you get any problems because of these scripts I promise to feel sorry for you. Other than that you are on your own.
Please note for the record that I do not even claim that
P4DB can be used to browse the P4 depot. I will also inform
you that even though the intention is that P4DB should not
in any way modify the depot
status I can make no promises that this is can not happen.
And please remember that it would be easy for someone to grab the
P4DB code, insert a few malicious lines of code, and
"release" it with this "Trojan Horse".
If you would like to contribute changes/improvements/new functions
the best way is to become a registered user at the
Perforce Public Depot, branch from
//guest/fredric_fredricson/P4DB/main/..., make the changes and
send me a
email.
I can of course not promise that I will like your
changes and immediately integrate them to P4DB but if not you can
always start you own competing version of P4DB, I do not mind.
If Perforce Public Depot does not work for you you can just send me an email and describe the changes.
I will be glad for any kind of contributions ranging from corrections of my bad English to new interesting functionality. Nice letters are also welcome.
The most important documentation is in the P4CGI.pm module. This modules is used by all scripts and contains a set of common functions that are useful or defines some common "look and feel" or both.
The P4CGI.pm module is documented using
perlpod (see perlpod man page). To get a HTML page
containing documentation
type:
pod2html P4CGI.pm >P4CGI.html
(There is one distributed with P4DB, for convenience)
For other files: more often than not the code is commented.
There are three different files 'types' in the design:
The code also uses the CGI.pm perl module. This module should be part of the "standard distribution" of perl (if there is such a thing). If you do not have the module it is available for download at www.cpan.org.
As a part of my personal religion the -w flag is always turned on and 'use strict' flag is also set. I have never had any reason to regret this particular peculiarity of mine but it might cause some warning messages that will be printed to the browsers error log.
Performance has not been a great issue. I assume that these cgi's will not have thousands of hits each day and the design has focused on ease of development rather than speed.
An incomplete list of people that has contributed to P4DB in different ways:
There are more but these are the only names I found in my records.