Examples of Enclosure


Examples of com.sun.syndication.feed.rss.Enclosure

    protected List createEnclosures(List sEnclosures) {
        List enclosures = new ArrayList();
        for (int i=0;i<sEnclosures.size();i++) {
            SyndEnclosure sEnc = (SyndEnclosure) sEnclosures.get(i);
            Enclosure enc = new Enclosure();
            enc.setUrl(sEnc.getUrl());
            enc.setType(sEnc.getType());
            enc.setLength(sEnc.getLength());
            enclosures.add(enc);
        }
        return enclosures;
    }
View Full Code Here

Examples of com.sun.syndication.feed.rss.Enclosure

        if (eEnclosures.size()>0) {
            List enclosures = new ArrayList();
            for (int i=0;i<eEnclosures.size();i++) {
                e = (Element) eEnclosures.get(i);

                Enclosure enclosure = new Enclosure();
                String att = e.getAttributeValue("url");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
                if (att!=null) {
                    enclosure.setUrl(att);
                }
                att = e.getAttributeValue("length");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
                if (att!=null) {
                    enclosure.setLength(Integer.parseInt(att));
                }
                att = e.getAttributeValue("type");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
                if (att!=null) {
                    enclosure.setType(att);
                }
                enclosures.add(enclosure);
            }
            item.setEnclosures(enclosures);
        }
View Full Code Here

Examples of net.dromard.common.rss.feed.Enclosure

          item.setGuid(getElementValue(itemElmt, "guid"));
          item.setPublished(getElementValue(itemElmt, "pubDate"));
          item.setTitle(getElementValue(itemElmt, "title"));
          NodeList enclosureNode = itemElmt.getElementsByTagName(Enclosure.ENCLOSURE);
          if (enclosureNode.getLength() == 1) {
            Enclosure enclosure = new Enclosure();
            Element enclosureElmt = ((Element) enclosureNode.item(0));
            String length = enclosureElmt.getAttribute(Enclosure.LENGTH);
            if (length.length() > 0) {
              try {
                enclosure.setLength(Integer.parseInt(length));
              } catch (NumberFormatException e) {
              }
            }
            enclosure.setType(enclosureElmt.getAttribute(Enclosure.TYPE));
            enclosure.setUrl(enclosureElmt.getAttribute(Enclosure.URL));
            item.setEnclosure(enclosure);
          }
          channel.addItem(item);
        }
View Full Code Here

Examples of net.dromard.common.rss.feed.Enclosure

      if (fileChooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION) {
        List<Exception> errors = new ArrayList<Exception>();
        for (Item item: rss.getChannel().getItems()) {
          glassPane.getProgressBar().setString(glassPane.getProgressBar().getValue() + "/" + rss.getChannel().getItems().size());
          glassPane.getProgressBar().setValue(glassPane.getProgressBar().getValue() + 1);
          Enclosure enclosure = item.getEnclosure();
          if (enclosure != null && enclosure.getType().equalsIgnoreCase("image/jpeg")) {
            try {
              download(enclosure.getUrl(), fileChooser.getSelectedFile() + File.separator + item.getTitle());
            } catch(Exception e) {
              e.printStackTrace();
              errors.add(e);
            }
          }
View Full Code Here

Examples of org.apache.wicket.markup.html.internal.Enclosure

    final ComponentTag tag)
  {
    if ((tag instanceof WicketTag) && ((WicketTag)tag).isEnclosureTag())
    {
      // Yes, we handled the tag
      return new Enclosure(tag.getId() + container.getPage().getAutoIndex(),
        tag.getAttribute(EnclosureHandler.CHILD_ATTRIBUTE));
    }

    // We were not able to handle the tag
    return null;
View Full Code Here

Examples of org.apache.wicket.markup.html.internal.Enclosure

    final ComponentTag tag)
  {
    if ((tag instanceof WicketTag) && ((WicketTag)tag).isEnclosureTag())
    {
      // Yes, we handled the tag
      return new Enclosure(tag.getId() + container.getPage().getAutoIndex(),
        tag.getAttribute(EnclosureHandler.CHILD_ATTRIBUTE));
    }

    // We were not able to handle the tag
    return null;
View Full Code Here

Examples of org.apache.wicket.markup.html.internal.Enclosure

    final ComponentTag tag)
  {
    if ((tag instanceof WicketTag) && ((WicketTag)tag).isEnclosureTag())
    {
      // Yes, we handled the tag
      return new Enclosure(tag.getId() + container.getPage().getAutoIndex(),
        tag.getAttribute(EnclosureHandler.CHILD_ATTRIBUTE));
    }

    // We were not able to handle the tag
    return null;
View Full Code Here

Examples of org.apache.wicket.markup.html.internal.Enclosure

      final ComponentTag tag)
  {
    if ((tag instanceof WicketTag) && ((WicketTag)tag).isEnclosureTag())
    {
      String id = "enclosure-" + container.getPage().getAutoIndex();
      final Enclosure enclosure = new Enclosure(id, tag
          .getString(EnclosureHandler.CHILD_ATTRIBUTE));
      container.autoAdd(enclosure, markupStream);

      // Yes, we handled the tag
      return true;
View Full Code Here

Examples of org.apache.wicket.markup.html.internal.Enclosure

      {
        id = "enclosure-" + container.getPage().getAutoIndex();
      }

      CharSequence childId = tag.getString(EnclosureHandler.CHILD_ATTRIBUTE);
      Enclosure enclosure = new Enclosure(id, childId);

      container.autoAdd(enclosure, markupStream);

      return true;
    }
    else if (inlineEnclosureChildId != null)
    {
      Enclosure enclosure = new InlineEnclosure(tag.getId(), inlineEnclosureChildId);

      container.autoAdd(enclosure, markupStream);

      return true;
    }
View Full Code Here

Examples of org.apache.wicket.markup.html.internal.Enclosure

      }
      if (id == null)
      {
        id = "enclosure-" + container.getPage().getAutoIndex();
      }
      final Enclosure enclosure = new Enclosure(id, tag.getString(
        EnclosureHandler.CHILD_ATTRIBUTE).toString());
      container.autoAdd(enclosure, markupStream);

      // Yes, we handled the tag
      return true;
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.