Package com.substanceofcode.rssreader.businessentities

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed


        (name.toLowerCase().indexOf(m_feedNameFilter) < 0)) ||
        (( m_feedURLFilter != null) &&
        (url.toLowerCase().indexOf(m_feedURLFilter) < 0))) {
        continue;
      }
            feeds[lineIndex] = new RssItunesFeed(name, url, "", "");
        }
       
        return feeds;       
    }
View Full Code Here


    }
    //#ifdef DLOGGING
//@    if (finestLoggable) {logger.finest("m_language=" + m_language);}
    //#endif
    m_hasExt = m_extParser.isHasExt();
    RssItunesFeed feed = cfeed;
        feed.setItems(items);
       
        /** Parse to first entry element */
        while(!parser.getName().equals("entry")) {
      //#ifdef DTEST
      //#ifndef DTESTUI
//@            System.out.println("Parsing to first entry");
      //#endif
      //#endif
            switch (parser.parse()) {
        case XmlParser.END_DOCUMENT:
          System.out.println("No entries found.");
          return feed;
        case XmlParser.ELEMENT:
          String elementName = parser.getName();
          char elemChar = elementName.charAt(0);
          if (parseCommon(parser, elemChar, elementName)) {
            if ((elemChar == 't') &&
                getTitleOnly && elementName.equals("title") ) {
              feed.setName(m_title);
              return feed;
            }
          }
          if ((elemChar == 's') &&
            elementName.equals("subtitle") ) {
            m_description = parser.getText(m_convXmlEnts);
            if (m_convXmlEnts) {
              m_description = StringUtil.removeHtml(
                  m_description );
            }
            //#ifdef DLOGGING
//@            if (finestLoggable) {logger.finest("m_description=" + m_description);}
            //#endif
            continue;
          }
          if (m_hasExt) {
            m_extParser.parseExtItem(parser, elemChar,
                         elementName);
          }
          break;
        default:
          break;
            }
        }

    feed.setLink(m_link);
    // Atom has not feed level date.
    feed.setDate(null);
    if (m_extParser.isItunes()) {
      feed = m_extParser.getFeedInstance(feed, m_language,
          m_title, m_description);
    }
       
View Full Code Here

             * collection.  Account for wrong OPML which is an
             * OPML composed of other OPML.  These have url attribute
             * instead of link attribute.
             */
            if (!needRss || needFirstRss) {
              RssItunesFeed feed = new RssItunesFeed(title, link, "", "");
              rssFeeds.addElement( feed );
              process = false;
              break;
            }
            if (( feedURLFilter != null) &&
              ( link.toLowerCase().indexOf(feedURLFilter) < 0)) {
              continue;
            }
            if (( feedNameFilter != null) &&
              ((title != null) &&
              (title.toLowerCase().indexOf(feedNameFilter) < 0))) {
              continue;
            }
            RssItunesFeed feed = new RssItunesFeed(title, link, "", "");
            rssFeeds.addElement( feed );
            break;
          default:
        }
      }
