Examples of ISource


Examples of fr.eolya.crawler.connectors.ISource

          if (CrawlerUtils.isAcceptedCountry((String)srcData.get("country"), countryInclude, countryExclude) || !"".equals(sourceId)) {

            String sourceCrawlMode = CrawlerUtils.getSourceCrawlMode(Integer.parseInt((String)srcData.get("crawl_mode")), reScan, reset, deeper, resetFromCache) ;

            // Build the source item according to its type and so its class
            ISource src = ConnectorFactory.getSourceInstance(crawlerDB.getSourceClass((String)srcData.get("type")), srcId, sourceCrawlMode, srcData);

            if (src!=null && src.isCrawlAllowedBySchedule()) {
              logger.log("        Pushing source : " + String.valueOf(src.getId()));
              sourceExecutor.submit(new ProcessorSource(src, config, logger, this));
            } else {
              sourceQueue.unpop(Integer.valueOf(srcId));
              logger.log("        Skip source due to schedule : " + String.valueOf(src.getId()));                     
            }
          } else {
            sourceQueue.unpop(Integer.valueOf(srcId));
            logger.log("        Skip source due to country : " + srcId);                                                       
          }
View Full Code Here

Examples of org.rssowl.core.model.types.ISource

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

Examples of org.rssowl.core.model.types.ISource

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

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

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

Examples of org.rssowl.core.persist.ISource

      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

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

Examples of org.rssowl.core.persist.ISource

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

    /* 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

Examples of org.rssowl.core.persist.ISource

      }
    }
  }

  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

Examples of org.rssowl.core.persist.ISource

      /* 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

Examples of org.rssowl.core.persist.ISource

          footer.append(categories);
        }
      }

      /* Source */
      ISource source = news.getSource();
      if (source != null) {
        hasFooter = true;
        String link = (source.getLink() != null) ? source.getLink().toASCIIString() : null;
        String name = source.getName();

        /* DIV: NewsItem/Footer/Source */
        div(footer, "source");

        /* Label */
 
View Full Code Here

Examples of org.rssowl.core.persist.ISource

      INews news4 = createNews(feed, null, "http://www.news.com/news4.html", State.UPDATED);
      Date news4Date = new Date(1000000);
      news4.setPublishDate(news4Date);
      IPerson author4 = fFactory.createPerson(null, news4);
      author4.setName("Pasero");
      ISource source4 = fFactory.createSource(news4);
      source4.setLink(new URI("http://www.source.com"));

      INews news5 = createNews(feed, null, "http://www.news.com/news5.html", State.NEW);
      news5.setFlagged(true);
      IPerson author5 = fFactory.createPerson(null, news5);
      author5.setEmail(new URI("test@rssowl.org"));
      ISource source5 = fFactory.createSource(news5);
      source5.setName("Source for News 5");
      ICategory news5cat1 = fFactory.createCategory(null, news5);
      news5cat1.setName("Apache Lucene");
      ICategory news5cat2 = fFactory.createCategory(null, news5);
      news5cat2.setName("Java");
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.