当前位置: 首页>>代码示例>>Java>>正文


Java SyndContent.setType方法代码示例

本文整理汇总了Java中com.sun.syndication.feed.synd.SyndContent.setType方法的典型用法代码示例。如果您正苦于以下问题:Java SyndContent.setType方法的具体用法?Java SyndContent.setType怎么用?Java SyndContent.setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.syndication.feed.synd.SyndContent的用法示例。


在下文中一共展示了SyndContent.setType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSyndEntry

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
    SyndEntry syndEntry = super.createSyndEntry(item);

    Description desc = item.getDescription();
    if (desc!=null) {
        SyndContent content = new SyndContentImpl();
        content.setType(desc.getType());
        content.setValue(desc.getValue());
        syndEntry.setDescription(content);

        // contents[0] and description then reference the same content
        //
        List contents = new ArrayList();
        contents.add(content);
        syndEntry.setContents(contents);

    }
    
    return syndEntry;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:ConverterForRSS10.java

示例2: createSyndEntry

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
    SyndEntry syndEntry = super.createSyndEntry(item);
    Description desc = item.getDescription();
    if (desc!=null) {
        SyndContent content = new SyndContentImpl();
        content.setType(desc.getType());
        content.setValue(desc.getValue());
        syndEntry.setDescription(content);

        // contents[0] and description then reference the same content
        //
        List contents = new ArrayList();
        contents.add(content);
        syndEntry.setContents(contents);

    }
    return syndEntry;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:ConverterForRSS091Userland.java

示例3: getContents

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List getContents() {
    List<SyndContent> contents = super.getContents();
    List<SyndContent> result = new ArrayList<SyndContent>(contents.size());
    for (SyndContent c : contents) {
        SyndContent cc = new SyndContentImpl();
        if (c != null) {
            cc.setType(removeInvalidChars(c.getType()));
            cc.setMode(removeInvalidChars(c.getMode()));
            cc.setValue(removeInvalidChars(c.getValue()));
        }
        result.add(cc);
    }
    return result;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:17,代码来源:ExtendedSyndEntryImpl.java

示例4: makeDescriptionFromRSSCorrespon

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
/**
 * Itemのdescription(本文)を作成.
 * @param c コレポン
 * @param baseURL BaseURL
 * @return itemのdescription
 */
private SyndContent makeDescriptionFromRSSCorrespon(
    RSSCorrespon c, String baseURL) {
    SyndContent description = new SyndContentImpl();
    description.setType("text/html");
    StringBuilder sb = new StringBuilder();
    sb.append(makeDescriptionLine("No.", c.getId()));
    sb.append(makeDescriptionLine("Correspondence No.", c.getCorresponNo()));
    sb.append(makeDescriptionLine("From", c.getFromCorresponGroup()));
    sb.append(makeDescriptionLine("To", c.getToGroupName()));
    sb.append(makeDescriptionLine("Cc", c.getCcGroupName()));
    sb.append(makeDescriptionLine("Type", c.getCorresponType()));
    sb.append(makeDescriptionLine("Subject", c.getSubject()));
    sb.append(makeDescriptionLine("Workflow Status", c.getWorkflowStatus()));
    sb.append(makeDescriptionLine("Created on", c.getCreatedAt()));
    sb.append(makeDescriptionLine("Issued on", c.getIssuedAt()));
    sb.append(makeDescriptionLine("Deadline for Reply", c.getDeadlineForReply()));
    sb.append(makeDescriptionLine("Created by", c.getCreatedBy()));
    sb.append(makeDescriptionLine("Issued by", c.getIssuedBy()));
    sb.append(makeDescriptionLine("Reply Required", c.getReplyRequired()));
    sb.append(makeDescriptionLine(true, "URL", baseURL  + "correspon/correspon.jsf?id="
        + convertDescriptionString(c.getId()) + "&projectId="
        + convertDescriptionString(c.getProjectId())));
    description.setValue(sb.toString());
    return description;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:32,代码来源:RSSServiceImpl.java

示例5: createSyndEntry

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
@Override
protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) {
    SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);

    Description desc = item.getDescription();
    if (desc!=null) {
        SyndContent descContent = new SyndContentImpl();
        descContent.setType(desc.getType());
        descContent.setValue(desc.getValue());
        syndEntry.setDescription(descContent);
    }
    Content cont = item.getContent();
    if (cont!=null) {
        SyndContent contContent = new SyndContentImpl();
        contContent.setType(cont.getType());
        contContent.setValue(cont.getValue());
        List contents = new ArrayList();
        contents.add(contContent);
        syndEntry.setContents(contents);
    }
            
    return syndEntry;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:24,代码来源:ConverterForRSS10.java

示例6: createSyndEntry

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
@Override
protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) {
    SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);
    Description desc = item.getDescription();

    if (desc != null) {
        SyndContent descContent = new SyndContentImpl();
        descContent.setType(desc.getType());
        descContent.setValue(desc.getValue());
        syndEntry.setDescription(descContent);
    }

    Content cont = item.getContent();

    if (cont != null) {
        SyndContent content = new SyndContentImpl();
        content.setType(cont.getType());
        content.setValue(cont.getValue());

        List syndContents = new ArrayList();
        syndContents.add(content);
        syndEntry.setContents(syndContents);
    }

    return syndEntry;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:27,代码来源:ConverterForRSS091Userland.java

