Package com.jalios.jcms.wiki
Class WikiRenderingHints
- java.lang.Object
-
- com.jalios.jcms.wiki.WikiRenderingHints
-
- Direct Known Subclasses:
WikiRenderingHints
public class WikiRenderingHints extends java.lang.Object
Contains rendering hints used by the WikiRenderer.- Since:
- jcms-5.7.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REVISION
-
Constructor Summary
Constructors Constructor Description WikiRenderingHints()
Creates a new WikiRenderingHints with the default values.WikiRenderingHints(java.lang.String css, boolean isSpan)
Creates a new WikiRenderingHints with the specified valuesWikiRenderingHints(java.lang.String css, boolean isSpan, java.lang.String baseURL)
Creates a new WikiRenderingHints with the specified values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getAttribute(java.lang.String name)
Get a rendering attribute.java.util.Map<java.lang.String,java.lang.Object>
getAttributeMap()
Returns the attributeMap used to store extra rendering options.java.lang.String
getBaseUrl()
Return the optional base URL used during renderingjava.lang.String
getCss()
Returns the css class(es) used during the rendering.Data
getData()
Retrieves theData
for which rendering is performed.java.lang.String
getField()
Set the name of the data field for which rendering is performed.boolean
isEditable()
Returns whether the field is editable.boolean
isSpan()
Returns whether a span or a div is used durint rendering.boolean
isWiki2JHTML()
Check if this hints is being used during a wiki to JHTML conversionvoid
setAttribute(java.lang.String name, java.lang.Object value)
Set a rendering attribute.void
setAttributeMap(java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Set the attributeMap used to store extra rendering options.void
setBaseUrl(java.lang.String baseURL)
Set the base URL to use in all generated links.
Default is null, generated link will be relative.void
setCss(java.lang.String css)
Set the css to use in the surrounding html div/span generated by the rendering.void
setData(Data data)
Set theData
for which rendering is performed.void
setEditable(boolean editable)
Set whether the field is editable.void
setField(java.lang.String field)
Set the name of the data field for which rendering is performed.void
setSpan(boolean isSpan)
Set whether a div or span should be used during the rendering.void
setWiki2JHTML(boolean isWiki2JHTML)
Set if this hints is being used for wiki to JHTML conversionjava.lang.String
toString()
WysiwygRenderingHints
toWysiwygRenderingHints()
Creates a new WysiwygRenderingHints from the current WikiRenderingHints.
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WikiRenderingHints
public WikiRenderingHints()
Creates a new WikiRenderingHints with the default values.
-
WikiRenderingHints
public WikiRenderingHints(java.lang.String css, boolean isSpan)
Creates a new WikiRenderingHints with the specified values- Parameters:
css
- the name of the CSS class to useisSpan
- if true generate a span instead of div
-
WikiRenderingHints
public WikiRenderingHints(java.lang.String css, boolean isSpan, java.lang.String baseURL)
Creates a new WikiRenderingHints with the specified values- Parameters:
css
- the name of the CSS class to useisSpan
- if true generate a span instead of divbaseURL
- if specified, this baseURL will be used to generate absolute link instead of the usual relative links. leave to null.
-
-
Method Detail
-
setCss
public void setCss(java.lang.String css)
Set the css to use in the surrounding html div/span generated by the rendering.
Default value is "wiki".- Parameters:
css
- one or more css class.
-
getCss
public java.lang.String getCss()
Returns the css class(es) used during the rendering.- Returns:
- the css class as one string,
-
setSpan
public void setSpan(boolean isSpan)
Set whether a div or span should be used during the rendering.
Default value if false.- Parameters:
isSpan
- true to use a span, false to use a div.
-
isSpan
public boolean isSpan()
Returns whether a span or a div is used durint rendering.- Returns:
- true if span is used, false to use a div.
-
setBaseUrl
public void setBaseUrl(java.lang.String baseURL)
Set the base URL to use in all generated links.
Default is null, generated link will be relative.- Parameters:
baseURL
- the base URL of the site, ending with a slash, such as http://mysite.com/mywebapp/
-
getBaseUrl
public java.lang.String getBaseUrl()
Return the optional base URL used during rendering- Returns:
- the base URL used or null if none has been defined (in which case relative url are used)
-
setData
public void setData(Data data)
Set theData
for which rendering is performed.- Parameters:
data
- the data to set- Since:
- jcms-10.0.0
-
getData
public Data getData()
Retrieves theData
for which rendering is performed.- Returns:
- the data, may return null
- Since:
- jcms-10.0.0
-
setField
public void setField(java.lang.String field)
Set the name of the data field for which rendering is performed.- Parameters:
field
- the name of the field being rendered- Since:
- jcms-10.0.0
-
getField
public java.lang.String getField()
Set the name of the data field for which rendering is performed.- Returns:
- the name of the field being rendered, may return null
- Since:
- jcms-10.0.0
-
setEditable
public void setEditable(boolean editable)
Set whether the field is editable.- Parameters:
editable
- whether the field is editable
-
isEditable
public boolean isEditable()
Returns whether the field is editable.- Returns:
- whether the field is editable
-
getAttributeMap
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
Returns the attributeMap used to store extra rendering options.- Returns:
- the attributeMap.
- Since:
- jcms-5.7.3
-
setAttributeMap
public void setAttributeMap(java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Set the attributeMap used to store extra rendering options.- Parameters:
attributeMap
- the attributeMap.- Since:
- jcms-5.7.3
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
Set a rendering attribute.- Parameters:
name
- the attribute's key.value
- the attribute's value.- Since:
- jcms-5.7.3
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Get a rendering attribute.- Parameters:
name
- the attribute's name.- Returns:
- the attribute's value.
- Since:
- jcms-5.7.3
-
isWiki2JHTML
public boolean isWiki2JHTML()
Check if this hints is being used during a wiki to JHTML conversion- Returns:
- true if JHTML conversion, false if wiki to HTML rendering
-
setWiki2JHTML
public void setWiki2JHTML(boolean isWiki2JHTML)
Set if this hints is being used for wiki to JHTML conversion- Parameters:
isWiki2JHTML
- true if JHTML conversion, false if wiki to HTML rendering
-
toWysiwygRenderingHints
public WysiwygRenderingHints toWysiwygRenderingHints()
Creates a new WysiwygRenderingHints from the current WikiRenderingHints.- Returns:
- WysiwygRenderingHints
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-