Examples of ApsAggregatorItem


Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

    assertEquals(3, entries.size());
  }
 
  public void _testGetContents() throws Throwable {
    String url = PluginConfigTestUtils.TEST_URL;
    ApsAggregatorItem item = TestAggregatorManagerHelper.createItem(3600, "dummy_descr", url);
    //_aggregatorManager.addItem(item);
    List<SyndEntryImpl> entries = _rssConverterManager.getRssEntries(IRssConverterManager.RSS_2_0, url);
    assertNotNull(entries);
    List<Content> contents = _rssConverterManager.getContents(item);
    assertNotNull(contents);
View Full Code Here

Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

  protected void tearDown() throws Exception {
    try {
      List<ApsAggregatorItem> items = this._aggregatorManager.getItems();
      Iterator<ApsAggregatorItem> it = items.iterator();
      while (it.hasNext()) {
        ApsAggregatorItem currentItem = it.next();
        this._aggregatorManager.deleteItem(currentItem.getCode());
      }
    } catch (Throwable t) {
      throw new Exception();
    } finally {
      this._testHelper.restoreConfig();
View Full Code Here

Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

      _contentManager.deleteContent(content);
    }
    List<ApsAggregatorItem> items = _aggregatorManager.getItems();
    Iterator<ApsAggregatorItem> it = items.iterator();
    while (it.hasNext()) {
      ApsAggregatorItem currentItem = it.next();
      _aggregatorManager.deleteItem(currentItem.getCode());
    }
  }
View Full Code Here

Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

  private void checkDuplicateLink() {
    try {
      List<ApsAggregatorItem> items = this.getAggregatorItems();
      if (null != items && items.size() > 0) {
        for (int i = 0; i < items.size(); i++) {
          ApsAggregatorItem aggregatorItem = items.get(i);
          boolean sameItem = this.getCode() == aggregatorItem.getCode();
          if (this.getLink().equals(aggregatorItem.getLink()) && !sameItem) {
            String arg[] = new String[]{aggregatorItem.getDescr()};
            this.addFieldError("link", this.getText("jprssaggregator.error.link.duplicated", arg));
          }
        }
      }
    } catch (Throwable t) {
View Full Code Here

Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

  @Override
  public String save() {
    try {
      int strutsAction = this.getStrutsAction();
      ApsAggregatorItem item = this.createItem();
      if (strutsAction == ApsAdminSystemConstants.ADD) {
        this.getAggregatorManager().addItem(item);
      } else if (strutsAction == ApsAdminSystemConstants.EDIT) {
        this.getAggregatorManager().update(item);
      }
View Full Code Here

Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

  }

  @Override
  public String delete() {
    try {
      ApsAggregatorItem item = this.getAggregatorManager().getItem(this.getCode());
      if (null == item) {
        this.addActionError(this.getText("jprssaggregator.error.itemNull"));
        return INPUT;
      }
      this.getAggregatorManager().deleteItem(item.getCode());
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "deleteItem");
      return FAILURE;
    }
    return SUCCESS;
View Full Code Here

Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

  }
 
  @Override
  public String syncronize() {
    try {
      ApsAggregatorItem item = this.getAggregatorManager().getItem(this.getCode());
      this.getAggregatorManager().updateSource(item);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "syncronize");
      return FAILURE;
    }
View Full Code Here

Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

    }
    return SUCCESS;
  }

  private ApsAggregatorItem createItem() throws Throwable {
    ApsAggregatorItem item = new ApsAggregatorItem();
    if (getStrutsAction() == ApsAdminSystemConstants.EDIT) {
      item.setCode(this.getCode());
      item.setLastUpdate(new Date(this.getLastUpdate().getTime()));
    }
    System.out.println(this.getContentType());
    item.setContentType(this.getContentType());
    item.setDelay(this.getDelay());
    item.setLink(this.getLink());
    item.setDescr(this.getDescr());
    item.setCategories(this.getCategories());
    return item;
  }
View Full Code Here

Examples of com.agiletec.plugins.jprssaggregator.aps.system.services.aggregator.ApsAggregatorItem

    return item;
  }

  protected String populateForm() throws ApsSystemException, IOException {
    int code = this.getCode();
    ApsAggregatorItem item = this.getAggregatorManager().getItem(code);
    if (null == item) {
      this.addActionError(this.getText("jprssaggregator.error.itemNotFound"));
      return "itemList";
    }
    if (null != item.getCategories()) {
      this.setXmlCategories(item.getCategories().toXml());
    }
    this.setCode(item.getCode());
    this.setContentType(item.getContentType());
    this.setDescr(item.getDescr());
    this.setDelay(item.getDelay());
    this.setLastUpdate(new Timestamp(item.getLastUpdate().getTime()));
    this.setLink(item.getLink());
    return null;
  }
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.