示例7: apply

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
@Override
public SyndEntry apply(final FedoraEvent event) {
    final SyndEntry entry = new SyndEntryImpl();
    try {
        entry.setTitle(event.getIdentifier());
        entry.setLink(event.getPath());
        entry.setPublishedDate(new DateTime(event.getDate())
                .toDate());
        final SyndContent description = new SyndContentImpl();
        description.setType("text/plain");
        description.setValue(event.getTypes().toString());
        entry.setDescription(description);
    } catch (final RepositoryException e) {
        throw propagate(e);
    }
    return entry;
}
 
开发者ID:fcrepo4-archive,项目名称:fcrepo-module-rss,代码行数:18,代码来源:RSSPublisher.java

示例8: createEntries

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
private List<SyndEntry> createEntries() throws DatabaseException {
  List<SyndEntry> entries = Lists.newArrayList();

  Date publishedData = new Date();

  for (PacketProblem problem : database.getLastestProblems()) {
    SyndEntry entry = new SyndEntryImpl();
    String problemReportSentence = problem.getProblemReportSentence();
    if (problemReportSentence.length() > 20) {
      problemReportSentence = problemReportSentence.substring(0, 20);
    }
    entry.setTitle("問題番号:" + problem.id + " " + problemReportSentence + "...");
    entry.setLink("http://kishibe.dyndns.tv/qmaclone/");
    entry.setPublishedDate(publishedData);
    SyndContent description = new SyndContentImpl();
    description.setType("text/plain");
    description.setValue(problemReportSentence);
    entry.setDescription(description);
    entry.setAuthor(problem.creator);
    entries.add(entry);
  }

  return entries;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:25,代码来源:RssServletStub.java

示例9: createSyndEntry

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
    SyndEntry syndEntry = super.createSyndEntry(item);

    Description desc = item.getDescription();
    if (desc!=null) {
        SyndContent descContent = new SyndContentImpl();
        descContent.setType(desc.getType());
        descContent.setValue(desc.getValue());
        syndEntry.setDescription(descContent);
    }
    Content cont = item.getContent();
    if (cont!=null) {
        SyndContent contContent = new SyndContentImpl();
        contContent.setType(cont.getType());
        contContent.setValue(cont.getValue());
        List contents = new ArrayList();
        contents.add(contContent);
        syndEntry.setContents(contents);
    }
            
    return syndEntry;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:23,代码来源:ConverterForRSS10.java

示例10: createSyndEntry

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
    SyndEntry syndEntry = super.createSyndEntry(item);
    Description desc = item.getDescription();
    if (desc != null) {
        SyndContent descContent = new SyndContentImpl();
        descContent.setType(desc.getType());
        descContent.setValue(desc.getValue());
        syndEntry.setDescription(descContent);
    }
    Content cont = item.getContent();
    if (cont != null) {
        SyndContent content = new SyndContentImpl();
        content.setType(cont.getType());
        content.setValue(cont.getValue());
        List syndContents = new ArrayList();
        syndContents.add(content);
        syndEntry.setContents(syndContents);
    }
    return syndEntry;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:21,代码来源:ConverterForRSS091Userland.java

示例11: getBuildEntries

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
private List getBuildEntries(final ConfigurationManager cm, final int activeBuildID, final BuildStatusURLGenerator urlGenerator) {
  final List result = new ArrayList(11);

  // traverse cmplete build runs for the given build
  final List completedBuildRuns = cm.getCompletedBuildRuns(activeBuildID, 0, PublishedResultFeedGenerator.MAX_BUILD_RUNS);
  for (final Iterator i = completedBuildRuns.iterator(); i.hasNext();) {
    final BuildRun buildRun = (BuildRun)i.next();

    // compose description
    final String resultDescr = buildRun.getResultID() == BuildRun.BUILD_RESULT_BROKEN ? ": " + buildRun.getResultDescription() : "";
    final StringBuffer subj = new StringBuffer(200);
    subj.append(buildRun.getBuildName()).append(" # ").append(buildRun.getBuildRunNumberAsString());
    subj.append(' ').append(new VerbialBuildResult().getVerbialResultString(buildRun));
    subj.append(resultDescr);

    // compose entry
    final SyndEntry entry = new SyndEntryImpl();
    entry.setTitle(subj.toString());
    entry.setPublishedDate(buildRun.getFinishedAt());
    entry.setLink(urlGenerator.makeBuildRunResultURL(buildRun));
    final SyndContent description = new SyndContentImpl();
    description.setType("text/plain");
    //description.setType("text/html");
    description.setValue(subj.toString());
    entry.setDescription(description);

    // edd entry to the result
    result.add(entry);
  }
  return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:32,代码来源:PublishedResultFeedGenerator.java

示例12: getBuildEntries

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
private List getBuildEntries(final ConfigurationManager cm, final int activeBuildID, final BuildStatusURLGenerator urlGenerator) {
  final List result = new ArrayList(1);

  // traverse cmplete build runs for the given build
  final List completedBuildRuns = cm.getCompletedBuildRuns(activeBuildID, 0, MAX_BUILD_RUNS);
  for (final Iterator i = completedBuildRuns.iterator(); i.hasNext();) {
    final BuildRun buildRun = (BuildRun) i.next();

    // compose description
    final String resultDescr = buildRun.getResultID() == BuildRun.BUILD_RESULT_BROKEN ? ": " + buildRun.getResultDescription() : "";
    final StringBuffer subj = new StringBuffer(200);
    subj.append(buildRun.getBuildName()).append(" # ").append(buildRun.getBuildRunNumberAsString());
    subj.append(" @ ").append(buildRun.getChangeListNumber());
    subj.append(" on ").append(new SimpleDateFormat("yyyy-MM-dd HH:ss z").format(buildRun.getFinishedAt()));
    subj.append(' ').append(new VerbialBuildResult().getVerbialResultString(buildRun));
    subj.append(resultDescr);

    // compose entry
    final SyndEntry entry = new SyndEntryImpl();
    entry.setTitle(subj.toString());
    entry.setPublishedDate(buildRun.getFinishedAt());
    entry.setLink(urlGenerator.makeBuildRunResultURL(buildRun));
    final SyndContent description = new SyndContentImpl();
    description.setType("text/plain");
    //description.setType("text/html");
    description.setValue(subj.toString());
    entry.setDescription(description);

    // edd entry to the result
    result.add(entry);
  }
  return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:34,代码来源:FeedGenerator.java

示例13: getDescription

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
@Override
public SyndContent getDescription() {
    SyndContent c = super.getDescription();
    SyndContent result = new SyndContentImpl();
    if (c != null) {
        result.setType(c.getType());
        result.setMode(c.getMode());
        result.setValue(removeInvalidChars(c.getValue()));
    }
    return result;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:12,代码来源:ExtendedSyndEntryImpl.java

示例14: getSyndEntry

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
public static SyndEntry getSyndEntry(Connection db, int id, String url) throws SQLException {
  SyndEntry entry = new SyndEntryImpl();
  try {
    Project project = new Project(db, id);
    if (!project.getApproved() || !project.getApprovalDate().before(new Timestamp(System.currentTimeMillis()))) {
      return null;
    }
    entry.setTitle(project.getTitle());
    // Need to check status
    entry.setPublishedDate(project.getEntered());
    entry.setAuthor(UserUtils.getUserName(project.getEnteredBy()));
    entry.setLink(url + "/show/" + project.getUniqueId());

    SyndContent description = new SyndContentImpl();
    description.setType("text/html");
    if (StringUtils.hasText(project.getShortDescription())) {
      if (project.getShortDescription().length() > 1000) {
        description.setValue(project.getShortDescription().substring(0, 1000));
      } else {
        description.setValue(project.getShortDescription());
      }
    }
    entry.setDescription(description);
  } catch (Exception e) {
    //likely if the object does not exist.
    return null;
  }

  return entry;
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:31,代码来源:ProjectFeedEntry.java

示例15: getSyndEntry

import com.sun.syndication.feed.synd.SyndContent; //导入方法依赖的package包/类
public static SyndEntry getSyndEntry(Connection db, int id, String url) throws SQLException {
  SyndEntry entry = new SyndEntryImpl();
  try {
    BlogPost blogPost = new BlogPost(db, id);
    Project project = ProjectUtils.loadProject(blogPost.getProjectId());
    if (blogPost.getStatus() != BlogPost.PUBLISHED) {
      return null;
    }
    entry.setTitle(blogPost.getSubject());
    // Need to check status
    entry.setPublishedDate(blogPost.getStartDate());
    entry.setAuthor(UserUtils.getUserName(blogPost.getEnteredBy()));
    entry.setLink(url + "/show/" + project.getUniqueId() + "/post/" + blogPost.getId());
    SyndContent description = new SyndContentImpl();
    description.setType("text/html");
    if (StringUtils.hasText(blogPost.getIntro())) {
      if (blogPost.getIntro().length() > 1000) {
        description.setValue(blogPost.getIntro().substring(0, 1000));
      } else {
        description.setValue(blogPost.getIntro());
      }
    }
    entry.setDescription(description);
  } catch (Exception e) {
    //likely if the object does not exist.
    return null;
  }

  return entry;
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:31,代码来源:BlogPostFeedEntry.java


注:本文中的com.sun.syndication.feed.synd.SyndContent.setType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。