View Full Code Here

        Vector items = new Vector();
    m_extParser = new ExtParser(convXmlEnts);
    m_extParser.parseNamespaces(parser);
    m_hasExt = m_extParser.isHasExt();
    m_convXmlEnts = convXmlEnts;
    RssItunesFeed feed = cfeed;
        feed.setItems(items);
       
        /** Parse to first entry element */
        while(!parser.getName().equals("item")) {
            switch (parser.parse()) {
        case XmlParser.END_DOCUMENT:
          System.out.println("No entries found.");
          return feed;
        case XmlParser.ELEMENT:
          String elementName = parser.getName();
          if (elementName.length() == 0) {
            continue;
          }
          char elemChar = elementName.charAt(0);
          if (parseCommon(parser, elemChar, elementName)) {
            if ((elemChar == 't') &&
                getTitleOnly && elementName.equals("title") ) {
              feed.setName(m_title);
              return feed;
            }
            continue;
          }
          switch (elemChar) {
            //#ifdef DITUNES
//@            case 'l':
//@               if (elementName.equals("language")) {
//@                 m_language = parser.getText();
                 //#ifdef DLOGGING
//@                 if (finestLoggable) {logger.finest("m_language=" + m_language);}
                 //#endif
//@                 continue;
//@               }
//@               break;
            //#endif
            case 'i':
               if (elementName.equals("image")) {
                 // Skip image text as it includes link
                 // and title.
                 String itext = parser.getText(false);
                 //#ifdef DLOGGING
//@                 if (finestLoggable) {logger.finest("image=" + itext);}
                 //#endif
                 continue;
               }
               break;
            default:
               break;
          }
          if (m_hasExt) {
            m_extParser.parseExtItem(parser, elemChar, elementName);
          }
          break;
        default:
          break;
            }
        }
    feed.setLink(m_link);
    if (m_date.length() > 0) {
      Date pubDate = parseRssDate(m_date);
      feed.setDate(pubDate);
    } else {
      feed.setDate(null);
    }
    if (m_extParser.isItunes()) {
      feed = m_extParser.getFeedInstance(feed, m_language, m_title,
          m_description);
    }
View Full Code Here

