Package net.sf.jpluck.xml

Examples of net.sf.jpluck.xml.TextRecordResult


        TextRecord textRecord = new TextRecord(((redirectionURI != null) ? redirectionURI : uri),
                                               jxlDocument.getOutputEncoding(), jxlDocument.isUseHiresMargins());
        if (redirectionURI != null) {
            textRecord.setAlternateURI(uri);
        }
        TextRecordResult result = new TextRecordResult(textRecord, jxlDocument.getURIRewriter(),
                                                       jxlDocument.getTextColorBrightness(),
                                                       jxlDocument.isParseTables(), pluckerDocument);
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.transform(new DOMSource(node), result);

        pluckerDocument.addRecord(textRecord);

        String[] linkURIs = result.getLinkURIs();
        for (int i = 0; i < linkURIs.length; i++) {
            String linkURI = linkURIs[i];
            addPageLink(linkURI);
        }

        String[] imageURIs = result.getEmbeddedImageURIs();
        for (int i = 0; i < imageURIs.length; i++) {
            String imageURI = imageURIs[i];
            addImageLink(imageURI);
        }
       
        // Add bookmarks defined by the page.
        Bookmark[] bookmarks = result.getBookmarks();
        for (int i = 0; i < bookmarks.length; i++) {
      Bookmark bookmark = bookmarks[i];
      pluckerDocument.addBookmark(bookmark);
    }
       
    // Process AutoBookmarks
        BookmarkProcessor processor = jxlDocument.getBookmarkProcessor();
        String title = result.getTitle();
        processor.process(pluckerDocument, uri, title);
    }
View Full Code Here


        if (mimeType.equals("text/html")) {
      Resource resource = new Resource("http://127.0.0.1/", null, new ContentType(mimeType), data, 0, false);
      org.w3c.dom.Document dom = resource.parseHTML();
      TextRecord textRecord = new TextRecord("http://127.0.0.1/");
      Transformer transformer = TransformerFactory.newInstance().newTransformer();
      TextRecordResult result = new TextRecordResult(textRecord, new URIRewriter(), 100, false, document);
      transformer.transform(new DOMSource(dom), result);
      document.addRecord(textRecord);
        } else if (mimeType.startsWith("image/")) {
      BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
      CompositeBitmap compositeBitmap = CompositeBitmap.create(image, bpp);
View Full Code Here

      }

      Transformer transformer = TransformerFactory.newInstance().newTransformer();
      TextRecord textRecord = resource.createTextRecord(jxlDocument.getOutputEncoding(),
                                jxlDocument.isUseHiresMargins());
      TextRecordResult result = new TextRecordResult(textRecord, jxlDocument.getURIRewriter(),
                               settings.getTextColorBrightness(), settings.isParseTables(),
                               pluckerDocument);
      transformer.transform(new DOMSource(formatter.getIndexDocument()), result);
      pluckerDocument.addRecord(textRecord);
      if (settings.isUseLinkStructure() || settings.isUseListStructure()) {
        String[] pageURIs = result.getLinkURIs();
        for (int i = 0; i < pageURIs.length; i++) {
          addPageLink(pageURIs[i]);
        }
      }

      String[] imageURIs = result.getEmbeddedImageURIs();
      for (int i = 0; i < imageURIs.length; i++) {
        addImageLink(imageURIs[i]);
      }
      if (ClientConfiguration.getDefault().isUseFeedDate() && (feed.getItems().length > 0)) {
        Date date = feed.getItems()[0].getDateIssued();
View Full Code Here

TOP

Related Classes of net.sf.jpluck.xml.TextRecordResult

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.