Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.ISource


    /* Return text and html as is */
    return element.getText();
  }

  private void processSource(Element element, INews news) {
    ISource source = Owl.getModelFactory().createSource(news);

    /* Check wether the Attributes are to be processed by a Contribution */
    processNamespaceAttributes(element, source);

    /* Interpret Children */
    List<?> sourceChilds = element.getChildren();
    for (Iterator<?> iter = sourceChilds.iterator(); iter.hasNext();) {
      Element child = (Element) iter.next();
      String name = child.getName().toLowerCase();

      /* Check wether this Element is to be processed by a Contribution */
      if (processElementExtern(child, source))
        continue;

      /* Name */
      else if ("title".equals(name)) { //$NON-NLS-1$
        source.setName(child.getText());
        processNamespaceAttributes(child, source);
      }

      /* EMail */
      else if ("link".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(child.getText());
        if (uri != null)
          source.setLink(uri);
        processNamespaceAttributes(child, source);
      }

      /* URI */
      else if ("id".equals(name) && source.getLink() == null) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(child.getText());
        if (uri != null)
          source.setLink(uri);
        processNamespaceAttributes(child, source);
      }
    }
  }
View Full Code Here


      Owl.getModelFactory().createGuid((INews) type, element.getText(), null);
    }

    /* Source */
    else if ("source".equals(name) && type instanceof INews) { //$NON-NLS-1$
      ISource source = Owl.getModelFactory().createSource((INews) type);
      source.setLink(URIUtils.createURI(element.getText()));
    }
  }
View Full Code Here

      /* XML URL */
      else if ("xmlurl".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(attribute.getValue());
        if (uri != null) {
          ISource source = Owl.getModelFactory().createSource(news);
          source.setLink(uri);
        }
      }

      /* Text */
      else if ("text".equals(name)) //$NON-NLS-1$
View Full Code Here

      }
    }
  }

  private void processSource(Element element, INews news) {
    ISource source = Owl.getModelFactory().createSource(news);
    source.setName(element.getText());

    /* Check wether the Attributes are to be processed by a Contribution */
    processNamespaceAttributes(element, source);

    /* Interpret Attributes */
    List<?> attributes = element.getAttributes();
    for (Iterator<?> iter = attributes.iterator(); iter.hasNext();) {
      Attribute attribute = (Attribute) iter.next();
      String name = attribute.getName().toLowerCase();

      /* Check wether this Attribute is to be processed by a Contribution */
      if (processAttributeExtern(attribute, source))
        continue;

      /* URL */
      else if ("url".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(attribute.getValue());
        if (uri != null)
          source.setLink(uri);
      }
    }
  }
View Full Code Here

    fFactory.createGuid(news, "someGUIDvalue", null);
    news.setLink(createURI("http://www.somelocation.com/feed.rss"));
    news.setModifiedDate(createDate());
    news.setProperty("property", "value");
    news.setPublishDate(createDate());
    ISource source = fFactory.createSource(news);
    source.setLink(createURI("http://www.someuri.com"));
    news.setSource(source);
    news.setTitle("This is the news title");
    news.setRating(70);
    return news;
  }
View Full Code Here

      category.getDomain();
      category.getName();
    }

    else if (type instanceof ISource) {
      ISource source = (ISource) type;
      source.getName();
      source.getLink();
    }

    else if (type instanceof IPerson) {
      IPerson person = (IPerson) type;
      person.getEmail();
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.ISource

Copyright © 2018 www.massapicom. 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.