Package org.javlo.helper
Class XHTMLHelper
- java.lang.Object
-
- org.javlo.helper.XHTMLHelper
-
public class XHTMLHelper extends Object
This class is a helper for construct XHTML code.- Author:
- pvandermaesen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
_textToXHTML(String text, boolean popup)
static boolean
alreadyClosedIfOpen(ContentContext ctx, String resource)
return false if a tag is open but not closed.static boolean
alreadyInserted(ContentContext ctx, String resource)
static String
autoLink(String content)
static String
autoLink(String content, boolean notfollow)
static String
autoLink(String content, GlobalContext globalContext)
static String
autoLinkNewWindow(String content)
static String
cleanHTML(String html)
static String
collectionToList(Collection<? extends Object> col)
static String
compileScss(String sass)
static String
compress(String newContent)
static void
compressCSS(File targetFile)
static void
compressJS(File targetFile)
static boolean
containsLink(String content)
static void
convert(File xhtmlFile, File pdfFile)
static String
createAdminMail(String title, String content, Map data, String link, String linkLabel, String footer)
static String
createAdminMail(String title, String content, Map data, String link, String linkLabel, String footer, boolean center)
static String
createHTMLTable(Map data)
static String
createUserMail(ContentContext ctx, String logo, String title, String content, String link, String linkLabel, String footer)
static String
createUserMail(TemplateData templateData, String title, String content, Map data, String link, String linkLabel, String footer)
static String
escapeNotAsciiChar(String html)
static String
escapeXHTML(String xhtml)
static String
escapeXML(String xhtml)
static String
extractBody(String content)
static String
extractTitle(String xhtml)
static List<String>
extractUnsedLinks(String html, boolean absolute)
static String
getAgnosticMessageHtml(String msg)
static String
getCheckbox(String field, boolean value)
static String
getCheckbox(String field, boolean value, String onchange)
static String
getCheckbox(ContentContext ctx, String field, FormComponent formComponent)
static String
getComponentPreffixSufixOneSelect(ContentContext ctx, IContentVisualComponent inComp)
static String
getComponentSelectBox(ContentContext ctx, String inputName, int complexityLevel)
static String
getDropDownFromMap(String name, Map map, String value)
create a drop down from a map.static String
getDropDownFromMap(String name, Map map, String value, String emptyName, boolean sortValue)
static String
getDropDownFromMap(String name, Map map, String value, String emptyName, boolean sortValue, String cssClass)
create a drop down from a map.static String
getErrorMessage(ContentContext ctx, String field, GenericMessage message)
static String
getFileBigIcone(ContentContext ctx, String fileName)
static String
getFileIcone(ContentContext ctx, String fileName)
static String
getHelpAttribute(String helpMessage)
static String
getHelpLink(ContentContext ctx, String uri)
static String
getHTMLChildList(MenuElement elem, String selectionPath, String startTag, String startSelectedTag, String endTag, boolean displayParent)
generate a list of navigation element. replace #id with the page id.static String
getIconesCode(ContentContext ctx, String imageName, String alt)
static String
getIconesCode(ContentContext ctx, String imageName, String alt, String onclick)
static String
getIconesCode(ContentContext ctx, String imageName, String alt, String onclick, String style)
static String
getIconesFlag(ContentContext ctx)
static String
getImageLabelLink(String name, String imageUp, String imageDown, String link, String label)
static String
getImageLink(String name, String imageUp, String imageDown, String link)
static String
getImageLink(String imageUp, String imageDown, String link, String[][] attributes, String js)
static String
getImageLink(String name, String imageUp, String imageDown, String link, String js)
static String
getImageLink(String name, String imageUp, String imageDown, String link, String[][] attributes)
static String
getImageLink(String name, String imageUp, String imageDown, String link, String[][] attributes, boolean popup, String js)
static String
getImagePopupLink(String name, String imageUp, String imageDown, String link)
static String
getInputMultiSelect(String name, String[][] content, String[] values, String cssClass, String jsOnChange)
static String
getInputMultiSelect(String name, String[] content, String[] value)
static String
getInputMultiSelect(String name, String[] content, String[] values, String cssClass)
static String
getInputMultiSelect(String name, Collection<String> content, Collection<String> values, String cssClass)
static String
getInputMultiSelect(String name, Collection content, Collection value)
call .toString on all object, create String array and call the same method with array as param.static String
getInputMultiSelect(String name, Map<String,String> content, Collection value)
static String
getInputMultiSelect(String name, Map<String,String> content, Collection value, String cssClass)
call .toString on all object, create String array and call the same method with array as param.static String
getInputMultiSelectList(ContentContext ctx, String[][] content, String value, String jsOnClick)
generate a one select widget in XHTMLstatic String
getInputOneSelect(String name, String[][] content, String value)
static String
getInputOneSelect(String name, String[][] content, String value, boolean sorting)
static String
getInputOneSelect(String name, String[][] content, String value, String jsOnChange)
static String
getInputOneSelect(String name, String[][] content, String value, String jsOnChange, boolean sorting)
generate a one select widget in XHTMLstatic String
getInputOneSelect(String name, String[][] content, String value, String jsOnChange, String popupMessage, boolean sorting)
static String
getInputOneSelect(String name, String[] content, String value)
static String
getInputOneSelect(String name, String[] ids, String[] labels, String value, String js)
static String
getInputOneSelect(String name, String[] ids, String[] labels, String value, String js, boolean sort)
static String
getInputOneSelect(String name, String[] ids, String[] labels, String value, String cssClass, String js, boolean sort)
static String
getInputOneSelect(String name, String[] content, String value, boolean sorting)
static String
getInputOneSelect(String name, String[] content, String value, String js, boolean sort)
static String
getInputOneSelect(String name, String[] ids, String value, String cssClass, String js, boolean sort)
static String
getInputOneSelect(String name, Collection<? extends Object> content, String value)
static String
getInputOneSelect(String name, Collection<? extends Object> content, String value, boolean sorting)
static String
getInputOneSelect(String name, Collection<? extends Object> content, String value, String cssClass)
static String
getInputOneSelect(String name, Collection<String> content, String value, String js, boolean sort)
static String
getInputOneSelect(String name, List<? extends Object> content, String value, String cssClass)
static String
getInputOneSelect(String name, List<? extends Object> content, String value, String cssClass, String js, boolean sort)
static String
getInputOneSelect(String name, Map<String,String> content, String value)
static String
getInputOneSelect(String name, Map<String,String> content, String value, String cssClass)
static String
getInputOneSelectFirstEnpty(String inputName, Collection<String> inValues, String currentValue)
static String
getInputOneSelectFirstEnpty(String inputName, Collection<String> inValues, String currentValue, boolean sort)
static String
getInputOneSelectFirstItem(String name, Collection<? extends Object> content, String value, String firstItem, String cssClass)
static String
getInputOneSelectWidthFirstElement(String name, Collection<Map.Entry<String,String>> content, String firstElement, String value, String js)
static String
getInputOneSelectWithClass(String name, String[][] content, String value, String cssClass)
static String
getIntegerInput(ContentContext ctx, String form, String name, int min, int max, String jsOnChange)
static String
getIntegerInput(ContentContext ctx, String form, String name, int min, int max, String jsOnChange, String[][] attributes)
static String
getLinkSubmit(String value)
static String
getLinkSubmit(String formID, String value)
static String
getListedSelection(ContentContext ctx, IContentVisualComponent inComp)
static String
getMarkerSelect(ContentContext ctx, IContentVisualComponent inComp)
static String
getRadio(String field, String radioValue, String value)
static String
getRadio(String id, String field, String value, boolean checked)
static String
getRadioInput(String field, String[][] values, String value, String jsOnChange)
static String
getRadioInput(String field, String[] values, String value)
static String
getRadioInput(String field, String[] values, String value, String jsOnChange)
static String
getRadioInput(ContentContext ctx, FormComponent formComponent, String field, String choiceValue)
static String
getRadioInput(ContentContext ctx, FormComponent formComponent, String field, String choiceValue, String jsOnChange)
static String
getReverlinkSelectType(ContentContext ctx, String inputName, String currentValue)
static String
getRowCheckbox(ContentContext ctx, String field, String label, String value, GenericMessage message)
static String
getRowInput(ContentContext ctx, String field, String value, String message)
static String
getRowInput(ContentContext ctx, String field, String label, String value, GenericMessage message, String type)
static String
getRowInput(ContentContext ctx, String field, String label, String value, GenericMessage message, String[][] content)
static String
getRowInput(ContentContext ctx, String field, String value, GenericMessage message)
static String
getRowInput(ContentContext ctx, String field, FormComponent formComponent)
static String
getRowInput(ContentContext ctx, String field, FormComponent formComponent, String inputType)
static String
getRowInput(ContentContext ctx, String field, FormComponent formComponent, String[][] content)
static String
getRowInputOneSelect(ContentContext ctx, String field, String[] content, FormComponent formComponent)
static String
getRowPassword(ContentContext ctx, String field, FormComponent formComponent)
static String
getRowTextArea(ContentContext ctx, FormComponent formComponent, String field)
static String
getSelectListFromMap(Map map, String[] currentSelection, boolean editable)
static String
getSelectOneCountry(ContentContext ctx, String name, String country)
static String
getStyleComponentOneSelect(ContentContext ctx, IContentVisualComponent inComp)
static String
getTableAlert(String linkLabel)
static String
getTextArea(String name, String value)
static String
getTextArea(String name, String value, String[][] attributes)
static String
getTextArea(String name, String value, String[][] attributes, String cssClass)
static String
getTextArea(ContentContext ctx, FormComponent formComponent, String field)
static String
getTextColor(int index)
static String
getTextInput(String name, String value)
static String
getTextInput(String name, String value, String cssValue)
static String
getTextInput(String name, String value, String[][] attributes)
static void
main(String[] args)
static String
minimizeHtml(String html)
static String
prepareToMailing(String xhtml)
static void
removeComment(File targetFile)
static String
removeComment(String text)
static String
removeEscapeTag(String html)
static String
removeTag(String html, String tag)
static String
renderColorChooser(String name, String cssValue, List<ExtendedColor> colors, String value)
static String
renderContentLanguage(ContentContext ctx)
static String
renderDateTime(ContentContext ctx, String name, Date date)
static String
renderHeaderModuleInsertion(ContentContext ctx, String resource, String buildId)
static String
renderHeaderResourceInsertion(ContentContext ctx, String resource)
static String
renderHeaderResourceInsertion(ContentContext ctx, String resource, String buildId)
static String
renderHeaderResourceInsertionWithoutalreadyTest(ContentContext ctx, String resource)
static String
renderHeaderResourceInsertionWithoutalreadyTest(ContentContext ctx, String resource, String buildId)
static String
renderLanguage(ContentContext ctx)
static String
renderLanguage(ContentContext ctx, String cssClass)
static String
renderLine(String label, String value)
static String
renderLine(String label, String inputName, boolean checked)
static String
renderLine(String label, String inputName, String value)
static String
renderListItem(List<IListItem> list, String key)
transform a value to a span with key as class and value inside.static String
renderMultiListItem(List<IListItem> list, Collection<String> keys)
transform a value to a span with key as class and value inside.static String
renderOnlySelectLangue(ContentContext ctx, String selectId, String inputName, String currentLg, boolean autoChange)
static String
renderSelectLanguage(ContentContext ctx)
static String
renderSelectLanguage(ContentContext ctx, boolean autoChange)
static String
renderSelectLanguage(ContentContext ctx, boolean autoChange, String selectId, String inputId)
static String
renderSelectLanguage(ContentContext ctx, boolean autoChange, String selectId, String inputId, boolean renderForm)
static String
renderSelectLanguage(ContentContext ctx, boolean autoChange, String selectId, String inputId, String currentLg, boolean renderForm)
static String
renderSpecialLink(ContentContext ctx, String currentLg, String multimediaFileURL, StaticInfo staticInfo)
static String
renderStaticInfo(ContentContext ctx, StaticInfo info)
static String
renderUserData(ContentContext ctx, User user)
static String
replaceJSTLData(ContentContext ctx, String xhtml)
static String
replaceJSTLUserInfo(String xhtml, IUserInfo userInfo)
static String
replaceLinks(ContentContext ctx, String html)
replace link in xhtml with createURL call.static String
replaceLinkSearchAllTag(ContentContext ctx, String content)
replace link in xhtml with createURL call.static String
replaceOutTag(String html, char token, char newToken)
replace text out test tag.static String
replaceOutTag(String html, String token, String newToken)
replace text out test tag.static String
safeHTML(String html)
static String
stringToAttribute(String str)
static String
textToXHTML(String text)
static String
textToXHTML(String text, boolean notFollow)
static String
textToXHTML(String text, boolean notFollow, String cssClass, GlobalContext globalContext)
static String
textToXHTML(String text, boolean notFollow, GlobalContext globalContext)
static String
textToXHTML(String text, GlobalContext globalContext)
static String
textToXHTMLDIV(String text)
static String
textToXHTMLNewWin(String text)
static String
textToXHTMLP(String text)
static String
textToXHTMLWidthParagraph(String text)
static String
textToXHTMLWidthParagraph(String text, GlobalContext globalContext)
-
-
-
Method Detail
-
containsLink
public static boolean containsLink(String content)
-
autoLink
public static String autoLink(String content, GlobalContext globalContext)
-
getCheckbox
public static String getCheckbox(ContentContext ctx, String field, FormComponent formComponent) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getCheckbox
public static String getCheckbox(String field, boolean value) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getCheckbox
public static String getCheckbox(String field, boolean value, String onchange) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getComponentPreffixSufixOneSelect
public static String getComponentPreffixSufixOneSelect(ContentContext ctx, IContentVisualComponent inComp)
-
getComponentSelectBox
public static String getComponentSelectBox(ContentContext ctx, String inputName, int complexityLevel) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException
-
getDropDownFromMap
public static String getDropDownFromMap(String name, Map map, String value)
create a drop down from a map.- Parameters:
name
- the name of the field.map
- the map with keys and values.value
- the current value of the field.- Returns:
- XHTML code with a dropdown.
-
getDropDownFromMap
public static String getDropDownFromMap(String name, Map map, String value, String emptyName, boolean sortValue)
-
getDropDownFromMap
public static String getDropDownFromMap(String name, Map map, String value, String emptyName, boolean sortValue, String cssClass)
create a drop down from a map.- Parameters:
name
- the name of the field.map
- the map with keys and values.value
- the current value of the field.emptyName
- the name of the first empty element (empty as value), if null no empty element.- Returns:
- XHTML code with a dropdown.
-
getErrorMessage
public static String getErrorMessage(ContentContext ctx, String field, GenericMessage message)
-
getFileBigIcone
public static String getFileBigIcone(ContentContext ctx, String fileName)
-
getFileIcone
public static String getFileIcone(ContentContext ctx, String fileName)
-
getHelpLink
public static String getHelpLink(ContentContext ctx, String uri)
-
getHTMLChildList
public static String getHTMLChildList(MenuElement elem, String selectionPath, String startTag, String startSelectedTag, String endTag, boolean displayParent) throws Exception
generate a list of navigation element. replace #id with the page id.- Parameters:
startTag
- insert before path sample :endTag
- insert after path :displayParent
- false for only dispay children and not the parent.- Returns:
- a string with XHTML code
- Throws:
Exception
-
getIconesCode
public static String getIconesCode(ContentContext ctx, String imageName, String alt)
-
getIconesCode
public static String getIconesCode(ContentContext ctx, String imageName, String alt, String onclick)
-
getIconesCode
public static String getIconesCode(ContentContext ctx, String imageName, String alt, String onclick, String style)
-
getIconesFlag
public static String getIconesFlag(ContentContext ctx)
-
getImageLabelLink
public static String getImageLabelLink(String name, String imageUp, String imageDown, String link, String label)
-
getImageLink
public static String getImageLink(String name, String imageUp, String imageDown, String link)
-
getImageLink
public static String getImageLink(String name, String imageUp, String imageDown, String link, String js)
-
getImageLink
public static String getImageLink(String name, String imageUp, String imageDown, String link, String[][] attributes)
-
getImageLink
public static String getImageLink(String name, String imageUp, String imageDown, String link, String[][] attributes, boolean popup, String js)
- Parameters:
name
-imageUp
-imageDown
-link
-attributes
-js
-- Returns:
-
getImageLink
public static String getImageLink(String imageUp, String imageDown, String link, String[][] attributes, String js)
-
getImagePopupLink
public static String getImagePopupLink(String name, String imageUp, String imageDown, String link)
-
getInputMultiSelect
public static String getInputMultiSelect(String name, Collection content, Collection value)
call .toString on all object, create String array and call the same method with array as param.- Parameters:
name
-content
-value
-- Returns:
-
getInputMultiSelect
public static String getInputMultiSelect(String name, Map<String,String> content, Collection value)
-
getInputMultiSelect
public static String getInputMultiSelect(String name, Map<String,String> content, Collection value, String cssClass)
call .toString on all object, create String array and call the same method with array as param.- Parameters:
name
-content
-value
-- Returns:
-
getInputMultiSelect
public static String getInputMultiSelect(String name, String[] content, String[] value)
-
getInputMultiSelect
public static String getInputMultiSelect(String name, Collection<String> content, Collection<String> values, String cssClass)
-
getInputMultiSelect
public static String getInputMultiSelect(String name, String[] content, String[] values, String cssClass)
-
getInputMultiSelect
public static String getInputMultiSelect(String name, String[][] content, String[] values, String cssClass, String jsOnChange)
-
getInputMultiSelectList
public static String getInputMultiSelectList(ContentContext ctx, String[][] content, String value, String jsOnClick)
generate a one select widget in XHTML- Parameters:
content
- a double array with id in 0 index and label in 1 indexvalue
-jsOnChange
-sorting
-jsOnClick
- javascript when we click on a link (@value@ for the value of the current line)- Returns:
-
getInputOneSelect
public static String getInputOneSelect(String name, Collection<? extends Object> content, String value)
-
getInputOneSelect
public static String getInputOneSelect(String name, Collection<? extends Object> content, String value, boolean sorting)
-
getInputOneSelectFirstItem
public static String getInputOneSelectFirstItem(String name, Collection<? extends Object> content, String value, String firstItem, String cssClass)
-
getInputOneSelect
public static String getInputOneSelect(String name, Collection<? extends Object> content, String value, String cssClass)
-
getInputOneSelect
public static String getInputOneSelect(String name, Collection<String> content, String value, String js, boolean sort)
-
getInputOneSelect
public static String getInputOneSelect(String name, List<? extends Object> content, String value, String cssClass)
-
getInputOneSelect
public static String getInputOneSelect(String name, List<? extends Object> content, String value, String cssClass, String js, boolean sort)
-
getInputOneSelect
public static String getInputOneSelect(String name, Map<String,String> content, String value)
-
getInputOneSelect
public static String getInputOneSelect(String name, Map<String,String> content, String value, String cssClass)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[] content, String value)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[] content, String value, boolean sorting)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[] content, String value, String js, boolean sort)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[] ids, String[] labels, String value, String js)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[] ids, String[] labels, String value, String js, boolean sort)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[] ids, String value, String cssClass, String js, boolean sort)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[] ids, String[] labels, String value, String cssClass, String js, boolean sort)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[][] content, String value)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[][] content, String value, boolean sorting)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[][] content, String value, String jsOnChange)
-
getInputOneSelect
public static String getInputOneSelect(String name, String[][] content, String value, String jsOnChange, boolean sorting)
generate a one select widget in XHTML- Parameters:
name
- the name of the parametercontent
- a double array with id in 0 index and label in 1 indexvalue
-jsOnChange
-sorting
-- Returns:
-
getInputOneSelect
public static String getInputOneSelect(String name, String[][] content, String value, String jsOnChange, String popupMessage, boolean sorting)
-
getInputOneSelectFirstEnpty
public static String getInputOneSelectFirstEnpty(String inputName, Collection<String> inValues, String currentValue) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
getInputOneSelectFirstEnpty
public static String getInputOneSelectFirstEnpty(String inputName, Collection<String> inValues, String currentValue, boolean sort) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
getInputOneSelectWithClass
public static String getInputOneSelectWithClass(String name, String[][] content, String value, String cssClass)
-
getInputOneSelectWidthFirstElement
public static String getInputOneSelectWidthFirstElement(String name, Collection<Map.Entry<String,String>> content, String firstElement, String value, String js)
-
getIntegerInput
public static String getIntegerInput(ContentContext ctx, String form, String name, int min, int max, String jsOnChange)
-
getIntegerInput
public static String getIntegerInput(ContentContext ctx, String form, String name, int min, int max, String jsOnChange, String[][] attributes)
-
getListedSelection
public static String getListedSelection(ContentContext ctx, IContentVisualComponent inComp)
-
getMarkerSelect
public static String getMarkerSelect(ContentContext ctx, IContentVisualComponent inComp) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
getRadio
public static String getRadio(String field, String radioValue, String value) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getRadio
public static String getRadio(String id, String field, String value, boolean checked) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getRadioInput
public static String getRadioInput(ContentContext ctx, FormComponent formComponent, String field, String choiceValue)
-
getRadioInput
public static String getRadioInput(ContentContext ctx, FormComponent formComponent, String field, String choiceValue, String jsOnChange)
-
getRadioInput
public static String getRadioInput(String field, String[] values, String value, String jsOnChange)
-
getRadioInput
public static String getRadioInput(String field, String[][] values, String value, String jsOnChange)
-
getReverlinkSelectType
public static String getReverlinkSelectType(ContentContext ctx, String inputName, String currentValue) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
getRowCheckbox
public static String getRowCheckbox(ContentContext ctx, String field, String label, String value, GenericMessage message) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getRowInput
public static String getRowInput(ContentContext ctx, String field, FormComponent formComponent) throws FileNotFoundException, ResourceNotFoundException, IOException
-
getRowInput
public static String getRowInput(ContentContext ctx, String field, FormComponent formComponent, String inputType) throws ResourceNotFoundException, FileNotFoundException, IOException
- Parameters:
request
-field
-formComponent
-inputType
- if equals to "checkbox", it actually calls getRowCheckbox(...)- Returns:
- Throws:
ResourceNotFoundException
FileNotFoundException
IOException
-
getRowInput
public static String getRowInput(ContentContext ctx, String field, FormComponent formComponent, String[][] content) throws ResourceNotFoundException, FileNotFoundException, IOException
-
getRowInput
public static String getRowInput(ContentContext ctx, String field, String value, GenericMessage message) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getRowInput
public static String getRowInput(ContentContext ctx, String field, String value, String message) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getRowInput
public static String getRowInput(ContentContext ctx, String field, String label, String value, GenericMessage message, String type) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getRowInput
public static String getRowInput(ContentContext ctx, String field, String label, String value, GenericMessage message, String[][] content)
-
getRowInputOneSelect
public static String getRowInputOneSelect(ContentContext ctx, String field, String[] content, FormComponent formComponent) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getRowPassword
public static String getRowPassword(ContentContext ctx, String field, FormComponent formComponent) throws FileNotFoundException, ResourceNotFoundException, IOException
-
getRowTextArea
public static String getRowTextArea(ContentContext ctx, FormComponent formComponent, String field) throws ResourceNotFoundException
- Throws:
ResourceNotFoundException
-
getSelectListFromMap
public static String getSelectListFromMap(Map map, String[] currentSelection, boolean editable)
-
getSelectOneCountry
public static String getSelectOneCountry(ContentContext ctx, String name, String country)
-
getStyleComponentOneSelect
public static String getStyleComponentOneSelect(ContentContext ctx, IContentVisualComponent inComp)
-
getTextArea
public static String getTextArea(ContentContext ctx, FormComponent formComponent, String field)
-
getTextArea
public static String getTextArea(String name, String value, String[][] attributes, String cssClass)
-
getTextColor
public static String getTextColor(int index)
-
removeTag
public static String removeTag(String html, String tag) throws XMLManipulationHelper.BadXMLException
-
renderContentLanguage
public static String renderContentLanguage(ContentContext ctx)
-
renderDateTime
public static String renderDateTime(ContentContext ctx, String name, Date date)
-
alreadyInserted
public static boolean alreadyInserted(ContentContext ctx, String resource)
-
alreadyClosedIfOpen
public static boolean alreadyClosedIfOpen(ContentContext ctx, String resource)
return false if a tag is open but not closed.- Parameters:
ctx
-resource
-- Returns:
- true if tag is'nt closed but opened.
-
renderHeaderResourceInsertionWithoutalreadyTest
public static String renderHeaderResourceInsertionWithoutalreadyTest(ContentContext ctx, String resource)
-
renderHeaderResourceInsertionWithoutalreadyTest
public static String renderHeaderResourceInsertionWithoutalreadyTest(ContentContext ctx, String resource, String buildId)
-
renderHeaderResourceInsertion
public static String renderHeaderResourceInsertion(ContentContext ctx, String resource) throws Exception
- Throws:
Exception
-
renderHeaderModuleInsertion
public static String renderHeaderModuleInsertion(ContentContext ctx, String resource, String buildId) throws Exception
- Throws:
Exception
-
renderHeaderResourceInsertion
public static String renderHeaderResourceInsertion(ContentContext ctx, String resource, String buildId) throws Exception
- Throws:
Exception
-
renderLanguage
public static String renderLanguage(ContentContext ctx)
-
renderLanguage
public static String renderLanguage(ContentContext ctx, String cssClass)
-
renderSelectLanguage
public static String renderSelectLanguage(ContentContext ctx)
-
renderSelectLanguage
public static String renderSelectLanguage(ContentContext ctx, boolean autoChange)
-
renderSelectLanguage
public static String renderSelectLanguage(ContentContext ctx, boolean autoChange, String selectId, String inputId)
-
renderSelectLanguage
public static String renderSelectLanguage(ContentContext ctx, boolean autoChange, String selectId, String inputId, boolean renderForm)
-
renderOnlySelectLangue
public static String renderOnlySelectLangue(ContentContext ctx, String selectId, String inputName, String currentLg, boolean autoChange)
-
renderSelectLanguage
public static String renderSelectLanguage(ContentContext ctx, boolean autoChange, String selectId, String inputId, String currentLg, boolean renderForm)
-
renderSpecialLink
public static String renderSpecialLink(ContentContext ctx, String currentLg, String multimediaFileURL, StaticInfo staticInfo) throws Exception
- Throws:
Exception
-
replaceJSTLData
public static String replaceJSTLData(ContentContext ctx, String xhtml) throws Exception
- Throws:
Exception
-
replaceJSTLUserInfo
public static String replaceJSTLUserInfo(String xhtml, IUserInfo userInfo) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, UnsupportedEncodingException
-
replaceOutTag
public static String replaceOutTag(String html, char token, char newToken)
replace text out test tag.- Parameters:
html
- a htmltoken
- the token to be replacenewToken
- the new token- Returns:
-
replaceOutTag
public static String replaceOutTag(String html, String token, String newToken)
replace text out test tag.- Parameters:
html
- a htmltoken
- the token to be replacenewToken
- the new token- Returns:
-
main
public static void main(String[] args) throws MalformedURLException, Exception
- Throws:
MalformedURLException
Exception
-
textToXHTML
public static String textToXHTML(String text, GlobalContext globalContext)
-
textToXHTMLWidthParagraph
public static String textToXHTMLWidthParagraph(String text, GlobalContext globalContext)
-
textToXHTML
public static String textToXHTML(String text, boolean notFollow, GlobalContext globalContext)
-
textToXHTML
public static String textToXHTML(String text, boolean notFollow, String cssClass, GlobalContext globalContext)
-
renderListItem
public static String renderListItem(List<IListItem> list, String key)
transform a value to a span with key as class and value inside.- Parameters:
list
-key
-- Returns:
- the key if list null, and empty string if key not found in the list.
-
renderMultiListItem
public static String renderMultiListItem(List<IListItem> list, Collection<String> keys)
transform a value to a span with key as class and value inside.- Parameters:
list
-key
-- Returns:
- the key if list null, and empty string if key not found in the list.
-
renderUserData
public static String renderUserData(ContentContext ctx, User user)
-
replaceLinkSearchAllTag
public static String replaceLinkSearchAllTag(ContentContext ctx, String content) throws Exception
replace link in xhtml with createURL call.- Parameters:
ctx
-content
-- Returns:
- Throws:
Exception
-
replaceLinks
public static String replaceLinks(ContentContext ctx, String html) throws Exception
replace link in xhtml with createURL call.- Parameters:
ctx
-content
-- Returns:
- Throws:
Exception
-
compressCSS
public static void compressCSS(File targetFile) throws IOException
- Throws:
IOException
-
removeComment
public static void removeComment(File targetFile) throws IOException
- Throws:
IOException
-
compressJS
public static void compressJS(File targetFile) throws IOException
- Throws:
IOException
-
prepareToMailing
public static String prepareToMailing(String xhtml) throws XMLManipulationHelper.BadXMLException
-
renderStaticInfo
public static String renderStaticInfo(ContentContext ctx, StaticInfo info) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
renderColorChooser
public static String renderColorChooser(String name, String cssValue, List<ExtendedColor> colors, String value)
-
collectionToList
public static String collectionToList(Collection<? extends Object> col)
-
createAdminMail
public static String createAdminMail(String title, String content, Map data, String link, String linkLabel, String footer)
-
createAdminMail
public static String createAdminMail(String title, String content, Map data, String link, String linkLabel, String footer, boolean center)
-
createUserMail
public static String createUserMail(ContentContext ctx, String logo, String title, String content, String link, String linkLabel, String footer) throws IOException, Exception
- Throws:
IOException
Exception
-
createUserMail
public static String createUserMail(TemplateData templateData, String title, String content, Map data, String link, String linkLabel, String footer)
-
compileScss
public static String compileScss(String sass) throws IOException
- Throws:
IOException
-
convert
public static final void convert(File xhtmlFile, File pdfFile) throws IOException, com.lowagie.text.DocumentException
- Throws:
IOException
com.lowagie.text.DocumentException
-
-