コード例 #1
0
  /**
   * Load an item from the specified node.
   *
   * @param node The Node to load the item from.
   */
  public void load(final Node node) {
    final NodeList nl = node.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      final Node n = nl.item(i);
      final String name = n.getNodeName();

      if (name.equalsIgnoreCase("title")) {
        this.title = RSS.getXMLText(n);
      } else if (name.equalsIgnoreCase("link")) {
        this.link = RSS.getXMLText(n);
      } else if (name.equalsIgnoreCase("description")) {
        this.description = RSS.getXMLText(n);
      } else if (name.equalsIgnoreCase("pubDate")) {
        final String str = RSS.getXMLText(n);
        if (str != null) {
          this.date = RSS.parseDate(str);
        }
      }
    }
  }
コード例 #2
0
ファイル: View.java プロジェクト: zlosch/jenkins
 public void doRssLatest(StaplerRequest req, StaplerResponse rsp)
     throws IOException, ServletException {
   List<Run> lastBuilds = new ArrayList<Run>();
   for (TopLevelItem item : getItems()) {
     if (item instanceof Job) {
       Job job = (Job) item;
       Run lb = job.getLastBuild();
       if (lb != null) lastBuilds.add(lb);
     }
   }
   RSS.forwardToRss(
       getDisplayName() + " last builds only",
       getUrl(),
       lastBuilds,
       Run.FEED_ADAPTER_LATEST,
       req,
       rsp);
 }
コード例 #3
0
ファイル: User.java プロジェクト: nahi/jenkins
 private void rss(
     StaplerRequest req, StaplerResponse rsp, String suffix, RunList runs, FeedAdapter adapter)
     throws IOException, ServletException {
   RSS.forwardToRss(getDisplayName() + suffix, getUrl(), runs.newBuilds(), adapter, req, rsp);
 }
コード例 #4
0
ファイル: View.java プロジェクト: zlosch/jenkins
 private void rss(StaplerRequest req, StaplerResponse rsp, String suffix, RunList runs)
     throws IOException, ServletException {
   RSS.forwardToRss(
       getDisplayName() + suffix, getUrl(), runs.newBuilds(), Run.FEED_ADAPTER, req, rsp);
 }