//@              RssItunesFeed bm2 =
//@                CompatibilityRssItunesFeed3.deserialize3(
//@                true, part );
//@              RssItunesFeed bm = new RssItunesFeed( bm2 );
              //#else
              RssItunesFeed bm = null;
              if (itunesCapable) {
                if (saveMemoryEnabled) {
                  rsi = RssItunesFeed.getStoreStringInfo(
                      true, false, part, itemsEncoded );
                } else {
                  bm = RssItunesFeed.deserialize(
                      itemsEncoded, part );
                }
              } else {
                bm = new RssItunesFeed(new RssFeed(
                      firstSettings, itemsEncoded, part ));
              }

              //#endif
              if((bm != null) && (bm.getName().length()>0)){
                final String fname = bm.getName();
                m_bookmarkList.append(fname,null);
                m_rssFeeds.put(fname, bm);
              } else {
                final String fname = rsi.getName();
                m_bookmarkList.append(fname,null);
View Full Code Here

        //#endif

        // Open existing bookmark and show headers (items).
                if( m_openPage || m_getPage || m_getModPage ) {
                    try {
            RssItunesFeed feed = null;
            if( m_openPage ) {
              m_curBookmark = UiUtil.getSelectedIndex(m_bookmarkList);
            }
            if( m_curBookmark<0 ){
              continue;
            }
            if( m_openPage ) {
              String parm = m_bookmarkList.getString(
                  m_curBookmark);
              feed = (RssItunesFeed)m_rssFeeds.get(parm);
              m_curRssParser = new RssFeedParser( feed );
              m_openPage = ( feed.getItems().size() > 0 );
              m_getPage = !m_openPage;
              m_prevDisp = m_bookmarkList;
            } else {
              feed = m_curRssParser.getRssFeed();
            }
            if( m_openPage ) {
              /* Loading feed... */
              initializeLoadingFormRsc("text.l.feed",
                  m_bookmarkList);
            } else {
              /* Updating feed... */
              initializeLoadingFormRsc(
                  m_getModPage ? "text.u.mfeed" :
                  "text.u.feed", m_prevDisp);
            }
            if(feed.getUrl().length() == 0) {
              recordExcFormFin("Unable to open feed.  No URL.",
                  new Exception(
                  "Feed has no URL cannot load."));
              continue;
            }
            if (!m_openPage) {
              /** Get RSS feed */
              final int maxItemCount =
                m_appSettings.getMaximumItemCountInFeed();
              final boolean convHtml =
                !m_appSettings.getHtmlEnabled();
              //#ifdef DTEST
//@              System.gc();
//@              long beginMem = Runtime.getRuntime().freeMemory();
              //#endif
              m_curRssParser.parseRssFeed( m_getModPage, convHtml,
                  maxItemCount );
              //#ifdef DTEST
//@              System.gc();
//@              System.out.println("RssItunesFeed size=" + (beginMem - Runtime.getRuntime().freeMemory()));
              //#endif
              feed = m_curRssParser.getRssFeed();
              //#ifdef DTEST
//@              System.gc();
//@              beginMem = Runtime.getRuntime().freeMemory();
              //#endif
              m_rssFeeds.put(feed.getName(), feed);
              //#ifdef DTEST
//@              System.gc();
//@              System.out.println("RssItunesFeed store size=" + (beginMem - Runtime.getRuntime().freeMemory()));
              //#endif
            }
            //#ifdef DTEST
//@            System.gc();
//@            long beginMem = Runtime.getRuntime().freeMemory();
            //#endif
            final HeaderList hdrList = new HeaderList(this, feed);
            //#ifdef DTEST
//@            System.gc();
//@            System.out.println("headerList size=" + (beginMem - Runtime.getRuntime().freeMemory()));
            //#endif
                        hdrList.fillHeadersList();
                        setCurrent( hdrList );
            //#ifdef DTEST
//@            hdrList.testFeed(true);
//@            hdrList.testFeed(false);
//@            hdrList.testFeed2(true);
//@            hdrList.testFeed2(false);
            //#endif
                    }catch(CauseMemoryException e) {
            System.gc();
            if ((m_curRssParser != null) &&
                (m_curRssParser.getRssFeed() != null)) {
              m_curRssParser.getRssFeed().setItems(new Vector());
            }
            recordExcFormFinRsc(
                            /* \nOut of memory loading/parsing feed on:\n */
                            (m_openPage ? "exc.om.ld" : "exc.om.pse"),
                                m_curRssParser.getRssFeed().getUrl(), e);
                    }catch(Exception e) {
            /* Error loading/parsing  feed on:\n \1 */
            recordExcFormFinRsc(
                            (m_openPage ? "exc.er.ld" : "exc.er.pse"),
                                m_curRssParser.getRssFeed().getUrl(), e);

                    }catch(OutOfMemoryError e) {
            System.gc();
            if ((m_curRssParser != null) &&
                (m_curRssParser.getRssFeed() != null)) {
              m_curRssParser.getRssFeed().setItems(new Vector());
            }
            recordExcFormFinRsc(
                            /* Out of memory loading/parsing feed on:\n */
                            (m_openPage ? "exc.om.ld" : "exc.om.pse"),
                                m_curRssParser.getRssFeed().getUrl(), e);
                    }catch(Throwable t) {
            recordExcFormFinRsc(
                            /* Internal error loading/parsing feed on:\n */
                            (m_openPage ? "exc.int.ld" : "exc.int.pse"),
                                m_curRssParser.getRssFeed().getUrl(), t);
          } finally {
            m_getPage = false;
            m_openPage = false;
            m_getModPage = false;
                    }
                }

        /* Handle going to settings form. */
                if( m_getSettingsForm ) {
          m_getSettingsForm = false;
          /* Loading settings... */
          initializeLoadingFormRsc("text.l.s", m_bookmarkList);
                    try{
            //#ifdef DTEST
//@            System.gc();
//@            long beginMem = Runtime.getRuntime().freeMemory();
            //#endif
            final SettingsForm settingsForm = new SettingsForm(this);
            //#ifdef DTEST
//@            System.gc();
//@            System.out.println("SettingsForm size=" +
//@                (beginMem - Runtime.getRuntime().freeMemory()));
            //#endif
            if (m_loadForm.hasExc()) {
              m_loadForm.addStartCmd( settingsForm );
            } else {
              setCurrent( settingsForm );
            }
                    } catch(OutOfMemoryError t) {
            System.gc();
            /* \nOut Of Memory Error loading settings form */
            recordExcFormFinRsc("exc.om.set", t);
                    } catch(Throwable t) {
            /* \nInternal error loading settings form */
            recordExcFormFinRsc("exc.int.lset", t);
          }
        }

        //#ifndef DSMALLMEM
        /* Handle going to help form. */
                if( m_getHelpForm ) {
          m_getHelpForm = false;
          /* Loading help... */
          initializeLoadingFormRsc("text.l.h", m_bookmarkList);
                    try{
            final HelpForm helpForm = initializeHelp();
            setCurrent( helpForm );
                    } catch(OutOfMemoryError t) {
            System.gc();
            /* \nOut Of Memory Error loading help form */
            recordExcFormFinRsc("exc.om.bhlp", t);
                    } catch(Throwable t) {
            /* \nInternal error loading help form */
            recordExcFormFinRsc("exc.int.bhlp", t);
          }
        }
        //#endif

        /* Handle going to bookmark form. */
                if( m_getAddBMForm || m_getEditBMForm ) {
          try {
            if( m_getEditBMForm ) {
              m_curBookmark = UiUtil.getSelectedIndex(m_bookmarkList);
              if( m_curBookmark<0 ){
                continue;
              }
            }
            if( m_getAddBMForm ) {
              /* Loading add bookmark... */
              initializeLoadingFormRsc("text.l.bmrk",
                  m_bookmarkList);
            } else {
              /* Loading edit bookmark... */
              initializeLoadingFormRsc("text.edit",
                  m_bookmarkList);
            }
            //#ifdef DTEST
//@            System.gc();
//@            long beginMem = Runtime.getRuntime().freeMemory();
            //#endif
            BMForm bmForm = new BMForm(m_getAddBMForm);
            //#ifdef DTEST
//@            System.gc();
//@            System.out.println("BMForm size=" +
//@                (beginMem - Runtime.getRuntime().freeMemory()));
            //#endif
            if (m_getEditBMForm) {
              final RssItunesFeed bm = (RssItunesFeed)m_rssFeeds.get(
                  m_bookmarkList.getString(m_curBookmark));
              bmForm.updateBM(bm);
            }
            setCurrent( bmForm );
          } catch(OutOfMemoryError t) {
            System.gc();
            /* \nOut Of Memory Error loading bookmark form */
            recordExcFormFinRsc("exc.om.bmk", t);
          } catch(Throwable t) {
            /* \nInternal error loading bookmark form */
            recordExcFormFinRsc("exc.int.bmk", t);
          } finally {
            m_getAddBMForm = false;
            m_getEditBMForm = false;
          }
        }

                if( m_refreshAllFeeds || m_refreshUpdFeeds ) {
          /* Updating all or modified feeds... */
          initializeLoadingFormRsc((m_refreshUpdFeeds ?
                "text.um.feed" : "text.ua.feed"),
              m_bookmarkList);
          /* Updating all (modified) feeds...*/
          Gauge gauge = new Gauge(ResourceProviderME.get(
                m_refreshAllFeeds ? "text.ua.feed" :
                "text.um.feed"),
              false, m_rssFeeds.size(), 0);
          int pl = m_loadForm.append(gauge);
                    try{
            boolean errFound = false;
                        final int maxItemCount =
                m_appSettings.getMaximumItemCountInFeed();
            final boolean convHtml =
              !m_appSettings.getHtmlEnabled();
                        Enumeration keyEnum = m_rssFeeds.keys();
            int ic = 1;
                        while(keyEnum.hasMoreElements()) {
                            final String fname =
                (String)keyEnum.nextElement();
                            RssItunesFeed feed =
                (RssItunesFeed)m_rssFeeds.get(fname);
                            try{
                                m_loadForm.appendMsg(fname + "...");
                                RssFeedParser parser = new RssFeedParser( feed );
                                parser.parseRssFeed( m_refreshUpdFeeds,
                    convHtml, maxItemCount);
                m_rssFeeds.put( fname, feed );
                                m_loadForm.appendMsg("ok\n");
                            } catch(CauseMemoryException ex) {
                throw ex;
                            } catch(Exception ex) {
                recordExcForm("Error parsing feed " +
                    feed.getName(), ex);
                errFound = true;
                            }
              gauge.setValue(ic);
              ic++;
                        }
            if (errFound) {
              setLoadingFinished(
                  /* Finished with one or more exceptions */
                  /* or errors below. */
                  ResourceProviderME.get("text.fin.errb"),
                  /* Updating finished with one or more */
                  /* exceptions or errors above*/
                  ResourceProviderME.get("text.fin.erra"));
              setCurrent( m_loadForm );
            } else {
              setLoadingFinished("Updating finished",
                  "Updating finished use back to return.");
              setCurrent( m_bookmarkList );
            }
            pl = -1;
                    } catch(CauseMemoryException ex) {
            recordExcForm("Out Of Memory Error parsing feeds", ex);
            m_loadForm.appendMsg("Trying to free memory.");
            freeFeedItems();
            recordFin();
                    } catch(Exception ex) {
            recordExcFormFin("Error parsing feeds", ex);
                    } catch(OutOfMemoryError ex) {
            System.gc();
            recordExcForm("Out Of Memory Error parsing feeds", ex);
            m_loadForm.appendMsg("Trying to free memory.");
            freeFeedItems();
            recordFin();
                    } catch(Throwable t) {
            recordExcFormFin("Internal error parsing feeds", t);
          } finally {
            if (pl >= 0) {
              m_loadForm.delete(pl);
            }
            m_refreshAllFeeds = false;
            m_refreshUpdFeeds = false;
          }
                }

        // Go to import feed form
        if( m_getImportForm ) {
          try {
            /* Loading import form... */
            initializeLoadingFormRsc("text.l.imp",
                m_bookmarkList);
            //#ifdef DTEST
//@            System.gc();
//@            long beginMem = Runtime.getRuntime().freeMemory();
            //#endif
            ImportFeedsForm importFeedsForm;
            //#ifdef DTEST
//@            if (m_getTestImportForm) {
//@              RssItunesFeed bm = (RssItunesFeed)m_rssFeeds.get(
//@                  m_bookmarkList.getString(m_curBookmark));
//@              importFeedsForm = new ImportFeedsForm(this,
//@                  m_bookmarkList, m_rssFeeds, m_appSettings,
//@                  m_loadForm, bm.getUrl());
//@            } else
            //#endif
              importFeedsForm = new ImportFeedsForm(this,
                  m_bookmarkList, m_rssFeeds, m_appSettings,
                  m_loadForm, m_appSettings.getImportUrl());
            //#ifdef DTEST
//@            System.gc();
//@            System.out.println("ImportForm size=" + (beginMem - Runtime.getRuntime().freeMemory()));
            //#endif
            setCurrent( importFeedsForm );
                    } catch(Exception ex) {
            recordExcFormFin("Error loading import form\n", ex);
                    } catch(OutOfMemoryError ex) {
            System.gc();
            recordExcFormFin("Out Of Memory loading import form\n",
                                ex);
                    } catch(Throwable t) {
            recordExcFormFin("Internal loading import form\n", t);
          } finally {
            m_getImportForm = false;
            //#ifdef DTEST
//@            m_getTestImportForm = false;
            //#endif
          }
        }

        //#ifdef DTESTUI
//@        if ((m_bookmarkIndex < m_bookmarkList.size()) &&
//@            (m_bookmarkIndex >= 0)) {
//@          if (m_bookmarkList.getSelectedIndex() >= 0) {
//@            m_bookmarkList.setSelectedIndex(
//@                m_bookmarkList.getSelectedIndex(), false);
//@          }
//@          m_bookmarkList.setSelectedIndex(m_bookmarkIndex, true);
//@          commandAction(m_editBookmark, m_bookmarkList);
//@          m_bookmarkIndex++;
//@          if (m_bookmarkIndex >= m_bookmarkList.size()) {
//@            m_bookmarkIndex = -1;
//@            System.out.println("Test UI Test Rss feeds last");
//@          }
//@        }
//@
        //#endif

        //#ifdef DJSR75
//@        /* Find files in the file system to get for bookmark or
//@           import from. */
//@                if( m_getFile ) {
//@          if (m_fileRtnForm instanceof ImportFeedsForm) {
//@            /* Loading files to import from... */
//@            initializeLoadingFormRsc("text.l.f.imp",
//@                m_fileRtnForm);
//@          } else {
//@            /* Loading files to bookmark from... */
//@            initializeLoadingFormRsc("text.l.f.bk",
//@                m_fileRtnForm);
//@          }
//@
//@          try {
//@            final KFileSelectorMgr fileSelectorMgr =
//@              new KFileSelectorMgr();
//@            fileSelectorMgr.doLaunchSelector(this,
//@                  m_fileRtnForm, m_fileURL);
//@          } catch(OutOfMemoryError ex) {
//@            System.gc();
//@            /* Out Of Memory Error getting file form. */
//@            recordExcFormFinRsc("exc.om.flf", ex);
//@          } catch (Throwable t) {
//@            /* Internal error getting file form. */
//@            recordExcFormFinRsc("exc.int.flf", t);
//@          } finally {
//@            m_getFile = false;
//@          }
//@        }
        //#endif

        /* Handle going to link (platform request.). */
        //#ifdef DMIDP20
        if (m_platformReq) {
          try {

            /* Loading web page... */
            initializeLoadingFormRsc("text.l.wp", m_itemForm);
            if( super.platformRequest(m_platformURL) ) {
              initializeLoadingForm("Exiting saving data...",
                  m_itemRtnList);
              m_exit = true;
              exitApp();
            } else {
              setCurrent( m_itemRtnList );
            }
          } catch (ConnectionNotFoundException e) {
            //#ifdef DLOGGING
//@            logger.severe("Error opening link " + m_platformURL, e);
            //#endif
            final Alert badLink = new Alert("Could not connect to link",
                "Bad link:  " + m_platformURL,
                null, AlertType.ERROR);
            badLink.setTimeout(Alert.FOREVER);
            setCurrent( badLink, m_itemRtnList );
          } finally {
            m_platformReq = false;
          }
        }
        //#endif

        /* Sort the read or unread items. */
        if ( m_runNews ) {
          try {
            /* Sorting items... */
            initializeLoadingFormRsc("text.s.item",
                m_bookmarkList);
            AllNewsList unreadHeaderList = new AllNewsList(this,
              m_bookmarkList, m_rssFeeds,
                  m_appSettings.getMarkUnreadItems() ?
                  m_unreadImage : null,
                  m_appSettings.getMarkUnreadItems() ?
                  m_readImage : null);
            //#ifdef DTESTUI
//@            m_unreadHeaderTestList = unreadHeaderList;
            //#endif
            unreadHeaderList.initializeUnreadHhdrsList();
            unreadHeaderList.sortUnreadItems( true,
                m_bookmarkList, m_rssFeeds );
            setCurrent( unreadHeaderList );
                    }catch(OutOfMemoryError t) {
            System.gc();
            recordExcFormFin("\nOut Of Memory Error sorting items", t);
                    }catch(Throwable t) {
            recordExcFormFin("\nInternal error sorting items", t);
          } finally {
            m_runNews = false;
          }
        }

        if ( m_backFrHdr ) {
          m_backFrHdr = false;
          /* Updating feed... */
          initializeLoadingFormRsc("text.u.feed", m_bookmarkList);
          try {
            m_rssFeeds.put(m_curRssParser.getRssFeed());
          } catch (Throwable t) {
            recordExcFormFin("Internal error updating feed.", t);
          }
          setCurrent( m_bookmarkList );
        }

        if ( m_showItem ) {
          m_showItem = false;
          initializeLoadingFormRsc( "text.l.it", m_itemRtnList );
          RssItunesFeed feed = m_curRssParser.getRssFeed();
          citem.setUnreadItem(false);
          initializeItemForm( feed, citem, m_itemRtnList );
          //#ifdef DTESTUI
//@          m_itemNext = true;
          //#endif
View Full Code Here

//@            long beginStore = System.currentTimeMillis();
            //#endif
            //#ifdef DCOMPATIBILITY
//@            appendCompatBmk(i, name, bookmarks);
            //#else
            RssItunesFeed rss = null;
            /* This is where things are normally done when not */
            /* testing compatibility. */
            if (saveMemoryEnabled) {
              /* Get unencoded store string. */
              store = m_rssFeeds.getRoStoreStr( name );
              /* Get encoded store string. */
              RssStoreInfo rsi = RssItunesFeed.getStoreStringInfo(true,
                  true, store, false);
              //#ifdef DTEST
//@              encodeTime += rsi.getEncodeTime();
//@              splitTime += rsi.getSplitTime();
//@              joinTime += rsi.getJoinTime();
              //#endif
              store = rsi.getStoreString();
            } else {
              rss = (RssItunesFeed)m_rssFeeds.get( name );
            }
            if (saveMemoryEnabled) {
              bookmarks.append(store);
            } else {
              bookmarks.append(rss.getStoreString(saveHdr,
                    saveItems, true));
            }
            //#endif
            //#ifdef DTEST
//@            storeTime += System.currentTimeMillis() - beginStore;
            //#endif
            //#ifdef DCOMPATIBILITY1
//@            bookmarks.append(OLD_FEED_SEPARATOR);
            //#elifdef DCOMPATIBILITY2
//@            bookmarks.append(OLD_FEED_SEPARATOR);
            //#elifdef DCOMPATIBILITY3
//@            bookmarks.append(OLD_FEED_SEPARATOR);
            //#else
            bookmarks.append(CFEED_SEPARATOR);
            //#endif
            if (releaseMemory) {
              vstored.addElement( name );
            }
          }
        }
      } catch(OutOfMemoryError error) {
        /* Don't release memory so that we can re-try. */
        releaseMemory = false;
        bookmarks.setLength(0);
        System.gc();
        recordExcForm("Out of memory error saving feeds.", error);
        throw error;
       
      } finally {
        if (!saveMemoryEnabled && releaseMemory) {
          final int vslen = vstored.size();
          for (int ic = 0; ic < vslen; ic++) {
            final RssItunesFeed rss =
              (RssItunesFeed)m_rssFeeds.get(
             (String)vstored.elementAt( ic ));
            rss.setItems(new Vector(0));
          }
        }
      }
      //#ifdef DTEST
