Package info.bliki.api

Examples of info.bliki.api.Page


        String[] listOfTitleStrings = { fullPageName };
        fUser.login();
        List<Page> listOfPages = fUser.queryContent(listOfTitleStrings);
        if (listOfPages.size() > 0) {
          Page page = listOfPages.get(0);
          content = page.getCurrentContent();
          if (content != null) {
            // System.out.println(name);
            // System.out.println(content);
            // System.out.println("-----------------------");
            topicData = new TopicData(fullPageName, content);
View Full Code Here


        listOfPages = fUser.queryImageinfo(listOfTitleStrings, imageFormat.getWidth());
      } else {
        listOfPages = fUser.queryImageinfo(listOfTitleStrings);
      }
      if (listOfPages.size() > 0) {
        Page page = listOfPages.get(0);
        imageData = new ImageData(imageName);

        // download the image to fImageDirectoryName directory
        FileOutputStream os = null;
        try {
          String imageUrl;
          if (imageFormat.getWidth() > 0) {
            imageUrl = page.getImageThumbUrl();
          } else {
            imageUrl = page.getImageUrl();
          }

          String urlImageName = Encoder.encodeTitleLocalUrl(page.getTitle());
          if (imageUrl != null) {
            int index = imageUrl.lastIndexOf('/');
            if (index > 0) {
              urlImageName = Encoder.encodeTitleLocalUrl(imageUrl.substring(index + 1));
            }
          }
          if (fImageDirectoryName != null) {
            String filename = fImageDirectoryName + urlImageName;
            File file = new File(filename);
            if (!file.exists()) {
              // if the file doesn't exist try to download from Wikipedia
              os = new FileOutputStream(filename);
              page.downloadImageUrl(os, imageUrl);
            }
            imageData.setUrl(imageUrl);
            imageData.setFilename(filename);
            fWikiDB.insertImage(imageData);
            super.appendInternalImageLink(hrefImageLink, "file:///" + filename, imageFormat);
View Full Code Here

      String content = contentCache.get(contentKey);
      if (content == null) {
        final String[] pageTitles = new String[] { contentKey };
        final List<Page> pages = user.queryContent(pageTitles);
        if (!pages.isEmpty()) {
          final Page page = pages.get(0);
          content = page.getCurrentContent();
          if (content != null) {
            if (content.length() <= 0) {
              content = null;
            }
          }
View Full Code Here

        }
        String[] listOfTitleStrings = { fullPageName };
        fUser.login();
        List<Page> listOfPages = fUser.queryContent(listOfTitleStrings);
        if (listOfPages.size() > 0) {
          Page page = listOfPages.get(0);
          content = page.getCurrentContent();
          if (content != null) {
            // System.out.println(name);
            // System.out.println(content);
            // System.out.println("-----------------------");
            topicData = new TopicData(fullPageName, content);
View Full Code Here

        listOfPages = fUser.queryImageinfo(listOfTitleStrings, imageFormat.getWidth());
      } else {
        listOfPages = fUser.queryImageinfo(listOfTitleStrings);
      }
      if (listOfPages.size() > 0) {
        Page page = listOfPages.get(0);
        imageData = new ImageData(imageName);

        // download the image to fImageDirectoryName directory
        FileOutputStream os = null;
        try {
          String imageUrl;
          if (imageFormat.getWidth() > 0) {
            imageUrl = page.getImageThumbUrl();
          } else {
            imageUrl = page.getImageUrl();
          }

          String urlImageName = Encoder.encodeTitleLocalUrl(page.getTitle());
          if (imageUrl != null) {
            int index = imageUrl.lastIndexOf('/');
            if (index > 0) {
              urlImageName = Encoder.encodeTitleLocalUrl(imageUrl.substring(index + 1));
            }
          }
          if (fImageDirectoryName != null) {
            String filename = fImageDirectoryName + urlImageName;
            File file = new File(filename);
            if (!file.exists()) {
              // if the file doesn't exist try to download from Wikipedia
              os = new FileOutputStream(filename);
              page.downloadImageUrl(os, imageUrl);
            }
            imageData.setUrl(imageUrl);
            imageData.setFilename(filename);
            fWikiDB.insertImage(imageData);
            super.appendInternalImageLink(hrefImageLink, "file:///" + filename, imageFormat);
View Full Code Here

            String content = contentCache.get(contentKey);
            if (content == null) {
                final String[] pageTitles = new String[] { contentKey };
                final List<Page> pages = user.queryContent(pageTitles);
                if (!pages.isEmpty()) {
                    final Page page = pages.get(0);
                    content = page.getCurrentContent();
                    if (content != null) {
                        if (content.length() <= 0) {
                            content = null;
                        }
                    }
View Full Code Here

                }
                String[] listOfTitleStrings = { fullPageName };
                fUser.login();
                List<Page> listOfPages = fUser.queryContent(listOfTitleStrings);
                if (listOfPages.size() > 0) {
                    Page page = listOfPages.get(0);
                    content = page.getCurrentContent();
                    if (content != null) {
                        // System.out.println(name);
                        // System.out.println(content);
                        // System.out.println("-----------------------");
                        topicData = new TopicData(fullPageName, content);
View Full Code Here

                listOfPages = fUser.queryImageinfo(listOfTitleStrings, imageFormat.getWidth());
            } else {
                listOfPages = fUser.queryImageinfo(listOfTitleStrings);
            }
            if (listOfPages.size() > 0) {
                Page page = listOfPages.get(0);
                imageData = new ImageData(imageName);

                // download the image to fImageDirectoryName directory
                String imageUrl;
                if (imageFormat.getWidth() > 0) {
                    imageUrl = page.getImageThumbUrl();
                } else {
                    imageUrl = page.getImageUrl();
                }

                String urlImageName = Encoder.encodeTitleLocalUrl(page.getTitle());
                if (imageUrl != null) {
                    int index = imageUrl.lastIndexOf('/');
                    if (index > 0) {
                        urlImageName = Encoder.encodeTitleLocalUrl(imageUrl.substring(index + 1));
                    }
                }
                if (fImageDirectoryName != null) {
                    String filename = fImageDirectoryName + urlImageName;
                    File file = new File(filename);
                    if (!file.exists()) {
                        // if the file doesn't exist try to download from Wikipedia

                        try (OutputStream os = new FileOutputStream(filename)) {
                            page.downloadImageUrl(os, imageUrl);
                        } catch (IOException e) {
                            logger.warn(null, e);
                        }
                    }
                    imageData.setUrl(imageUrl);
View Full Code Here

TOP

Related Classes of info.bliki.api.Page

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.