Package org.xwiki.blame.script
Class BlameScriptService
- java.lang.Object
-
- org.xwiki.blame.script.BlameScriptService
-
- All Implemented Interfaces:
ScriptService
@Component @Named("blame") @Singleton public class BlameScriptService extends Object implements ScriptService
Provide script oriented APIs to do annotate/blame/praise.- Since:
- 6.2M2
- Version:
- $Id: aa3fd749f0b857c042a2ef4cc6233e02d65c315e $
-
-
Constructor Summary
Constructors Constructor Description BlameScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,E>
AnnotatedContent<R,E>blame(AnnotatedContent<R,E> content, R revision, List<E> previous)
Annotate content with current revision based on a diff with a previous revision.<R> AnnotatedContent<R,String>
blame(AnnotatedContent<R,String> content, R revision, String previous)
Annotate content with current revision based on a diff with a previous revision.Exception
getLastError()
Get the error generated while performing the previously called action.
-
-
-
Method Detail
-
blame
public <R,E> AnnotatedContent<R,E> blame(AnnotatedContent<R,E> content, R revision, List<E> previous)
Annotate content with current revision based on a diff with a previous revision.- Type Parameters:
R
- type of the revision object that old metadata about the revision.E
- type of the element to annotate (ie: String holding a line).- Parameters:
content
- the annotated content (up to the revision preceding the one given), use null to start a new blame.revision
- the revision metadata to associate with the given revision.previous
- the content of the previous revision to diff against the currently annotated content, use the latest revision to start a new blame.- Returns:
- the updated annotated content.
-
blame
public <R> AnnotatedContent<R,String> blame(AnnotatedContent<R,String> content, R revision, String previous)
Annotate content with current revision based on a diff with a previous revision.- Type Parameters:
R
- type of the revision object that old metadata about the revision.- Parameters:
content
- the annotated content (up to the revision preceding the one given), use null to start a new blame.revision
- the revision metadata to associate with the given revision.previous
- the content of the previous revision to diff against the currently annotated content, use the latest revision to start a new blame.- Returns:
- the updated annotated content.
-
getLastError
public Exception getLastError()
Get the error generated while performing the previously called action.- Returns:
- an eventual exception or
null
if no exception was thrown
-
-