Package org.b3log.solo.model.sitemap

Examples of org.b3log.solo.model.sitemap.URL


        for (int i = 0; i < articles.length(); i++) {
            final JSONObject article = articles.getJSONObject(i);
            final String permalink = article.getString(Article.ARTICLE_PERMALINK);

            final URL url = new URL();

            url.setLoc(Latkes.getServePath() + permalink);

            final Date updateDate = (Date) article.get(Article.ARTICLE_UPDATE_DATE);
            final String lastMod = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(updateDate);

            url.setLastMod(lastMod);

            sitemap.addURL(url);
        }
    }
View Full Code Here


        for (int i = 0; i < pages.length(); i++) {
            final JSONObject page = pages.getJSONObject(i);
            final String permalink = page.getString(Page.PAGE_PERMALINK);

            final URL url = new URL();

            // The navigation maybe a page or a link
            // Just filters for user mistakes tolerance
            if (!permalink.contains("://")) {
                url.setLoc(Latkes.getServePath() + permalink);
            } else {
                url.setLoc(permalink);
            }

            sitemap.addURL(url);
        }
    }
View Full Code Here

        for (int i = 0; i < tags.length(); i++) {
            final JSONObject tag = tags.getJSONObject(i);
            final String link = URLEncoder.encode(tag.getString(Tag.TAG_TITLE), "UTF-8");

            final URL url = new URL();

            url.setLoc(Latkes.getServePath() + "/tags/" + link);

            sitemap.addURL(url);
        }

        // Tags wall
        final URL url = new URL();

        url.setLoc(Latkes.getServePath() + "/tags.html");
        sitemap.addURL(url);
    }
View Full Code Here

        for (int i = 0; i < archiveDates.length(); i++) {
            final JSONObject archiveDate = archiveDates.getJSONObject(i);
            final long time = archiveDate.getLong(ArchiveDate.ARCHIVE_TIME);
            final String dateString = DateFormatUtils.format(time, "yyyy/MM");

            final URL url = new URL();

            url.setLoc(Latkes.getServePath() + "/archives/" + dateString);

            sitemap.addURL(url);
        }
    }
View Full Code Here

        final JSONArray articles = articleResult.getJSONArray(Keys.RESULTS);
        for (int i = 0; i < articles.length(); i++) {
            final JSONObject article = articles.getJSONObject(i);
            final String permalink = article.getString(Article.ARTICLE_PERMALINK);

            final URL url = new URL();
            url.setLoc("http://" + host + permalink);

            final Date updateDate = (Date) article.get(Article.ARTICLE_UPDATE_DATE);
            final String lastMod = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(updateDate);
            url.setLastMod(lastMod);

            sitemap.addURL(url);
        }
    }
View Full Code Here

        final JSONArray pages = result.getJSONArray(Keys.RESULTS);
        for (int i = 0; i < pages.length(); i++) {
            final JSONObject page = pages.getJSONObject(i);
            final String permalink = page.getString(Page.PAGE_PERMALINK);

            final URL url = new URL();
            url.setLoc("http://" + host + permalink);

            sitemap.addURL(url);
        }
    }
View Full Code Here

        final JSONArray tags = result.getJSONArray(Keys.RESULTS);
        for (int i = 0; i < tags.length(); i++) {
            final JSONObject tag = tags.getJSONObject(i);
            final String link = URLEncoder.encode(tag.getString(Tag.TAG_TITLE), "UTF-8");

            final URL url = new URL();
            url.setLoc("http://" + host + "/tags/" + link);

            sitemap.addURL(url);
        }

        // Tags wall
        final URL url = new URL();
        url.setLoc("http://" + host + "/tags.html");
        sitemap.addURL(url);
    }
View Full Code Here

        for (int i = 0; i < archiveDates.length(); i++) {
            final JSONObject archiveDate = archiveDates.getJSONObject(i);
            final long time = archiveDate.getLong(ArchiveDate.ARCHIVE_TIME);
            final String dateString = ArchiveDate.DATE_FORMAT.format(time);

            final URL url = new URL();
            url.setLoc("http://" + host + "/archives/" + dateString);

            sitemap.addURL(url);
        }
    }
View Full Code Here

TOP

Related Classes of org.b3log.solo.model.sitemap.URL

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.