Package org.apache.roller.weblogger.business

Examples of org.apache.roller.weblogger.business.URLStrategy


                atomURL+"/"+website.getHandle()
                + "/resource/" + filePath + ".media-link";
        String editMediaURI =
                atomURL+"/"+ website.getHandle()
                + "/resource/" + filePath;
        URLStrategy urlStrategy = WebloggerFactory.getWeblogger().getUrlStrategy();
        String viewURI = urlStrategy.getWeblogResourceURL(website, filePath, true);
       
        FileTypeMap map = FileTypeMap.getDefaultFileTypeMap();
        // TODO: figure out why PNG is missing from Java MIME types
        if (map instanceof MimetypesFileTypeMap) {
            try {
View Full Code Here


        try {
            WeblogEntryManager wmgr =
                    WebloggerFactory.getWeblogger().getWeblogEntryManager();

            URLStrategy urlStrategy;
            urlStrategy = WebloggerFactory.getWeblogger().getUrlStrategy();

            List rawEntries;
            rawEntries = wmgr.getWeblogEntries(getActionWeblog(), null, null,
                    null, null, null, null, null, null, null, null, 0, -1);
View Full Code Here

        Hashtable struct = new Hashtable();
        struct.put("title", category.getPath());
        struct.put("description", category.getPath());
       
        Weblogger roller = WebloggerFactory.getWeblogger();
        URLStrategy strategy = roller.getUrlStrategy();
       
        String catUrl = strategy.getWeblogCollectionURL(category.getWebsite(),
            null, category.getPath(), null, null, 0, true);
        struct.put("htmlUrl", catUrl);
       
        String rssUrl = strategy.getWeblogFeedURL(category.getWebsite(),
               null, "entries", "rss", category.getPath(), null, null, false, true);
        struct.put("rssUrl",rssUrl);
       
        return struct;
    }
View Full Code Here

        String description = null;
        String contact = null;
        String searchFeed = null;
        String searchPage = null;
       
        URLStrategy strat = WebloggerFactory.getWeblogger().getUrlStrategy();
        Weblog weblog = null;
        try {
            weblog = WebloggerFactory.getWeblogger().getWeblogManager().getWeblogByHandle(handle);
        } catch (WebloggerException ex) {
            throw new ServletException("ERROR: fetching specified weblog");
        }
        searchPage = StringEscapeUtils.escapeXml(
                strat.getWeblogSearchPageURLTemplate(weblog));
        searchFeed = StringEscapeUtils.escapeXml(
                strat.getWeblogSearchFeedURLTemplate(weblog));

        boolean siteWide = WebloggerRuntimeConfig.isSiteWideWeblog(handle);
        if (siteWide) {
            shortName = "[Search Descriptor] " + StringEscapeUtils.escapeXml(
                    WebloggerRuntimeConfig.getProperty("site.shortName"));
View Full Code Here

                atomURL+"/"+website.getHandle()
                + "/resource/" + filePath + ".media-link";
        String editMediaURI =
                atomURL+"/"+ website.getHandle()
                + "/resource/" + filePath;
        URLStrategy urlStrategy = WebloggerFactory.getWeblogger().getUrlStrategy();
       
        String contentType = Utilities.getContentTypeFromFileName(file.getName());
       
        Entry entry = new Entry();
        entry.setId(editMediaURI);
View Full Code Here

            }
            pw.println("\n  ]\n}");
            response.flushBuffer();
           
        } else if ("xml".equals(format)) {
            URLStrategy urlstrat = roller.getUrlStrategy();
            response.setContentType("application/tagdata+xml; charset=utf-8");
            PrintWriter pw = response.getWriter();
            pw.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            pw.println("<categories fixed=\"no\" ");
            pw.println("   xmlns=\"http://www.w3.org/2007/app\"");
            pw.println("   xmlns:atom=\"http://www.w3.org/2005/Atom\"");
            pw.println("   xmlns:tagdata=\"http://roller.apache.org/ns/tagdata\">");
            int count = 0;
            for (Iterator it = tags.iterator(); it.hasNext();) {
                TagStat stat = (TagStat) it.next();
                String term = stat.getName();
                String viewURI = urlstrat.getWeblogCollectionURL(weblog,
                        null,  // locale
                        null,  // category
                        null,  // date string
                        Collections.singletonList(stat.getName()),
                        0,     // page
                        true); // absolute
                int frequency = stat.getCount();
                pw.print("<atom:category term=\"" + term + "\" tagdata:frequency=\"" + frequency + "\" ");
                pw.println("tagdata:href=\"" + viewURI + "\" />");
                if (count++ > MAX) break;
            }
            if (tags.size() > MAX) {
                // get next URI, if site-wide then don't specify weblog
                String nextURI = urlstrat.getWeblogTagsJsonURL(weblog, true, page + 1);
                pw.println("<atom:link rel=\"next\" href=\"" + nextURI + "\" />");
            }
            if (page > 0) {
                // get prev URI, if site-wide then don't specify weblog
                String prevURI = urlstrat.getWeblogTagsJsonURL(weblog, true, page - 1);
                pw.println("<atom:link rel=\"previous\" href=\"" + prevURI + "\" />");
            }
            pw.println("</categories>");
            response.flushBuffer();
        } else {
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.business.URLStrategy

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.