Package de.nava.informa.core

Examples of de.nava.informa.core.ImageIF


    if (image != null) {

      ParserUtils.matchCaseOfChildren(image, new String[] { "title", "url",
          "link", "width", "height", "description" });

      ImageIF rssImage = cBuilder.createImage(image.getChildTextTrim("title",
          defNS), ParserUtils.getURL(image.getChildTextTrim("url", defNS)),
          ParserUtils.getURL(image.getChildTextTrim("link", defNS)));
      Element imgWidth = image.getChild("width", defNS);
      if (imgWidth != null) {
        try {
          rssImage.setWidth(Integer.parseInt(imgWidth.getTextTrim()));
        } catch (NumberFormatException e) {
          logger.warn("Error parsing width: " + e.getMessage());
        }
      }
      Element imgHeight = image.getChild("height", defNS);
      if (imgHeight != null) {
        try {
          rssImage.setHeight(Integer.parseInt(imgHeight.getTextTrim()));
        } catch (NumberFormatException e) {
          logger.warn("Error parsing height: " + e.getMessage());
        }
      }
      Element imgDescr = image.getChild("description", defNS);
      if (imgDescr != null) {
        rssImage.setDescription(imgDescr.getTextTrim());
      }
      chnl.setImage(rssImage);
    }

    // 0..1 textinput element
View Full Code Here


    if (image != null) {

      ParserUtils.matchCaseOfChildren(image, new String[] {
        "title", "url", "link", "width", "height", "description" });

      ImageIF rssImage =
        cBuilder.createImage(
          image.getChildTextTrim("title"),
          ParserUtils.getURL(image.getChildTextTrim("url")),
          ParserUtils.getURL(image.getChildTextTrim("link")));
      Element imgWidth = image.getChild("width");
      if (imgWidth != null) {
        try {
          rssImage.setWidth(Integer.parseInt(imgWidth.getTextTrim()));
        } catch (NumberFormatException e) {
          logger.warn(e);
        }
      }
      Element imgHeight = image.getChild("height");
      if (imgHeight != null) {
        try {
          rssImage.setHeight(Integer.parseInt(imgHeight.getTextTrim()));
        } catch (NumberFormatException e) {
          logger.warn(e);
        }
      }
      Element imgDescr = image.getChild("description");
      if (imgDescr != null) {
        rssImage.setDescription(imgDescr.getTextTrim());
      }
      chnl.setImage(rssImage);
    }

    // 0..1 textinput element
View Full Code Here

    if (image != null) {

      ParserUtils.matchCaseOfChildren(image, new String[] { "title", "url",
          "link", "width", "height", "description" });

      ImageIF rssImage = cBuilder.createImage(image.getChildTextTrim("title",
          defNS), ParserUtils.getURL(image.getChildTextTrim("url", defNS)),
          ParserUtils.getURL(image.getChildTextTrim("link", defNS)));
      Element imgWidth = image.getChild("width", defNS);
      if (imgWidth != null) {
        try {
          rssImage.setWidth(Integer.parseInt(imgWidth.getTextTrim()));
        } catch (NumberFormatException e) {
          logger.warn(e);
        }
      }
      Element imgHeight = image.getChild("height", defNS);
      if (imgHeight != null) {
        try {
          rssImage.setHeight(Integer.parseInt(imgHeight.getTextTrim()));
        } catch (NumberFormatException e) {
          logger.warn(e);
        }
      }
      Element imgDescr = image.getChild("description", defNS);
      if (imgDescr != null) {
        rssImage.setDescription(imgDescr.getTextTrim());
      }
      chnl.setImage(rssImage);
    }

    // textinput element
View Full Code Here

    */
   public boolean equals(Object o) {
      if (this == o) return true;
      if (!(o instanceof ImageIF)) return false;

      final ImageIF image = (ImageIF) o;

      if (location != null ? !location.equals(image.getLocation()) : image.getLocation() != null) return false;

      return true;
   }
View Full Code Here

     
 
  public ImageIF createImage(String title, URL location, URL link) {
    Query query = session.createQuery("from Image as img where img.locationString = ? ");
    query.setString(0, location.toString());
    ImageIF obj = (Image) query.uniqueResult();
    if (obj == null) {
      obj = new Image(title, location, link);
      session.save(obj);
    }
    return obj;
View Full Code Here

TOP

Related Classes of de.nava.informa.core.ImageIF

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.