Examples of Opml


Examples of com.rometools.opml.feed.opml.Opml

  @Path("/export")
  @UnitOfWork
  @Produces(MediaType.APPLICATION_XML)
  @ApiOperation(value = "OPML export", notes = "Export an OPML file of the user's subscriptions")
  public Response exportOpml(@SecurityCheck User user) {
    Opml opml = opmlExporter.export(user);
    WireFeedOutput output = new WireFeedOutput();
    String opmlString = null;
    try {
      opmlString = output.outputString(opml);
    } catch (Exception e) {
View Full Code Here

Examples of com.rometools.opml.feed.opml.Opml

  public void importOpml(User user, String xml) {
    xml = xml.substring(xml.indexOf('<'));
    WireFeedInput input = new WireFeedInput();
    try {
      Opml feed = (Opml) input.build(new StringReader(xml));
      List<Outline> outlines = feed.getOutlines();
      for (Outline outline : outlines) {
        handleOutline(user, outline, null);
      }
    } catch (Exception e) {
      log.error(e.getMessage(), e);
View Full Code Here

Examples of com.rometools.opml.feed.opml.Opml

  private final FeedCategoryDAO feedCategoryDAO;
  private final FeedSubscriptionDAO feedSubscriptionDAO;

  public Opml export(User user) {
    Opml opml = new Opml();
    opml.setFeedType("opml_1.1");
    opml.setTitle(String.format("%s subscriptions in CommaFeed", user.getName()));
    opml.setCreated(new Date());

    List<FeedCategory> categories = feedCategoryDAO.findAll(user);
    List<FeedSubscription> subscriptions = feedSubscriptionDAO.findAll(user);

    // export root categories
    for (FeedCategory cat : categories) {
      if (cat.getParent() == null) {
        opml.getOutlines().add(buildCategoryOutline(cat, subscriptions));
      }
    }

    // export root subscriptions
    for (FeedSubscription sub : subscriptions) {
      if (sub.getCategory() == null) {
        opml.getOutlines().add(buildSubscriptionOutline(sub));
      }
    }

    return opml;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.