com.day.cq.collab.blog
Interface BlogManager


public interface BlogManager

BlogManager is a central interface to manage blogs and blog entries. To retrieve a BlogManager, please use Adaptable.adaptTo(Class).


Field Summary
static String ATTR_BLOG
           
 
Method Summary
 Blog createBlog(String path, String title)
          Creates a Blog at path using the specified title and description.
 Page createPage(String path, String template, String resourceType, String title)
          Creates a new page.
 Page createPage(String parentPath, String name, String template, String resourceType, String title)
          Creates a new page.
 Blog getBlog(org.apache.sling.api.SlingHttpServletRequest req)
          Returns the Blog for the specified request.
 Blog getBlog(String path)
          Returns the Blog at the specified path, or null if no blog can be found.
 BlogEntry getBlogEntry(String path)
          Returns the BlogEntry at the specified path or null if no blog entry can be found.
 String getView(javax.servlet.http.HttpServletRequest req)
          Returns the selected view for the blog.
 String map(String url)
          Returns the full URL for the specified URL, including scheme, server name and port.
 void save()
          Saves all changes made.
 

Field Detail

ATTR_BLOG

static final String ATTR_BLOG
See Also:
Constant Field Values
Method Detail

getBlog

Blog getBlog(String path)
Returns the Blog at the specified path, or null if no blog can be found.

Parameters:
path - The blog path
Returns:
The blog

getBlog

Blog getBlog(org.apache.sling.api.SlingHttpServletRequest req)
Returns the Blog for the specified request. The corresponding resource will be retrieved from the request, and the blog will be instantiated only once per request.

Parameters:
req - The request
Returns:
The blog

createBlog

Blog createBlog(String path,
                String title)
                throws BlogException
Creates a Blog at path using the specified title and description.

Parameters:
path - The path of the blog
title - The title of the blog
Returns:
The blog
Throws:
BlogException - If the blog cannot be created

getBlogEntry

BlogEntry getBlogEntry(String path)
Returns the BlogEntry at the specified path or null if no blog entry can be found.

Parameters:
path - The blog entry path
Returns:
The blog entry

map

String map(String url)
Returns the full URL for the specified URL, including scheme, server name and port.

Parameters:
url - The URL
Returns:
The full URL
See Also:
ResourceResolver.map(String)

getView

String getView(javax.servlet.http.HttpServletRequest req)
Returns the selected view for the blog. The value can be one of:

Parameters:
req - The request
Returns:
The view

createPage

Page createPage(String path,
                String template,
                String resourceType,
                String title)
                throws BlogException
Creates a new page.

Parameters:
path - The path of the page
template - The template of the page
resourceType - The resource type of the page
title - The title of the page
Returns:
The page
Throws:
BlogException - If the page cannot be created

createPage

Page createPage(String parentPath,
                String name,
                String template,
                String resourceType,
                String title)
                throws BlogException
Creates a new page.

Parameters:
parentPath - The parent page of the page
name - The name of the page
template - The template of the page
resourceType - The resource type of the page
title - The title of the page
Returns:
The page
Throws:
BlogException - If the page cannot be created

save

void save()
          throws BlogException
Saves all changes made. In case the blog resource doesn't exist yet, it will be created.

Throws:
BlogException - if saving fails


Copyright © 2009 Day Management AG. All Rights Reserved.