com.atlassian.confluence.content.service.blogpost
Class CreateBlogPostCommandImpl

java.lang.Object
  extended by com.atlassian.confluence.core.service.AbstractServiceCommand
      extended by com.atlassian.confluence.content.service.page.CreateAbstractPageCommandImpl
          extended by com.atlassian.confluence.content.service.blogpost.CreateBlogPostCommandImpl
All Implemented Interfaces:
CreateBlogPostCommand, ServiceCommand

public class CreateBlogPostCommandImpl
extends CreateAbstractPageCommandImpl
implements CreateBlogPostCommand

An implementation of the CreatePageCommand that will create a page, and assign any provided permissions then perform the clean up of any Drafts and raise the necessary event.


Field Summary
protected  SpacePermissionManager spacePermissionManager
           
 
Fields inherited from class com.atlassian.confluence.content.service.page.CreateAbstractPageCommandImpl
attachmentManager, contentPermissionManager, contentPropertyManager, contextProvider, createdContent, draft, draftManager, draftService, eventPublisher, notificationManager, notifySelf, pageManager, permissionProvider, user
 
Constructor Summary
CreateBlogPostCommandImpl(PageManager pageManager, SpacePermissionManager spacePermissionManager, ContentPermissionManager contentPermissionManager, DraftManager draftManager, DraftService draftService, AttachmentManager attachmentManager, NotificationManager notificationManager, com.atlassian.event.api.EventPublisher eventPublisher, BlogPostProvider blogPostProvider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, Draft draft, com.atlassian.user.User user, boolean notifySelf, ContentPropertyManager contentPropertyManager)
           
 
Method Summary
protected  AbstractPage getContent()
           
 BlogPost getCreatedBlogPost()
           
protected  Created getCreateEvent()
           
protected  boolean isAuthorizedInternal()
          Template method for implementations to perform authorization.
protected  void validateInternal(ServiceCommandValidator validator)
          Ensure that a page has been provided and that its title will not be a duplicate in the target space.
 
Methods inherited from class com.atlassian.confluence.content.service.page.CreateAbstractPageCommandImpl
executeInternal, getCreatedContent
 
Methods inherited from class com.atlassian.confluence.core.service.AbstractServiceCommand
execute, getCurrentUser, getValidationErrors, isAuthorized, isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.core.service.ServiceCommand
execute, getValidationErrors, isAuthorized, isValid
 

Field Detail

spacePermissionManager

protected SpacePermissionManager spacePermissionManager
Constructor Detail

CreateBlogPostCommandImpl

public CreateBlogPostCommandImpl(PageManager pageManager,
                                 SpacePermissionManager spacePermissionManager,
                                 ContentPermissionManager contentPermissionManager,
                                 DraftManager draftManager,
                                 DraftService draftService,
                                 AttachmentManager attachmentManager,
                                 NotificationManager notificationManager,
                                 com.atlassian.event.api.EventPublisher eventPublisher,
                                 BlogPostProvider blogPostProvider,
                                 ContentPermissionProvider permissionProvider,
                                 CreateContextProvider contextProvider,
                                 Draft draft,
                                 com.atlassian.user.User user,
                                 boolean notifySelf,
                                 ContentPropertyManager contentPropertyManager)
Method Detail

validateInternal

protected void validateInternal(ServiceCommandValidator validator)
Ensure that a page has been provided and that its title will not be a duplicate in the target space.

Overrides:
validateInternal in class CreateAbstractPageCommandImpl

isAuthorizedInternal

protected boolean isAuthorizedInternal()
Description copied from class: AbstractServiceCommand
Template method for implementations to perform authorization.

Specified by:
isAuthorizedInternal in class AbstractServiceCommand
Returns:
true if the current user is authorized to perform this command, false otherwise

getContent

protected AbstractPage getContent()
Specified by:
getContent in class CreateAbstractPageCommandImpl
Returns:
the content to be created.

getCreateEvent

protected Created getCreateEvent()
Specified by:
getCreateEvent in class CreateAbstractPageCommandImpl
Returns:
the event to be published on successful creation

getCreatedBlogPost

public BlogPost getCreatedBlogPost()
Specified by:
getCreatedBlogPost in interface CreateBlogPostCommand
Returns:
the BlogPost that was created if the command has executed already. Null if the command has not yet executed.


Copyright © 2003-2014 Atlassian. All Rights Reserved.