// // Copyright 1999 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wRSSJobviewPane: // Generates the RSS feed for the User's Reviews #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wHtml.h" #include "p4wPane.h" #include "p4wRSSJobviewPane.h" #include "p4wRSSJobsPane.h" p4wRSSJobviewPane::p4wRSSJobviewPane( p4wView & ParentView, p4wRequest & Request ) : p4wPane( ParentView, Request ), fSeenBegin(0), fGotSpec(0), fSeenData(0) { } p4wRSSJobviewPane::~p4wRSSJobviewPane() { } void p4wRSSJobviewPane::Begin() { } void p4wRSSJobviewPane::Render( StrDict * varList ) { maxResults = 0; for( int i = 0; i < fSpec->Count(); i++ ) { // Get our spec element. SpecElem *se = fSpec->Get( i ); const char *val = NULL; // Ignore all fields except Username and JobView // List values are stored in <varname>0, <varname>1, etc. if( !se->IsList() && ( varList->GetVar( se->tag.Text() ) == NULL) ) continue; if (!StrPtr::CCompare( se->tag.Text(), "User")) // generate feed title { feedTitle << "JobView for "; if( fRequest.GetURL().Length() == 0 ) { feedTitle << fRequest.GetUser().Text(); } else { feedTitle << fRequest.GetURL().Text(); } continue; } if (StrPtr::CCompare( se->tag.Text(), "JobView")) continue; // Get the value of this field. if( varList->GetVar( se->tag.Text() ) != NULL ) val = varList->GetVar( se->tag.Text() )->Text(); maxResults = 25; filter << val; } } void p4wRSSJobviewPane::End() { } // Use the maxresults and filter (JobView) gotten from the user spec // to generate the XML for the RSS feed. void p4wRSSJobviewPane::Finish() { if (!maxResults) // there is no JobView { fRequest << " "; return; } // Run the jobs command. StrBuf mxBuf; mxBuf << StrNum(maxResults); fRequest.p4Arg( "-m" ); fRequest.p4Arg( mxBuf.Text() ); fRequest.p4Arg( "-e" ); fRequest.p4Arg( filter.Text() ); fRequest.p4Arg( "-l" ); fRequest.p4Arg( "-r" ); p4wRSSJobsPane cmdPane( (p4wView &)*this, fRequest ); cmdPane.SetFeedTitle(feedTitle.Text()); cmdPane.SetDefaultMX("25"); cmdPane.SetDefaultFT(filter.Text()); fRequest.p4( "jobs", 0, 0, &cmdPane ); fRequest.p4Wait(); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 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. |
||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |