test.plugin.apiavailable
Class DummyCommentExtensionSupport

java.lang.Object
  extended by test.plugin.apiavailable.DummyCommentExtensionSupport
All Implemented Interfaces:
CommentExtensionsSupport

public class DummyCommentExtensionSupport
extends Object
implements CommentExtensionsSupport

Used by the ContentConvertibleRestAcceptanceTest


Field Summary
static String EXTENSION_KEY_1
           
 
Fields inherited from interface com.atlassian.confluence.content.apisupport.CommentExtensionsSupport
NULL_OBJECT
 
Constructor Summary
DummyCommentExtensionSupport()
           
 
Method Summary
 Iterable<ContentType> getCommentContainerType()
          Get the comment container ContentType that we provide support for.
 Map<String,com.atlassian.fugue.Option<String>> getExpansions()
          Get the map of expandable extension properties provided by this CommentExtensionSupport
 Map<ContentId,Map<String,Object>> getExtensions(Iterable<Comment> comments, Expansions expansions)
          Get the map of extension properties for each of the comment entities
 void updateExtensionsOnEntity(Comment comment, Map<String,Object> extensions)
          A creation hook, extension properties should be set on the passed in comment object.
 ValidationResult validateExtensionsForCreate(Map<String,Object> extensions, SimpleValidationResult.Builder validationResultBuilder)
          Validation hook for create operations.
 ValidationResult validateExtensionsForUpdate(Comment comment, Map<String,Object> extensions, SimpleValidationResult.Builder validationResultBuilder)
          Validation hook for update operations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTENSION_KEY_1

public static final String EXTENSION_KEY_1
See Also:
Constant Field Values
Constructor Detail

DummyCommentExtensionSupport

public DummyCommentExtensionSupport()
Method Detail

getCommentContainerType

public Iterable<ContentType> getCommentContainerType()
Description copied from interface: CommentExtensionsSupport
Get the comment container ContentType that we provide support for. This is needed so that we can provide different handling for inline comments when they are on Files compared to Pages and Blogs

Specified by:
getCommentContainerType in interface CommentExtensionsSupport
Returns:
a set of ContentTypes

getExtensions

public Map<ContentId,Map<String,Object>> getExtensions(Iterable<Comment> comments,
                                                       Expansions expansions)
Description copied from interface: CommentExtensionsSupport
Get the map of extension properties for each of the comment entities

Specified by:
getExtensions in interface CommentExtensionsSupport
Parameters:
comments - the comments to get the additional extension properties for
expansions - the expansions that have been requested
Returns:

getExpansions

public Map<String,com.atlassian.fugue.Option<String>> getExpansions()
Description copied from interface: CommentExtensionsSupport
Get the map of expandable extension properties provided by this CommentExtensionSupport

Specified by:
getExpansions in interface CommentExtensionsSupport
Returns:
a map of expandable extension properties to an optional url for that property

validateExtensionsForCreate

public ValidationResult validateExtensionsForCreate(Map<String,Object> extensions,
                                                    SimpleValidationResult.Builder validationResultBuilder)
Description copied from interface: CommentExtensionsSupport
Validation hook for create operations.

Specified by:
validateExtensionsForCreate in interface CommentExtensionsSupport
Returns:
A validation result containing any validation errors encountered

validateExtensionsForUpdate

public ValidationResult validateExtensionsForUpdate(Comment comment,
                                                    Map<String,Object> extensions,
                                                    SimpleValidationResult.Builder validationResultBuilder)
Description copied from interface: CommentExtensionsSupport
Validation hook for update operations.

Specified by:
validateExtensionsForUpdate in interface CommentExtensionsSupport
Returns:
A validation result containing any validation errors encountered

updateExtensionsOnEntity

public void updateExtensionsOnEntity(Comment comment,
                                     Map<String,Object> extensions)
Description copied from interface: CommentExtensionsSupport
A creation hook, extension properties should be set on the passed in comment object. This will be called during creation of the comment within a transaction

Specified by:
updateExtensionsOnEntity in interface CommentExtensionsSupport
Parameters:
comment - - the newly created comment that needs properties set on it
extensions - - the extension properties to set


Copyright © 2003–2015 Atlassian. All rights reserved.