//@      System.out.println("storeTime=" + storeTime);
View Full Code Here

    }
   
    /** Fill RSS header list */
    final private void fillHeadersList() {
      UiUtil.delItems(this);
      RssItunesFeed feed = m_curRssParser.getRssFeed();
      super.setTitle( feed.getName() );
      final boolean markUnreadItems = m_appSettings.getMarkUnreadItems();
      final Vector vitems = feed.getItems();
      final int itemLen = vitems.size();
      for(int i=0; i < itemLen; i++){
        RssItunesItem r = (RssItunesItem)vitems.elementAt(i);
        String text = r.getTitle();
        if (text.length() == 0) {
View Full Code Here

      /** Open RSS feed's selected topic */
      if( c == m_openHeaderCmd || (c == List.SELECT_COMMAND &&
          m_display.getCurrent()==this)) {
        final int selIdx = UiUtil.getSelectedIndex(this);
        if( selIdx >= 0 ) {
          RssItunesFeed feed = m_curRssParser.getRssFeed();
          citem = (RssItunesItem)feed.getItems().elementAt(selIdx);
          final boolean markUnreadItems =
            m_appSettings.getMarkUnreadItems();
          if (markUnreadItems) {
            super.set(selIdx, super.getString(selIdx),
                  m_readImage );
View Full Code Here

      /* If name changed, need to remove the previous name. */
      if (!m_addForm && !m_editName.equals(name)) {
        m_rssFeeds.remove(m_editName);
      }
     
      final RssItunesFeed bm = new RssItunesFeed(name, url, username, password);
     
      if (m_addForm) {
        m_bookmarkList.insert(m_addBkmrk, bm.getName(), null);
      } else {
        m_bookmarkList.set(m_curBookmark, bm.getName(), null);
      }
      m_rssFeeds.put(bm.getName(), bm);
    }
View Full Code Here

TOP

Related Classes of com.substanceofcode.rssreader.businessentities.RssItunesFeed

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.