public void doRssChangelog ( StaplerRequest req , StaplerResponse rsp ) throws IOException , ServletException { class FeedItem { ChangeLogSet . Entry e ; int idx ; public FeedItem ( ChangeLogSet . Entry e , int idx ) { this . e = e ; this . idx = idx ; } Run < ? , ? > getBuild ( ) { return e . getParent ( ) . build ; } } List < FeedItem > entries = new ArrayList <> ( ) ; String scmDisplayName = "" ; if ( this instanceof SCMTriggerItem ) { SCMTriggerItem scmItem = ( SCMTriggerItem ) this ; List < String > scmNames = new ArrayList <> ( ) ; for ( SCM s : scmItem . getSCMs ( ) ) { scmNames . add ( s . getDescriptor ( ) . getDisplayName ( ) ) ; } scmDisplayName = " " + Util . join ( scmNames , ", " ) ; } for ( RunT r = getLastBuild ( ) ; r != null ; r = r . getPreviousBuild ( ) ) { int idx = 0 ; if ( r instanceof RunWithSCM ) { for ( ChangeLogSet < ? extends ChangeLogSet . Entry > c : ( ( RunWithSCM < ? , ? > ) r ) . getChangeSets ( ) ) { for ( ChangeLogSet . Entry e : c ) { entries . add ( new FeedItem ( e , idx ++ ) ) ; } } } } RSS . forwardToRss ( getDisplayName ( ) + scmDisplayName + " changes" , getUrl ( ) + "changes" , entries , new FeedAdapter < FeedItem > ( ) { public String getEntryTitle ( FeedItem item ) { return "#" + item . getBuild ( ) . number + ' ' + item . e . getMsg ( ) + " (" + item . e . getAuthor ( ) + ")" ; } public String getEntryUrl ( FeedItem item ) { return item . getBuild ( ) . getUrl ( ) + "changes#detail" + item . idx ; } public String getEntryID ( FeedItem item ) { return getEntryUrl ( item ) ; } public String getEntryDescription ( FeedItem item ) { StringBuilder buf = new StringBuilder ( ) ; for ( String path : item . e . getAffectedPaths ( ) ) buf . append ( path ) . append ( ' ' ) ; return buf . toString ( ) ; } public Calendar getEntryTimestamp ( FeedItem item ) { return item . getBuild ( ) . getTimestamp ( ) ; } public String getEntryAuthor ( FeedItem entry ) { return JenkinsLocationConfiguration . get ( ) . getAdminAddress ( ) ; } } , req , rsp ) ; }
RSS feed for changes in this project .