com.atlassian.confluence.content.render.xhtml.storage
Class InlineTasksUtils

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.storage.InlineTasksUtils

public class InlineTasksUtils
extends Object

Utilities to parse Inline Tasks

Since:
4.3

Field Summary
static QName CSS_CLASS_ATTRIBUTE
           
static String CSS_CLASS_CHECKED
           
static String CSS_CLASS_INLINE_TASK
           
static QName INLINE_TASK_ID_DATA_ATTRIBUTE
           
static String INLINE_TASK_ID_DATA_ATTRIBUTE_NAME
           
static QName INLINE_TASK_STATUS_ATTRIBUTE
           
static String INLINE_TASK_STATUS_NAME
           
static QName LI_TAG
           
static QName P_TAG
           
static QName TABLE_TAG
           
static QName UL_TAG
           
 
Constructor Summary
InlineTasksUtils()
           
 
Method Summary
static List<DataSource> getRequiredResources(DataSourceFactory dataSourceFactory, String htmlContent)
          Returns the inline task DataSource resources required for the specified content.
static boolean isStartOfInlineTask(XMLEvent event)
          Returns true if the event is the start event of an Inline Task.
static String parseTitle(XMLEventReader reader, List<String> mentions, UserAccessor userAccessor)
          Assuming the last consumed element of the reader was the beginning of an Inline Task, consumes all events until the end of the title and returns the title and the mentions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LI_TAG

public static final QName LI_TAG

UL_TAG

public static final QName UL_TAG

TABLE_TAG

public static final QName TABLE_TAG

P_TAG

public static final QName P_TAG

CSS_CLASS_ATTRIBUTE

public static final QName CSS_CLASS_ATTRIBUTE

CSS_CLASS_CHECKED

public static final String CSS_CLASS_CHECKED

CSS_CLASS_INLINE_TASK

public static final String CSS_CLASS_INLINE_TASK

INLINE_TASK_ID_DATA_ATTRIBUTE_NAME

public static final String INLINE_TASK_ID_DATA_ATTRIBUTE_NAME

INLINE_TASK_ID_DATA_ATTRIBUTE

public static final QName INLINE_TASK_ID_DATA_ATTRIBUTE

INLINE_TASK_STATUS_NAME

public static final String INLINE_TASK_STATUS_NAME

INLINE_TASK_STATUS_ATTRIBUTE

public static final QName INLINE_TASK_STATUS_ATTRIBUTE
Constructor Detail

InlineTasksUtils

public InlineTasksUtils()
Method Detail

isStartOfInlineTask

public static boolean isStartOfInlineTask(XMLEvent event)
                                   throws XMLStreamException
Returns true if the event is the start event of an Inline Task.

Returns:
true if the event is the start event of an Inline Task, false otherwise.
Throws:
XMLStreamException

parseTitle

public static String parseTitle(XMLEventReader reader,
                                List<String> mentions,
                                UserAccessor userAccessor)
                         throws XMLStreamException

Assuming the last consumed element of the reader was the beginning of an Inline Task, consumes all events until the end of the title and returns the title and the mentions.

The behaviour is undetermined if the last consumed element wasn't the beginning of an Inline Task.

It leaves alone the first foreign element of the reader: the start event of a sublist, a table, etc. It consumes the </li> if it meets it and stops afterwards.

The returned title uses a pretty gross approximation that free text in the storage format leads to a user-facing description for the task.

Parameters:
reader - the reader
mentions - a modifiable list where the mentioned users will be added. Only the first mention should be considered as the assignee.
userAccessor -
Returns:
the title
Throws:
XMLStreamException

getRequiredResources

public static List<DataSource> getRequiredResources(DataSourceFactory dataSourceFactory,
                                                    String htmlContent)
Returns the inline task DataSource resources required for the specified content. Can be used for:

Parameters:
dataSourceFactory - DataSourceFactory to retrieve resources
htmlContent - html formatted content in which inline tasks may appear
Returns:
a list of the inline task resources required by the specified content


Copyright © 2003-2013 Atlassian. All Rights Reserved.