// Copyright 1999 (c) by Perforce Software, Inc. All rights reserved. // // p4wRSSPane: // The changes pane. // ------------------------------------- // Includes // #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wRSSPane.h" #define MAX_FILES 100 // ------------------------------------- // Constructors and destructor. // p4wRSSChangeDetailPane::p4wRSSChangeDetailPane(p4wView & ParentView, p4wRequest & Request) : p4wPane(ParentView, Request) { } p4wRSSChangeDetailPane::~p4wRSSChangeDetailPane() { } // ------------------------------------- // Render functions. // void p4wRSSChangeDetailPane::Render(StrDict * varList) { // // Display the output of the describe command StrPtr *val; StrPtr *action; StrPtr *rev; StrBuf url; StrBuf newBase; const StrPtr *change = varList->GetVar( "change" ); const StrPtr *desc = varList->GetVar( "desc" ); p4wHtml htm( 1 ); #if 0 htm.text( "Changelist: ", "b" ); htm.text( p4wStrBuf().Expand( StrRef( "%change%" ), *varList ).Text() ); htm.linebreak(); #endif htm.text( "Date: ", "b" ); htm.text( p4wStrBuf().Expand( StrRef( "%time@*Y/*m/*d *H:*M%" ), *varList ).Text() ); htm.linebreak(); htm.text( "Client: ", "b" ); htm.text( p4wStrBuf().Expand( StrRef( "%client%" ), *varList ).Text() ); htm.linebreak(); htm.text( "User: ", "b" ); htm.text( p4wStrBuf().Expand( StrRef( "%user%" ), *varList ).Text() ); htm.linebreak(); htm.text( "Description:", "b" ); htm.beginBlockquote(); htm.beginUnformatted(); // // Convert http: & https: into real links in the // Description field htm.text( p4wStrBuf().EscapeHTMLDoURLs( *desc ).Text() ); htm.endUnformatted(); htm.endBlockquote(); htm.text( "Affected files:", "b" ); htm.linebreak(); p4wStrBuf buf; buf.EscapeHTML(htm); fRequest << buf; htm.Clear(); buf.Clear(); if ( ( val = varList->GetVar( StrRef( "depotFile" ), MAX_FILES + 1 ) ) != NULL ) { StrBuf msg; msg << "There are more than " << MAX_FILES << " files. Look in the browser to retrieve them all."; htm.text( msg.Text(), "b" ); htm.linebreak(); } for( int i = 0; ( val = varList->GetVar( StrRef( "depotFile" ), i ) ) != NULL; i++ ) { // // If page content limit in bytes has been exceeded, don't // generate this entry if( i > MAX_FILES ) { buf.EscapeHTML(htm); fRequest << buf; htm.Clear(); buf.Clear(); return; } // Fetch some information about this file. action = varList->GetVar( StrRef( "action" ), i ); rev = varList->GetVar( StrRef( "rev" ), i ); // Prepare the file browser url p4wURL urlMaker; fRequest.ReplaceBase( "pat", NULL ); fRequest.UseNewBase( newBase, NULL, "md", "d" ); fRequest.UseNewBase( newBase, newBase.Text(), "cd", "//" ); fRequest.UseNewBase( newBase, newBase.Text(), "wr", NULL ); fRequest.UseNewBase( newBase, newBase.Text(), "path", val->Text() ); urlMaker.ConstructURL( url, newBase.Text(), AC_BROWSEFILE, NULL ); // Output this entry & url htm.beginLink( url.Text() ); htm.text( p4wStrBuf().EscapeHTML( *val, Unicode() ).Text() ); htm.endLink(); htm << "#" << p4wStrBuf().EscapeHTML( *rev, Unicode() ).Text() << " " << p4wStrBuf().EscapeHTML( *action, Unicode() ).Text(); htm.linebreak(); buf.EscapeHTML(htm); fRequest << buf; htm.Clear(); buf.Clear(); } htm.endCol(); htm.endTRow(); buf.EscapeHTML(htm); fRequest << buf; htm.Clear(); buf.Clear(); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/Panes/p4wRSSPane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |