Package cz.podcastee.domain.entities

Examples of cz.podcastee.domain.entities.Podcast


                podcastID = Long.parseLong(request.getParameter("podcastId"));
            } catch (NumberFormatException ex) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                throw ex;
            }
            Podcast podcast = null;
            try {
                podcast = podcastManager.getPodcastByID(podcastID, true);
            } catch (Throwable ex) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }

            if (podcast == null) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                out.close();
                return;
            }
            out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            out.println("<rss  version=\"2.0\">");
            out.println("<channel>");
            out.println("<title>" + podcast.getTitle() + "</title>");
            out.println("<description>" + podcast.getDescription() + "</description>");
            out.println("<link>www.podcastee.cz</link>"); // TODO tady nevim co sem presne patri asi nic dulezityho
            out.println("<language>en-us</language>");
            out.println("<copyright>Copyright 2010</copyright>");

            //for()
            out.println("<lastBuildDate>Sat, 25 Mar 2010 11:30:00 -0500</lastBuildDate>");
            out.println("<pubDate>" + podcast.getDateOfCreation() + "</pubDate>");

            out.println("<docs>http://blogs.law.harvard.edu/tech/rss</docs>");
            out.println("<webMaster>rob@podcast411.com</webMaster>");

            for (Episode episode : podcast.getEpisodes()) {
                File episodeFile = new File(podcastsPath + "/" + episode.getFileName());
                if (!episodeFile.exists()) {
                    continue;
                }
View Full Code Here


        podcastDao.persist(podcast);
        return podcast;
    }

    public Podcast savePodcast(String title, String desc, Channel channel) {
        Podcast podcast = new Podcast();
        podcast.setTitle(title);
        podcast.setDescription(desc);
        podcast.setChannel(channel);
        podcastDao.persist(podcast);
        return podcast;
    }
View Full Code Here

            genres.add(new SelectItem(e.name(), e.toString()));
        }
    }

    public String createPodcast() {
        Podcast podcast = new Podcast();

        podcast.setTitle(this.title);
        podcast.setSubtitle(this.subtitle);
        podcast.setDescription(this.desc);
        podcast.setDateOfCreation(new Date());
        podcast.setGenre(GenreEnum.valueOf(selectedGenre));

        Channel ch = null;
        if (selectedChannel != -1) {
            ch = podcastManager.getChannelByID(selectedChannel);
        }
        podcast.setChannel(ch);

        podcastManager.savePodcast(podcast);

        return "success";
    }
View Full Code Here

    public boolean isFavorite() {
        if (favorites == null || !loginBean.isLoggedIn()) {
            return false;
        }
        Podcast p = (Podcast) podcastsTable.getRowData();
        return favorites.contains(p);
    }
View Full Code Here

    public String toggleFavorite() {
        if (favorites == null || !loginBean.isLoggedIn() || u == null) {
            return null;
        }
        Podcast p = (Podcast) podcastsTable.getRowData();
        if(u.getFavoritePodcasts().contains(p)) {
            accountManager.deleteFavorite(p, u);
        } else {
            accountManager.addFavorite(p, u);
        }
View Full Code Here

TOP

Related Classes of cz.podcastee.domain.entities.Podcast

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.