Package com.substanceofcode.rssreader.businessentities

Examples of com.substanceofcode.rssreader.businessentities.RssItunesFeed


            bms = bms.substring(pos+1);
            if(part.length()>0) {
              RssStoreInfo rsi = null;
              //#ifdef DCOMPATIBILITY1
              RssFeed bm1 = new CompatibilityRssFeed1( part );
              RssItunesFeed bm = new RssItunesFeed( bm1 );
              //#elifdef DCOMPATIBILITY2
              RssFeed bm2 = new CompatibilityRssFeed2( part );
              RssItunesFeed bm = new RssItunesFeed( bm2 );
              //#elifdef DCOMPATIBILITY3
              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

  /* Append compatibility store to allow testing from previous stores. */
  final private void appendCompatBmk(final int i, final String name,
      StringBuffer bookmarks)
  throws Exception {
    //#ifdef DCOMPATIBILITY1
    final RssItunesFeed rss =
      (RssItunesFeed)m_rssFeeds.get( name );
    CompatibilityRssFeed1 rss1 = new CompatibilityRssFeed1(rss);
    //#ifdef DTEST
    String prevStore = rss1.getStoreString( true );
    RssItunesFeed nrss = RssItunesFeed.deserialize( true, prevStore );
    if (!rss1.equals(nrss)) {
      //#ifdef DLOGGING
      logger.severe("itunes store stings not backwards compatible i=" + i);
      //#endif
    }
    long beginStore = System.currentTimeMillis();
    //#endif
    bookmarks.append(rss1.getStoreString(true));
    //#elifdef DCOMPATIBILITY2
    final RssItunesFeed rss =
      (RssItunesFeed)m_rssFeeds.get( name );
    CompatibilityRssFeed2 rss2 = new CompatibilityRssFeed2(rss);
    final String prevStore = rss2.getStoreString(true);
    bookmarks.append(prevStore);
    //#ifdef DTEST
    RssItunesFeed nrss = new RssItunesFeed(new RssFeed(
              false, true, prevStore ));
    if (!rss2.equals(nrss)) {
      //#ifdef DLOGGING
      logger.severe("itunes store stings not backwards compatible i=" + i);
      //#endif
    }
    long beginStore = System.currentTimeMillis();
    //#endif
    //#elifdef DCOMPATIBILITY3
    final RssItunesFeed rss =
      (RssItunesFeed)m_rssFeeds.get( name );
    CompatibilityRssItunesFeed3 rss3 =
      new CompatibilityRssItunesFeed3(rss);
    final String prevStore = rss3.getStoreString(
        true, true);
    bookmarks.append(prevStore);
    //#ifdef DTEST
    RssItunesFeed nrss = new RssItunesFeed(new RssFeed(
              false, true, prevStore ));
    if (!rss3.equals(nrss)) {
      //#ifdef DLOGGING
      logger.severe("itunes store stings not backwards compatible i=" + i);
      //#endif
View Full Code Here

                null,
                //#endif
                sitems );
          }
        } else {
          final RssItunesFeed feed =
            (RssItunesFeed)rssFeeds.getRo(fname);
          final Vector vitems = feed.getItems();
          final int ilen = vitems.size();
          if (ilen > 0) {
            RssItunesItem[] ritems = new RssItunesItem[ilen];
            vitems.copyInto(ritems);
            /**
             * Show currently selected RSS feed
             * headers without updating them
             */
            fillVectors( ilen, fname,
                //#ifdef DITUNES
                feed.getDate(),
                //#endif
                ritems );
          }
        }
      }
View Full Code Here

      System.out.println("Adding: " + name);
      //#endif
      // If no title (name) and we are getting the title from the
      // feed being imported, parse the name(title) only.
      if (((name == null) || (name.length() == 0)) && m_getFeedTitleList) {
        RssItunesFeed feed = feeds[feedIndex];
        RssFeedParser fparser = new RssFeedParser( feed );
        /* Loading title for */
        m_loadForm.appendMsg(ResourceProviderME.get("text.ld.t",
              feed.getUrl()));
        //#ifdef DLOGGING
        if (m_finestLoggable) {m_logger.finest("Getting title for url=" + feed.getUrl());}
        //#endif
        fparser.setGetTitleOnly(true);
        /** Get RSS feed */
        int maxItemCount = m_appSettings.getMaximumItemCountInFeed();
        try {
          fparser.parseRssFeed( false, true, maxItemCount );
          name = feed.getName();
          m_loadForm.appendMsg("ok\n");
        } catch(Exception ex) {
          m_midlet.recordExcForm("Error loading title for feed " +
              feed.getUrl(), ex);
          notesShown = true;
        }
      }
      if((name != null) && (name.length()>0)) {
        final boolean pres = m_rssFeeds.containsKey( name );
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

    }
   
    //#ifdef DTEST
    /** Test that the feed is not ruined by being stored and restored. */
    final private void testFeed(final boolean encoded) {
      RssItunesFeed feed = m_curRssParser.getRssFeed();
      String store = feed.getStoreString(true, true, encoded);
      boolean feedEq;
      RssItunesFeed feed2;
      try {
        feed2 = RssItunesFeed.deserialize( encoded, store );
        feedEq = feed.equals(feed2);
      } catch (Throwable t) {
        recordExcForm("Error while deserialize feed.", t);
View Full Code Here

    //#endif

    //#ifdef DTEST
    /** Test that the feed is not ruined by being stored and transformed. */
    final private void testFeed2(final boolean encoded) {
      RssItunesFeed feed = m_curRssParser.getRssFeed();
      String store1 = feed.getStoreString(true, true, encoded);
      String store2 = feed.getStoreString(true, true, !encoded);
      String name1 = feed.getName();
      boolean feedEq;
      boolean feedEq2;
      String store2b = "";
      String name2 = "";
      try {
        RssStoreInfo ri = RssItunesFeed.getStoreStringInfo( true,
            !encoded, store1, encoded );
        store2b = ri.getStoreString();
        name2 = ri.getName();
        feedEq = store2.equals(store2b);
        feedEq2 = name1.equals(name2);
      } catch (Throwable t) {
        recordExcForm("Error while deserialize feed.", t);
        feedEq = false;
        feedEq2 = false;
      }
      //#ifdef DLOGGING
      if (finestLoggable) {logger.finest("feed1,2 encoded,eq,2=" + encoded + "," + feedEq + "," + feedEq2);}
      //#endif
      if (!feedEq || !feedEq2) {
        //#ifdef DLOGGING
        logger.severe("Itunes feed does not match name=" + feed.getName());
        //#endif
        System.out.println("store2=\n" + store2);
        System.out.println("store2b=\n" + store2b);
        System.out.println("name1=" + name1);
        System.out.println("name2=" + name2);
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

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.